Skip to content

Todos

Fetch all todos

fetch('https://dummyapi.online/api/todos')
.then((response) => response.json())
.then((json) => console.log(json));
Output
[
{
"id": 1,
"title": "Take out washing",
"completed": false,
"priority": "low"
},
// More todos...
]

Fetch a single todo

Getting a single todo by ID. In this example, we use the /api/todos/1 route.

fetch('https://dummyapi.online/api/todos/1')
.then((response) => response.json())
.then((json) => console.log(json));
Output
{
"id": 1,
"title": "Take out washing",
"completed": false,
"priority": "low"
}

Show All Available Todos

To view all available todos, you can open the Todos Endpoint in your browser.