0

I just created an account with ESPN Developer, and I'm trying to get a list of all the Professional Golfers. I made the following request:

http://api.espn.com/v1/sports/golf/athletes?&apikey=[mykey]

Unfortunately, the browser only shows a handful of names (which are in alphabetical order). How can I get the API request to return all the golfers?

CaliCoder
  • 23
  • 2
  • 2
    Reading the fine manual suggests it's only players from a season and that's all you'll get from this part of the API http://developer.espn.com/docs/athletes#parameters – ta.speot.is Mar 02 '14 at 03:49
  • Not sure why this got downvoted I am seeing the same thing with the nba, it's not listing all the players. None the less it's very cool to me that ESPN has an api! – Michael Joseph Aubry May 10 '14 at 19:26

2 Answers2

0

According to my research, you should be seeing all of the Golfers that they have.

If you use http://api.espn.com/v1/sports/golf?apikey=KEY, you will get a list of "all organizing bodies" in the sport. You can (if you have the patience) go through that list, and check to see if they are listed in the data returned from your (correct) API URI, along with the members of each section.

You can also use http://api.espn.com/v1/sports/golf/pga/athletes?apikey=KEY to get a list of athletes in that organization. Be sure to replace "pga" if you are looking for something else.

I just now created a Developer account there and requested a key to assist you with your question, so I could be wrong. If I am I will certainly come back to better answer your question.

JesseH
  • 1
  • 1
0

I am reading this post http://www.javacodegeeks.com/2013/06/parsing-espn-api-using-java-and-google-gson.html

The NBA request http://api.espn.com/v1//sports/basketball/nba/athletes?apikey=KEY returns only 50 athletes, you have to use the offset parameter to get more

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

So in your case

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

I am still reading the post but now I see I can return more players and the first request only got to players last name ending with B so geeze to get all athletes the JSON response would be huge!

I can't find this on the ESPN docs, so I don't know how developers are supposed to know this, there may be a better way but at least now I know how to get all the players.

Michael Joseph Aubry
  • 12,282
  • 16
  • 70
  • 135