What is an API?
Short answer
An API (application programming interface) is a defined set of requests one piece of software can make to another, and the responses it gets back. Web APIs usually send HTTP requests to a URL and receive JSON in return.
The idea: a contract between programs
An API is a documented boundary: it says what you can ask for, how to ask, and what you get back — without exposing how the other side is built. Like a restaurant menu, you order from defined options instead of walking into the kitchen.
How a web API request works
Most web APIs are REST APIs: they use HTTP methods such as GET, POST, PUT, DELETE, and sometimes QUERY against resource URLs. See what is a REST API, HTTP methods, and what is an HTTP header.
Terms you will meet
- Endpoint — a specific URL you send a request to
- Method — the action verb: GET to read, POST to create, QUERY for supported read-only queries with content, etc.
- Headers — metadata like authentication tokens and content type
- Payload / body — the data sent or received, usually JSON
- Status code — the outcome, e.g. 200 OK or 404 Not Found
- Rate limit — a cap on how many requests you may send