fetch('https://dummyapi.online/api/todos') .then((response) => response.json()) .then((json) => console.log(json));
import requestsimport json response = requests.get('https://dummyapi.online/api/todos')if response.status_code == 200: data = json.loads(response.text) print(data)
[ { "id": 1, "title": "Take out washing", "completed": false, "priority": "low" }, // More todos...]
Getting a single todo by ID. In this example, we use the /api/todos/1 route.
/api/todos/1
fetch('https://dummyapi.online/api/todos/1') .then((response) => response.json()) .then((json) => console.log(json));
import requestsimport json response = requests.get('https://dummyapi.online/api/todos/1')if response.status_code == 200: data = json.loads(response.text) print(data)
{ "id": 1, "title": "Take out washing", "completed": false, "priority": "low"}
To view all available todos, you can open the Todos Endpoint in your browser.