Base URL
https://fakeapi.in/api/postsAPI Endpoints
GET
Copy All/api/postsGet all posts
Parameters
page(number)limit(number)sortField(string)sortOrder(string)GET
Copy All/api/posts/1Get post by ID
Parameters
id(number)GET
Copy All/api/posts?q=FirstSearch posts by title containing 'First'
Parameters
q(string)GET
Copy All/api/posts?authorId=5Filter posts by author ID
Parameters
authorId(number)GET
Copy All/api/posts?category=TechFilter posts by category
Parameters
category(string)GET
Copy All/api/posts?tags=ReactFilter posts by tag 'React'
Parameters
tags(string)GET
Copy All/api/posts?sortField=title&sortOrder=ascGet posts sorted by title ascending
Parameters
sortField(string)sortOrder(string)GET
Copy All/api/posts?sortField=title&sortOrder=descGet posts sorted by title descending
Parameters
sortField(string)sortOrder(string)GET
Copy All/api/posts?page=2&limit=10Get posts with pagination (page 2, 10 per page)
Parameters
page(number)limit(number)GET
Copy All/api/posts?sortField=title&sortOrder=desc&page=2&limit=50Combined filters: search, filter, sort, and paginate posts
Parameters
q(string)category(string)authorId(number)tags(string)sortField(string)sortOrder(string)page(number)limit(number)POST
Copy All/api/postsCreate post
Parameters
title(string)content(string)authorId(number)category(string)tags(array)status(string)image(string)PATCH
Copy All/api/posts/1Partially update post (only specific fields)
Parameters
id(number)fields(object)PUT
Copy All/api/posts/1Update post (replace all fields)
Parameters
id(number)title(string)content(string)authorId(number)category(string)tags(array)status(string)image(string)DELETE
Copy All/api/posts/1Delete post
Parameters
id(number)Example Usage
Copy All
import axios from "axios";
const API_URL = process.env.NEXT_PUBLIC_API_URL;
// Get all products
axios
.get(`${API_URL}api/products`)
.then(res => console.log("All Products:", res.data))
.catch(err => console.error(err));
// Create a new product
axios
.post(`${API_URL}api/products`, {
name: "Laptop",
price: 79999,
category: "Electronics"
})
.then(res => console.log("Product Created:", res.data))
.catch(err => console.error(err));
Example Response
Copy All
{
"id": 1,
"title": "Charisma cattus utrum dedico vespillo.",
"content": "Vindico uter voluntarius sono. Fugiat tenetur voluptatibus earum ipsa. Verumtamen aureus baiulus similique vilitas.
Sono cupiditas delicate bis ager debilito alienus ambitus ter. Anser eveniet tardus. Audio argentum possimus turbo decet.",
"author": "Jermaine Willms",
"category": "Education",
"likes": 797,
"comments": 175,
"publishedAt": "2025-10-19T13:29:54.519Z",
"createdAt": "2024-10-23T03:27:50.255Z"
}Quick Actions
API Status
StatusOperational
Rate Limit1000 requests/hour
Response FormatJSON
