Docs menu

Cosmos post

Beta GET /v1/cosmos/post

GET /v1/cosmos/post

A public Cosmos post: media URLs, captions, source links and the save count.

  • Cost: 1 credit
  • Status: Beta. Built and tested against recorded responses; the shape may still gain fields.
  • Cache: Results are kept up to 30 days; send max_age_days to reuse them for free.
  • Timeout: A request still running after about 25 seconds answers 202 with a job to poll (Batch and jobs).

Parameters#

NameTypeRequiredDescription
urlURLyesPublic post URL (cosmos.so/e/<id>). Accepted hosts: cosmos.so.

Every request also accepts:

  • trim: true for a smaller response without null fields and extra.
  • raw: true to also get the platform's original object as raw.
  • max_age_days: accept a cached result up to this many days old, for 0 credits (Caching).

Example request#

Set your key in the environment first (see Authentication).

curl
curl -G "https://api.socialscrape.io/v1/cosmos/post" \
  -H "x-api-key: $SOCIALSCRAPE_API_KEY" \
  --data-urlencode "url=https://www.cosmos.so/e/2107587668"
Python
import os
import requests

params = {
    "url": "https://www.cosmos.so/e/2107587668",
}
res = requests.get(
    "https://api.socialscrape.io/v1/cosmos/post",
    headers={"x-api-key": os.environ["SOCIALSCRAPE_API_KEY"]},
    params=params,
)
body = res.json()

if body["ok"]:
    print(body["data"])
else:
    print(body["error"]["code"], body["error"]["message"])
TypeScript
const url = new URL("https://api.socialscrape.io/v1/cosmos/post");
url.search = new URLSearchParams({
  "url": "https://www.cosmos.so/e/2107587668"
}).toString();
const res = await fetch(url, {
  headers: { "x-api-key": process.env.SOCIALSCRAPE_API_KEY! },
});
const body = await res.json();

if (body.ok) {
  console.log(body.data);
} else {
  console.error(body.error.code, body.error.message);
}
n8n
{
  "nodes": [
    {
      "name": "SocialScrape Cosmos post",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        0,
        0
      ],
      "parameters": {
        "method": "GET",
        "url": "https://api.socialscrape.io/v1/cosmos/post",
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "url",
              "value": "https://www.cosmos.so/e/2107587668"
            }
          ]
        },
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "x-api-key",
              "value": "={{ $env.SOCIALSCRAPE_API_KEY }}"
            }
          ]
        }
      }
    }
  ],
  "connections": {}
}

Example response#

This is a sample from a recorded response. Status 200.

{
  "ok": true,
  "credits_charged": 1,
  "credits_remaining": 4999,
  "cached": false,
  "cached_at": null,
  "request_id": "req_3cfee68cc929a9e6319d5af7",
  "data": {
    "object": "post",
    "platform": "cosmos",
    "id": "2107587668",
    "url": "https://www.cosmos.so/e/2107587668",
    "type": "image",
    "author": {
      "id": "2074596056",
      "handle": "audreyelli",
      "name": "Audrey Ellison",
      "url": "https://www.cosmos.so/audreyelli",
      "avatar_url": "https://cdn.cosmos.so/default-avatars/011.png",
      "verified": false
    },
    "title": null,
    "text": "Japanese movie poster for A Hard Day's Night (1964) featuring The Beatles.",
    "published_at": "2026-01-24T17:23:49.338775Z",
    "duration_seconds": null,
    "language": null,
    "hashtags": null,
    "mentions": null,
    "stats": {
      "views": null,
      "likes": null,
      "comments": null,
      "shares": null,
      "saves": 147,
      "dislikes": null
    },
    "media": {
      "thumbnail_url": "https://cdn.cosmos.so/8d612bfd-2b7b-458c-ac99-af7c406eef97",
      "video_url": null,
      "audio_url": null,
      "image_urls": [
        "https://cdn.cosmos.so/8d612bfd-2b7b-458c-ac99-af7c406eef97"
      ],
      "width": 1080,
      "height": 1671
    },
    "song": null,
    "location": null,
    "is_pinned": null,
    "is_sponsored": null,
    "extra": {
      "caption_generated": "Japanese movie poster for A Hard Day's Night (1964) featuring The Beatles.",
      "content_accessibility": "ACCESSIBLE",
      "has_more_media": false,
      "is_featured": false,
      "media": [
        {
          "ai_generated": false,
          "height": 1671,
          "id": "8d612bfd-2b7b-458c-ac99-af7c406eef97",
          "nsfw_status": "SAFE",
          "type": "StaticImage",
          "url": "https://cdn.cosmos.so/8d612bfd-2b7b-458c-ac99-af7c406eef97",
          "width": 1080
        }
      ],
      "original_collection_id": 752032445,
      "processing_state": "FINISHED",
      "source": {
        "author": {
          "name": "Tom Elliott",
          "profile_url": "https://www.pinterest.com/telliott1817",
          "username": "telliott1817"
        },
        "is_public_domain": false,
        "url": "https://www.pinterest.com/pin/7177680652369084/"
      }
    }
  },
  "cursor": null,
  "has_more": null
}

Response#

A Post object in data.

See Data models for every field. The envelope around data is described in Responses.

Errors#

Failures are free: credits_charged is 0. Branch on error.code, never on the message.

CodeHTTPRetryMeaning
invalid_params400noA parameter is missing, unknown or has the wrong type.
unsupported_url400noThe URL is not one this endpoint accepts (wrong platform or form).
not_found404noThe platform says this profile, post or item does not exist.

Every request can also fail with the account and platform errors listed on the Errors page.

Example error:

{
  "ok": false,
  "error": {
    "code": "not_found",
    "message": "The platform says this profile, post or item does not exist.",
    "retryable": false
  },
  "credits_charged": 0,
  "request_id": "req_a17bda79baf2ba2215cdd7a2"
}