Skip to content
Robyn Overstreet edited this page Mar 12, 2015 · 48 revisions

APIs: Getting Data from the Outside World

Read:

See the code examples

Don't forget to check out the new code in the repo this week.

Publishing JSON data

Creating a JSON file

Part of the assignment this week is to publish some JSON data. You don't necessarily have to write the JSON from scratch. If you have data in a spreadsheet, you can convert it to JSON. In your spreadsheet program, export the file as CSV, open the CSV file in Sublime or other text editor, copy the contents, and paste it into this online CSV-to-JSON converter. Then click "Download" or just copy and paste the resulting JSON into a new file and save it with the file extension .json.

If you prefer, you can write JSON in a text editor, or use the online JSON editing tool, JSON Editor Online.

Refer to the notes on JSON as a formatting guide.

Publishing JSON

Publish your JSON to gist by forking my example JSON gist and replacing my code with your own. Make sure to validate your JSON using JSON Editor Online.

#####JSON Tools

Available APIs

Try out some of these APIs or find others on your own:

Also see NYC Open Data, where you can get NYC-related datasets, some downloadable and others available as URLs.