JSON read object and ESPN API

edited March 2014 in Library Questions

Hey all,

I am pretty new to using JSON objects from API's, so bare with me on this somewhat coherent explanation.

I am essentially trying to use the ESPN sports API to track a winning score for a specific team (my needs is the Miami Heat). I have come across the JSON object from their github here: https://gist.github.com/espnapi/4126003

So, gathering my limited knowledge, I assumed I am in the right track to use the JSON load example here:

processing.org/reference/loadJSONObject_.html

This is where I am hitting a wall of inexperience. I am referencing the ESPN reference here: developer.espn.com/docs/scores#using-the-api that seems to require me to setup a request.

The how is what confuses me. I am speculating the steps involved are to setup a request (using JSON to request? does that even make sense? Is this API reference using am XML request?), and gathering certain continuously updating variables from the object folder (is loading the object enough to gather live/updating info? )

I am a bit overwhelmed and not too sure which direction to really begin. All help greatly appreciated.

Answers

  • you need to get an api key from them

  • That is understood. Sorry for not clarifying this information.

    I guess the main concern is will I need to have some form of credentials using a JSON object? does it update periodically?

  • edited March 2014

    I got an api-key from them and tried but I only got an 403 error from them (too many attempts)

    the general idea is that you tell them an URL / URI with the data you want to retrieve (team, year....).

    The API returns a String which can be a xml-object or JSON or so...

    so the result is xml or JSON

    Those can be very complex and you need to ask it the stuff you want to know.

  • Answer ✓

    I made an example with another api

    http://forum.processing.org/two/discussion/3161/json-use-api-and-show-json-data-on-screen/p1

    once you get something from the espn try println and check it out.

  • Great! I'll test out. It looks like it's definitely in the right direction.

  • Also, if you are just wanting to extract data, you could use json-csv.com to pull the data into a spreadsheet.

  • afaik as I know, ESPN is closing the API soon :-(

Sign In or Register to comment.