API · Cosmos
GET /cosmos/posts
One Cosmos element: media, source, owner.
| Request | GET /v1/cosmos/posts |
| Operation id | cosmos.post.get |
| Cost | 1 credit, refunded if the call fails |
| Auth | API key: Authorization: Bearer <key> or x-api-key. |
One Cosmos element: media, source, owner.
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
url | string | yes | An element URL or id. Example: https://www.cosmos.so/e/1565142027. |
Responses
| Status | Meaning | Schema |
|---|---|---|
200 | The element. | CosmosElement |
400 | Invalid input. Nothing was charged. | Error |
401 | Missing or invalid API key. | Error |
402 | Not enough credits, a spend cap was reached, or payment is required. | Error |
403 | The target is private, or the account is suspended. | Error |
404 | The user, element or collection does not exist. | Error |
429 | Too many requests. Wait for Retry-After seconds. | Error |
503 | Cosmos is temporarily unavailable. Retryable; nothing was charged. | Error |
CosmosElement fields
| 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 |
Errors use one shape everywhere; see Errors for every code and what to do.