Working with API

What is an API?

Faizah Ahsan
4 min readJan 16, 2021

API stands for Application Programming Interface. In basic terms, APIs are a set of functions and procedures that allow for the creation of applications that access data and features of other applications, services, or operating system. In another words, A way to generate data and interact with data in a database. Good APIs make it easier to develop a computer program by providing all the building blocks, which are then put together by the programmer. The API is not the database or even the server, it is the code that governs the access point(s) for the server.

There are two types of APIs:

  • Internal API
  • Third Party API.

What is Internal API?

An internal API is an interface that enables access to a company’s backend information and application functionality for use by the organization’s developers.

YOUR BACK END IS AND API!

Pros and Cons of Internal API:

Pros:

  • Control: Decide how your data is formatted and manipulated. If you are also the creator of the database, you can decide the structure of the data from the ground up. If not, you can use your API requests to reformat the data when you retrieve it as you see fit.
  • Freedom: When working with a third party API you may be limited in the number and types of calls you can make to retrieve the data, and that is not the case when you are in the driver seat setting up those calls.
  • Data Persistence: The fact that you are working with your own database and API means that if/when something breaks, you will still have direct access to the data, and not have information cut off from a third party.

Cons:

  • Dirty Work: With an internal API, you will need to set up all of your application controllers on your own, as well as most likely the database you are using. This takes time, and if there is a third party database with an existing API you can leverage, you can get moving quicker.
  • Reliability: Chances are, if you are just now setting up an internal API and database from scratch, it is not likely that your system is already as robust an existing third party API. If this third party API is open, it is likely that many other engineers are already using it and it is at least more battle tested than something brand new.
  • Maintenance: As your data and app change, you are going to need to refactor your back end API to work with each new feature as necessary. This could be true for a third party API as well, but as you do not have the power to change an external API’s calls and endpoints, that amount of work is eliminated and you will likely have to change whatever feature you’re working on to fit the third party calls.

What is a third party API?

Third party APIs are APIs developed & located on third party servers. They are sets of requirements and regulations through which partial access to a 1st party system or program can be gained. Generally, companies such as Facebook, Twitter, or Google — to allow you to access their functionality via JavaScript and use it on your site.

Pros and Cons of Internal API:

Pros:

  • Fast: Being able to integrate maps within seconds, images or authentication services in our applications we download much of the programming and allows us to focus quickly in our business domain.
  • Robustness: Most popular APIs and services are so highly extended that have been tested in all kinds of stress, so we can ensure that your response will be adequate in the vast majority of cases.
  • Efficient: It is much more efficient and more convenient to use the capabilities of one of the APIs than to try to independently implement similar functionality.
  • Maintenance: Generally, large companies that their products will not deteriorate, so it is not uncommon for services accessed through the APIs are in a constant improvement, also in many cases will be totally transparent to the programmer that uses them.

Cons:

  • Changing conditions: When you link us to a third party to a contract as weak as is a license to use API , we are normally exposed to the will of the other party, which may mean cuts in benefits, methods implemented obsolescence or loss of free service.
  • Availability: If that was not enough to worry about keep running our own server and applications, falls outside services, such as those that occurred this year with Amazon , you can leave your unused services. Can you imagine having a virtual shop works perfectly, but only supports PayPal payments and that they not work?
  • Image: Before I named it as an advantage because we can favor us the reputation of a good brand to work with, but what happens when the reputation of our partners down to the mud? Unfortunately, it is very difficult to completely separate the image of each other, and we will be hurt by the mistakes of others.

How to pull data from an API?

  1. GET API KEY
  • Most APIs require an API key. Once you find an API you want to play with, look in the documentation for access requirements. Most APIs will ask you to complete an identity verification, like signing in with your Google account. You’ll get a unique string of letters and numbers to use when accessing the API.

2. FINDING THE METHOD

  • The easiest way to start using an API is by finding an HTTP client online, like REST-Client, Postman, or Paw. These ready-made tools help you structure your requests to access existing APIs with the API key you received.

--

--

Faizah Ahsan

Junior Full-Stack Web Developer. Looking for opportunities!