0

Is there any way to do this in javascript?

<?
    $fgc=file_get_contents('http://steamcommunity.com/market/priceoverview/?country=PL&currency=3&appid=730&market_hash_name=StatTrak%E2%84%A2%20AWP%20|%20Worm%20God%20%28Minimal%20Wear%29');
    $json=json_decode($fgc,true);
    echo $json['lowest_price'];
?>
Andreas
  • 21,535
  • 7
  • 47
  • 56
eska97
  • 77
  • 5
  • Not without modifying the server to either allow cross-origin requests or to switch to `jsonp`. But then, I'm guessing you're not a Steam developer... – CodingIntrigue Jul 29 '15 at 08:36

1 Answers1

0

No it is not possible. steamcommunity.com either has to support jsonp (which it does not) or set the right headers to allow CORS (which it does not).

Your only option is to have a proxy in i.e. PHP that passes the data, but there is most likely a reason that steamcommunity.com haven't implemented these features, and you might be breaking their copyright.

Torben Pi Jensen
  • 850
  • 9
  • 27