0

Trying to get the data from ESPN using curl. Need it to be with offset which as I know is specified as a parameter. Here is the call I use that has been generated by ESPN explorer tool:

http://api.espn.com/v1/sports/basketball/nba/athletes/?offset=51&apikey=

This does not work for me in the terminal or in PHP and throws an error with code 403 but it works in the espn explorer tool.

Another observation is that if I remove the offset parameter and attempt a curl call then it works in terminal and in PHP. Below is the example of working call:

http://api.espn.com/v1/sports/basketball/nba/athletes/?apikey=

Has anyone came across this issue?

Mikael Östberg
  • 16,982
  • 6
  • 61
  • 79
Arturs
  • 1
  • Are you passing in your API KEY? I am unable to reproduce this using my own API key and the offset you specified above. From the command line i typed: curl http://api.espn.com/v1/sports/basketball/nba/athletes\?offset\=50\&apikey\={MY-APIKEY} and received back valid json with athletes. (JSON below has been edited to fit in this comment) { "sports": [ { "name": "basketball", "id": 40, "uid": "s:40", "leagues": [] } ], "resultsOffset": 50, "resultsLimit": 50, "resultsCount": 634, "timestamp": "2013-08-02T15:23:40Z", "status": "success" } – Roger Raymond Aug 02 '13 at 15:25
  • yes, I'm using the API key after the equal sign. Plus as I mentioned the query without the offset works. Also, it does not work with limit option either. Tested it on Linux and Windows and it doesnt work. – Arturs Aug 03 '13 at 17:05
  • 1
    One more thing, I registered for new app key and the behaviour is the same. As a conclusion, I'm pretty sure it's a BUG in espn api. As a side note, it's really frustrating how there is totally no help on espn forums as well. – Arturs Aug 03 '13 at 17:11

0 Answers0