100 free credits. No credit card required. Get a key

Cosmos collection API

A Cosmos collection by URL: name, description, owner, element and follower counts.

GET /v1/cosmos/clusters1 credit per callRefunded on failure
import os, requests

res = requests.get(
    "https://api.groundsocial.dev/v1/cosmos/clusters?url=https://www.cosmos.so/cosmos/genesis",
    headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
)
res.raise_for_status()
data = res.json()
Response
200 · 1 credit
{
"id": 1799209375,
"name": "Genesis",
"slug": "genesis",
"description": null,
"numberOfElements": 201,
"followersCount": 3908486,
"coverImageUrl": "https://cdn.cosmos.so/a369df88-f606-4716-81e3-4c86881712f5?rect=119,70,334,334",
"owner": {
"username": "cosmos",
"id": 108564255,
"fullName": "Cosmos"
},
"isPrivate": false,
"parentClusterId": null,
"url": "https://www.cosmos.so/cosmos/genesis"
}

Parameters

NameTypeDescription
urlquery · requiredstringA collection URL (cosmos.so/<user>/<slug>) or user/slug. Example: https://www.cosmos.so/cosmos/genesis.
Response fields

200 with a CosmosCluster, in Cosmos’s own JSON.

FieldTypeDescription
idinteger
namestring
slugstring
descriptionstring | null
numberOfElementsinteger | null
followersCountinteger | null
coverImageUrlstring | null
ownerobject | null
urlstring
Status codes
StatusMeaning
200The collection.
400Invalid input. Nothing was charged.
401Missing or invalid API key.
402Not enough credits, a spend cap was reached, or payment is required.
403The target is private, or the account is suspended.
404The user, element or collection does not exist.
429Too many requests. Wait for Retry-After seconds.
503Cosmos is temporarily unavailable. Retryable; nothing was charged.

Every error has code, message, hint and retryable. All error codes

Questions

What URL?

cosmos.so/<user>/<collection>.

Cosmos is a trademark of Cosmos. We are not affiliated with or endorsed by Cosmos.