Back to APIs
JSONPlaceholder
A free online REST API with predictable fake data — perfect for testing frontend code, prototyping, or teaching HTTP basics.
Base URL
https://jsonplaceholder.typicode.comtestingmockRESTfreeprototyping
Endpoints
GET
/postsGet a list of 100 fake posts.
const response = await fetch("https://jsonplaceholder.typicode.com/posts", {
method: "GET",
headers: {
"Content-Type": "application/json"
}
});
const data = await response.json();
console.log(data);Response Preview
[
{
"id": 1,
"userId": 1,
"title": "sunt aut facere repellat provident...",
"body": "quia et suscipit..."
}
]POST
/postsCreate a fake post (returns the created resource).
const response = await fetch("https://jsonplaceholder.typicode.com/posts", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
"title": "My Post",
"body": "Hello world",
"userId": 1
})
});
const data = await response.json();
console.log(data);Response Preview
{
"id": 101,
"title": "My Post",
"body": "Hello world",
"userId": 1
}