JSONPlaceholder

Development API · Fake data for testing · 7 resource types

TL;DR

JSONPlaceholder is the internet's favorite fake REST API for prototyping and testing. It provides 7 common resource types — posts, comments, albums, photos, todos, and users — all with realistic JSON data. Every standard CRUD operation (GET, POST, PUT, PATCH, DELETE) works. Changes aren't persisted (it's fake data), but the API returns proper HTTP status codes and response structures so you can build and test your frontend against a real backend.

Quick start: https://jsonplaceholder.typicode.com/posts/1

No API key needed — just make a request!

How to Use This API

1. Get a Single Post

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

Returns {"userId":1,"id":1,"title":"sunt aut facere...","body":"quia et suscipit..."}

2. Get All Posts by a User

https://jsonplaceholder.typicode.com/posts?userId=1

Filter by userId, id, or any field using query parameters.

3. Create a New Post (POST)

Test your POST form handler:

POST https://jsonplaceholder.typicode.com/posts
Content-Type: application/json

{"title":"foo","body":"bar","userId":1}

Returns 201 Created with your data and an id of 101.

4. JavaScript — Fetch and Display Posts

async function getPost(id) {
  const resp = await fetch(
    `https://jsonplaceholder.typicode.com/posts/${id}`
  );
  return resp.json();
}

async function getComments(postId) {
  const resp = await fetch(
    `https://jsonplaceholder.typicode.com/posts/${postId}/comments`
  );
  return resp.json();
}

// Display post 1 with its comments
Promise.all([getPost(1), getComments(1)]).then(([post, comments]) => {
  console.log(post.title);
  comments.forEach(c => console.log(' -', c.email, ':', c.body));
});

5. Python — Test CRUD Operations

import requests

BASE = 'https://jsonplaceholder.typicode.com'

# GET all users
users = requests.get(f'{BASE}/users').json()
print(f"Found {len(users)} users")

# POST a new todo
todo = {
    'userId': 1,
    'title': 'Test JSONPlaceholder',
    'completed': false
}
resp = requests.post(f'{BASE}/todos', json=todo)
created = resp.json()
print(f"Created todo #{created['id']}: {created['title']}")

# DELETE the todo
delete = requests.delete(f'{BASE}/todos/{created['id']}')
print(f"Deleted: {delete.status_code}")  # 200
Try fetching post #1: https://jsonplaceholder.typicode.com/posts/1

Frequently Asked Questions

What endpoints are available?
7 resources: /posts (100 items), /comments (500), /albums (100), /photos (5000), /todos (200), /users (10). Each follows RESTful conventions with nested routes like /posts/1/comments.
Does the API actually save my data?
No. All mutations (POST, PUT, PATCH, DELETE) return realistic responses but data is not persisted. This is designed so you can test your code without worrying about cleaning up test data.
Are there rate limits?
There are no published rate limits, but the service is free and open source. It's been running reliably for years and handles millions of requests daily.
Can I use this for load testing?
JSONPlaceholder is designed for functional testing and prototyping, not load testing. For load testing, consider running a local instance — the code is open source on GitHub.
What image URLs does the photos endpoint return?
The photos endpoint returns placeholder URLs in the format https://via.placeholder.com/600/{id}. These are real placeholder images from placeholder.com, sized 600x400 by default.
Does it support pagination?
Yes. Use _page and _limit query parameters: /posts?_page=2&_limit=5. Default is 10 items per page. Response headers include X-Total-Count for total available items.

API Details

API URL
https://jsonplaceholder.typicode.com
Documentation
jsonplaceholder.typicode.com
Category
Development
Authentication
Not Required
Geographic Coverage
Global

What You Can Build