List posts
curl --request GET \
--url https://jsonplaceholder.typicode.com/postsimport requests
url = "https://jsonplaceholder.typicode.com/posts"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://jsonplaceholder.typicode.com/posts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://jsonplaceholder.typicode.com/posts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://jsonplaceholder.typicode.com/posts"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://jsonplaceholder.typicode.com/posts")
.asString();require 'uri'
require 'net/http'
url = URI("https://jsonplaceholder.typicode.com/posts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body[
{
"userId": 123,
"id": 123,
"title": "<string>",
"body": "<string>"
}
]Endpoint examples
List Posts
Returns a list of posts. Supports limiting results via _limit query param.
GET
/
posts
List posts
curl --request GET \
--url https://jsonplaceholder.typicode.com/postsimport requests
url = "https://jsonplaceholder.typicode.com/posts"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://jsonplaceholder.typicode.com/posts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://jsonplaceholder.typicode.com/posts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://jsonplaceholder.typicode.com/posts"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://jsonplaceholder.typicode.com/posts")
.asString();require 'uri'
require 'net/http'
url = URI("https://jsonplaceholder.typicode.com/posts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body[
{
"userId": 123,
"id": 123,
"title": "<string>",
"body": "<string>"
}
]Overview
Response notes
- Returns a list of posts from JSONPlaceholder.
- No authentication required; perfect for demos of Mintlify Try it out.
- Fetch sample content items for demos, prototypes, or to test API flows.
- _limit (number): Optional. Maximum number of posts to return (1-100). Useful to keep responses short in demos.
- name: List first 5 posts
method: GET
path: /posts
query:
_limit: 5
headers:
Accept: application/json
- Status 200: An array of Post objects with fields id, userId, title, and body.
- JSONPlaceholder returns static seeded data; repeated calls return the same list unless filtered.
- Combine with /comments?postId= to show relationships.
- Use _limit to keep responses compact for readers.