BYTETOOLS

JSONPlaceholder API

Free fake REST API for testing and prototyping. Posts, comments, users and todos with full GET, POST, PUT and DELETE support. No key. Real curl examples.

No API key requiredCORS enabledHTTPSCompletely free.

Endpoint tested and returned HTTP 200 on 2026-08-19

What is the JSONPlaceholder API?

JSONPlaceholder is a free fake REST API for testing and prototyping. It serves realistic dummy data — posts, comments, albums, photos, todos and users — and accepts GET, POST, PUT, PATCH and DELETE requests without any API key.

JSONPlaceholder is the API nearly every developer meets first. It exists purely so you can test HTTP code against something realistic without building a backend, and it has been reliably online for years.

Writes are simulated rather than persisted: a POST returns HTTP 201 with a plausible new `id`, but nothing is saved, so fetching that id afterwards returns 404. That is intentional — it lets thousands of people run the same tutorial without corrupting shared state. Use it to verify your request code works, not to test persistence.

Quick facts

Base URL
https://jsonplaceholder.typicode.com
Authentication
No key or authentication of any kind.
Rate limit
No published limit; fair use expected.
Pricing
Completely free.
CORS
Enabled — callable directly from browser JavaScript
Official docs
Read the docs

How to use the JSONPlaceholder API

Every request below was executed against the live API on 2026-08-19, and the response shown is the real body it returned — not an illustration.

1. Fetch a single post

GET https://jsonplaceholder.typicode.com/posts/1

curl
curl 'https://jsonplaceholder.typicode.com/posts/1'
JavaScript (fetch)
const res = await fetch("https://jsonplaceholder.typicode.com/posts/1");
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();
console.log(data);
Python (requests)
import requests

res = requests.get("https://jsonplaceholder.typicode.com/posts/1", timeout=20)
res.raise_for_status()
print(res.json())
Response — HTTP 200
{
  "userId": 1,
  "id": 1,
  "title": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit",
  "body": "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto"
}

2. Create a post with a POST request

POST https://jsonplaceholder.typicode.com/posts

curl
curl -X POST 'https://jsonplaceholder.typicode.com/posts' \
  -H 'Content-Type: application/json' \
  -d '{"title":"ByteTools","body":"Hello","userId":1}'
JavaScript (fetch)
const res = await fetch("https://jsonplaceholder.typicode.com/posts", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"title":"ByteTools","body":"Hello","userId":1}),
});
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();
console.log(data);
Python (requests)
import requests

headers = {
    "Content-Type": "application/json",
}

payload = {"title":"ByteTools","body":"Hello","userId":1}

res = requests.post("https://jsonplaceholder.typicode.com/posts", headers=headers, json=payload, timeout=20)
res.raise_for_status()
print(res.json())
Response — HTTP 201
{
  "title": "ByteTools",
  "body": "Hello",
  "userId": 1,
  "id": 101
}

Parameters

ParameterTypeRequiredDescription
<resource>pathRequiredOne of posts, comments, albums, photos, todos, users. posts
<id>pathOptionalResource id. Omit to list all. 1
_limitintegerOptionalLimit the number of results returned. 10
userIdintegerOptionalFilter child resources by owning user. 1

Response fields

idinteger
Resource identifier.
userIdinteger
Owning user, present on most resources.
titlestring
Short title text on posts and todos.
bodystring
Longer body text on posts and comments.

What you can build with the JSONPlaceholder API

  • Test fetch, Axios or HttpClient code before your real backend exists
  • Demonstrate GET and POST requests in tutorials and documentation
  • Prototype list and detail UI screens with realistic data volumes
  • Verify loading, error and empty states in a front-end app

Common errors and how to fix them

404

Unknown resource or id — including any id you just 'created'.

Fix: Writes are simulated and never persisted; do not expect to read back what you POST.

Created resource disappears

Expected behaviour, not a bug.

Fix: Use a real backend, or a local json-server instance, when you need persistence.

JSONPlaceholder API — frequently asked questions

Does JSONPlaceholder actually save data I POST?

No. It returns HTTP 201 with a realistic id so your client code can be tested end to end, but nothing is persisted. Requesting that id afterwards returns 404.

Is JSONPlaceholder free and does it need an API key?

It is completely free with no key, no signup and no authentication, which is why it is the standard choice for tutorials and HTTP client testing.

What resources does JSONPlaceholder provide?

Six: posts, comments, albums, photos, todos and users, with realistic relationships between them — for example comments belong to posts and posts belong to users.

Can I run JSONPlaceholder locally?

Yes. The same author maintains json-server, which serves an equivalent REST API from a local JSON file and does persist writes, making it better for offline development.

Tools that pair with this API

JSONPlaceholder is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 2026-08-19; always check the official documentation before relying on this API in production, as terms and limits can change.