https://dummyapi-backend.onrender.com/api
CodeSmash โ†—

๐Ÿ“Posts โ€“ Docs

The posts endpoint offers 200 blog posts with titles, body text, tags, views, and reaction counts โ€” useful for prototyping social or blog-style UIs.

Base URL: https://dummyapi-backend.onrender.com/api
GET

Get all posts. Supports ?limit&skip.

๐Ÿ”—

GET https://dummyapi-backend.onrender.com/api/posts

?limit?skip
fetch('https://dummyapi-backend.onrender.com/api/posts')
.then(res => res.json())
.then(console.log);
GET

Get a single post.

๐Ÿ”—

GET https://dummyapi-backend.onrender.com/api/posts/:id

fetch('https://dummyapi-backend.onrender.com/api/posts/:id')
.then(res => res.json())
.then(console.log);
GET

Get all posts by a user.

๐Ÿ”—

GET https://dummyapi-backend.onrender.com/api/posts/user/:id

fetch('https://dummyapi-backend.onrender.com/api/posts/user/:id')
.then(res => res.json())
.then(console.log);
GET

Get all comments for a post.

๐Ÿ”—

GET https://dummyapi-backend.onrender.com/api/posts/:id/comments

fetch('https://dummyapi-backend.onrender.com/api/posts/:id/comments')
.then(res => res.json())
.then(console.log);
POST

Create a new post (demo).

๐Ÿ”—

GET https://dummyapi-backend.onrender.com/api/posts

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

Update a post.

๐Ÿ”—

GET https://dummyapi-backend.onrender.com/api/posts/:id

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

Delete a post.

๐Ÿ”—

GET https://dummyapi-backend.onrender.com/api/posts/:id

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