dummyapi
📝

Posts

8 endpoints

200 blog posts with titles, body text, tags, views, and reaction counts — useful for prototyping social or blog-style UIs.

Base URLhttps://dummyapi.codesmash.in/api
GET

Get all posts. Supports ?limit&skip.

🔗

GET https://dummyapi.codesmash.in/api/posts

?limit?skip
fetch('https://dummyapi.codesmash.in/api/posts')
.then(res => res.json())
.then(console.log);
ℹ️
Pagination — By default you will get 30 items. Use ?limit and ?skip to paginate through all items. Max limit is 200.
?limit=10Number of items to return (default: 30, max: 200)
?skip=10Number of items to skip (default: 0)
// By default you get 30 items
fetch('https://dummyapi.codesmash.in/api/posts?limit=10&skip=0')
.then(res => res.json())
.then(console.log);
// Get next page (items 11–20)
fetch('https://dummyapi.codesmash.in/api/posts?limit=10&skip=10')
.then(res => res.json())
.then(console.log);
// Get ALL 200 at once
fetch('https://dummyapi.codesmash.in/api/posts?limit=200')
.then(res => res.json())
.then(console.log);
GET

Get a single post.

🔗

GET https://dummyapi.codesmash.in/api/posts/:id

fetch('https://dummyapi.codesmash.in/api/posts/:id')
.then(res => res.json())
.then(console.log);
GET

Get all posts by a user.

🔗

GET https://dummyapi.codesmash.in/api/posts/user/:id

fetch('https://dummyapi.codesmash.in/api/posts/user/:id')
.then(res => res.json())
.then(console.log);
GET

Get all comments for a post.

🔗

GET https://dummyapi.codesmash.in/api/posts/:id/comments

fetch('https://dummyapi.codesmash.in/api/posts/:id/comments')
.then(res => res.json())
.then(console.log);
POST

Create a new post (demo).

🔗

POST https://dummyapi.codesmash.in/api/posts

fetch('https://dummyapi.codesmash.in/api/posts', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({})
})
.then(res => res.json())
.then(console.log);
PUT

Update a post.

🔗

PUT https://dummyapi.codesmash.in/api/posts/:id

fetch('https://dummyapi.codesmash.in/api/posts/:id', {
method: 'PUT',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({})
})
.then(res => res.json())
.then(console.log);
DELETE

Delete a post.

🔗

DELETE https://dummyapi.codesmash.in/api/posts/:id

fetch('https://dummyapi.codesmash.in/api/posts/:id', {
method: 'DELETE',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({})
})
.then(res => res.json())
.then(console.log);
Buy me a coffee