2. What APIs actually are
APIs are invisible connectors that let one piece of software talk to another. Every interaction in a modern app, from heart taps to message sends to photo uploads, is one of these conversations.
When you tap a heart icon, your app sends a request to an API at an online server to record that interaction. The API then sends a response back to your phone to confirm the heart has turned red. This request-response cycle happens every time you interact with an app.
Every API interaction follows this pattern: you send a request, the server processes it, the server sends a response. This happens thousands of times as you browse the web, but it happens so fast (usually 50 to 200 milliseconds) that you perceive it as instant. Understanding this cycle is fundamental to everything you'll do with APIs.
Real-world API examples
Five applications you probably used today, and the kinds of APIs that power apps like them:
| Application | API categories an app like this uses |
|---|---|
| Uber | Mapping and directions APIs, payment processor APIs, SMS or push notification APIs, analytics APIs (usage patterns) |
| Spotify | Music catalogue APIs, recommendation engines, social media APIs (sharing to X, Instagram), payment processor APIs |
| Airbnb | Mapping and location APIs, payment processor APIs, messaging APIs, translation APIs, photo storage APIs |
| Weather apps | Weather data APIs (for example, NOAA), mapping and location APIs, push notification services |
| Food delivery | Mapping and routing APIs, payment processor APIs, SMS or push notification APIs, restaurant menu APIs |
These are categories, not a claim that each company currently uses a specific vendor. The point is that none of these companies built every supporting system themselves. They focused on their core product and used APIs for everything else: maps, payments, messaging, analytics, authentication, recommendations, storage, and translation.
This is the real power of APIs: they let developers stand on the shoulders of specialised services, assembling complex applications from proven building blocks. By the end of this book, you'll know how to connect to APIs like these and build applications that combine multiple services into something greater than the sum of its parts.
Next, we'll get away from technology for a moment and use a restaurant analogy that makes the whole request-response cycle click.