0

I'm coding from time to time and make scripts for fun and to help others. How can I get JSON from other site? As we know, there are cross-domain restrictions.. This is what I'm trying to get: http://steamcommunity.com/market/priceoverview/?appid=730&currency=3&market_hash_name=StatTrak%E2%84%A2%20M4A1-S%20|%20Hyper%20Beast%20(Minimal%20Wear). I have tried this:

$.ajax({
    url: 'https://jsonp.afeld.me/?url=http://steamcommunity.com/market/priceoverview/?appid=730&currency=3&market_hash_name=StatTrak%E2%84%A2%20M4A1-S%20|%20Hyper%20Beast%20(Minimal%20Wear)',
    type: 'GET',
    dataType: 'jsonp',
    success: function(data) {
        console.log(data);
    }
});

I would really appreciate your help. Thanks! :)

  • Do you have any errors or output? – aprok Mar 15 '16 at 20:02
  • Uh, i forgot to mention. I get a GET error with link in script. When i open link from script, I get blank array "[]", i should get "{"success":true,"lowest_price":"65,90\u20ac","volume":"17","median_price":"72,--\u20ac"}" –  Mar 15 '16 at 20:16
  • Try to delete this: `https://jsonp.afeld.me/?url=` and use just URL – aprok Mar 15 '16 at 20:18
  • Then I get error due to cross-domain-policy –  Mar 15 '16 at 20:24

0 Answers0