Resolve post media
GET/v1/media/resolve1 credit
Turns a post URL from Instagram, TikTok, X, Facebook, Pinterest, Threads, Reddit or LinkedIn into the post's files, in carousel order, each with its type, size and duration where the platform states them, and a URL to fetch it: the platform's own file URL wherever that works for any client, and our signed download link only where none does. Our own route: ScrapeCreators has no download contract.
01Query parameters
| Name | Type | Description |
|---|---|---|
| urlrequired | string | The post URL, e.g. `https://www.instagram.com/p/De2FpkRDMGi/`, a TikTok video or photo post, an X status, a Facebook post, video or reel, a Pinterest pin, a Threads post, a Reddit post (`/r/<sub>/comments/<id>`, a `/r/<sub>/s/<code>` share link, `v.redd.it/<id>` or an `i.redd.it` file) or a LinkedIn post (`/posts/…`, `/feed/update/urn:li:activity:…`). |
02Pricing
1 credit when the post has media; a post without media, and every error, is free. Downloads are free.
03Request
curl "https://api.scrapesocial.ai/v1/media/resolve?url=https%3A%2F%2Fwww.instagram.com%2Fp%2FDe2FpkRDMGi%2F" \ -H "x-api-key: $SCRAPESOCIAL_KEY"
04Responses
Real answers from the API. Lists are shortened to 2 items.
GET /v1/media/resolve?url=https://www.instagram.com/p/De2FpkRDMGi/
{
"success": true,
"credits_remaining": 4980,
"credits_charged": 1,
"platform": "instagram",
"source_url": "https://www.instagram.com/p/De2FpkRDMGi/",
"post_id": "De2FpkRDMGi",
"owner": {
"id": "787132",
"username": "natgeo"
},
"media": [
{
"index": 0,
"type": "image",
"mime": "image/jpeg",
"width": 1439,
"height": 959,
"duration_seconds": null,
"bitrate": null,
"has_audio": false,
"rendition": null,
"watermarked": null,
"is_original_sound": null,
"source_url": "https://instagram.fyei4-1.fna.fbcdn.net/v/t51.82787-15/864735906_18711180154019133_8705801405776303818_n.jpg?stp=dst-jpg_e35_tt6&_nc_cat=1&ig_cache_key=NDAxNDQyMDg5MjY1Mzk5MTY1OA%3D%3D.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNBUk9VU0VMX0lURU0ueHBpZHMuMTQzOS5zZHIucmVndWxhcl9waG90by5DMyJ9&_nc_ohc=Upbv1bKyRVUQ7kNvwE0wmMY&_nc_oc=AdqHodq85qcwwpDDupqYLLvYylAeZTNlcBANwsJNRM5y_yWZqQ5-X-F…",
"download_url": null,
"expires_at": "2026-10-30T02:29:24Z",
"note": null
},
{
"index": 1,
"type": "image",
"mime": "image/jpeg",
"width": 1440,
"height": 1920,
"duration_seconds": null,
"bitrate": null,
"has_audio": false,
"rendition": null,
"watermarked": null,
"is_original_sound": null,
"source_url": "https://instagram.fyei4-1.fna.fbcdn.net/v/t51.82787-15/862036245_18711180169019133_4044701529584872849_n.jpg?stp=dst-jpg_e35_tt6&_nc_cat=1&ig_cache_key=NDAxNDQyMDg5ODc0NDExNDQwOA%3D%3D.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNBUk9VU0VMX0lURU0ueHBpZHMuMTQ0MC5zZHIucmVndWxhcl9waG90by5DMyJ9&_nc_ohc=80CqLe78ixIQ7kNvwHZRMkj&_nc_oc=Adoma4IRQ5mOsY_3MBeKm0ZOrwOZ5XlfuQDM-mRZQFXDacczXUuSHhd…",
"download_url": null,
"expires_at": "2026-10-30T03:02:54Z",
"note": null
}
]
}Common to every endpoint
Any route can answer these: a missing or wrong key, no credits left, the platform not answering, or a failure on our side. None of them costs credits.
GET /v1/cosmos/profile?handle=design
{
"success": false,
"message": "Invalid API key"
}05Notes
The answer is `platform, source_url, post_id, owner{id, username}, media[]`; each item has `index, type` (`image`, `video` or `audio`), `mime, width, height, duration_seconds, bitrate, has_audio, rendition, watermarked, is_original_sound, source_url, download_url, expires_at, note`, null where the platform does not say. Each item carries exactly one URL. `source_url` is the platform's own CDN URL of the file: fetch it directly, nothing passes through us. It expires: Meta's (Instagram, Facebook, Threads) within hours to days, TikTok's within a day or two, Reddit's packaged videos within hours; `expires_at` is the CDN's own expiry when the URL states one, else null (which does not mean it never expires). When it has passed, or the CDN answers 403 or 404, resolve the post again. A browser opens a cross-origin URL instead of saving it (`<a download>` is ignored there and the CDNs send no `Content-Disposition: attachment`), so an app that wants a saved file should download it itself. `download_url` (`GET /v1/media/download/<token>`) is used only where no platform URL works for you: a TikTok video (its file URL only works in the session that loaded the page; served without the watermark, `rendition: play`) and a Reddit video whose sound is a separate file (we merge both while streaming, `rendition: merged`). It needs no API key, is free, lives one hour (`expires_at`) and sends the file with `Content-Disposition: attachment`; the TikTok video answers `Range` requests with 206, the merged Reddit video is always 200 with the whole file, without `Content-Length` and with `Accept-Ranges: none`. An expired link answers 410 `expired_link`, a file the platform has removed 410 `expired_media`. A TikTok video or photo post also lists its sound (the music track) as an `audio` item with `is_original_sound` (TikTok's own flag: a sound a user made rather than a licensed track); TikTok's CDN may label an MP3 sound `video/mp4`, while `mime` gives its real type. Items without a file (a TikTok sound TikTok no longer serves, a Pinterest video that exists only as HLS segments) have both URLs null and a `note`. A Pinterest carousel pin lists every card in order. Reddit: images and gallery items are the originals on `i.redd.it`, a GIF post its MP4, a video one MP4 with sound where Reddit has one; a video without a sound track has `has_audio: false`. LinkedIn: a video is its best MP4 (`rendition`, e.g. `720p`), an image post its images, a document post its pages as images, in order. A post without media is a free empty list. YouTube is not supported (free 400 `unsupported_platform`).
06Errors & credits
Every error has success: false, a real HTTP status and costs no credits.
400missing_parameter
A required parameter is missing or invalid.
403private_account
The account is private or age-restricted.
404not_found
No such account.
503upstream_error
The platform did not answer; retry shortly.