What Is an API? Plain-English Explanation + Examples
An API (Application Programming Interface) is a defined way for one piece of software to ask another for data or work. Clear explanation with REST, GraphQL, and public API examples.
Short answer
An API (Application Programming Interface) is a contract that defines how two pieces of software talk to each other. In practice, modern APIs are usually web endpoints that accept an HTTP request and return structured data (usually JSON), letting one app fetch information or trigger actions in another without knowing the other's internal code.
What "interface" actually means here
Think of the API as a restaurant menu. The menu doesn't tell you how the kitchen prepares each dish — it just lists what you can order, what you have to specify (size, toppings), and what you'll get back. The kitchen can change how it cooks anything, and as long as the menu stays the same, your order still works. That separation between "what's possible" and "how it's done" is the whole point of an API.
What a modern API looks like
Most APIs you encounter today are web APIs: HTTPS endpoints at URLs like https://api.example.com/users/42. You send an HTTP request (GET, POST, PUT, DELETE), include any needed data, and receive a response with a status code and a body (almost always JSON). That's it. Every mobile app, every integration, every "sign in with Google" button is doing this.
API styles you'll encounter
- REST — the most common style. Resources are URLs; HTTP verbs are operations (
GET /users/42,POST /users,DELETE /orders/17). See REST vs GraphQL. - GraphQL — one endpoint; clients specify exactly what fields they want. Better for apps with many data needs.
- gRPC — binary protocol built on HTTP/2; fast internal-service communication.
- WebSocket — persistent bidirectional connection; for real-time updates.
- Webhooks — reverse direction: the server calls YOUR endpoint when something happens. See What is a webhook?
Authentication, if any
Public APIs (weather, open data) often require no auth — just hit the URL. Private APIs use API keys (a secret header), OAuth tokens (scoped bearer tokens), or JWTs (signed tokens containing user claims). You can inspect any JWT you receive with the JWT decoder.
Common real examples
- Weather app → calls OpenWeather API → gets JSON of current conditions
- Stripe payment → your checkout page calls Stripe API → card charged
- Google Maps embed → browser calls Maps API → tiles returned
- ChatGPT plugin → OpenAI calls your API → your API returns data that GPT uses
- Utilko API → utilko.com/api/tools returns the tool catalog as JSON
Debugging tools you'll need
Prettify raw JSON responses with JSON formatter. Encode special characters in URL parameters with URL encoder/decoder. Look up unfamiliar response codes with HTTP status codes. Decode a bearer JWT with JWT decoder.
Featured Tools
Try these free tools directly in your browser — no sign-up required.
JSON Formatter
Format, beautify, and validate JSON instantly. Paste raw JSON and get a clean, indented, human-readable output with syntax error detection.
JWT Decoder
Decode and inspect JSON Web Tokens (JWTs) instantly. View header, payload, and signature without a secret key. Debug authentication tokens safely.
URL Encoder / Decoder
Encode or decode URLs and query strings instantly. Convert special characters to percent-encoding and back for safe URL transmission and debugging.
HTTP Status Codes
Complete HTTP status code reference with explanations, use cases, and examples. Look up any HTTP response code from 1xx informational to 5xx server errors.