Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const request = new XMLHttpRequest();
- request.open('GET', 'https://steamcommunity.com/market/priceoverview/?currency=3&appid=730&market_hash_name=Chroma%202%20Case');
- request.send();
- request.onload = () => {
- if (request.status === 200) {
- console.log("Success"); // So extract data from json and create table
- //Extracting data
- let price = JSON.parse(request.response).median_price;
- let volume = JSON.parse(request.response).volume;
- console.log(price);
- console.log(volume);
- }
- };
- request.onerror = () => {
- console.log("error")
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement