List todos
GET
/todosReturns all todos. Supports filtering by user and completion status.
Query Parameters
| Name | Type | Description |
|---|---|---|
userId ? | integer | Filter by user ID |
completed ? | boolean | Filter by completion status |
Responses
A list of todos
| Name | Type | Description |
|---|---|---|
userId ? | integer | |
id ? | integer | |
title ? | string | |
completed ? | boolean |
curl -X GET 'https://jsonplaceholder.typicode.com/todos'const response = await fetch('https://jsonplaceholder.typicode.com/todos', {
method: 'GET',
headers: { 'Accept': 'application/json' }
});
const data = await response.json();