Home
/
JSON Examples
/
Todo list
Todo list JSON example
Last updated 2026-05-20
When to use this
Use this for the most common tutorial / sample-app shape: id, todo, completed, userId. Drop it into a todo demo, a checkbox-driven dashboard, or a simple offline-first list.
Example JSON
A paginated todo list response. Identical to /todos?limit=3.
{
"todos": [
{
"id": 1,
"todo": "Do something nice for someone you care about",
"completed": false,
"userId": 152
},
{
"id": 2,
"todo": "Memorize a poem",
"completed": true,
"userId": 13
},
{
"id": 3,
"todo": "Watch a classic movie",
"completed": false,
"userId": 68
}
],
"total": 150,
"skip": 0,
"limit": 3
}
Request examples
fetch()
Axios
cURL
React
Python
Copy
fetch('https://jsonexamples.com/todos?limit=10')
.then(r => r.json())
.then(({ todos }) => console.log(todos));
Copy
const { data } = await axios.get('https://jsonexamples.com/todos?limit=10');
Copy
curl -s 'https://jsonexamples.com/todos?limit=10'
Copy
function Todos() {
const [todos, setTodos] = useState([]);
useEffect(() => {
fetch('https://jsonexamples.com/todos?limit=20')
.then(r => r.json())
.then(d => setTodos(d.todos));
}, []);
return <ul>{todos.map(t => <li key={t.id}><input type="checkbox" defaultChecked={t.completed}/> {t.todo}</li>)}</ul>;
}
Copy
todos = requests.get('https://jsonexamples.com/todos', params={'limit': 10}, timeout=5).json()['todos']
Try the live endpoint
Click below to call /todos?limit=3 from your browser.
Call /todos?limit=3
// click the button to populate this block
Common variations
Single todo
{
"id": 1,
"todo": "Do something nice for someone you care about",
"completed": false,
"userId": 152
}
Random todo (matches /todos/random)
{
"id": 41,
"todo": "Learn a new programming language",
"completed": false,
"userId": 64
}
Per-user todos (matches /users/5/todos)
{
"todos": [
{
"id": 7,
"todo": "Solve a Rubik's cube",
"completed": false,
"userId": 5
},
{
"id": 38,
"todo": "Plant a tree",
"completed": true,
"userId": 5
}
],
"total": 2,
"skip": 0,
"limit": 30
}
Convert this JSON
Generated starting points for TypeScript, JSON Schema, and Zod. Refine before shipping to production.
TypeScript
JSON Schema
Zod
Copy
export interface TodoList {
"todos": {
"id": number;
"todo": string;
"completed": boolean;
"userId": number;
}[];
"total": number;
"skip": number;
"limit": number;
}
Copy
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "TodoList",
"type": "object",
"properties": {
"todos": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"todo": {
"type": "string"
},
"completed": {
"type": "boolean"
},
"userId": {
"type": "integer"
}
},
"required": [
"id",
"todo",
"completed",
"userId"
],
"additionalProperties": false
}
},
"total": {
"type": "integer"
},
"skip": {
"type": "integer"
},
"limit": {
"type": "integer"
}
},
"required": [
"todos",
"total",
"skip",
"limit"
],
"additionalProperties": false
}
Copy
import { z } from 'zod';
export const TodoListSchema = z.object({
todos: z.array(z.object({
id: z.number(),
todo: z.string(),
completed: z.boolean(),
userId: z.number()
})),
total: z.number(),
skip: z.number(),
limit: z.number()
});
export type TodoList = z.infer<typeof TodoListSchema>;
Copy link to this example
https://jsonexamples.com/json-examples/todo-list