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.
Endpoint tested and returned HTTP 200 on 19 Aug 2026
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 19 Aug 2026, 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 'https://jsonplaceholder.typicode.com/posts/1'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);import requests
res = requests.get("https://jsonplaceholder.typicode.com/posts/1", timeout=20)
res.raise_for_status()
print(res.json()){
"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 -X POST 'https://jsonplaceholder.typicode.com/posts' \
-H 'Content-Type: application/json' \
-d '{"title":"ByteTools","body":"Hello","userId":1}'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);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()){
"title": "ByteTools",
"body": "Hello",
"userId": 1,
"id": 101
}Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
<resource> | path | Required | One of posts, comments, albums, photos, todos, users. posts |
<id> | path | Optional | Resource id. Omit to list all. 1 |
_limit | integer | Optional | Limit the number of results returned. 10 |
userId | integer | Optional | Filter 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
JSON Formatter
Format, beautify and minify JSON online with 2-space, 4-space or tab indentation. Sort keys alphabetically and catch syntax errors instantly — free and private.
JSON Validator
Free online JSON validator: validate JSON and find syntax errors with the exact line and column. See root type, key counts and depth — instant and 100% private.
Alternatives to JSONPlaceholder API
If JSONPlaceholder does not fit, these developer & testing apis cover similar ground. Every one was called before publishing, and each links to its own reference page with a working curl command and the response it returned.
| API | What it does | Auth | CORS | Last verified |
|---|---|---|---|---|
| GitHub REST API | GitHub REST API with no key for public data: repository details, users, issues, releases and commits. 60 req/hour unauthenticated, 5,000 with a token. | No key | Yes | 19 Aug 2026 |
| Postman Echo | Postman Echo reflects your HTTP request back as JSON: headers, body, query params and auth. Free, no key, ideal for debugging clients. Real POST example. | No key | No | 19 Aug 2026 |
| DummyJSON | Free fake REST API with realistic products, users, carts, recipes and auth. Supports search, pagination, sorting and POST. No key. Tested GET and POST examples. | No key | Yes | 19 Aug 2026 |
| Fake Store API | Free fake e-commerce API with products, categories, carts and users. Built for building shop prototypes and React tutorials. No key. Tested curl example. | No key | Yes | 19 Aug 2026 |
| Kroki | Free diagram-as-code API with no key: send Graphviz, Mermaid, PlantUML or 25 other diagram languages as text and get back SVG, PNG or PDF. Tested curl example included. | No key | Yes | 21 Aug 2026 |
| Maven Central Search | Search Maven Central for Java artifacts, latest versions and coordinates with no API key. Solr-backed query syntax, tested example and the epoch-milliseconds trap. | No key | No | 21 Aug 2026 |
JSONPlaceholder is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 19 Aug 2026; always check the official documentation before relying on this API in production, as terms and limits can change.