Cosmos element API
One Cosmos element by URL: media, source page and author, product details and owner.
GET /v1/cosmos/posts1 credit per callRefunded on failureimport os, requests
res = requests.get(
"https://api.groundsocial.dev/v1/cosmos/posts?url=https://www.cosmos.so/e/1565142027",
headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
)
res.raise_for_status()
data = res.json()Response
200 · 1 credit{ "__typename": "MediaElementTile", "id": 1565142027, "createdAt": "2026-05-05T21:42:10.754327Z", "shareUrl": "https://www.cosmos.so/e/1565142027", "ownerId": 1539668393, "owner": { "username": "tawarcuri", "fullName": "tori arcuri" }, "generatedCaption": null, "source": { "url": "https://www.pinterest.com/pin/698480223497014140/", "isPublicDomain": false, "author": { "username": "jeffspinterest2", "fullName": "jeffs", "profileUrl": "https://www.pinterest.com/jeffspinterest2" } }, "media": { "__typename": "StaticImage", "url": "https://cdn.cosmos.so/c6053ba1-3d75-4611-8251-1bc4d4c495be", "width": 1400, "height": 1866, "aiGenerated": false }, "product": null, "hasMoreMedia": false, "multipleMedia": []}Parameters
| Name | Type | Description |
|---|---|---|
urlquery · required | string | An element URL or id. Example: https://www.cosmos.so/e/1565142027. |
Response fields
200 with a CosmosElement, in Cosmos’s own JSON.
| Field | Type | Description |
|---|---|---|
__typename | string | |
id | integer | |
createdAt | string | null | |
shareUrl | string | null | |
ownerId | integer | null | |
owner | object | null | |
generatedCaption | object | null | |
source | object | null | |
media | object | null |
Status codes
| Status | Meaning |
|---|---|
200 | The element. |
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
Which element types?
Images, videos, animations, websites, products and text.
Cosmos is a trademark of Cosmos. We are not affiliated with or endorsed by Cosmos.