What Is an API?
Understanding APIs and how they work
An API is a way to ask the internet a question and get an answer back.
When you open a website, your browser:
- sends a request i.e. question
- receives information i.e. response
- displays it on the screen
An API works the same way, but instead of showing a website, it sends data.
Example: Weather
If you type "weather" into Google, you see:
- today's date
- temperature
- sun or clouds
- the forecast for the week


Figure: Screenshot from Google Search with "weather near Baden-Baden" as search keyword.
Behind the scenes, your browser asks an API for this information.
Sometimes, the browser also sends information, for example your location (if you allow it).
APIs use structured data formats like JSON to exchange information.
To use many APIs, you need an API key to identify yourself.