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

๐Ÿ’ฌComments โ€“ Docs

The comments endpoint provides 200 comments linked to posts and users, with like counts and full user info.

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

Get all comments.

๐Ÿ”—

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

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

Get a single comment.

๐Ÿ”—

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

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

Get all comments on a post.

๐Ÿ”—

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

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

Create a new comment (demo).

๐Ÿ”—

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

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

Update a comment.

๐Ÿ”—

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

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

Delete a comment.

๐Ÿ”—

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

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