What is an API and how does it work?

Rapid
What is an API and how does it work?
What is an API and how does it work?

APIs (Application Programming Interface) are the intermediary between two programs. They allow data to be transferred between them. APIs are very versatile and can be used on the web, databases and operating systems.

Rapid
What is an API and how does it work?
What is an API and how does it work?

API Request: It means an API call is initiated. This is the process of the client app submitting a request to a server. APIs can be used to share data, embed content and much more. An analogy can be drawn to how ants from a hive work together. Ants from inside the hive might generated a request for food to Ants that can get it. The latter are a good representatives of our APIs

Rapid
What is an API and how does it work?
What is an API and how does it work?

Our worker ant acting like the API that it is, goes to fetch the needed data for the hive (client). APIs use HyperText Transfer Protocols (HTTP) to transfer data.

Rapid
What is an API and how does it work?
What is an API and how does it work?

Each time you open up twitter, google maps, a weather app etc. you are using APIS. APIs are everywhere. Our worker ant can be seen collecting food (data) in this panel. To find the right data, APIs have endpoints. End points are essentially the URLs that navigate to the correct resource. In this example the endpoint is a baby carrot.

Rapid
What is an API and how does it work?
What is an API and how does it work?

API Response: As long as the server (field) can return the requested data (food) to the client successfully the API call and response are declared a success. If the server cannot return what the client asked for, the API will return an error message declaring the request has been denied.