curl --request GET \
--url https://api.buttercms.com/v2/content/ \
--header 'Authorization: <api-key>'import requests
url = "https://api.buttercms.com/v2/content/"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.buttercms.com/v2/content/', 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://api.buttercms.com/v2/content/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$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://api.buttercms.com/v2/content/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.buttercms.com/v2/content/")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.buttercms.com/v2/content/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"navigation_menu_item": [
{
"meta": {
"id": 790691
},
"label": "Home",
"url": "#home"
},
{
"meta": {
"id": 790692
},
"label": "About",
"url": "#about"
}
],
"navigation_menu": [
{
"meta": {
"id": 790697
},
"name": "Main menu",
"menu_items": [
{
"meta": {
"id": 790691
},
"label": "Home",
"url": "#home"
},
{
"meta": {
"id": 790692
},
"label": "About",
"url": "#about"
}
]
}
]
}
}Retrieve Multiple Collections by Key
Retrieve items from one or more Collections at once, by a comma-delimited list of collection keys.
curl --request GET \
--url https://api.buttercms.com/v2/content/ \
--header 'Authorization: <api-key>'import requests
url = "https://api.buttercms.com/v2/content/"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.buttercms.com/v2/content/', 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://api.buttercms.com/v2/content/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$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://api.buttercms.com/v2/content/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.buttercms.com/v2/content/")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.buttercms.com/v2/content/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"navigation_menu_item": [
{
"meta": {
"id": 790691
},
"label": "Home",
"url": "#home"
},
{
"meta": {
"id": 790692
},
"label": "About",
"url": "#about"
}
],
"navigation_menu": [
{
"meta": {
"id": 790697
},
"name": "Main menu",
"menu_items": [
{
"meta": {
"id": 790691
},
"label": "Home",
"url": "#home"
},
{
"meta": {
"id": 790692
},
"label": "About",
"url": "#about"
}
]
}
]
}
}GET /content/{collection_key}/ endpoint always returns exactly one collection.
Legacy Endpoint: This is an older, lighter-weight endpoint. With two or more keys, the response has no pagination meta and all items for each key are returned. With exactly one key that names a collection, the request is handled by GET /content/{collection_key}/: the response includes meta (count, next_page, previous_page) and accepts the same page, page_size, order, preview and fields.<name> parameters.Authorizations
Set the Authorization header to Token your_read_api_token.
Example: Authorization: Token abc123def456
Note: The header value includes the Token prefix. Authorization: Bearer ... is not accepted and returns 401.
You can access your API token from your settings page.
Query Parameters
Comma-delimited list of Collection keys to retrieve. Every key must match an existing collection, or the request returns a 404.
Your ButterCMS read API token
Set to 1 to include draft/unpublished collection items (the alias used by this legacy endpoint; equivalent to preview=1 elsewhere).
0, 1 Set to the api slug of your configured locale (e.g. en or fr). When omitted, this query parameter will default to your organization's default locale.
10"en"
Depth of relationship serialization.
Controls how many levels of referenced content to include:
- 1: Direct fields only, references as URIs
- 2: Direct fields + one level of references (default)
- 3-5: Deeper relationship traversal
Important: Higher levels increase response size. Maximum 10MB per response.
Valid range: 1-5 (inclusive). Values outside this range will be automatically capped.
1 <= x <= 5Response
Collections retrieved successfully. The data object is keyed by each requested collection key. For two or more keys there is no pagination meta and all items for each key are included; a single collection key returns the GET /content/{collection_key}/ shape, with meta.
Show child attributes
Show child attributes
Was this page helpful?