You heard about APIs, but you do not know what they are or where to start? This guide is for you.
APIs are everywhere, and they power almost all the internet. From weather forecasts to financial market data, nearly everything transits through APIs. It allows to disseminate data like never before and help developers build applications with reuse in mind instead of reinventing the wheel.
API is the acronym for Application Programming Interface. In contrast to a User Interface (UI) that connects a person to a computer, it's a software-to-software interface, or intermediary, enabling two applications to talk to each other.
APIs are not designed to be used by a person other than the developer using or implementing them. APIs are a way to expose a simple interface, a layer of abstraction, to interact with a more complex system without knowing its internal way of working.
APIs power web and mobile applications, desktop applications, internet of things. They are behind:
There are many other benefits of using APIs: enabling mobile applications, increased security, reduced outages, etc. But you probably got the idea. One last remark: it's always a matter of choice between speeding up development and being locked with third-party vendors, the dreaded vendor lock-in!
APIs can take various forms, but we are more interested in web APIs for this guide. Web APIs are the ones that can be accessed over the web, frequently using the HTTP protocol. They involve a client, your browser, and a server. The client initiates the request and waits for a response from the server. The response can take a lot of forms, mostly structured data, but also images, text, videos, etc.
Web-based APIs are the most widely available type of APIs. But inside this broad category, we can still distinguish many types of architectures: REST APIs, SOAP APIs, GraphQL APIs, XML-RPC, WebSocket, etc. One of the most popular is the REST API, and it's the one we will see in detail in the rest of this guide. GraphQL APIs are also very popular while more recent than REST APIs. They propose a completely different way to query the data server. WebSocket is also widely used for two-way interactive communication between a client and a server, like real-time chat applications.