Cosmos user elements API
Everything a Cosmos user saved publicly: images, videos, websites and products with their source links, 40 a page.
GET /v1/cosmos/users/{handle}/posts1 credit per callRefunded on failureimport os, requests
res = requests.get(
"https://api.groundsocial.dev/v1/cosmos/users/cosmos/posts",
headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
)
res.raise_for_status()
data = res.json()Response
200 · 1 credit{ "data": [ { "__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": [] }, { "__typename": "MediaElementTile", "id": 1267096845, "createdAt": "2025-05-13T06:34:29.986651Z", "shareUrl": "https://www.cosmos.so/e/1267096845", "ownerId": 153242744, "owner": { "username": "spitefael", "fullName": "⋆" }, "generatedCaption": null, "source": { "url": "https://www.pinterest.com/pin/797911259011239697", "isPublicDomain": false, "author": { "username": "mriimrii", "fullName": "m", "profileUrl": "https://www.pinterest.com/mriimrii" } }, "media": { "__typename": "StaticImage", "url": "https://cdn.cosmos.so/16ccb300-a890-45f1-9767-b12d1f1193a1", "width": 1352, "height": 1534, "aiGenerated": false }, "product": null, "hasMoreMedia": false, "multipleMedia": [] }, "… 38 more" ], "meta": { "result_count": 40, "count": 744, "next_token": "eyJ2MSI6NzExLjc1LCJ2MiI6OTUxODkxfQ==" }}Parameters
| Name | Type | Description |
|---|---|---|
handlepath · required | string | Username, with or without @, or a profile URL. Example: cosmos. |
afterquery | string | The previous page’s meta.next_token. |
Response fields
200 with a CosmosElements, in Cosmos’s own JSON.
| Field | Type | Description |
|---|---|---|
data | CosmosElement[] | |
meta | object |
Status codes
| Status | Meaning |
|---|---|
200 | A page of elements. |
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
Are private saves included?
No, only public ones.
Cosmos is a trademark of Cosmos. We are not affiliated with or endorsed by Cosmos.