Cosmos profile API
A public Cosmos profile: name, bio, links, and how many elements and collections it has.
GET /v1/cosmos/users/{handle}1 credit per callRefunded on failureimport os, requests
res = requests.get(
"https://api.groundsocial.dev/v1/cosmos/users/cosmos",
headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
)
res.raise_for_status()
data = res.json()Response
200 · 1 credit{ "id": 108564255, "username": "cosmos", "fullName": "Cosmos", "bio": "Your space for inspiration.", "avatarUrl": "https://cdn.cosmos.so/a658f9e9-e757-4f32-8e78-7c5d78bed9a8", "websiteUrl": "cosmos.so", "isPremium": true, "isVerifiedProfile": false, "publicElementsCluster": { "id": 1996613743, "numberOfElements": 744 }, "socialLinks": { "instagramUrl": "https://www.instagram.com/cosmos", "twitterUrl": "https://x.com/thecosmos", "tiktokUrl": null, "spotify": null }, "clusters_count": 33}Parameters
| Name | Type | Description |
|---|---|---|
handlepath · required | string | Username, with or without @, or a profile URL. Example: cosmos. |
Response fields
200 with a CosmosUser, in Cosmos’s own JSON.
| Field | Type | Description |
|---|---|---|
id | integer | |
username | string | |
fullName | string | null | |
bio | string | null | |
avatarUrl | string | null | |
websiteUrl | string | null | |
isPremium | boolean | null | |
isVerifiedProfile | boolean | null | |
publicElementsCluster | object | null | |
socialLinks | object | null | |
clusters_count | integer | null | Public collections. |
Status codes
| Status | Meaning |
|---|---|
200 | The profile. |
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
Does it take a URL?
Yes, a cosmos.so profile URL works.
Cosmos is a trademark of Cosmos. We are not affiliated with or endorsed by Cosmos.