API 101
API’s are an interesting topic for me in programming. API stands for Application Programming Interface, but what does that actually mean? This means that the application that you are viewing sends a request to a server that then requests information to be sent back to the application after being converted to something that makes for a good user experience. This server could be a public API with hundreds or millions of different applications that could also be making requests or a personal one that only you have access to.
The requests sent to the API will then get a response back, which is the data that was being requested. This could be weather data, books from a certain author, or geological map data. This data is then sent back to the application to be processed and turned into something that the ‘frontend’ can use to render the requested data while taking requests from vastly different applications that could be doing different things with the data at the same time.
Most modern APIs are language agnostic this means that any language could in theory access this server and draw the information out as most nowadays use JSON, HTTP, and REST to access the server and then sends JSON back to the application. This JSON data can then be manipulated in any way that the application sees fit. This means that they’re incredibly versatile and have their own services and dedicated developers. Some of the largest companies have public APIs that allow developers to easily access their large wealth of data without creating or gathering any of their own. Some API’s also query data from multiple APIs such as some travel site APIs.
Travel or flight APIs is one of the best examples of the importance of APIs. Without access to this server any time a developer would want to find data about which hotel had which rooms vacant or which rental car company had the cheapest rates in that city so they could get that data to their user. They would have to either ask each company to have access to their data every single time save it to the developer’s own database and then send it to his application or worse create the data himself. This API has access to thousands of hotels, flights, and other travel data from multiple companies. There’s no need to make requests from multiple servers or store them into one’s own database when the data can be simply requested which the user clicks a link or searches for a hotel.
In my opinion, APIs are one of the most brilliant things about modern-day programming and public APIs abide by the philosophy that all information should be free. This is one of the greatest reasons for innovation!