Skip to content

Todos

The Todos resource provides fake todo data with titles, completion status, and user relationships.

Available Endpoints

MethodEndpointDescription
GET/v1/todosList all todos
GET/v1/todos/:idGet a specific todo
{
"id": 1,
"userId": 1,
"title": "Buy groceries",
"completed": false,
"createdAt": "2026-01-15T10:30:00.000Z",
"updatedAt": "2026-01-15T10:30:00.000Z"
}
Field Type Description
id number Unique identifier
userId number ID of the user
title string Todo title
completed boolean Completion status
createdAt string ISO 8601 timestamp
updatedAt string ISO 8601 timestamp
Terminal window
curl https://api.phantomjson.app/v1/todos
Parameter Type Default Description
page number 1 Page number
limit number 20 Items per page (max: 100)
sort string Sort field and direction
q string Search query
fields string Fields to return
userId number Filter by user ID
completed boolean Filter by completion status
{
"data": [
{
"id": 1,
"userId": 1,
"title": "Buy groceries",
"completed": false
}
],
"meta": {
"total": 300,
"page": 1,
"limit": 20,
"totalPages": 15
}
}
Terminal window
curl https://api.phantomjson.app/v1/todos/1
{
"data": {
"id": 1,
"userId": 1,
"title": "Buy groceries",
"completed": false
}
}
Terminal window
curl "https://api.phantomjson.app/v1/todos?q=buy"
Terminal window
curl "https://api.phantomjson.app/v1/todos?userId=1"
Terminal window
# Get completed todos
curl "https://api.phantomjson.app/v1/todos?completed=true"
# Get incomplete todos
curl "https://api.phantomjson.app/v1/todos?completed=false"
Terminal window
curl "https://api.phantomjson.app/v1/todos?sort=title:asc"
Terminal window
curl "https://api.phantomjson.app/v1/todos?fields=id,title,completed"
  • User — Each todo belongs to a user (userId)
  • Access todos for a specific user via /v1/users/:id/todos