What is an API?
An API is the menu of things you're allowed to ask another system to do.
Mental model
Plain English
An API (Application Programming Interface) is a contract. Another system says 'here are the exact things you can ask me to do, here is how to ask, here is what you'll get back'. Your code calls those endpoints to get data or trigger actions.
An API is a drive-thru menu. You can only order what's on the board, in the way the board describes.
Sending an email through the Resend API — your backend calls a specific URL with a payload, Resend sends the email.
The WhatsApp Cloud API — your backend posts a message to a URL and WhatsApp delivers it.
The Google Maps API returns coordinates for a property address.
Go deeper
A menu of things another system lets you ask for.
Common mistakes
- Putting the API key in the frontend.
- Ignoring the error response and assuming success.
- Hitting the API too often and getting rate-limited.
AI-agent trap
Summary
APIs are usually HTTP endpoints (URLs). You send a request with a method (GET/POST), headers (including an API key), and a body. You get back a status and a body.