Skip to content
JSON Tidy

Fake JSON API for testing

Free REST endpoints that return made-up JSON about a fleet of office robot vacuums. Call them from a front end, a test suite or a terminal. There’s no sign-up and no API key, and CORS is open, so a page on any site can call them.

GET/api/fake/robots

Base URL: https://www.jsontidy.com/api/fake

Endpoints

Press Send request on any of them to see the response here, or copy the URL into your own code.

GET/api/fake/robots

The five robots. Filter with ?status=stuck or ?model=CP-300.

GET/api/fake/robots/TIDY-002

One robot. An ID that doesn’t exist gets a 404 with a JSON error body.

GET/api/fake/robots/TIDY-002/runs?limit=3

One robot’s cleaning runs, paged.

GET/api/fake/runs?page=2&limit=5

500 cleaning runs, paged. Filter with robot_id, room or result.

GET/api/fake/runs/48001

One run, by its numeric ID.

GET/api/fake/events?level=error&limit=5

200 things the robots reported. Filter with robot_id, code or level.

GET/api/fake/tickets?fixed=false&limit=5

60 maintenance tickets. Filter with robot_id, part or fixed.

GET/api/fake/rooms

The rooms in the building. Filter with ?floor=2.

GET/api/fake/people

The three people who look after the robots.

GET/api/fake/random?dataset=events&count=5&seed=42

Generated records, up to 1,000. The same seed always gives the same data.

Pages and filters

Runs, events and tickets come back a page at a time, wrapped in an object that says where you are:

{
  "data": [ ...5 runs... ],
  "page": 2,
  "limit": 5,
  "total": 500,
  "total_pages": 100,
  "next": "/api/fake/runs?page=3&limit=5"
}

limit can be up to 100, and a page past the end gives you the last page. The total is also in an X-Total-Count header, as json-server and many real APIs send it. Robots, rooms and people are short lists, so they come back as a plain array.

Filter on any field listed next to an endpoint by adding it to the query string, like ?robot_id=TIDY-002&result=stuck. Matching ignores case.

Slow responses and errors

Add delay to any URL to wait that many milliseconds before answering, up to 10 seconds. Add status with a number to get that status code and a JSON error body instead of the data. Together they let you test loading states, timeouts and error handling without breaking a real server.

GET/api/fake/robots?delay=2000

Answers after 2 seconds.

GET/api/fake/robots/TIDY-002?status=503

A 503 with a Retry-After header, as an overloaded server sends.

// Does the loading state look right while a slow request is in flight?
await fetch("https://www.jsontidy.com/api/fake/robots?delay=3000");

// Does the app retry, or show a message, when the API is down?
const res = await fetch("https://www.jsontidy.com/api/fake/robots?status=503");
res.status;                      // 503
res.headers.get("Retry-After");  // "120"
await res.json();                // { "error": { "status": 503, ... } }

The codes you can ask for are 200, 201, 202, 204, 400, 401, 403, 404, 405, 409, 410, 418, 422, 429, 500, 502, 503, 504. A 401 comes with a WWW-Authenticate header, and 429 and 503 come with Retry-After, so you can test code that reads them. A word instead of a number, like ?status=stuck, filters robots by their own status field.

POST, PUT, PATCH and DELETE

Robots, runs, events and tickets accept writes, and answer the way a real API would: 201 Created with a new ID and a Location header for a POST, 200 for PUT and PATCH, and 204 No Content for DELETE. Nothing is saved, so the next GET returns the same data as before.

The API never reads the body you send. You can test the code that sends a request, but don’t expect your data back in the response.

POST/api/fake/runs
PATCH/api/fake/robots/TIDY-002
DELETE/api/fake/robots/TIDY-002

Calling it from code

// JavaScript
const res = await fetch("https://www.jsontidy.com/api/fake/robots/TIDY-002");
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const robot = await res.json();

# cURL
curl "https://www.jsontidy.com/api/fake/runs?robot_id=TIDY-002&limit=3"

# Python, with requests
import requests
runs = requests.get("https://www.jsontidy.com/api/fake/runs", params={"limit": 3}).json()["data"]

Every response has Access-Control-Allow-Origin: *, so browser code on any site, including localhost, can call it without a proxy.

What the data is

Made-up records about a small fleet of office robot vacuums. They have what real responses have: nested objects, ISO 8601 timestamps, null where a value is missing, and IDs in more than one style. The data never changes, so tests that use it stay stable, and responses are cached for a day, which keeps them fast.

Limits and fair use

It’s meant for development, tests, demos and learning. Please don’t use it for load testing or as a backend for something in production. If you need your own data shapes or state that sticks between requests, run json-server locally.

To test what happens when the JSON itself is broken, such as an empty body, an HTML error page or a trailing comma, use the broken JSON test URLs. For more records, other formats or a file to download, use the JSON generator.