Understanding and consuming APIs and data
Prerequisite: understand how the Internet works, how apps make and respond to requests, and other essential networks.
APIs, or application programming interfaces, are kind of hard to define. In the context of web development, APIs denote websites that accept requests through HTTP (the same process as when you type a URL into your browser and hit ‘Enter’, only through code), and respond back with JSON containing your requested information. Open APIs in this case means essentially databases that you can access via a programming interface.
Here’s a small tutorial I wrote on how to use Ruby to access an API.
Check out Rise of APIs, a cool article talking about the current status of APIs.
Code you’ll need to make API calls
- Net::HTTP Cheatsheet, best short-and-sweet support for making raw HTTP requests with Ruby, no framework required.
- HTTP Calls with Ruby
- unirest, helping you make very clean http requests without the headache of Net::HTTP syntax.
Open data to use
Check out Programmable Web for many more awesome APIs you can use.
- Unsplash’s API, a gorgeous collection of free photos to use, that you can request via an API.
- FreeCodeCamp’s Coder Survey data
- open NASA data API
- Datamuse, a very simple API providing words and language data based on queries: rhymes and more!
- NYC open data API
- Open US government data API
- UK government data API
- NYTimes APIs
- NYTimes books API
- Google books API
- Haven OnDemand APIs
- IBM’s Watson API catalog: APIs for the “cognitive era”.
- The Imgur API, making API calls to Imgur.
- Reddit: while it has an official API, you can also append
.jsonto any Reddit post page to get that page as JSON data.
- Eventful, an API for events.
Data analysis, graphing, and more.