Finding the right API for your project
Using data from an API is crucial to making a good project — GREAT. One essential aspect of looking for an API to help your project get off the ground is the ease of access to grab information. You’ll also want to check out the documentation before implementing the data into your project.
Below, I’ll give you some examples of what to look for when trying to find a great API for your project.
Documentation and Examples
For my mod 4 project at Flatiron School, I used the New York Times Top Stories API. This was great because the documentation was easy to read and they had example calls that I could follow.
Example calls are great because they give you a clue as to what type of information you can grab. I like to think of these types as “genres.” Depending on the section, the endpoint (example: /arts/.json?api-key=yourkey”) will change. Which leads me to what I look for next!
Diversity in the data
You can imagine that each article section has a type(or genre) such as: arts; home; science; us; or world. This creates a natural split in the information and neatly organizes the sections for you.
When APIs this, I like to exploit that to the user in the interface so they can choose what type of article they want to read.
You can see that there’s quite a bit of repetition in our user interface, so let’s talk about the similarities.
Similarities in the data
It’s important to note that although each section is different, they still hold some similarities. That being said, each article in the section is similar to each other and we can find that data in the schema.
Looking at the schema is great when you’re looking for what information you might think is fun for the user.
Note: I always look for visual cues in the data, such as an image_url or video that I can show the user. Pictures and videos are great ways to draw in your users.
Things to watch for
Request Limits. Be careful with request limits! Request limits can be harsh especially when you’re first developing your application. You’ll want to continually test your app, and you don’t want to be tied down by those limits. As you can see here, I tried unsplash for an image api, but I blew that 50/requests per hour out of the water. They allow you to apply for production level access, but meh…
Proxies. Some APIs require you to use proxies to gather data. This can be troublesome as it adds an extra layer to API calls. But this is better for securing the api, prevent denial of service attacks and other things. But if you don’t plan on launching a public application, this can be an extra hurdle for you.
That’s pretty much it! I look for those major things to kick off a successful project. I hope these tips are helpful for you!