Unique identifier for the post
GET
/posts/{id}Get Post by ID
Retrieve a single blog post by its unique identifier including title, body, author, and publication metadata
Overview
Retrieves detailed information about a specific blog post.
Path Parameters
Path Parameters
id requiredThe unique identifier of the post to retrieve
Response
id integeruserId integerID of the user who created the post
title stringTitle of the post
body stringFull content of the post
Related Endpoints
Error Responses
| Status | Description |
|---|---|
404 | Post not found - the specified ID does not exist |
curl -X GET "https://jsonplaceholder.typicode.com/posts/1"const response = await fetch("https://jsonplaceholder.typicode.com/posts/1");const data = await response.json();console.log(data);import requests
response = requests.get("https://jsonplaceholder.typicode.com/posts/1")print(response.json()){ "userId": 1, "id": 1, "title": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit", "body": "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto"}{ "error": "Post not found"}Was this page helpful?
Request
curl -X GET "https://jsonplaceholder.typicode.com/posts/{id}" \
-H "Content-Type: application/json"const response = await fetch("https://jsonplaceholder.typicode.com/posts/{id}", {
method: "GET",
headers: {
"Content-Type": "application/json"
},
});
const data = await response.json();
console.log(data);import requests
response = requests.get(
"https://jsonplaceholder.typicode.com/posts/{id}",
headers={'Content-Type':'application/json'},
)
print(response.json())package main
import (
"fmt"
"net/http"
"io"
)
func main() {
req, _ := http.NewRequest("GET", "https://jsonplaceholder.typicode.com/posts/{id}", nil)
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}Response
Send a request to see the response
Headers
Response