Cosmos user collections API
The top public collections on a Cosmos profile, with element and follower counts.
GET /v1/cosmos/users/{handle}/clusters1 credit per callRefunded on failureimport os, requests
res = requests.get(
"https://api.groundsocial.dev/v1/cosmos/users/cosmos/clusters",
headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
)
res.raise_for_status()
data = res.json()Response
200 · 1 credit{ "data": [ { "id": 577804873, "name": "Gift Selects", "slug": "gift-selects", "description": null, "numberOfElements": 26, "followersCount": 0, "coverImageUrl": "https://cdn.cosmos.so/01a18adc-f949-74e7-be29-fce82900d362?rect=0,1024,2560,2560", "owner": { "username": "cosmos", "id": 108564255, "fullName": "Cosmos" }, "isPrivate": false, "parentClusterId": null, "url": "https://www.cosmos.so/cosmos/gift-selects" }, { "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" }, "… 1 more" ], "meta": { "result_count": 3, "count": 33 }}Parameters
| Name | Type | Description |
|---|---|---|
handlepath · required | string | Username, with or without @, or a profile URL. Example: cosmos. |
Response fields
200 with a CosmosClusters, in Cosmos’s own JSON.
| Field | Type | Description |
|---|---|---|
data | CosmosCluster[] | |
meta | object |
Status codes
| Status | Meaning |
|---|---|
200 | The collections. |
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
Is it every collection?
Logged out, Cosmos shows the top ones; meta.count says how many there are.
Cosmos is a trademark of Cosmos. We are not affiliated with or endorsed by Cosmos.