100 free credits. No credit card required. Get a key

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 failure
import 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

NameTypeDescription
urlquery · requiredstringAn element URL or id. Example: https://www.cosmos.so/e/1565142027.
Response fields

200 with a CosmosElement, in Cosmos’s own JSON.

FieldTypeDescription
__typenamestring
idinteger
createdAtstring | null
shareUrlstring | null
ownerIdinteger | null
ownerobject | null
generatedCaptionobject | null
sourceobject | null
mediaobject | null
Status codes
StatusMeaning
200The element.
400Invalid input. Nothing was charged.
401Missing or invalid API key.
402Not enough credits, a spend cap was reached, or payment is required.
403The target is private, or the account is suspended.
404The user, element or collection does not exist.
429Too many requests. Wait for Retry-After seconds.
503Cosmos 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.