TL;DR
What it does: Provides fake, realistic REST API endpoints for testing. Posts, comments, users, todos, albums, photos - all with realistic JSON responses and full CRUD support.
Quick start: curl "https://jsonplaceholder.typicode.com/posts/1"
No API key needed - just make requests
Overview
JSONPlaceholder is the most popular fake REST API for prototyping and testing. It provides 6 resource types (posts, comments, albums, photos, todos, users) with realistic JSON responses and full CRUD support. With 200+ million requests per month, it's the industry standard for front-end development, teaching REST APIs, and CI/CD testing. No API key or authentication required.
Live Example
Here's the exact URL to call and the real response you'll get:
The actual response you get:
{
"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"
}
What does this data mean?
A typical blog post: User #1 wrote a post with ID 1. The title and body contain lorem-ipsum style text.
- userId
- The ID of the author who wrote this post (1-10, each user has 10 posts)
- id
- Unique identifier for this post (1-100)
- title
- The title of the post - realistic lorem-ipsum style text
- body
- The full content of the post, with newlines preserved
How to use this API
JavaScript Example (CRUD)
// GET a post
fetch('https://jsonplaceholder.typicode.com/posts/1')
.then(res => res.json())
.then(data => console.log(data));
// POST a new post
fetch('https://jsonplaceholder.typicode.com/posts', {
method: 'POST',
body: JSON.stringify({ title: 'foo', body: 'bar', userId: 1 }),
headers: { 'Content-Type': 'application/json' }
}).then(res => res.json());
// DELETE a post
fetch('https://jsonplaceholder.typicode.com/posts/1', {
method: 'DELETE'
});
Python Example
import requests
# GET
response = requests.get('https://jsonplaceholder.typicode.com/posts/1')
print(response.json())
# POST
data = {'title': 'foo', 'body': 'bar', 'userId': 1}
response = requests.post('https://jsonplaceholder.typicode.com/posts', json=data)
print(response.json())
# Filter by userId
response = requests.get(
'https://jsonplaceholder.typicode.com/posts',
params={'userId': 1}
)
print(response.json())
cURL Example
# GET a post
curl "https://jsonplaceholder.typicode.com/posts/1"
# GET with pagination
curl "https://jsonplaceholder.typicode.com/posts?_page=1&_limit=5"
# POST a new post
curl -X POST "https://jsonplaceholder.typicode.com/posts" \
-H "Content-Type: application/json" \
-d '{"title":"foo","body":"bar","userId":1}'
# DELETE a post
curl -X DELETE "https://jsonplaceholder.typicode.com/posts/1"
Frequently Asked Questions
- What can I use JSONPlaceholder for?
- Front-end prototyping, testing API calls, teaching REST, mocking data in development, and CI/CD test suites that need an API endpoint.
- Does it support pagination?
- Yes. Use
?_page=1&_limit=10. The Link header tells you about next/previous pages. - Can I filter results?
- Yes.
/posts?userId=1returns posts by user 1./comments?postId=1returns comments on post 1. - Does it support nested resources?
- Yes:
/posts/1/comments,/users/1/posts,/albums/1/photos. - Can I test POST/PUT/DELETE?
- Yes. POST to
/postswith a JSON body. PUT/posts/1to update. DELETE/posts/1to delete. The API returns realistic responses. - What status codes does it return?
- 200 OK for GET, 201 Created for POST, 200 OK for PUT/PATCH, 200 OK or 204 for DELETE. Matches real REST API conventions.
API Details
- Base URL
https://jsonplaceholder.typicode.com- Documentation
- https://jsonplaceholder.typicode.com/
- Category
- Development
- Authentication
- None required - completely free
- Resources
/posts,/comments,/albums,/photos,/todos,/users- Methods
- GET, POST, PUT, PATCH, DELETE
- CORS
- Yes