Get clusters
List clusters allowed for your plan and their gateways (for viewing files). API endpoint: GET /users/me/clusters.
Scope required: cluster:read
Endpoint
| Method | GET |
| URL | https://api.pinarkive.com/api/v3/users/me/clusters |
Headers: Authorization: Bearer YOUR_API_KEY or X-API-Key: YOUR_API_KEY
No query parameters required.
Request
cURL
curl -X GET "https://api.pinarkive.com/api/v3/users/me/clusters" \
-H "X-API-Key: YOUR_API_KEY"JavaScript (fetch)
const response = await fetch("https://api.pinarkive.com/api/v3/users/me/clusters", {
headers: { "X-API-Key": process.env.PINARKIVE_API_KEY },
});
const data = await response.json();JavaScript (axios)
const { data } = await axios.get(
"https://api.pinarkive.com/api/v3/users/me/clusters",
{
headers: { "X-API-Key": process.env.PINARKIVE_API_KEY },
}
);Python
import os
import requests
url = "https://api.pinarkive.com/api/v3/users/me/clusters"
headers = {"X-API-Key": os.environ["PINARKIVE_API_KEY"]}
r = requests.get(url, headers=headers)
r.raise_for_status()
clusters = r.json()Go
package main
import (
"net/http"
"os"
)
func main() {
url := "https://api.pinarkive.com/api/v3/users/me/clusters"
apiKey := os.Getenv("PINARKIVE_API_KEY")
req, _ := http.NewRequest("GET", url, nil)
req.Header.Set("X-API-Key", apiKey)
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
}PHP
<?php
$url = 'https://api.pinarkive.com/api/v3/users/me/clusters';
$apiKey = getenv('PINARKIVE_API_KEY');
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['X-API-Key: ' . $apiKey]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
$clusters = json_decode($response, true);Response
Success (200)
[
{
"clusterId": "cl0-global",
"gateways": [
{
"publicUrl": "https://gateway.pinarkive.com/ipfs/",
"url": "https://gateway.pinarkive.com/ipfs/",
"label": "Primary",
"order": 0
}
]
}
]Gateway URLs are bases (ending with /ipfs/). Append the CID: base + cid → e.g. https://gateway.pinarkive.com/ipfs/<cid>.
Error (4xx / 5xx)
{
"error": "Unauthorized",
"message": "Invalid or missing API key",
"code": "INVALID_API_KEY"
}Common codes: 401, 403 (code: missing_scope, required), 429. See Error handling.