Over the last two weeks, I’ve been developing a government accountability app based on several public data sources. The primary source is the Sunlight Foundation’s Congress API, but we’ve supplemented this with data from NYT, and LittleSis.
Hosting data on your own server can be ideal when you can get the full data set, but external API calls come in especially handy during rapid prototyping. You can quickly mash up information from multiple sources and see what interesting details emerge.
During this project, I ran across an app called Postman, an HTTP client that reduces a variety of pain points that show up when exploring a new API. These pain points include:
- Crafting queries and testing optional parameters
- Formatting and evaluating objects returned
- Keeping track of successful queries and all the parameter options you’ve tried
I’d like to show you how postman tackles these.
Using Postman is easy as plugging in an API call and hitting send. The clearest feature up front is the clean formatting of the response object. Rather than parsing through a glob of JSON, you can quickly scan a tabbed and lined object to find the data you need.
If you want to adjust your query, Postman offers a “URL parameters” button where you can list out every parameter you want to include without hunting through ?s and &s.
Once you discover queries that do what you want, you can save them and organize them into collections. This is extremely helpful when sorting API calls for each project and then easily finding calls to use later in new projects. I love this feature as I usually run across something that would make a great one-page visualizaton, but doesn’t quite fit my current purpose.
If you forget to save a call or your browser crashes, Postman has you covered with a simple History tab that lists all your recent activity.
As if all this wasn’t enough, Postman also lets you set up and manage environments based on your projects. Just load in keys and values as they appear in your code and you can test your API calls as they’ll show up in the environment you’re working in. No need to rewrite or translate just for testing.
All in all, Postman is a must have for you tool kit when developing apps that make external API calls.