API Documentation

A free example API that actually works. Every endpoint below is live — open any link or run the curl command.

Endpoints

MethodPathDescription
GET/jsonA simple, stable JSON example you can paste anywhere.
GET/usersA fixed list of example users. No database behind it.
GET/users/:idA single example user. Unknown ids return 404.
GET/postsA fixed list of example posts.
GET/posts/:idA single example post. Unknown ids return 404.
GET/status/:codeReturns the HTTP status code given in the URL, with a small JSON body. Useful for testing error handling.
GET/delay/:secondsWaits the given number of seconds before responding. Capped at 10 seconds.
GET/headersEchoes back the headers your client sent.
GET/ipEchoes back your IP address. Nothing is stored or logged.
GET/uuidReturns a fresh UUIDv4 on every call.
ALL/anythingThe debugging endpoint. Echoes the method, URL, query string, headers and body of any request.

Endpoint details

GET /json

A simple, stable JSON example you can paste anywhere.

curl https://api-example.com/json
{
  "message": "Hello from api-example.com",
  "success": true
}

GET /users

A fixed list of example users. No database behind it.

curl https://api-example.com/users
[
  { "id": 1, "name": "Ada Lovelace", "username": "ada", "email": "ada@example.com" },
  { "id": 2, "name": "Alan Turing", "username": "alan", "email": "alan@example.com" },
  { "id": 3, "name": "Grace Hopper", "username": "grace", "email": "grace@example.com" }
]

GET /users/:id

A single example user. Unknown ids return 404.

curl https://api-example.com/users/1
{
  "id": 1,
  "name": "Ada Lovelace",
  "username": "ada",
  "email": "ada@example.com"
}

GET /posts

A fixed list of example posts.

curl https://api-example.com/posts
[
  { "id": 1, "userId": 1, "title": "Getting started with api-example.com", "body": "..." },
  { "id": 2, "userId": 2, "title": "How to test a webhook endpoint", "body": "..." }
]

GET /posts/:id

A single example post. Unknown ids return 404.

curl https://api-example.com/posts/1
{
  "id": 1,
  "userId": 1,
  "title": "Getting started with api-example.com",
  "body": "Stop inventing fake API URLs. Use one that works."
}

GET /status/:code

Returns the HTTP status code given in the URL, with a small JSON body. Useful for testing error handling.

curl -i https://api-example.com/status/404
HTTP/1.1 404 Not Found

{
  "success": false,
  "status": 404,
  "message": "Not Found",
  "path": "/status/404"
}

GET /delay/:seconds

Waits the given number of seconds before responding. Capped at 10 seconds.

curl https://api-example.com/delay/3
{
  "success": true,
  "message": "Delayed by 3 seconds.",
  "seconds": 3,
  "timestamp": "2026-08-24T00:00:00.000Z"
}

GET /headers

Echoes back the headers your client sent.

curl -H "X-Custom: hello" https://api-example.com/headers
{
  "headers": {
    "accept": "*/*",
    "user-agent": "curl/8.9.1",
    "x-custom": "hello"
  }
}

GET /ip

Echoes back your IP address. Nothing is stored or logged.

curl https://api-example.com/ip
{
  "ip": "203.0.113.7"
}

GET /uuid

Returns a fresh UUIDv4 on every call.

curl https://api-example.com/uuid
{
  "uuid": "1f2a3b4c-5d6e-4f80-9a1b-2c3d4e5f6071"
}

ALL /anything

The debugging endpoint. Echoes the method, URL, query string, headers and body of any request.

curl -X POST https://api-example.com/anything \
  -H "Content-Type: application/json" \
  -d '{"name": "Ada"}'
{
  "method": "POST",
  "url": "https://api-example.com/anything",
  "query": {},
  "headers": {
    "accept": "*/*",
    "content-type": "application/json",
    "user-agent": "curl/8.9.1"
  },
  "body": { "name": "Ada" },
  "timestamp": "2026-08-24T00:00:00.000Z"
}

POST JSON example

Send a JSON body and inspect exactly what arrived.

curl -X POST https://api-example.com/anything \
  -H "Content-Type: application/json" \
  -d '{"name": "Ada", "role": "engineer"}'

{
  "method": "POST",
  "url": "https://api-example.com/anything",
  "query": {},
  "headers": { "content-type": "application/json", "user-agent": "curl/8.9.1" },
  "body": { "name": "Ada", "role": "engineer" },
  "timestamp": "2026-08-24T00:00:00.000Z"
}

HTTP status testing

Return any status code to test how your client handles errors, retries and redirects:

curl -i https://api-example.com/status/200   # 200 OK
curl -i https://api-example.com/status/404   # 404 Not Found
curl -i https://api-example.com/status/500   # 500 Internal Server Error
curl -i https://api-example.com/status/418   # 418 I'm a teapot

JavaScript (fetch)

// GET example
const user = await fetch("https://api-example.com/users/1").then((r) => r.json())
console.log(user.name) // "Ada Lovelace"

// POST example
const res = await fetch("https://api-example.com/anything", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ hello: "world" }),
})
console.log(await res.json())

Python (requests)

import requests

# GET example
user = requests.get("https://api-example.com/users/1").json()
print(user["name"])  # Ada Lovelace

# POST example
echo = requests.post("https://api-example.com/anything", json={"hello": "world"}).json()
print(echo["body"])  # {'hello': 'world'}

CORS & browser usage

All endpoints send Access-Control-Allow-Origin: * and answer OPTIONS preflight requests, so you can call them directly from any browser page, CodePen, or local frontend without a proxy.

Limits & policy

Historical paths

This domain has been used as a placeholder API in the past. Unknown paths such as /v1/..., /v2/..., /api/..., /login, /foo or /article return a friendly JSON payload instead of a broken link, so old documentation keeps working.