Every time a lecturer answers a question with ‘Well, that’s really hard to explain, because you can’t teach x-concept,” it feels like a personal challenge. The truth is, this response is disturbingly common in a field that is trying to become more welcoming to newcomers.
This time, it was frustration over my school’s lack of curriculum around API’s. After 6 hours of going in circles and getting different advice from every TA on which API I should be using for angularJS-d3 and how to integrate them, I suggested that it might be good to write down some of this information so that students don’t have to go through what I and many others have. I received the answer that “You can’t teach API’s” and “Struggling is good. That’s why you’re here.”
I agree, with one important clarification. Struggling is good when it is accompanied by learning. But struggling with a problem needlessly because important information was not conveyed is not good, and it’s not why I’m here. If I wanted to waste time, I could be in my pajamas watching “Parks and Recreation” (LESLIE KNOPE!!!).
How to Choose an API
This excellent article on How to Choose an API explains some of the core concepts of comparing API’s. It covers all of the basics, including ensuring that your API doesn’t have permission limits that will hamper your app.
A few adds:
- Github indicators can assist you in knowing which API’s are tried and true. Great API’s will have been updated within the last 3 months, and will have a decent number of stars (500 or more stars indicates a good repo; 1,000 or more indicates a great one). Are they still accepting pull requests and addressing issues? All of these things indicate whether a repo is well-maintained and well-supported.
- Examples: Assuming that the repo provides good examples, can you envision incorporating these examples into your project seamlessly? If not, how much prep work will you need to do?
- Data relay: Ensure that you are prepared to relay the data in order to use the package. If you’re trying to do a client-side analysis and the API is for NodeJS, keep in mind the work and time added when you relay the data to the back-end. With larger data sets, this could become cumbersome.
- NPM or Bower package: Does one of the API’s you’re considering have an NPM or Bower package? API’s with packages are slightly easier to incorporate than those without, and tend to have better functionality (though not true in every case).
How do you choose your API’s?