Cosmos collection API
A Cosmos collection by URL: name, description, owner, element and follower counts.
GET /v1/cosmos/clusters1 credit per callRefunded on failureimport 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
| Name | Type | Description |
|---|---|---|
urlquery · required | string | A 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.
| Field | Type | Description |
|---|---|---|
id | integer | |
name | string | |
slug | string | |
description | string | null | |
numberOfElements | integer | null | |
followersCount | integer | null | |
coverImageUrl | string | null | |
owner | object | null | |
url | string |
Status codes
| Status | Meaning |
|---|---|
200 | The collection. |
400 | Invalid input. Nothing was charged. |
401 | Missing or invalid API key. |
402 | Not enough credits, a spend cap was reached, or payment is required. |
403 | The target is private, or the account is suspended. |
404 | The user, element or collection does not exist. |
429 | Too many requests. Wait for Retry-After seconds. |
503 | Cosmos 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.