Threads Media API — Download Images and Videos

Download an image or video

Delivers one image or video from a result, by the link the result gave. Supports Range requests so players can seek and downloads can resume. The links in a result expire after a few days: an expired link is a 404, and reading the post again returns a fresh one. Each request costs 1 credit, a range request included.

GET /media Utilities
https://api.fetchlayer.dev/threads/media
OpenAPI JSON

Headers

Authorization string required

Bearer token — your FetchLayer API key.

Parameters

url string required

An image or video link as a result gave it (media[].url or media[].videoUrl, or a profile picture). Only Threads media links; anything else is a 400. A link that has expired is a 404: read the post again for a fresh one.

Response Fields

media

Download an image or video

(binary) file

The file, streamed with its own content type. A Range request is answered with 206 and content-range, so players can seek and an interrupted download can resume.

Request

curl -X GET "https://api.fetchlayer.dev/threads/media?url=https%3A%2F%2Fscontent.cdninstagram.com%2Fv%2Ft51.2885-15%2F%E2%80%A6_n.jpg" \
  -H "Authorization: Bearer ss-your-key"

Response

{
  "note": "The image’s bytes, streamed with its own content type."
}
Product overview Threads API: what it returns, pricing and use cases