Skip to content

API Reference

JSONPlaceholder provides a complete REST API with 6 main resource types. All endpoints support standard HTTP methods and return JSON responses.

Base URL

bash
https://api.jsonplaceholder.dev
bash
http://localhost:3000

Quick Overview

Get basic API information:

bash
GET /
json
{
  "message": "🚀 JSONPlaceholder - Powered by Bun + Elysia.js",
  "version": "2.0.0",
  "resources": {
    "posts": "100 posts",
    "comments": "500 comments",
    "albums": "100 albums",
    "photos": "5000 photos",
    "todos": "200 todos",
    "users": "10 users"
  },
  "endpoints": {
    "users": "/users",
    "posts": "/posts",
    "comments": "/comments",
    "albums": "/albums",
    "photos": "/photos",
    "todos": "/todos"
  }
}

Resources

ResourceDescriptionCount
UsersUser accounts with complete profile information10
PostsBlog posts with title and content100
CommentsComments on posts500
AlbumsPhoto albums100
PhotosIndividual photos with URLs5000
TodosTodo items with completion status200

HTTP Methods

All resources support the following HTTP methods:

MethodDescriptionExample
GETRetrieve resource(s)GET /posts
POSTCreate new resourcePOST /posts
PUTUpdate entire resourcePUT /posts/1
PATCHPartially update resourcePATCH /posts/1
DELETEDelete resourceDELETE /posts/1

Common Patterns

Get All Resources

bash
GET /posts
GET /users
GET /comments

Get Single Resource

bash
GET /posts/1
GET /users/1
GET /comments/1
bash
GET /posts?userId=1
GET /comments?postId=1
GET /albums?userId=1
bash
GET /users/1/posts
GET /users/1/albums
GET /posts/1/comments

Response Format

All responses are in JSON format with proper HTTP status codes:

  • 200 - Success
  • 201 - Created (for POST requests)
  • 404 - Not Found
  • 500 - Server Error

Success Response

json
{
  "id": 1,
  "title": "Example Post",
  "body": "This is an example post content",
  "userId": 1
}

Error Response

json
{
  "error": "Post not found",
  "status": "error"
}

Rate Limiting

There are no rate limits on the JSONPlaceholder API. It's designed for testing and development purposes.

CORS

CORS is enabled for all origins and methods, making it perfect for frontend development:

http
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, PUT, PATCH, DELETE
Access-Control-Allow-Headers: Content-Type

Fast Fake REST API powered by Bun + Elysia.js | Documentation site source: github.com/ckissi/jsonplaceholder