API Directory โ€บ Guides โ€บ What Is an API Endpoint?

What Is an API Endpoint?

An endpoint is a specific URL you call to do one thing. Here's what that means and how to read one.

An API endpoint is a single URL that an API exposes to do one specific job — fetch a user, create an order, search for a city. If an API is a building, the endpoints are its doors: each one leads somewhere specific, and each has rules about who may go through and what they must bring.

The anatomy of an endpoint

Take this endpoint from the OpenWeatherMap API:

GET https://api.openweathermap.org/data/2.5/weather?q=Lagos&appid=KEY

Every part of that line matters:

MethodGET — the verb. GET reads, POST creates, PUT/PATCH update, DELETE removes. The same path with a different method is, in effect, a different endpoint.
Base URLhttps://api.openweathermap.org — the host every endpoint on this API shares.
Path/data/2.5/weather — the part that identifies this resource or action. /data/2.5 is a version prefix; /weather is the resource.
Query string?q=Lagos&appid=KEY — parameters that filter or configure the request. Here: which city, and which API key.
Path parametersNot shown here, but common: /users/42 puts the id in the path instead of the query string.

Endpoint vs. API vs. route

How to find an API’s endpoints

Good documentation lists them in a reference section, usually grouped by resource, each with its method, path, parameters, an example request and an example response. Many APIs also publish a machine-readable OpenAPI (Swagger) specification — a single JSON or YAML file describing every endpoint, which tools can turn into interactive docs or client libraries. If there’s a “Try it” console, use it: it shows the exact URL it builds.

Calling an endpoint

Every endpoint call is the same four steps, whatever the language:

# 1. build the URL (base + path + query)
# 2. add headers (auth, Accept, Content-Type)
# 3. send the request with the right method
# 4. check the status code, then parse the body

import requests
r = requests.get(
    'https://api.openweathermap.org/data/2.5/weather',
    params={'q': 'Lagos', 'appid': 'YOUR_KEY'},
    headers={'Accept': 'application/json'},
    timeout=10,
)
r.raise_for_status()          # step 4a: did it work?
data = r.json()               # step 4b: read the body
print(data['main']['temp'])

Things that trip people up

FAQ

What is the difference between an API and an endpoint?

The API is the entire interface a service exposes. An endpoint is one specific URL within it — one method and path that performs one operation, like GET /users/42.

Is a URL the same as an endpoint?

An endpoint is identified by a URL and an HTTP method. GET /orders and POST /orders share a URL but are two different endpoints that do different things.

How do I know what endpoints an API has?

Read its API reference documentation, or its OpenAPI/Swagger spec if it publishes one. Both list every endpoint with its method, path, parameters and example responses.

What is a REST endpoint?

A REST endpoint is named after a resource and uses HTTP methods for actions: GET /articles lists, GET /articles/5 reads one, POST /articles creates, DELETE /articles/5 removes.

Keep going

Try it on a real API

Browse all 196 free APIs โ†’

๐Ÿ”Œ Explore free public APIs

Hundreds of free APIs, searchable by category, with auth & CORS at a glance.

Browse the directory โ†’