Base URL
https://fakeapi.in/api/todosAPI Endpoints
GET
Copy All/api/todosGet all todos
Parameters
page(number)limit(number)sortField(string)sortOrder(string)GET
Copy All/api/todos/1Get single todo by ID
Parameters
id(number)GET
Copy All/api/todos?q=learnSearch todos by task name
Parameters
q(string)GET
Copy All/api/todos?completed=trueFilter todos by completion status
Parameters
completed(boolean)GET
Copy All/api/todos?priority=high&assignedTo=VishalFilter todos by multiple fields
Parameters
priority(string)assignedTo(string)GET
Copy All/api/todos?sortField=priority&sortOrder=descSort todos by any field in ascending/descending order
Parameters
sortField(string)sortOrder(string)GET
Copy All/api/todos?page=2&limit=5Get todos with pagination
Parameters
page(number)limit(number)POST
Copy All/api/todosCreate todo
Parameters
title(string)description(string)priority(string)dueDate(string)assignedTo(string)completed(boolean)PATCH
Copy All/api/todos/1Partially update todo (only specific fields)
Parameters
id(number)fields(object)PUT
Copy All/api/todos/1Update todo (replace all fields)
Parameters
id(number)title(string)description(string)priority(string)dueDate(string)assignedTo(string)completed(boolean)DELETE
Copy All/api/todos/1Delete todo
Parameters
id(number)Example Usage
Copy All
import axios from "axios";
const API_URL = process.env.NEXT_PUBLIC_API_URL;
// Get all todos
axios
.get(`${API_URL}api/todos`)
.then(res => console.log("All Todos:", res.data))
.catch(err => console.error(err));
// Create a new todo
axios
.post(`${API_URL}api/todos`, {
task: "Learn MERN Stack",
completed: false,
assignedTo: "Vishal",
priority: "high"
})
.then(res => console.log("Todo Created:", res.data))
.catch(err => console.error(err));
Example Response
Copy All
{
"id": 1,
"task": "aufero credo spoliatio cerno",
"completed": false,
"dueDate": "2025-10-20T01:47:40.504Z",
"priority": "Medium",
"assignedTo": "Marjorie Brekke II"
}Quick Actions
API Status
StatusOperational
Rate Limit1000 requests/hour
Response FormatJSON
