Social downloaders

Fetch public posts, videos, profiles and stories from Instagram, Twitter / X, Threads, TikTok and Facebook in one JSON format.

Each platform is its own service. Subscribe to it, then call /s/{service-slug}/{endpoint} with your API key, the same way as any other service. The slug is the one shown on your subscription page, usually instagram, twitter, threads, tiktok or facebook. All endpoints are GET.

Response shapes

Every platform returns the same shapes. Media URLs point straight at the platform's CDN and expire after a while, so download files soon after fetching them.

// Every success response
{ data: Post | Profile | Page | HighlightList | CaptionList }

Post {
  platform, id, code?, url?, type?,        // type: post, reel, video, photo, carousel, story…
  text?, createdAt?, expiresAt?,           // ISO 8601; expiresAt only on stories
  author?: { id, username, name, avatar, verified },
  media: [{ type: 'image' | 'video' | 'gif' | 'audio', url, thumbnail?, width?, height?, duration?, hasAudio?,
            variants?: [{ url, contentType?, bitrate?, width?, height? }] }],
  stats: { likes?, comments?, views?, shares?, reposts?, quotes?, saves? }, // missing = not reported
  captions?: [{ language, label?, url?, format?, autoGenerated }]          // TikTok videos
}

Profile {
  platform, id, username, name?, bio?, avatar?,
  links?: [{ url, title? }],  // every link on the profile, in order; title = the owner's label
  externalUrl?,               // the first link (kept for older clients)
  verified, private, followers?, following?, postCount?, likes?
}

Page          { items: Post[]; nextCursor?: string; hasMore: boolean }
HighlightList { items: [{ id, title?, cover?, count? }] }
CaptionList   { id; items: [{ language, label?, url?, format?, autoGenerated, text, vtt }] }

Pagination

/posts returns one page. While hasMore is true, pass nextCursor back as cursor to get the next page. You can load up to 3 pages: the third comes back without a nextCursor. TikTok has a single page. Each page is a billed request.

// Loads up to 3 pages (the API's limit).
async function allPosts(username) {
  const posts = [];
  let cursor = '';
  do {
    const qs = new URLSearchParams({ username, count: '24' });
    if (cursor) qs.set('cursor', cursor);
    const res = await fetch('/s/instagram/posts?' + qs, {
      headers: { 'X-API-Key': 'YOUR_API_KEY' },
    });
    if (!res.ok) throw new Error((await res.json()).message);
    const { data } = await res.json();
    posts.push(...data.items);
    cursor = data.hasMore ? data.nextCursor : '';
  } while (cursor);
  return posts;
}

Errors

Errors use the body { "message", "error", "statusCode" }. Responses with a 5xx status are not billed.

  • 400

    Bad Request

    Missing or malformed parameter (bad URL, username, count)

  • 401

    Unauthorized

    Invalid or missing API key

  • 403

    Forbidden

    The account is private

  • 404

    Not Found

    The post or account does not exist, or the endpoint is not offered on that platform

  • 429

    Too Many Requests

    Your plan’s rate limit was reached

  • 502

    Bad Gateway

    Every source failed. Retry after a short wait; this request is not billed