API
Application Programming Interface
ELI5 — The Vibe Check
An API is like a menu at a restaurant. The kitchen (server) can do a bunch of things, but you can only order what's on the menu. The API is the list of things you're allowed to ask for and exactly how to ask.
Real Talk
An API is a defined set of rules and protocols that allows different software applications to communicate with each other. It specifies what requests can be made, how to make them, and what responses to expect, abstracting away the underlying implementation.
Show Me The Code
// Calling a weather API
const res = await fetch('https://api.weather.com/v1/current?city=London');
const data = await res.json();
When You'll Hear This
"We need to integrate the Stripe API for payments." / "What does the API return when the user doesn't exist?"
Related Terms
Endpoint
An endpoint is a specific URL that your API listens on for requests.
GraphQL
GraphQL is like ordering food where YOU specify exactly what you want on your plate.
Request
A request is what your browser (or app) sends to a server when it wants something. 'Give me the homepage.' 'Give me that image.
Response
A response is what the server sends back after receiving a request.
REST (Representational State Transfer)
REST is a set of rules for how APIs should behave. Think of it as the etiquette guide for servers and clients talking to each other.