# Authentication (/docs/authentication) Every request authenticates with an API key of your workspace. The workspace's credits pay for its calls. ## Send Your Key [#send-your-key] Send the key in the `Authorization` header. ```bash curl https://api.socialapi.sh/v1/credits \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" ``` A missing, revoked or expired key returns `401 UNAUTHENTICATED`. ## Create an API Key [#create-an-api-key] Open **API Keys** in the dashboard and create a key. Copy it now, because it is shown only once. Every workspace also starts with a key named "Default", shown on **Overview** until you copy it. | Setting | Options | | --- | --- | | Name | Up to 80 characters, to tell keys apart | | Expires | After 7, 30, 90 or 365 days, or never | | Monthly limit | The most credits the key may spend in a calendar month (UTC), or none | A call that would pass the key's monthly limit returns `402 KEY_CREDIT_LIMIT_REACHED` until the month turns. It costs nothing. ## Manage Keys [#manage-keys] Keys start with `sapi_`, and only a hash of each is stored, so a lost key cannot be shown again. Create a new one instead. A workspace can have 50 active keys, and **Logs** and **Usage** show each one's requests and spend. Members revoke the keys they created, and admins and the owner revoke any key. A revoked key stops at once, and removing a member revokes the keys they created. ## Keep Keys on Your Server [#keep-keys-on-your-server] A key spends your workspace's credits. Call the API from your server, a script or a job, never from a web page or an app on a user's device. Revoke a key that leaked and create a new one. ## AI Agents [#ai-agents] An agent can connect to the [MCP Server](/docs/mcp) with OAuth instead of a key you copy. It gets a key of its own, named after it, such as "Claude (MCP)", which you revoke like any other. ## Next Steps [#next-steps] - [Quickstart](/docs/quickstart): Your API key, a free first call and a page of posts. - [Credits](/docs/credits): Where costs are listed, and how to watch your balance. - [Errors](/docs/errors): The error envelope and every code. - [MCP Server](/docs/mcp): Read social data from Claude, Cursor and more. # Caching (/docs/caching) Answers are kept for a while, and the same request within that time is free. The cache is shared, so a profile anyone read a minute ago is free for you too. ## Lifetimes [#lifetimes] Each answer is kept as long as what it holds stays current. | Answer | Kept For | | --- | :---: | | Live streams | 1 minute | | Searches | 2 minutes | | Comments | 5 minutes | | Posts and lists | 10 minutes | | Profiles | 15 minutes | | Transcripts | 30 days | Instagram's searches are kept 5 minutes, and trending lists from 2 minutes to an hour, by how fast each one moves. ## Ask for a Fresher Answer [#ask-for-a-fresher-answer] Every endpoint takes `maxAge`, the oldest answer you accept, in seconds. A cached answer older than that is read again from the platform and charged, and `maxAge=0` always reads it again. It can only shorten a lifetime, never extend it. **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.tiktok.profile({ handle: "nike", maxAge: 60 }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.tiktok.profile(handle="nike", max_age=60).data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/tiktok/profile \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=nike" \ --data-urlencode "maxAge=60" ``` ## Cached or Fresh [#cached-or-fresh] Every answer says in its headers whether it came from the cache. | Header | Cached | Fresh | | --- | :---: | :---: | | `X-Cache` | `HIT` | `MISS` | | `X-Cache-Age` | Its age | Not sent | | `X-Credits-Charged` | `0` | The cost | # Credits (/docs/credits) Every call is paid in credits from your workspace's balance. Credits never expire. ## What a Call Costs [#what-a-call-costs] Each endpoint's cost is on its page in the [API Reference](/docs/api-reference). A call that fails, or an answer from the [cache](/docs/caching), costs nothing. ## Read Your Balance [#read-your-balance] Reading your balance is free. **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const answer = await client.account.getCredits(); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) answer = client.account.get_credits() ``` **cURL** ```bash curl https://api.socialapi.sh/v1/credits \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" ``` **Response** ```json { "balance": 319668 } ``` Every answer also says what it cost and what is left. ```http X-Credits-Charged: 1 X-Credits-Remaining: 2499 ``` A call the balance cannot cover returns `402 INSUFFICIENT_CREDITS`, at no cost. ## Auto Top-Up [#auto-top-up] Auto top-up buys a pack with your saved card when the balance falls below a threshold you set. Turn it on in **Settings → Billing**. If the card is declined, it turns itself off and emails the workspace owner. ## Limits per Key [#limits-per-key] A key can be capped at a number of credits a month, so one integration cannot spend the whole balance. A call past the cap returns `402 KEY_CREDIT_LIMIT_REACHED`, at no cost. See [Authentication](/docs/authentication#create-an-api-key). # Errors (/docs/errors) Every error has the same shape and a stable code. No error costs credits. ## Error Envelope [#error-envelope] A refused call answers this body, with the HTTP status that matches its code. ```json { "error": "No Instagram account matches this handle.", "code": "NOT_FOUND" } ``` | Field | Type | Description | | ------------------ | -------- | --------------------------------------------------------- | | `error` (required) | `string` | A message for people. Its wording can change. | | `code` (required) | `string` | A stable code, such as NOT_FOUND. Build your logic on it. | | `param` | `string` | The parameter at fault, for INVALID_REQUEST. | A code never changes its meaning, but new codes can appear, so handle an unknown one by its status. ## Error Codes [#error-codes] Each code always comes with the same status. | Code | Status | Meaning | | --- | :---: | --- | | `INVALID_REQUEST` | `400` | A parameter is missing or wrong | | `UNAUTHENTICATED` | `401` | The key is missing, revoked or expired | | `INSUFFICIENT_CREDITS` | `402` | The balance does not cover the call | | `KEY_CREDIT_LIMIT_REACHED` | `402` | The key spent its monthly limit | | `PRIVATE` | `403` | The account or the list is private | | `NOT_FOUND` | `404` | No such account, post or thing | | `CONFLICT` | `409` | The [Idempotency-Key](/docs/idempotency) is in use | | `SUSPENDED` | `410` | The account exists, but is suspended | | `RATE_LIMITED` | `429` | Too many requests | | `INTERNAL_ERROR` | `500` | An error on our side | | `UPSTREAM_UNAVAILABLE` | `502` | The platform did not answer | | `ENDPOINT_UNAVAILABLE` | `503` | The endpoint is paused | ## What to Do [#what-to-do] The status tells you whether to fix the request, wait, or retry. | Status | Do | | --- | --- | | `400` | Fix the parameter named in `param` | | `401` | Send a valid [key](/docs/authentication) | | `402` | Buy [credits](/docs/credits), or raise the key's limit | | `403`, `404`, `410` | Do not retry. The answer will be the same | | `409` | Use a new key, or wait for `Retry-After` | | `429` | Wait for `Retry-After` | | `500`, `502`, `503` | Try again shortly | ## Retries [#retries] Retry with a growing pause, such as 1, 2, then 4 seconds, and wait at least `Retry-After` when it is sent. Failed calls are free, so retrying costs nothing until one succeeds. A request that timed out may still have run. Send it with an [Idempotency-Key](/docs/idempotency), so a retry never pays twice. ## Request Ids [#request-ids] Every response has an `X-Request-Id`, such as `req_01m87tg3trs1ppxbs3h0ys092`. Log it, and send it to support with a question. The SDKs raise every error as a `SocialAPIError`. See [SDKs](/docs/sdks#errors). # Idempotency (/docs/idempotency) A request that timed out on your side may still have run, and been charged. Send an `Idempotency-Key` with it, and a retry with the same key returns the first answer instead of running again. ## Send a Key [#send-a-key] Add the header to any request. Use a new key for each request you mean to make, such as a UUID. ```bash curl -G https://api.socialapi.sh/v1/tiktok/post/transcript \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ -H "Idempotency-Key: 6f1c2a52-7f3e-4b0e-9a55-0d3f2b8e4c11" \ --data-urlencode "id=7711414040114892045" ``` | Property | Value | | --- | --- | | Header | `Idempotency-Key` | | Length | 1 to 255 characters | | Kept | 24 hours | | Scope | Your workspace | In the TypeScript SDK, pass it in a call's second argument: `{ headers: { "Idempotency-Key": key } }`. ## Repeat a Request [#repeat-a-request] Within 24 hours, the same key with the same request (the same method, path and query) returns the first answer's status and body, with the header `Idempotent-Replayed: true`. Another API key of the same workspace gets it too. The repeat costs nothing, and does not count against your [rate limit](/docs/rate-limits). ## When a Key Is Refused [#when-a-key-is-refused] A key is refused in three cases, each with its own answer. | Case | Answer | Do | | --- | :---: | --- | | The key was used for another request | `409 CONFLICT` | Use a new key for a new request | | The first request is still running | `409 CONFLICT` | Wait for `Retry-After`, then repeat | | The key is empty or too long | `400 INVALID_REQUEST` | Send 1 to 255 characters | ## Answers That Are Not Kept [#answers-that-are-not-kept] A key keeps the first answer that settles the request. Some answers do not settle it, so the key is freed and the next request with it runs afresh. - A `5xx` answer, such as `502 UPSTREAM_UNAVAILABLE`. - A `429 RATE_LIMITED` answer. - An answer over 1 MB. These answers cost nothing, so running the request again is safe. ## Idempotency and the Cache [#idempotency-and-the-cache] They solve different problems. Use both. | Property | Idempotency | [Cache](/docs/caching) | | --- | :---: | :---: | | Answers | Your own first answer | Anyone's recent answer | | Kept | 24 hours | Per endpoint, minutes to 30 days | | Needs | A key you send | Nothing | | Cost | Free | Free | ## Next Steps [#next-steps] - [Rate Limits](/docs/rate-limits): How many requests you can send, and how to retry. - [Errors](/docs/errors): The error envelope and every code. - [Credits](/docs/credits): Where costs are listed, and how to watch your balance. - [SDKs](/docs/sdks): Typed clients for TypeScript and Python. # Identifiers (/docs/identifiers) Every endpoint names what it reads with the same parameters. Give one of them. ## Accounts [#accounts] An account is named by its handle or its profile link. | Parameter | Example | | --- | --- | | `handle` | `nike` or `@nike` | | `url` | `https://www.tiktok.com/@nike` | An account's lists take the same parameters as its profile. Some platforms take more, such as TikTok's `secUid` or YouTube's `channelId`, and say so on their page. A Reddit community is named by `name` (`AskReddit`, with or without `r/`) or its `url`. ## Posts and Other Things [#posts-and-other-things] Anything else is named by its link, its id, a name or a query, as its endpoint asks. | Parameter | Example | | --- | --- | | `url` | `https://www.instagram.com/p/Df147tCiAyB/` | | `id` | `7711465226318728461` | | `name` | `fyp` | | `query` | `coffee` | - A link is the one the app's share button gives. - An id is the platform's, as `id` comes in our answers. - A name is a hashtag's, without `#`. - Short links work too: `vm.tiktok.com/…`, `pin.it/…`, `youtu.be/…`, `redd.it/…`. ## Every List [#every-list] Every list also takes two parameters of its own. | Parameter | Takes | | --- | --- | | `cursor` | Where the next page starts | | `maxAge` | The oldest cached answer to accept | See [Pagination](/docs/pagination) and [Caching](/docs/caching). ## Wrong Kind of Link [#wrong-kind-of-link] A link to the wrong kind of thing returns `400 INVALID_REQUEST`, and says what it is to. ```json { "error": "This link is to an account, not a post.", "code": "INVALID_REQUEST", "param": "url" } ``` # Introduction (/docs) SocialAPI reads public data from the [major platforms](/docs/platforms) with one API key and one schema. ## Where to Find What [#where-to-find-what] Start from what you want to do. | You want to | Read | | --- | --- | | Make your first call | [Quickstart](/docs/quickstart) | | See what each platform offers | [Platforms](/docs/platforms) | | Look up an endpoint's parameters and answer | [API Reference](/docs/api-reference) | | Understand answers, ids, paging, errors and costs | [Core Concepts](/docs/responses) | | Call the API from TypeScript or Python | [SDKs](/docs/sdks) | | Let Claude, Cursor or another agent read social data | [MCP Server](/docs/mcp) | ## How It Works [#how-it-works] A few words come up on every page. | Concept | What it is | Example | | --- | --- | --- | | Workspace | Your team, with its credits, API keys and logs | Set by your [API key](/docs/authentication) | | API key | What your requests authenticate with | `sapi_…` | | Credit | What calls are paid with | See [Credits](/docs/credits) | | Platform | Where the data comes from, the first segment of the path | `tiktok`, `youtube`, `reddit`… | | Profile | An account on a platform | `@nike` | | Post | A post, reel, video or thread | Its link, or its id | | Cursor | Where the next page of a list starts | `pagination.nextCursor` | ## The Request Shape [#the-request-shape] Every endpoint is a `GET` with the platform and the thing to read in its path, and what to read as query parameters. This reads a TikTok profile: **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.tiktok.profile({ handle: "nike" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.tiktok.profile(handle="nike").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/tiktok/profile \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=nike" ``` **Response** ```json { "data": { "id": "208464585232822272", "username": "nike", "displayName": "Nike", "bio": "Just Do It.", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-maliva-avt-0068/e0b0ac7b6ad6447a8e923fd1eb162f2c~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=c73b1f8a&x-expires=1795730400&x-signature=WFCAToitWtbkgo5qXRwrQmcX%2FZY%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=my", "url": "https://www.tiktok.com/@nike", "verified": true, "private": false, "followers": 9440793, "following": 94, "likes": 51312842, "posts": 1131, "externalUrl": "http://empli.fi/niketiktok", "createdAt": null, "ext": { "secUid": "MS4wLjABAAAA_3ndMt8d_tECTdpKgCxcx238tOnQZX-20wqN01aMui5zQ7hsqSdff-jC5qYC-Cl_", "friends": 47, "liked": 0, "category": "Sports, Fitness & Outdoors", "seller": false, "likesPublic": false, "roomId": null } } } ``` Every platform answers with the same fields. An account on any platform is a `Profile`, and what only one platform has sits under `ext`. One item comes as `{ "data": … }`, a list as `{ "data": [...], "pagination": … }`. See [Responses](/docs/responses). Every request goes to `https://api.socialapi.sh` with your [API key](/docs/authentication). A call that fails costs nothing. ## What to Read Next [#what-to-read-next] - [Quickstart](/docs/quickstart): Your API key, a free first call and a page of posts. - [Authentication](/docs/authentication): Create an API key and send it with your requests. - [Compare Platforms](/docs/platforms): What each platform offers and where its lists end. - [API Reference](/docs/api-reference): Every endpoint, with a real request and answer. - [SDKs](/docs/sdks): Typed clients for TypeScript and Python. - [MCP Server](/docs/mcp): Read social data from Claude, Cursor and more. # MCP Server (/docs/mcp) Connect an AI assistant such as Claude, Cursor or VS Code to SocialAPI and read social data from a chat. The assistant talks to SocialAPI through the [Model Context Protocol](https://modelcontextprotocol.io/) (MCP). ## What You Can Do [#what-you-can-do] - Read any public profile on a [platform SocialAPI reads](/docs/platforms), and its posts. - Read a post's comments and replies, and what is said in a video. - Search posts and accounts, and read what is trending. - Read hashtags, sounds, places, Marketplace listings and events. - Check how many credits are left. Every endpoint of the API is there. The assistant finds the one for a task with `find_endpoints` and calls it with `call_endpoint`, so its context stays small however many endpoints there are. See [Tools](/docs/mcp/tools). ## Server URL [#server-url] ``` https://api.socialapi.sh/mcp ``` The server uses Streamable HTTP and MCP protocol versions `2025-11-25`, `2025-06-18` and `2025-03-26`. ## Sign-In [#sign-in] An app signs in through your browser, or with an API key. | Method | For | How | | --- | --- | --- | | Sign-in (OAuth) | Claude, ChatGPT, Claude Code, Cursor, VS Code, Codex and most apps | A browser window opens. Sign in, pick a workspace and allow the app | | API key | Scripts, servers and apps that cannot open a browser | Send your key as `Authorization: Bearer sapi_…` | Signing in is the usual way. The app gets a key of its own, named after it, such as "Claude (MCP)", and listed in **Connected Apps**. Every tool call is charged, limited and logged as an API call, and a refused call costs nothing. To connect your app, see [Setup](/docs/mcp/setup). ## Example [#example] **You:** How many followers does Nike have on TikTok and on Instagram? The assistant calls `find_endpoints` with "tiktok and instagram profile". It answers `tiktok_profile` and `instagram_profile`, with their parameters. Then it calls `call_endpoint` for each. ```json { "endpoint": "tiktok_profile", "arguments": { "handle": "nike" } } ``` Each call answers the endpoint's JSON, the profile under `data`. The assistant reads `followers` from both answers and replies with the two counts. The search is free, and the two calls cost 2 credits. Asking again within 15 minutes is free, from the cache. ## Docs for Assistants [#docs-for-assistants] These docs come in forms an assistant reads directly. | Resource | Contains | | --- | --- | | [`/llms.txt`](/llms.txt) | An index of these docs | | [`/llms-full.txt`](/llms-full.txt) | All of them as one text | | Any page with `.md` | That page as Markdown, also from **Copy Markdown** | | [`/openapi.json`](https://api.socialapi.sh/openapi.json) | The API's contract | ## Next Steps [#next-steps] - [Setup](/docs/mcp/setup): Add the server to Claude, Cursor and VS Code. - [Tools](/docs/mcp/tools): Every tool, what it takes and what it answers. - [Credits](/docs/credits): Where costs are listed, and how to watch your balance. - [SDKs](/docs/sdks): Typed clients for TypeScript and Python. # Setup (/docs/mcp/setup) Add SocialAPI to Claude, ChatGPT, Cursor or any other MCP app, then sign in once in your browser. There is no key to copy: the app gets its own. ## Before You Start [#before-you-start] You need a SocialAPI account, which starts with 100 free credits, and an app that supports remote MCP servers, such as Claude or Cursor. If yours only runs local servers, use the **Other** tab below. ## Add the Server [#add-the-server] Add `https://api.socialapi.sh/mcp` with the steps for your app below. Start the connection. A browser window opens. Sign in to SocialAPI if you are not signed in yet. Pick the workspace whose credits the app spends, and click **Allow**. Ask the assistant how many credits you have left. If it answers, you are connected. **Claude** 1. In Claude, open **Settings → Connectors → Add custom connector**. 2. Name it SocialAPI and enter `https://api.socialapi.sh/mcp`. 3. Click **Connect** and allow it in the browser. This works in claude.ai and Claude Desktop alike. **ChatGPT** 1. In ChatGPT, open **Settings → Apps → Advanced settings** and turn on **Developer mode**. 2. Click **Create app**, name it SocialAPI and enter `https://api.socialapi.sh/mcp`. Leave the authentication on **OAuth**. 3. Create it and allow it in the browser. On a Business or Enterprise plan, an admin turns on developer mode for the workspace. **Claude Code** Add the server. ```bash claude mcp add --transport http socialapi https://api.socialapi.sh/mcp ``` Then run `/mcp` in Claude Code, select **socialapi** and sign in in the browser. **Cursor** Add the server to `~/.cursor/mcp.json`, or to `.cursor/mcp.json` in a project. ```json { "mcpServers": { "socialapi": { "url": "https://api.socialapi.sh/mcp" } } } ``` Then open **Cursor Settings → MCP** and click **Needs authentication** under **socialapi** to sign in in the browser. **VS Code** Add the server to `.vscode/mcp.json` in your workspace. ```json { "servers": { "socialapi": { "type": "http", "url": "https://api.socialapi.sh/mcp" } } } ``` Start the server from the file or with the **MCP: List Servers** command, and allow it when VS Code asks you to sign in. **Codex** Add the server and sign in. ```bash codex mcp add socialapi --url https://api.socialapi.sh/mcp codex mcp login socialapi ``` The CLI, the desktop app and the IDE extension share this configuration. **MCP Inspector** Start the inspector. ```bash npx @modelcontextprotocol/inspector@latest ``` Select the **Streamable HTTP** transport and enter `https://api.socialapi.sh/mcp`. Click **Connect** and sign in in the browser. **Other** Any app with Streamable HTTP support can connect to `https://api.socialapi.sh/mcp`. If yours only runs local servers, bridge it with [`mcp-remote`](https://www.npmjs.com/package/mcp-remote). ```json { "mcpServers": { "socialapi": { "command": "npx", "args": ["-y", "mcp-remote@latest", "https://api.socialapi.sh/mcp"] } } } ``` To build your own client, follow the MCP authorization specification. A `401` names the sign-in in its `WWW-Authenticate` header, and dynamic client registration and PKCE are supported. ## Connect With an API Key [#connect-with-an-api-key] Signing in works for every app above. For a script, a server or an app that cannot open a browser, send an API key from **API Keys** instead, as `Authorization: Bearer sapi_…`. See [Authentication](/docs/authentication). ```bash claude mcp add --transport http socialapi https://api.socialapi.sh/mcp --header "Authorization: Bearer $SOCIALAPI_API_KEY" ``` ## Manage Connected Apps [#manage-connected-apps] Every app you sign in from is listed in **Connected Apps** in the dashboard, with when it was connected, when it was last used and what it spent. - Disconnect it there to end its access at once. Your API keys are not affected. - It does not expire. The app keeps working until you disconnect it. - Its calls show in **Logs** under its name, such as "Claude (MCP)". - To connect another workspace, connect the app again and pick it. ## Troubleshooting [#troubleshooting] Most problems when connecting come from one of these. | Error | Cause | Fix | | --- | --- | --- | | `401` Not signed in | The app was disconnected, or its key revoked | [Sign in again](#sign-in-again) | | `INSUFFICIENT_CREDITS (402)` | The balance does not cover the call | Buy credits in **Settings → Billing** | | `KEY_CREDIT_LIMIT_REACHED (402)` | The key spent its monthly limit | Raise it with a new key, or wait for the 1st | | `RATE_LIMITED (429)` | The workspace sent 600 requests in a minute | Wait the seconds the error gives | | Takes no `…` argument | The tool was called with an argument it does not take | None. The message names the ones it takes, and the assistant retries | | No tools appear | The app did not reload its MCP configuration | Restart the app completely | ### Sign In Again [#sign-in-again] | App | What to do | | --- | --- | | Claude Code | Run `/mcp` and select **socialapi** | | Codex | Run `codex mcp login socialapi` | | Other apps | Remove the server and add it again | Errors about the data itself, such as an account that does not exist, are listed in [Tools](/docs/mcp/tools#errors). # Tools (/docs/mcp/tools) Three tools, however many endpoints there are: the assistant finds the endpoint for a task, then calls it. | Tool | Does | Credits | | --- | --- | :---: | | `find_endpoints` | Finds the endpoints for a task, with their parameters | Free | | `call_endpoint` | Calls an endpoint and answers its JSON | As the endpoint | | `get_credits` | Answers the credits left in the workspace | Free | Every tool only reads. None changes anything on a platform or in your workspace. ## Find Endpoints [#find-endpoints] Search in plain words, such as "tiktok comments" or "reels of an instagram account". Add `platform` to search one platform, or give `platform` alone to list all of its endpoints. ```json { "query": "instagram post comments" } ``` It answers up to 8 endpoints, best first. The first 3 come with their description and parameters, the rest with what they return. ```json { "endpoints": [ { "name": "instagram_post_comments", "summary": "A post's comments with their likes, about 22 a page.", "description": "A post's comments with their likes, about 22 a page. … 5 credits a page.", "parameters": { "url": { "type": "string", "description": "The post's link." }, "id": { "type": "string", "description": "The post's media id, instead of `url`." }, "cursor": { "type": "string", "description": "`nextCursor` of the previous page." }, "maxAge": { "type": "integer", "minimum": 0, "description": "How old a cached answer may be, in seconds; …" } } }, { "name": "instagram_post", "summary": "One post or reel with its counts, media and tags.", "parameters": { … } } ] } ``` An endpoint's name and parameters stay valid for the whole conversation, so the assistant searches once per kind of call. A search for a platform SocialAPI does not read says so, and names the ones it does. ## Call Endpoint [#call-endpoint] Give the endpoint's name and its arguments. ```json { "endpoint": "instagram_post_comments", "arguments": { "url": "https://www.instagram.com/p/DA1b2c3D4e5/" } } ``` - A call is the endpoint's request, made with the app's key: charged, cached, limited and logged as any API call. - The endpoint's path works as its name too, such as `instagram/post/comments`. - A name with a typo is refused with the nearest names, such as `tiktok_profile` for `tiktok_profle`. ## Answers [#answers] A call answers the endpoint's JSON: `{ data }` for one item, `{ data, pagination }` for a list. The fields are the ones in [Responses](/docs/responses). The text the assistant reads leaves out empty fields, and the answer in full is in `structuredContent`. For the next page of a list, the assistant passes `pagination.nextCursor` back as `cursor`, and each page is charged as a call of its own. Its `_meta` says what the call cost. | Key | Contains | | --- | --- | | `socialapi.sh/creditsCharged` | Credits the call cost, 0 from the cache | | `socialapi.sh/creditsRemaining` | Credits left in the workspace | | `socialapi.sh/requestId` | The request's id, for support | | `socialapi.sh/cache` | `HIT` or `MISS` | ## Errors [#errors] A refused call is a tool error the assistant reads (`isError`), and costs nothing. Its text is the code, the status and the message. ``` NOT_FOUND (404): No TikTok account matches this handle. ``` An argument the endpoint does not take is refused, naming the ones it does. Every code is in [Errors](/docs/errors). ## Direct Mode [#direct-mode] For an assistant that only needs a few platforms, add them to the server URL. Each of their endpoints is then a tool of its own, named as below, alongside `get_credits`. ``` https://api.socialapi.sh/mcp?platforms=tiktok,instagram ``` Use `platforms=all` for every endpoint. A platform's tools take about 200 tokens of context each, so keep the list short. ## Endpoint Names [#endpoint-names] Every endpoint by the name `call_endpoint` takes. Its parameters are on its page in the [API Reference](/docs/api-reference). | Name | Endpoint | Credits | | --- | --- | :---: | | `bluesky_batch_posts` | [`/v1/bluesky/batch/posts`](/docs/api-reference/bluesky/batch-posts) | 1 | | `bluesky_batch_profiles` | [`/v1/bluesky/batch/profiles`](/docs/api-reference/bluesky/batch-profiles) | 1 | | `bluesky_feed` | [`/v1/bluesky/feed`](/docs/api-reference/bluesky/feed) | 1 | | `bluesky_feed_posts` | [`/v1/bluesky/feed/posts`](/docs/api-reference/bluesky/feed-posts) | 1 | | `bluesky_hashtag_posts` | [`/v1/bluesky/hashtag/posts`](/docs/api-reference/bluesky/hashtag-posts) | 1 | | `bluesky_list` | [`/v1/bluesky/list`](/docs/api-reference/bluesky/list) | 1 | | `bluesky_list_members` | [`/v1/bluesky/list/members`](/docs/api-reference/bluesky/list-members) | 1 | | `bluesky_list_posts` | [`/v1/bluesky/list/posts`](/docs/api-reference/bluesky/list-posts) | 1 | | `bluesky_post` | [`/v1/bluesky/post`](/docs/api-reference/bluesky/post) | 1 | | `bluesky_post_comments` | [`/v1/bluesky/post/comments`](/docs/api-reference/bluesky/post-comments) | 1 | | `bluesky_post_likes` | [`/v1/bluesky/post/likes`](/docs/api-reference/bluesky/post-likes) | 1 | | `bluesky_post_quotes` | [`/v1/bluesky/post/quotes`](/docs/api-reference/bluesky/post-quotes) | 1 | | `bluesky_post_reposts` | [`/v1/bluesky/post/reposts`](/docs/api-reference/bluesky/post-reposts) | 1 | | `bluesky_profile` | [`/v1/bluesky/profile`](/docs/api-reference/bluesky/profile) | 1 | | `bluesky_profile_feeds` | [`/v1/bluesky/profile/feeds`](/docs/api-reference/bluesky/profile-feeds) | 1 | | `bluesky_profile_followers` | [`/v1/bluesky/profile/followers`](/docs/api-reference/bluesky/profile-followers) | 1 | | `bluesky_profile_following` | [`/v1/bluesky/profile/following`](/docs/api-reference/bluesky/profile-following) | 1 | | `bluesky_profile_lists` | [`/v1/bluesky/profile/lists`](/docs/api-reference/bluesky/profile-lists) | 1 | | `bluesky_profile_media` | [`/v1/bluesky/profile/media`](/docs/api-reference/bluesky/profile-media) | 1 | | `bluesky_profile_posts` | [`/v1/bluesky/profile/posts`](/docs/api-reference/bluesky/profile-posts) | 1 | | `bluesky_profile_replies` | [`/v1/bluesky/profile/replies`](/docs/api-reference/bluesky/profile-replies) | 1 | | `bluesky_profile_starter_packs` | [`/v1/bluesky/profile/starter-packs`](/docs/api-reference/bluesky/profile-starter-packs) | 1 | | `bluesky_profile_videos` | [`/v1/bluesky/profile/videos`](/docs/api-reference/bluesky/profile-videos) | 1 | | `bluesky_search` | [`/v1/bluesky/search`](/docs/api-reference/bluesky/search) | 1 | | `bluesky_search_feeds` | [`/v1/bluesky/search/feeds`](/docs/api-reference/bluesky/search-feeds) | 1 | | `bluesky_search_starter_packs` | [`/v1/bluesky/search/starter-packs`](/docs/api-reference/bluesky/search-starter-packs) | 1 | | `bluesky_search_users` | [`/v1/bluesky/search/users`](/docs/api-reference/bluesky/search-users) | 1 | | `bluesky_starter_pack` | [`/v1/bluesky/starter-pack`](/docs/api-reference/bluesky/starter-pack) | 1 | | `bluesky_trending` | [`/v1/bluesky/trending`](/docs/api-reference/bluesky/trending) | 1 | | `bluesky_trending_topics` | [`/v1/bluesky/trending/topics`](/docs/api-reference/bluesky/trending-topics) | 1 | | `get_credits` | [`/v1/credits`](/docs/api-reference/account/credits) | 0 | | `douyin_hashtag` | [`/v1/douyin/hashtag`](/docs/api-reference/douyin/hashtag) | 1 | | `douyin_live` | [`/v1/douyin/live`](/docs/api-reference/douyin/live) | 1 | | `douyin_playlist_posts` | [`/v1/douyin/playlist/posts`](/docs/api-reference/douyin/playlist-posts) | 1 | | `douyin_post` | [`/v1/douyin/post`](/docs/api-reference/douyin/post) | 2 | | `douyin_post_comment_replies` | [`/v1/douyin/post/comment/replies`](/docs/api-reference/douyin/post-comment-replies) | 1 | | `douyin_post_comments` | [`/v1/douyin/post/comments`](/docs/api-reference/douyin/post-comments) | 1 | | `douyin_post_related` | [`/v1/douyin/post/related`](/docs/api-reference/douyin/post-related) | 1 | | `douyin_profile` | [`/v1/douyin/profile`](/docs/api-reference/douyin/profile) | 2 | | `douyin_profile_playlists` | [`/v1/douyin/profile/playlists`](/docs/api-reference/douyin/profile-playlists) | 1 | | `douyin_profile_posts` | [`/v1/douyin/profile/posts`](/docs/api-reference/douyin/profile-posts) | 2 | | `douyin_search_suggestions` | [`/v1/douyin/search/suggestions`](/docs/api-reference/douyin/search-suggestions) | 1 | | `douyin_sound` | [`/v1/douyin/sound`](/docs/api-reference/douyin/sound) | 1 | | `douyin_sound_posts` | [`/v1/douyin/sound/posts`](/docs/api-reference/douyin/sound-posts) | 1 | | `douyin_trending` | [`/v1/douyin/trending`](/docs/api-reference/douyin/trending) | 10 | | `douyin_trending_posts` | [`/v1/douyin/trending/posts`](/docs/api-reference/douyin/trending-posts) | 1 | | `facebook_event` | [`/v1/facebook/event`](/docs/api-reference/facebook/event) | 1 | | `facebook_events` | [`/v1/facebook/events`](/docs/api-reference/facebook/events) | 1 | | `facebook_events_search` | [`/v1/facebook/events/search`](/docs/api-reference/facebook/events-search) | 1 | | `facebook_marketplace_item` | [`/v1/facebook/marketplace/item`](/docs/api-reference/facebook/marketplace-item) | 1 | | `facebook_marketplace_search` | [`/v1/facebook/marketplace/search`](/docs/api-reference/facebook/marketplace-search) | 1 | | `facebook_post` | [`/v1/facebook/post`](/docs/api-reference/facebook/post) | 1 | | `facebook_post_comment_replies` | [`/v1/facebook/post/comment/replies`](/docs/api-reference/facebook/post-comment-replies) | 1 | | `facebook_post_comments` | [`/v1/facebook/post/comments`](/docs/api-reference/facebook/post-comments) | 1 | | `facebook_post_transcript` | [`/v1/facebook/post/transcript`](/docs/api-reference/facebook/post-transcript) | 10 | | `facebook_profile` | [`/v1/facebook/profile`](/docs/api-reference/facebook/profile) | 1 | | `facebook_profile_photos` | [`/v1/facebook/profile/photos`](/docs/api-reference/facebook/profile-photos) | 1 | | `facebook_profile_posts` | [`/v1/facebook/profile/posts`](/docs/api-reference/facebook/profile-posts) | 1 | | `facebook_profile_videos` | [`/v1/facebook/profile/videos`](/docs/api-reference/facebook/profile-videos) | 1 | | `instagram_highlight` | [`/v1/instagram/highlight`](/docs/api-reference/instagram/highlight) | 1 | | `instagram_location` | [`/v1/instagram/location`](/docs/api-reference/instagram/location) | 1 | | `instagram_location_posts` | [`/v1/instagram/location/posts`](/docs/api-reference/instagram/location-posts) | 5 | | `instagram_post` | [`/v1/instagram/post`](/docs/api-reference/instagram/post) | 1 | | `instagram_post_comments` | [`/v1/instagram/post/comments`](/docs/api-reference/instagram/post-comments) | 5 | | `instagram_profile` | [`/v1/instagram/profile`](/docs/api-reference/instagram/profile) | 1 | | `instagram_profile_highlights` | [`/v1/instagram/profile/highlights`](/docs/api-reference/instagram/profile-highlights) | 1 | | `instagram_profile_posts` | [`/v1/instagram/profile/posts`](/docs/api-reference/instagram/profile-posts) | 1 | | `instagram_profile_reels` | [`/v1/instagram/profile/reels`](/docs/api-reference/instagram/profile-reels) | 1 | | `instagram_profile_similar` | [`/v1/instagram/profile/similar`](/docs/api-reference/instagram/profile-similar) | 5 | | `instagram_search` | [`/v1/instagram/search`](/docs/api-reference/instagram/search) | 1 | | `instagram_sound` | [`/v1/instagram/sound`](/docs/api-reference/instagram/sound) | 1 | | `instagram_sound_posts` | [`/v1/instagram/sound/posts`](/docs/api-reference/instagram/sound-posts) | 1 | | `instagram_trending` | [`/v1/instagram/trending`](/docs/api-reference/instagram/trending) | 5 | | `instagram_trending_topics` | [`/v1/instagram/trending/topics`](/docs/api-reference/instagram/trending-topics) | 1 | | `kick_category` | [`/v1/kick/category`](/docs/api-reference/kick/category) | 1 | | `kick_category_clips` | [`/v1/kick/category/clips`](/docs/api-reference/kick/category-clips) | 1 | | `kick_category_lives` | [`/v1/kick/category/lives`](/docs/api-reference/kick/category-lives) | 1 | | `kick_live` | [`/v1/kick/live`](/docs/api-reference/kick/live) | 1 | | `kick_post` | [`/v1/kick/post`](/docs/api-reference/kick/post) | 1 | | `kick_post_comments` | [`/v1/kick/post/comments`](/docs/api-reference/kick/post-comments) | 1 | | `kick_post_transcript` | [`/v1/kick/post/transcript`](/docs/api-reference/kick/post-transcript) | 10 | | `kick_profile` | [`/v1/kick/profile`](/docs/api-reference/kick/profile) | 1 | | `kick_profile_clips` | [`/v1/kick/profile/clips`](/docs/api-reference/kick/profile-clips) | 1 | | `kick_profile_posts` | [`/v1/kick/profile/posts`](/docs/api-reference/kick/profile-posts) | 1 | | `kick_search_categories` | [`/v1/kick/search/categories`](/docs/api-reference/kick/search-categories) | 1 | | `kick_search_lives` | [`/v1/kick/search/lives`](/docs/api-reference/kick/search-lives) | 1 | | `kick_search_users` | [`/v1/kick/search/users`](/docs/api-reference/kick/search-users) | 1 | | `kick_trending` | [`/v1/kick/trending`](/docs/api-reference/kick/trending) | 1 | | `kick_trending_categories` | [`/v1/kick/trending/categories`](/docs/api-reference/kick/trending-categories) | 1 | | `kick_trending_clips` | [`/v1/kick/trending/clips`](/docs/api-reference/kick/trending-clips) | 1 | | `linkedin_ad` | [`/v1/linkedin/ad`](/docs/api-reference/linkedin/ad) | 1 | | `linkedin_ads_search` | [`/v1/linkedin/ads/search`](/docs/api-reference/linkedin/ads-search) | 1 | | `linkedin_article` | [`/v1/linkedin/article`](/docs/api-reference/linkedin/article) | 1 | | `linkedin_company` | [`/v1/linkedin/company`](/docs/api-reference/linkedin/company) | 1 | | `linkedin_company_jobs` | [`/v1/linkedin/company/jobs`](/docs/api-reference/linkedin/company-jobs) | 1 | | `linkedin_company_posts` | [`/v1/linkedin/company/posts`](/docs/api-reference/linkedin/company-posts) | 1 | | `linkedin_job` | [`/v1/linkedin/job`](/docs/api-reference/linkedin/job) | 1 | | `linkedin_post` | [`/v1/linkedin/post`](/docs/api-reference/linkedin/post) | 1 | | `linkedin_post_comments` | [`/v1/linkedin/post/comments`](/docs/api-reference/linkedin/post-comments) | 1 | | `linkedin_post_transcript` | [`/v1/linkedin/post/transcript`](/docs/api-reference/linkedin/post-transcript) | 10 | | `linkedin_profile` | [`/v1/linkedin/profile`](/docs/api-reference/linkedin/profile) | 1 | | `linkedin_profile_articles` | [`/v1/linkedin/profile/articles`](/docs/api-reference/linkedin/profile-articles) | 1 | | `linkedin_profile_posts` | [`/v1/linkedin/profile/posts`](/docs/api-reference/linkedin/profile-posts) | 1 | | `linkedin_search_companies` | [`/v1/linkedin/search/companies`](/docs/api-reference/linkedin/search-companies) | 1 | | `linkedin_search_jobs` | [`/v1/linkedin/search/jobs`](/docs/api-reference/linkedin/search-jobs) | 1 | | `linkedin_search_locations` | [`/v1/linkedin/search/locations`](/docs/api-reference/linkedin/search-locations) | 1 | | `linkedin_search_users` | [`/v1/linkedin/search/users`](/docs/api-reference/linkedin/search-users) | 1 | | `pinterest_board` | [`/v1/pinterest/board`](/docs/api-reference/pinterest/board) | 1 | | `pinterest_board_posts` | [`/v1/pinterest/board/posts`](/docs/api-reference/pinterest/board-posts) | 1 | | `pinterest_board_section_posts` | [`/v1/pinterest/board/section/posts`](/docs/api-reference/pinterest/board-section-posts) | 1 | | `pinterest_board_sections` | [`/v1/pinterest/board/sections`](/docs/api-reference/pinterest/board-sections) | 1 | | `pinterest_post` | [`/v1/pinterest/post`](/docs/api-reference/pinterest/post) | 1 | | `pinterest_post_comment_replies` | [`/v1/pinterest/post/comment/replies`](/docs/api-reference/pinterest/post-comment-replies) | 1 | | `pinterest_post_comments` | [`/v1/pinterest/post/comments`](/docs/api-reference/pinterest/post-comments) | 1 | | `pinterest_profile` | [`/v1/pinterest/profile`](/docs/api-reference/pinterest/profile) | 1 | | `pinterest_profile_boards` | [`/v1/pinterest/profile/boards`](/docs/api-reference/pinterest/profile-boards) | 1 | | `pinterest_profile_posts` | [`/v1/pinterest/profile/posts`](/docs/api-reference/pinterest/profile-posts) | 1 | | `pinterest_search` | [`/v1/pinterest/search`](/docs/api-reference/pinterest/search) | 1 | | `pinterest_search_boards` | [`/v1/pinterest/search/boards`](/docs/api-reference/pinterest/search-boards) | 1 | | `pinterest_search_suggestions` | [`/v1/pinterest/search/suggestions`](/docs/api-reference/pinterest/search-suggestions) | 1 | | `pinterest_search_users` | [`/v1/pinterest/search/users`](/docs/api-reference/pinterest/search-users) | 1 | | `pinterest_search_videos` | [`/v1/pinterest/search/videos`](/docs/api-reference/pinterest/search-videos) | 1 | | `pinterest_topic` | [`/v1/pinterest/topic`](/docs/api-reference/pinterest/topic) | 1 | | `pinterest_topic_posts` | [`/v1/pinterest/topic/posts`](/docs/api-reference/pinterest/topic-posts) | 1 | | `pinterest_trending` | [`/v1/pinterest/trending`](/docs/api-reference/pinterest/trending) | 10 | | `pinterest_url` | [`/v1/pinterest/url`](/docs/api-reference/pinterest/url) | 1 | | `reddit_post` | [`/v1/reddit/post`](/docs/api-reference/reddit/post) | 1 | | `reddit_post_comment_replies` | [`/v1/reddit/post/comment/replies`](/docs/api-reference/reddit/post-comment-replies) | 1 | | `reddit_post_comments` | [`/v1/reddit/post/comments`](/docs/api-reference/reddit/post-comments) | 5 | | `reddit_post_transcript` | [`/v1/reddit/post/transcript`](/docs/api-reference/reddit/post-transcript) | 10 | | `reddit_profile` | [`/v1/reddit/profile`](/docs/api-reference/reddit/profile) | 1 | | `reddit_profile_comments` | [`/v1/reddit/profile/comments`](/docs/api-reference/reddit/profile-comments) | 2 | | `reddit_profile_posts` | [`/v1/reddit/profile/posts`](/docs/api-reference/reddit/profile-posts) | 1 | | `reddit_search` | [`/v1/reddit/search`](/docs/api-reference/reddit/search) | 1 | | `reddit_search_comments` | [`/v1/reddit/search/comments`](/docs/api-reference/reddit/search-comments) | 1 | | `reddit_search_media` | [`/v1/reddit/search/media`](/docs/api-reference/reddit/search-media) | 1 | | `reddit_search_subreddits` | [`/v1/reddit/search/subreddits`](/docs/api-reference/reddit/search-subreddits) | 1 | | `reddit_search_users` | [`/v1/reddit/search/users`](/docs/api-reference/reddit/search-users) | 1 | | `reddit_subreddit` | [`/v1/reddit/subreddit`](/docs/api-reference/reddit/subreddit) | 1 | | `reddit_subreddit_posts` | [`/v1/reddit/subreddit/posts`](/docs/api-reference/reddit/subreddit-posts) | 1 | | `reddit_subreddit_search` | [`/v1/reddit/subreddit/search`](/docs/api-reference/reddit/subreddit-search) | 1 | | `reddit_trending` | [`/v1/reddit/trending`](/docs/api-reference/reddit/trending) | 1 | | `reddit_trending_searches` | [`/v1/reddit/trending/searches`](/docs/api-reference/reddit/trending-searches) | 1 | | `telegram_invite` | [`/v1/telegram/invite`](/docs/api-reference/telegram/invite) | 1 | | `telegram_post` | [`/v1/telegram/post`](/docs/api-reference/telegram/post) | 1 | | `telegram_post_comments` | [`/v1/telegram/post/comments`](/docs/api-reference/telegram/post-comments) | 1 | | `telegram_profile` | [`/v1/telegram/profile`](/docs/api-reference/telegram/profile) | 1 | | `telegram_profile_posts` | [`/v1/telegram/profile/posts`](/docs/api-reference/telegram/profile-posts) | 1 | | `telegram_profile_search` | [`/v1/telegram/profile/search`](/docs/api-reference/telegram/profile-search) | 1 | | `threads_post` | [`/v1/threads/post`](/docs/api-reference/threads/post) | 1 | | `threads_post_comments` | [`/v1/threads/post/comments`](/docs/api-reference/threads/post-comments) | 1 | | `threads_profile` | [`/v1/threads/profile`](/docs/api-reference/threads/profile) | 1 | | `threads_profile_media` | [`/v1/threads/profile/media`](/docs/api-reference/threads/profile-media) | 1 | | `threads_profile_posts` | [`/v1/threads/profile/posts`](/docs/api-reference/threads/profile-posts) | 1 | | `threads_profile_replies` | [`/v1/threads/profile/replies`](/docs/api-reference/threads/profile-replies) | 1 | | `threads_profile_reposts` | [`/v1/threads/profile/reposts`](/docs/api-reference/threads/profile-reposts) | 1 | | `threads_search` | [`/v1/threads/search`](/docs/api-reference/threads/search) | 1 | | `threads_search_users` | [`/v1/threads/search/users`](/docs/api-reference/threads/search-users) | 1 | | `threads_trending` | [`/v1/threads/trending`](/docs/api-reference/threads/trending) | 1 | | `tiktok_collection_posts` | [`/v1/tiktok/collection/posts`](/docs/api-reference/tiktok/collection-posts) | 1 | | `tiktok_hashtag` | [`/v1/tiktok/hashtag`](/docs/api-reference/tiktok/hashtag) | 1 | | `tiktok_hashtag_posts` | [`/v1/tiktok/hashtag/posts`](/docs/api-reference/tiktok/hashtag-posts) | 1 | | `tiktok_live` | [`/v1/tiktok/live`](/docs/api-reference/tiktok/live) | 1 | | `tiktok_playlist_posts` | [`/v1/tiktok/playlist/posts`](/docs/api-reference/tiktok/playlist-posts) | 1 | | `tiktok_post` | [`/v1/tiktok/post`](/docs/api-reference/tiktok/post) | 1 | | `tiktok_post_comment_replies` | [`/v1/tiktok/post/comment/replies`](/docs/api-reference/tiktok/post-comment-replies) | 1 | | `tiktok_post_comments` | [`/v1/tiktok/post/comments`](/docs/api-reference/tiktok/post-comments) | 1 | | `tiktok_post_related` | [`/v1/tiktok/post/related`](/docs/api-reference/tiktok/post-related) | 1 | | `tiktok_post_transcript` | [`/v1/tiktok/post/transcript`](/docs/api-reference/tiktok/post-transcript) | 10 | | `tiktok_profile` | [`/v1/tiktok/profile`](/docs/api-reference/tiktok/profile) | 1 | | `tiktok_profile_followers` | [`/v1/tiktok/profile/followers`](/docs/api-reference/tiktok/profile-followers) | 1 | | `tiktok_profile_following` | [`/v1/tiktok/profile/following`](/docs/api-reference/tiktok/profile-following) | 1 | | `tiktok_profile_liked` | [`/v1/tiktok/profile/liked`](/docs/api-reference/tiktok/profile-liked) | 1 | | `tiktok_profile_playlists` | [`/v1/tiktok/profile/playlists`](/docs/api-reference/tiktok/profile-playlists) | 1 | | `tiktok_profile_posts` | [`/v1/tiktok/profile/posts`](/docs/api-reference/tiktok/profile-posts) | 1 | | `tiktok_profile_reposts` | [`/v1/tiktok/profile/reposts`](/docs/api-reference/tiktok/profile-reposts) | 1 | | `tiktok_search` | [`/v1/tiktok/search`](/docs/api-reference/tiktok/search) | 1 | | `tiktok_search_users` | [`/v1/tiktok/search/users`](/docs/api-reference/tiktok/search-users) | 1 | | `tiktok_sound` | [`/v1/tiktok/sound`](/docs/api-reference/tiktok/sound) | 1 | | `tiktok_sound_posts` | [`/v1/tiktok/sound/posts`](/docs/api-reference/tiktok/sound-posts) | 1 | | `tiktok_trending` | [`/v1/tiktok/trending`](/docs/api-reference/tiktok/trending) | 5 | | `twitch_batch_live` | [`/v1/twitch/batch/live`](/docs/api-reference/twitch/batch-live) | 1 | | `twitch_batch_profiles` | [`/v1/twitch/batch/profiles`](/docs/api-reference/twitch/batch-profiles) | 1 | | `twitch_category` | [`/v1/twitch/category`](/docs/api-reference/twitch/category) | 1 | | `twitch_category_clips` | [`/v1/twitch/category/clips`](/docs/api-reference/twitch/category-clips) | 1 | | `twitch_category_lives` | [`/v1/twitch/category/lives`](/docs/api-reference/twitch/category-lives) | 1 | | `twitch_category_posts` | [`/v1/twitch/category/posts`](/docs/api-reference/twitch/category-posts) | 1 | | `twitch_live` | [`/v1/twitch/live`](/docs/api-reference/twitch/live) | 1 | | `twitch_post` | [`/v1/twitch/post`](/docs/api-reference/twitch/post) | 1 | | `twitch_post_comments` | [`/v1/twitch/post/comments`](/docs/api-reference/twitch/post-comments) | 1 | | `twitch_profile` | [`/v1/twitch/profile`](/docs/api-reference/twitch/profile) | 1 | | `twitch_profile_clips` | [`/v1/twitch/profile/clips`](/docs/api-reference/twitch/profile-clips) | 1 | | `twitch_profile_posts` | [`/v1/twitch/profile/posts`](/docs/api-reference/twitch/profile-posts) | 1 | | `twitch_profile_schedule` | [`/v1/twitch/profile/schedule`](/docs/api-reference/twitch/profile-schedule) | 1 | | `twitch_search` | [`/v1/twitch/search`](/docs/api-reference/twitch/search) | 1 | | `twitch_search_categories` | [`/v1/twitch/search/categories`](/docs/api-reference/twitch/search-categories) | 1 | | `twitch_search_lives` | [`/v1/twitch/search/lives`](/docs/api-reference/twitch/search-lives) | 1 | | `twitch_search_suggestions` | [`/v1/twitch/search/suggestions`](/docs/api-reference/twitch/search-suggestions) | 1 | | `twitch_search_users` | [`/v1/twitch/search/users`](/docs/api-reference/twitch/search-users) | 1 | | `twitch_trending` | [`/v1/twitch/trending`](/docs/api-reference/twitch/trending) | 1 | | `twitch_trending_categories` | [`/v1/twitch/trending/categories`](/docs/api-reference/twitch/trending-categories) | 1 | | `x_community` | [`/v1/x/community`](/docs/api-reference/x/community) | 1 | | `x_community_posts` | [`/v1/x/community/posts`](/docs/api-reference/x/community-posts) | 1 | | `x_live` | [`/v1/x/live`](/docs/api-reference/x/live) | 1 | | `x_post` | [`/v1/x/post`](/docs/api-reference/x/post) | 1 | | `x_post_comments` | [`/v1/x/post/comments`](/docs/api-reference/x/post-comments) | 1 | | `x_post_transcript` | [`/v1/x/post/transcript`](/docs/api-reference/x/post-transcript) | 10 | | `x_profile` | [`/v1/x/profile`](/docs/api-reference/x/profile) | 1 | | `x_profile_highlights` | [`/v1/x/profile/highlights`](/docs/api-reference/x/profile-highlights) | 1 | | `x_profile_posts` | [`/v1/x/profile/posts`](/docs/api-reference/x/profile-posts) | 1 | | `x_profile_similar` | [`/v1/x/profile/similar`](/docs/api-reference/x/profile-similar) | 1 | | `x_space` | [`/v1/x/space`](/docs/api-reference/x/space) | 1 | | `x_trending` | [`/v1/x/trending`](/docs/api-reference/x/trending) | 1 | | `x_trending_posts` | [`/v1/x/trending/posts`](/docs/api-reference/x/trending-posts) | 1 | | `youtube_batch_posts` | [`/v1/youtube/batch/posts`](/docs/api-reference/youtube/batch-posts) | 1 | | `youtube_batch_profiles` | [`/v1/youtube/batch/profiles`](/docs/api-reference/youtube/batch-profiles) | 1 | | `youtube_batch_transcripts` | [`/v1/youtube/batch/transcripts`](/docs/api-reference/youtube/batch-transcripts) | 5 | | `youtube_community` | [`/v1/youtube/community`](/docs/api-reference/youtube/community) | 1 | | `youtube_hashtag` | [`/v1/youtube/hashtag`](/docs/api-reference/youtube/hashtag) | 1 | | `youtube_hashtag_posts` | [`/v1/youtube/hashtag/posts`](/docs/api-reference/youtube/hashtag-posts) | 1 | | `youtube_playlist` | [`/v1/youtube/playlist`](/docs/api-reference/youtube/playlist) | 1 | | `youtube_playlist_posts` | [`/v1/youtube/playlist/posts`](/docs/api-reference/youtube/playlist-posts) | 1 | | `youtube_post` | [`/v1/youtube/post`](/docs/api-reference/youtube/post) | 1 | | `youtube_post_comment_replies` | [`/v1/youtube/post/comment/replies`](/docs/api-reference/youtube/post-comment-replies) | 1 | | `youtube_post_comments` | [`/v1/youtube/post/comments`](/docs/api-reference/youtube/post-comments) | 1 | | `youtube_post_related` | [`/v1/youtube/post/related`](/docs/api-reference/youtube/post-related) | 1 | | `youtube_post_transcript` | [`/v1/youtube/post/transcript`](/docs/api-reference/youtube/post-transcript) | 5 | | `youtube_profile` | [`/v1/youtube/profile`](/docs/api-reference/youtube/profile) | 1 | | `youtube_profile_community` | [`/v1/youtube/profile/community`](/docs/api-reference/youtube/profile-community) | 1 | | `youtube_profile_lives` | [`/v1/youtube/profile/lives`](/docs/api-reference/youtube/profile-lives) | 1 | | `youtube_profile_playlists` | [`/v1/youtube/profile/playlists`](/docs/api-reference/youtube/profile-playlists) | 1 | | `youtube_profile_podcasts` | [`/v1/youtube/profile/podcasts`](/docs/api-reference/youtube/profile-podcasts) | 1 | | `youtube_profile_posts` | [`/v1/youtube/profile/posts`](/docs/api-reference/youtube/profile-posts) | 1 | | `youtube_profile_search` | [`/v1/youtube/profile/search`](/docs/api-reference/youtube/profile-search) | 1 | | `youtube_profile_shorts` | [`/v1/youtube/profile/shorts`](/docs/api-reference/youtube/profile-shorts) | 1 | | `youtube_search` | [`/v1/youtube/search`](/docs/api-reference/youtube/search) | 1 | | `youtube_search_channels` | [`/v1/youtube/search/channels`](/docs/api-reference/youtube/search-channels) | 1 | | `youtube_search_playlists` | [`/v1/youtube/search/playlists`](/docs/api-reference/youtube/search-playlists) | 1 | | `youtube_search_suggestions` | [`/v1/youtube/search/suggestions`](/docs/api-reference/youtube/search-suggestions) | 1 | | `youtube_trending` | [`/v1/youtube/trending`](/docs/api-reference/youtube/trending) | 1 | ## Next Steps [#next-steps] - [Setup](/docs/mcp/setup): Add the server to Claude, Cursor and VS Code. - [API Reference](/docs/api-reference): Every endpoint, with a real request and answer. - [Errors](/docs/errors): The error envelope and every code. - [Credits](/docs/credits): Where costs are listed, and how to watch your balance. # Pagination (/docs/pagination) Lists come a page at a time. Each page says whether there is another, and where it starts. ## Page Fields [#page-fields] A page holds its items and says where the next one starts. | Field | Contains | | --- | --- | | `data` | The page's items | | `pagination.hasMore` | Whether there is a next page | | `pagination.nextCursor` | Where the next page starts | The first request takes no `cursor`. Pass each page's `nextCursor` as `cursor` to read the next one, until a page comes with `hasMore` set to `false` and `nextCursor` to `null`. ## Read Every Page [#read-every-page] This reads every post of an account, a page at a time. **TypeScript** ```ts import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); let cursor: string | undefined; do { const page = await client.tiktok.profilePosts({ handle: "nike", cursor }); for (const post of page.data) console.log(post.url, post.stats.views); cursor = page.pagination.hasMore ? (page.pagination.nextCursor ?? undefined) : undefined; } while (cursor); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) cursor = None while True: page = client.tiktok.profile_posts(handle="nike", cursor=cursor) for post in page.data: print(post.url, post.stats.views) if not page.pagination.has_more: break cursor = page.pagination.next_cursor ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/tiktok/profile/posts \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=nike" \ --data-urlencode "cursor=1792764276701" ``` ## Cost and Cache [#cost-and-cache] Each page is a call of its own. It costs [credits](/docs/credits) and is [cached](/docs/caching) like any other, so reading it again soon is free. ## Cursors [#cursors] A cursor belongs to its list and its parameters, so use it with the same parameters, and soon after you get it. Page sizes differ by platform, as [Compare Platforms](/docs/platforms) shows. # Quickstart (/docs/quickstart) When you finish this page, you have read a TikTok profile and a page of its posts. It takes an API key and three API calls, and the first one is free. ### Create an API Key [#create-an-api-key] Sign up at [app.socialapi.sh](https://app.socialapi.sh). Your workspace starts with 100 free credits and a key named "Default". Copy it from **Overview**, or create one under **API Keys**. It is shown only once. ```bash export SOCIALAPI_API_KEY="sapi_YOUR_KEY" ``` Every sample in these docs reads the key from `SOCIALAPI_API_KEY`. See [Authentication](/docs/authentication) for headers and limits. ### Install an SDK [#install-an-sdk] **TypeScript** ```bash npm install @socialapihq/sdk ``` **Python** ```bash pip install socialapihq ``` Prefer plain HTTP? Skip this step. Every sample has a cURL tab, and the base URL is `https://api.socialapi.sh`. ### Check Your Credits [#check-your-credits] Reading your balance with `GET /v1/credits` is free and shows that the key works. **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const answer = await client.account.getCredits(); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) answer = client.account.get_credits() ``` **cURL** ```bash curl https://api.socialapi.sh/v1/credits \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" ``` **Response** ```json { "balance": 319668 } ``` ### Read a Profile [#read-a-profile] **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.tiktok.profile({ handle: "nike" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.tiktok.profile(handle="nike").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/tiktok/profile \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=nike" ``` **Response** ```json { "data": { "id": "208464585232822272", "username": "nike", "displayName": "Nike", "bio": "Just Do It.", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-maliva-avt-0068/e0b0ac7b6ad6447a8e923fd1eb162f2c~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=c73b1f8a&x-expires=1795730400&x-signature=WFCAToitWtbkgo5qXRwrQmcX%2FZY%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=my", "url": "https://www.tiktok.com/@nike", "verified": true, "private": false, "followers": 9440793, "following": 94, "likes": 51312842, "posts": 1131, "externalUrl": "http://empli.fi/niketiktok", "createdAt": null, "ext": { "secUid": "MS4wLjABAAAA_3ndMt8d_tECTdpKgCxcx238tOnQZX-20wqN01aMui5zQ7hsqSdff-jC5qYC-Cl_", "friends": 47, "liked": 0, "category": "Sports, Fitness & Outdoors", "seller": false, "likesPublic": false, "roomId": null } } } ``` This costs 1 credit. The `X-Credits-Charged` and `X-Credits-Remaining` headers say so. The same request within 15 minutes is answered from the [cache](/docs/caching) for free. ### Read Its Posts [#read-its-posts] **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.tiktok.profilePosts({ handle: "nike" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.tiktok.profile_posts(handle="nike") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/tiktok/profile/posts \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=nike" ``` **Response** ```json { "data": [ { "id": "7711465226318728461", "url": "https://www.tiktok.com/@nike/video/7711465226318728461", "text": "Vroom vroom 🏎️💨 #Formula1 #LasVegasGP #NSW #Nike Feat. @Miku Martineau @lizzy greene @Nick @Caleb McLaughlin @Sabrina Ionescu @Brianna LaPaglia", "createdAt": "2026-11-23T20:24:10.000Z", "author": { "id": "208464585232822272", "username": "nike", "displayName": "Nike", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-maliva-avt-0068/e0b0ac7b6ad6447a8e923fd1eb162f2c~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=c73b1f8a&x-expires=1795730400&x-signature=WFCAToitWtbkgo5qXRwrQmcX%2FZY%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=my", "verified": true, "url": "https://www.tiktok.com/@nike" }, "stats": { "views": 18200, "likes": 309, "comments": 14, "shares": 5, "saves": 17, "engagementRate": 0.018 }, "media": [ { "kind": "video", "url": "https://v16-webapp-prime.tiktok.com/video/tos/alisg/tos-alisg-ve-37c799-sg/o0kDDPDSFCeIBoEwTRQMABOEM1SIESQfgrKdjE/?a=1988&bti=ODszNWYuMDE6&&bt=1397&ft=I~da4oJwD12Nvkkb3lIxR4bNLlBF-UjNSbopiX&mime_type=video_mp4&rc=ZzppN2U1OzY2PGVnN2c0Z0BpM3g3NnQ5cmxkZjMzZzczNEAtMC0tXjZeNmIxNmMyLi4tYSMzYmlnMmQ0Li9hLS1kMS9zcw%3D%3D&expire=1795731854&l=20261125062401F5D7C61FE8069925FC37&ply_type=2&policy=2&signature=f40036e4d779d55738cdeebc4d92928f&tk=tt_chain_token&btag=e000b0000", "thumbnailUrl": "https://p16-common-sign.tiktokcdn.com/tos-useast5-p-0068-tx/oMeIeALC2IGwPxAAHOAAe3IEWJQ6jbPHkAcUQE~tplv-tiktokx-origin.image?dr=14575&x-expires=1795730400&x-signature=fWhitTvuuSB%2FxWl2xEN2vB%2BBXsQ%3D&t=4d5b0474&ps=13740610&shp=81f88b70&shcp=43f4a2f9&idc=my", "width": 720, "height": 1280, "durationSeconds": 13 } ], "hashtags": [ "Formula1", "LasVegasGP", "NSW" ], "mentions": [ "Miku", "lizzy", "Nick" ], "ext": { "authorSecUid": "MS4wLjABAAAA_3ndMt8d_tECTdpKgCxcx238tOnQZX-20wqN01aMui5zQ7hsqSdff-jC5qYC-Cl_", "sound": { "id": "7711465298314021645", "title": "original sound", "artist": "Nike", "original": true }, "durationSeconds": 13, "reposts": null, "pinned": false, "ad": false, "playlistId": null, "region": null, "language": "nl", "screenText": [], "subtitles": [] } }, { "id": "7711414040114892045", "url": "https://www.tiktok.com/@nike/video/7711414040114892045", "text": "Mode push or box box? Nike family answering the big questions from Vegas. #Formula1 #LasVegasGP #NSW #Nike Feat. @Miku Martineau @lizzy greene @Nick @noah beck @Caleb McLaughlin @Sabrina Ionescu @Brianna LaPaglia", "createdAt": "2026-11-23T17:05:31.000Z", "author": { "id": "208464585232822272", "username": "nike", "displayName": "Nike", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-maliva-avt-0068/e0b0ac7b6ad6447a8e923fd1eb162f2c~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=c73b1f8a&x-expires=1795730400&x-signature=WFCAToitWtbkgo5qXRwrQmcX%2FZY%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=my", "verified": true, "url": "https://www.tiktok.com/@nike" }, "stats": { "views": 9265, "likes": 351, "comments": 13, "shares": 8, "saves": 20, "engagementRate": 0.0402 }, "media": [ { "kind": "video", "url": "https://v16-webapp-prime.tiktok.com/video/tos/alisg/tos-alisg-ve-37c799-sg/oQIPUULoFBxwE9yAiE4Q90acBEILZgKUHijAR/?a=1988&bti=ODszNWYuMDE6&&bt=1427&ft=I~da4oJwD12Nvkkb3lIxR4bNLlBF-UjNSbopiX&mime_type=video_mp4&rc=aGVnaGUzNzY1ZDM0NzU1M0Bpanc4OW45cjs6ZjMzZzczNEA2LzUwYWJjXzQxMDM1NDMvYSMyNmIyMmQ0MS9hLS1kMS9zcw%3D%3D&expire=1795731907&l=20261125062401F5D7C61FE8069925FC37&ply_type=2&policy=2&signature=8053e4971cbbbdafac72141b14d41c57&tk=tt_chain_token&btag=e00090000", "thumbnailUrl": "https://p16-common-sign.tiktokcdn.com/tos-useast5-p-0068-tx/okaWE1EB4PAEDiwgAIcARB6AaAEjylyhnikDI~tplv-tiktokx-origin.image?dr=14575&x-expires=1795730400&x-signature=ysNydei3newlYGkacpZQIzqSmV8%3D&t=4d5b0474&ps=13740610&shp=81f88b70&shcp=43f4a2f9&idc=my", "width": 720, "height": 1280, "durationSeconds": 66 } ], "hashtags": [ "Formula1", "LasVegasGP", "NSW" ], "mentions": [ "Miku", "lizzy", "Nick" ], "ext": { "authorSecUid": "MS4wLjABAAAA_3ndMt8d_tECTdpKgCxcx238tOnQZX-20wqN01aMui5zQ7hsqSdff-jC5qYC-Cl_", "sound": { "id": "7711414149750459167", "title": "original sound", "artist": "Nike", "original": true }, "durationSeconds": 66, "reposts": null, "pinned": false, "ad": false, "playlistId": null, "region": null, "language": "en", "screenText": [], "subtitles": [ { "language": "eng-US", "format": "webvtt", "source": "ASR" } ] } } ], "pagination": { "nextCursor": "1792764276701", "hasMore": true } } ``` You get a page of posts in `data`, newest first. While `pagination.hasMore` is `true`, pass `pagination.nextCursor` as `cursor` to read the next page. See [Pagination](/docs/pagination). ## If It Fails [#if-it-fails] A first call that fails usually fails for one of these reasons. | What you see | Cause | Fix | | --- | --- | --- | | `401 UNAUTHENTICATED` | The key is missing, revoked or expired | Send the full key | | `400 INVALID_REQUEST` | A parameter is missing or wrong, named in `param` | Fix it | | `404 NOT_FOUND` | No account has this handle | Check the handle | | `403 PRIVATE` | The account or the list is private | Nothing to read | | `402 INSUFFICIENT_CREDITS` | The balance is too low | Buy credits on the **Credits** page | | `502 UPSTREAM_UNAVAILABLE` | The platform did not answer | Try again shortly | None of these costs credits. Send support the `X-Request-Id`. All codes are in [Errors](/docs/errors). ## Next Steps [#next-steps] - [Compare Platforms](/docs/platforms): What each platform offers and where its lists end. - [API Reference](/docs/api-reference): Every endpoint, with a real request and answer. - [Pagination](/docs/pagination): Read a list a page at a time. - [SDKs](/docs/sdks): Typed clients for TypeScript and Python. # Rate Limits (/docs/rate-limits) Two limits keep the API fast for everyone. Neither costs anything when you reach it. ## Limits [#limits] A workspace has a limit a minute, and each of its keys a limit at once. | Limit | Applies to | | --- | --- | | 600 requests a minute | Each workspace | | 50 requests at once | Each API key | The minute slides, and counts every key of the workspace together. Reading your balance does not count. If you need more, write to [support@socialapi.sh](mailto:support@socialapi.sh). ## Read Your Limit [#read-your-limit] Every answer says how much of the minute's limit is left. | Header | Contains | | --- | --- | | `X-RateLimit-Limit` | Requests allowed a minute | | `X-RateLimit-Remaining` | Requests left this minute | | `X-RateLimit-Reset` | When the next one frees up | The reset is a Unix time, in seconds. ## Handle 429 Responses [#handle-429-responses] A request past either limit returns `429 RATE_LIMITED`, with a `Retry-After` in seconds. ```http HTTP/1.1 429 Too Many Requests Retry-After: 7 ``` Wait that long, then send it again. To repeat a request that may already have run without paying twice, send it with an [Idempotency-Key](/docs/idempotency). # Responses (/docs/responses) Every platform answers in the same shape, with the same field names. ## Shape [#shape] An answer is one item, a list, or an error. | Answer | Body | | --- | --- | | One item | `{ "data": … }` | | A list | `{ "data": [...], "pagination": … }` | | An error | `{ "error", "code", "param" }` | ```json { "data": [{ "id": "7711465226318728461" }, { "id": "7711414040114892045" }], "pagination": { "nextCursor": "1792764276701", "hasMore": true } } ``` See [Pagination](/docs/pagination) and [Errors](/docs/errors). ## Shared Types [#shared-types] A few types cover what the platforms return. | Type | What it is | | --- | --- | | `Profile` | An account | | `Post` | A post, reel, video or thread | | `Comment` | A comment or a reply | | `Transcript` | A video's captions | | `Hashtag`, `Sound` | A tag or a sound, and its posts | Each type has the same fields on every platform, and what only one platform has sits under `ext`. Every field is typed in the [API Reference](/docs/api-reference). ```json { "data": { "id": "63055343223", "username": "zuck", "displayName": "Mark Zuckerberg", "bio": "Mostly superintelligence and MMA takes", "avatarUrl": "https://scontent-nrt6-1.cdninstagram.com/v/t51.82787-19/825322135_17989325280103224_1252773933700107438_n.jpg?stp=dst-jpg_s640x640_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby4xMDgwLmMyIn0&_nc_ht=scontent-nrt6-1.cdninstagram.com&_nc_cat=100&_nc_oc=Q6cZ2gEbJAaY4VAfsA-SdUiOuyyefB_PaDbIjArtHdBA5E9_oz8s23mkKO8K36do2sY94fk&_nc_ohc=TcNBs21yW1gQ7kNvwHHOsMz&_nc_gid=3utomVOdhJVr5GxFQLdxgQ&edm=AAZTMJEBAAAA&ccb=7-5&_nc_ct=RQAsPBUCFQIAAAA&oh=00_AQQ7XHzV0_X-JdqIiVqvgiHTaON1Otu3q1X6WoaBBg9WbA&oe=6B0BE5EB&_nc_sid=49cb7f", "url": "https://www.threads.com/@zuck", "verified": true, "private": false, "followers": 5783862, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": null, "ext": { "bioLinks": [], "interests": [ "AI Threads", "UFC Threads", "AI" ] } } } ``` ### Profile [#profile] | Field | Contains | | --- | --- | | `id`, `url` | The account's id and link | | `username`, `displayName` | Its handle and name | | `bio`, `externalUrl` | Its bio and website | | `avatarUrl` | Its picture | | `verified`, `private` | Its badge, and whether it is private | | `followers`, `following` | Its follower counts | | `likes`, `posts` | Likes received and posts made | | `createdAt` | When it was made | ### Post [#post] | Field | Contains | | --- | --- | | `id`, `url` | The post's id and link | | `text`, `createdAt` | Its caption, and when it was posted | | `author` | Who posted it | | `stats` | Its counts and engagement rate | | `media` | Its videos and pictures | | `hashtags`, `mentions` | The tags and accounts in its text | The engagement rate is likes, comments and shares over views, to four places. ### Comment [#comment] | Field | Contains | | --- | --- | | `id`, `postId` | The comment's id, and its post | | `parentId` | The comment it answers, for a reply | | `text`, `createdAt` | What it says, and when | | `author` | Who wrote it | | `likes`, `replies` | Its likes and reply count | ### Transcript [#transcript] | Field | Contains | | --- | --- | | `text` | Every line, one after another | | `cues` | Each line with its start and end | | `language` | The captions' language | | `source` | Generated, or written by the author | | `translated` | Whether it is a translation | ## Formats [#formats] Values are written the same way on every platform. | Data | Format | | --- | --- | | Field names | camelCase | | Ids | Strings | | Times | RFC 3339 in UTC | | Counts | Whole numbers | | Rates | Fractions, such as `0.0181` | | Media links | Expire within hours | A count a platform does not have is `null`, never `0`. Ids are strings because some do not fit a JavaScript number. Media links expire, so download the media you keep. ## Headers [#headers] Every answer also carries these headers. | Header | Contains | | --- | --- | | `X-Request-Id` | The request's id | | `X-Credits-Charged` | What the call cost | | `X-Credits-Remaining` | The balance after it | | `X-Cache` | `HIT` or `MISS` | | `X-Cache-Age` | A cached answer's age, in seconds | | `X-RateLimit-Remaining` | Requests left this minute | See [Caching](/docs/caching) and [Rate Limits](/docs/rate-limits) for the rest. # SDKs (/docs/sdks) The official SDKs cover every endpoint in the [API Reference](/docs/api-reference), with typed parameters and answers. Both are generated from the [OpenAPI spec](https://api.socialapi.sh/openapi.json) and released with every change to the API. | Language | Package | Runs On | Types | | --- | :---: | :---: | :---: | | TypeScript | [`@socialapihq/sdk`](https://www.npmjs.com/package/@socialapihq/sdk) | Node.js 18+, Bun, Deno | Yes | | Python | [`socialapihq`](https://pypi.org/project/socialapihq/) | Python 3.10+ | Yes | The TypeScript SDK has no dependencies and uses the runtime's `fetch`. The Python SDK is synchronous, with Pydantic models. If you prefer plain HTTP, every example in these docs also has a cURL tab, and [Authentication](/docs/authentication) shows how to send your key. ## Install [#install] **TypeScript** ```bash npm install @socialapihq/sdk ``` **Python** ```bash pip install socialapihq ``` ## First Call [#first-call] Create a client with your API key. Without one, it reads the `SOCIALAPI_API_KEY` environment variable. **TypeScript** ```ts title="profile.ts" import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data: profile } = await client.instagram.profile({ handle: "natgeo" }); console.log(profile.displayName, profile.followers); ``` **Python** ```python title="profile.py" import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) profile = client.instagram.profile(handle="natgeo").data print(profile.display_name, profile.followers) ``` To check your key for free, call `client.account.getCredits()` in TypeScript or `client.account.get_credits()` in Python. It answers your balance and costs nothing. ## Naming [#naming] Each platform is a property of the client. Each endpoint is a method named after its path. | In the API | TypeScript | Python | | --- | --- | --- | | `/v1/tiktok/…` | `client.tiktok` | `client.tiktok` | | `GET /v1/tiktok/post/comment/replies` | `postCommentReplies()` | `post_comment_replies()` | | `GET /v1/credits` | `account.getCredits()` | `account.get_credits()` | | Parameter `secUid` | `{ secUid }` | `sec_uid=` | | Field `displayName` | `displayName` | `display_name` | TypeScript methods take one object of the endpoint's parameters, and Python methods take keyword arguments in snake case. Every platform method also takes `maxAge` (`max_age` in Python), the oldest [cached](/docs/caching) answer you accept. ## Answers [#answers] A method returns the answer's body, typed: `{ data }` for one item, `{ data, pagination }` for a list. The fields are the ones in [Responses](/docs/responses). | Detail | TypeScript | Python | | --- | :---: | :---: | | Answer | Typed object | Pydantic model | | Times | `Date` | `datetime` | | Counts not shown | `null` | `None` | | As plain JSON | The object itself | `.model_dump(by_alias=True)` | A count the platform does not show is null, never 0, and what only one platform has is under `ext`, typed per platform. ## Pagination [#pagination] A list answers one page. Send `pagination.nextCursor` back as `cursor` for the next one, until there is none. Each page is a call of its own, charged like any other. **TypeScript** ```ts let cursor: string | undefined; do { const page = await client.tiktok.profilePosts({ handle: "tiktok", cursor }); for (const post of page.data) { console.log(post.id, post.stats.views); } cursor = page.pagination.nextCursor ?? undefined; } while (cursor); ``` **Python** ```python cursor = None while True: page = client.tiktok.profile_posts(handle="tiktok", cursor=cursor) for post in page.data: print(post.id, post.stats.views) cursor = page.pagination.next_cursor if not cursor: break ``` See [Pagination](/docs/pagination) for page sizes and limits. ## Options [#options] Both clients work with no options, and take a few when you need them. | Option | TypeScript | Python | Default | | --- | --- | --- | --- | | API key | `apiKey` | `api_key` | `SOCIALAPI_API_KEY` | | Base URL | `baseUrl` | `base_url` | `https://api.socialapi.sh` | | Timeout | `signal` on a call | `timeout` in seconds | None | | Custom `fetch` | `fetch` | No | Global `fetch` | | Extra headers | `headers` | No | None | In TypeScript, a method's second argument goes to `fetch`, so `{ signal: AbortSignal.timeout(10_000) }` stops a call after 10 seconds. In Python, the client keeps its connections open. Use it as a context manager (`with SocialAPI() as client:`), or call `client.close()` when you are done. ## Errors [#errors] A refused call raises a `SocialAPIError`. Refused calls cost nothing. | Field | TypeScript | Python | | --- | --- | --- | | HTTP status | `status` | `status` | | Stable code | `code` | `code` | | Message | `message` | `message` | | Parameter at fault | `param` | `param` | | Request id | `requestId` | `request_id` | | Seconds to wait | `retryAfter` | `retry_after` | Branch on `code`, never on the message, and see [Errors](/docs/errors) for every code. A network failure has status 0 and code `NETWORK_ERROR`. When you write to support, quote the request id. **TypeScript** ```ts import { SocialAPIError } from "@socialapihq/sdk"; try { await client.tiktok.profile({ handle: "no-such-account" }); } catch (error) { if (error instanceof SocialAPIError && error.code === "NOT_FOUND") { // No such account. } else { throw error; } } ``` **Python** ```python from socialapihq import SocialAPIError try: client.tiktok.profile(handle="no-such-account") except SocialAPIError as error: if error.code != "NOT_FOUND": raise # No such account. ``` ## Versions [#versions] A new version is released whenever the API changes, so a new endpoint is a new method as soon as it ships. The code is on GitHub, in [socialapihq/socialapi-node](https://github.com/socialapihq/socialapi-node) for TypeScript and [socialapihq/socialapi-python](https://github.com/socialapihq/socialapi-python) for Python. ## Next Steps [#next-steps] - [Quickstart](/docs/quickstart): Your API key, a free first call and a page of posts. - [Errors](/docs/errors): The error envelope and every code. - [Pagination](/docs/pagination): Read a list a page at a time. - [API Reference](/docs/api-reference): Every endpoint, with a real request and answer. # Bluesky (/docs/bluesky) Read accounts with their posts, their followers and what they made, a post with its replies, likes, reposts and quotes, feeds, lists and starter packs, and what Bluesky shows by search, hashtag and trend. ## Quick Reference [#quick-reference] | Property | Value | | --- | --- | | Endpoints | 30 | | Accounts by | `handle` or `url` | | Posts by | `url` or `id` | | Feeds and lists by | `url` or `id` | | Posts a page | 50 | | Accounts a page | 100 | | Transcripts | No | | Counts | Likes, replies, reposts, quotes, bookmarks | ## Accounts [#accounts] | Endpoint | Returns | Credits | | --- | --- | :---: | | [`/v1/bluesky/profile`](/docs/api-reference/bluesky/profile) | An account with its follower and post counts. | 1 | | [`/v1/bluesky/profile/feeds`](/docs/api-reference/bluesky/profile-feeds) | The feeds an account made, 50 a page. | 1 | | [`/v1/bluesky/profile/followers`](/docs/api-reference/bluesky/profile-followers) | The accounts following an account, 100 a page. | 1 | | [`/v1/bluesky/profile/following`](/docs/api-reference/bluesky/profile-following) | The accounts an account follows, 100 a page. | 1 | | [`/v1/bluesky/profile/lists`](/docs/api-reference/bluesky/profile-lists) | The lists an account made, 50 a page. | 1 | | [`/v1/bluesky/profile/media`](/docs/api-reference/bluesky/profile-media) | An account's posts with images or video. | 1 | | [`/v1/bluesky/profile/posts`](/docs/api-reference/bluesky/profile-posts) | An account's posts and reposts, newest first. | 1 | | [`/v1/bluesky/profile/replies`](/docs/api-reference/bluesky/profile-replies) | An account's posts with its replies, newest first. | 1 | | [`/v1/bluesky/profile/starter-packs`](/docs/api-reference/bluesky/profile-starter-packs) | The starter packs an account made, 50 a page. | 1 | | [`/v1/bluesky/profile/videos`](/docs/api-reference/bluesky/profile-videos) | An account's posts with video. | 1 | ### Read a Profile [#read-a-profile] **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.bluesky.profile({ handle: "bsky.app" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.bluesky.profile(handle="bsky.app").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/bluesky/profile \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=bsky.app" ``` **Response** ```json { "data": { "id": "did:plc:z72i7hdynmk6r22z27h6tvur", "username": "bsky.app", "displayName": "Bluesky", "bio": "official Bluesky account (check username👆)\n\nBugs, feature requests, feedback: support@bsky.app", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreihwihm6kpd6zuwhhlro75p5qks5qtrcu55jp3gddbfjsieiv7wuka", "url": "https://bsky.app/profile/bsky.app", "verified": false, "private": false, "followers": 35847780, "following": 44, "likes": null, "posts": 928, "externalUrl": null, "createdAt": "2023-04-12T04:53:57.057Z", "ext": { "bannerUrl": "https://cdn.bsky.app/img/banner/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreichzyovokfzmymz36p5jibbjrhsur6n7hjnzxrpbt5jaydp2szvna", "pronouns": null, "pinnedPost": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3l6oveex3ii2l", "lists": 26, "feeds": 7, "starterPacks": 23, "trustedVerifier": true, "labeler": false, "liveUrl": null, "labels": [], "indexedAt": "2026-11-04T15:41:10.973Z" } } } ``` - An account's `id` is its DID, and `username` its handle. A `handle` can be either. - A profile has its follower, following and post counts. - Its `ext` has its banner, its pinned post, its labels, and how many lists, feeds and starter packs it made. ### Account Lists [#account-lists] - Posts are the account's posts and reposts. A repost has `ext.repost`, with who reposted it and when. - Replies add its replies, each with `ext.replyTo`. Media and videos keep the posts with them. - Followers and following give accounts with their name, bio and picture, without counts. - Lists, feeds and starter packs are what the account made for others. ## Posts [#posts] | Endpoint | Returns | Credits | | --- | --- | :---: | | [`/v1/bluesky/post`](/docs/api-reference/bluesky/post) | One post with its likes, replies, reposts and quotes. | 1 | | [`/v1/bluesky/post/comments`](/docs/api-reference/bluesky/post-comments) | A post's replies, and the replies to them. | 1 | | [`/v1/bluesky/post/likes`](/docs/api-reference/bluesky/post-likes) | The accounts that liked a post, 100 a page. | 1 | | [`/v1/bluesky/post/quotes`](/docs/api-reference/bluesky/post-quotes) | The posts quoting a post, 50 a page. | 1 | | [`/v1/bluesky/post/reposts`](/docs/api-reference/bluesky/post-reposts) | The accounts that reposted a post, 100 a page. | 1 | ### Post Fields [#post-fields] - A post's `id` is its AT-URI, which every endpoint takes as `id`. - The `stats` have likes, comments (its replies), shares (its reposts) and saves (its bookmarks). - Its `ext.quotes` is the posts quoting it. - Its `media` is its images or its video. A link's card is `ext.link`, and a quoted post `ext.quoted`. - Its `ext.labels` are the labels on it, and `ext.langs` its languages. ### Replies [#replies] A post's comments are its replies and the replies to them, on one page. They take `sort`: `top` (the default), `newest` or `oldest`. A reply is a post too: read further down a thread with the reply's `id`. ### Likes, Reposts and Quotes [#likes-reposts-and-quotes] - Likes give each account with when it liked. - Reposts give the accounts that reposted, and quotes the posts quoting it. ## Feeds and Lists [#feeds-and-lists] | Endpoint | Returns | Credits | | --- | --- | :---: | | [`/v1/bluesky/feed`](/docs/api-reference/bluesky/feed) | A feed with its description and likes. | 1 | | [`/v1/bluesky/feed/posts`](/docs/api-reference/bluesky/feed-posts) | A feed's posts, 50 a page. | 1 | | [`/v1/bluesky/list`](/docs/api-reference/bluesky/list) | A list with its purpose and member count. | 1 | | [`/v1/bluesky/list/members`](/docs/api-reference/bluesky/list-members) | A list's accounts, 100 a page. | 1 | | [`/v1/bluesky/list/posts`](/docs/api-reference/bluesky/list-posts) | The posts of a list's accounts, 50 a page. | 1 | | [`/v1/bluesky/starter-pack`](/docs/api-reference/bluesky/starter-pack) | A starter pack with its accounts' list and feeds. | 1 | - A feed is a custom feed anyone can read, with its likes and who made it. - A list is a set of accounts, with its members and their posts. - A starter pack has a `listId`, which `list/members` reads its accounts by. ## Discovery [#discovery] | Endpoint | Returns | Credits | | --- | --- | :---: | | [`/v1/bluesky/hashtag/posts`](/docs/api-reference/bluesky/hashtag-posts) | A hashtag's posts, 50 a page. | 1 | | [`/v1/bluesky/search`](/docs/api-reference/bluesky/search) | Posts matching a query, 50 a page. | 1 | | [`/v1/bluesky/search/feeds`](/docs/api-reference/bluesky/search-feeds) | Feeds matching a query, the most liked first. | 1 | | [`/v1/bluesky/search/starter-packs`](/docs/api-reference/bluesky/search-starter-packs) | Starter packs matching a query, 50 a page. | 1 | | [`/v1/bluesky/search/users`](/docs/api-reference/bluesky/search-users) | Accounts matching a query, 100 a page. | 1 | | [`/v1/bluesky/trending`](/docs/api-reference/bluesky/trending) | The posts of Bluesky's Discover feed, 50 a page. | 1 | | [`/v1/bluesky/trending/topics`](/docs/api-reference/bluesky/trending-topics) | The topics trending now, up to 25. | 1 | - Search takes `sort`: `top` (one page) or `latest` (newest first, paged). - Search narrows by `since`, `until`, `language`, `author`, `mentions`, `domain`, `link` and `tag`. - Accounts, feeds and starter packs are searched by their own endpoints. - A hashtag's posts take `sort` the same way. - Trending is Bluesky's Discover feed. Trending topics are the topics of the hour, each with its post count and its feed. ## Batch [#batch] | Endpoint | Returns | Credits | | --- | --- | :---: | | [`/v1/bluesky/batch/posts`](/docs/api-reference/bluesky/batch-posts) | Up to 25 posts at once, by their ids or links. | 1 | | [`/v1/bluesky/batch/profiles`](/docs/api-reference/bluesky/batch-profiles) | Up to 25 accounts at once, by handle or DID. | 1 | - Batch profiles and batch posts read up to 25 items at once. - Each item is read as its own endpoint answers it, and one served from the cache is free. - An item not found is left out of the answer, and costs nothing. # Douyin (/docs/douyin) Read accounts with their latest posts and series, a post with its comments, replies and posts like it, hashtags and sounds, the hot search list, what Douyin recommends and live rooms. ## Quick Reference [#quick-reference] | Property | Value | | --- | --- | | Endpoints | 15 | | Accounts by | `secUid` or `url` | | Posts by | `url` or `id` | | Share links | `v.douyin.com/…`, wherever a `url` is taken | | An account's posts | Its latest, about 10 | | Comments a page | 20 | | Replies | The first 50 | | Transcripts | No | | Counts | Likes, comments, shares and saves; no plays | ## Accounts [#accounts] | Endpoint | Returns | Credits | | --- | --- | :---: | | [`/v1/douyin/profile`](/docs/api-reference/douyin/profile) | An account with its followers, likes and post count. | 2 | | [`/v1/douyin/profile/playlists`](/docs/api-reference/douyin/profile-playlists) | An account's series (合集). | 1 | | [`/v1/douyin/profile/posts`](/docs/api-reference/douyin/profile-posts) | An account's latest posts, about 10. | 2 | | [`/v1/douyin/live`](/docs/api-reference/douyin/live) | A live room, on air or not. | 1 | ### Read an Account [#read-an-account] **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.douyin.profile({ secUid: "MS4wLjABAAAA8U_l6rBzmy7bcy6xOJel4v0RzoR_wfAubGPeJimN__4" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.douyin.profile(sec_uid="MS4wLjABAAAA8U_l6rBzmy7bcy6xOJel4v0RzoR_wfAubGPeJimN__4").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/douyin/profile \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "secUid=MS4wLjABAAAA8U_l6rBzmy7bcy6xOJel4v0RzoR_wfAubGPeJimN__4" ``` **Response** ```json { "data": { "id": "104255897823", "username": "rmrbxmt", "displayName": "人民日报", "bio": "参与、沟通、记录时代。", "avatarUrl": "https://p3-pc.douyinpic.com/aweme/1080x1080/aweme-avatar/tos-cn-avt-0015_21b4383e542b8991bcd33d33eeda7d8d.jpeg?from=2956013662", "url": "https://www.douyin.com/user/MS4wLjABAAAA8U_l6rBzmy7bcy6xOJel4v0RzoR_wfAubGPeJimN__4", "verified": true, "private": false, "followers": 203912912, "following": 35, "likes": 19445869999, "posts": 12986, "externalUrl": null, "createdAt": null, "ext": { "secUid": "MS4wLjABAAAA8U_l6rBzmy7bcy6xOJel4v0RzoR_wfAubGPeJimN__4", "shortId": null, "verification": "人民日报官方账号", "ipLocation": null, "live": false, "series": 0, "coverUrl": "https://p3-pc-sign.douyinpic.com/obj/douyin-user-image-file/a0fed342d45f11ee57830326fa8bb1b1?lk3s=93de098e&x-expires=1795971600&x-signature=BQcW6nFUv7nzrCmTA6wyIHE29%2BM%3D&from=2480802190" } } } ``` - An account's `followers`, `following`, `likes` and `posts` are exact. - Its `username` is its Douyin id (抖音号) where it chose one, else its short number; `ext.secUid` is what its link names. - Its `ext` also has Douyin's verification, where Douyin shows it posting from and whether it is live. ### Posts and Series [#posts-and-series] - An account's posts are its latest, about 10, with the ones it pinned (`ext.pinned`): the one page Douyin shows a visitor. They cost 2 credits each. - Series (合集) are an account's collections; a series' posts page to its last episode, 10 at a time. ### Live Rooms [#live-rooms] - A room is read by its link (`live.douyin.com/`) or that number. - On air, it has its title, viewers, likes and its stream's playlist, which expires. - Off air, `live` is `false`. A room is kept for a minute. ## Posts [#posts] | Endpoint | Returns | Credits | | --- | --- | :---: | | [`/v1/douyin/playlist/posts`](/docs/api-reference/douyin/playlist-posts) | A series' posts, in order, 10 a page. | 1 | | [`/v1/douyin/post`](/docs/api-reference/douyin/post) | One post with its likes, comments, shares and saves. | 2 | | [`/v1/douyin/post/comments`](/docs/api-reference/douyin/post-comments) | A post's comments, 20 a page. | 1 | | [`/v1/douyin/post/comment/replies`](/docs/api-reference/douyin/post-comment-replies) | A comment's replies, up to 50. | 1 | | [`/v1/douyin/post/related`](/docs/api-reference/douyin/post-related) | Posts like a post, 10. | 1 | ### Post Fields [#post-fields] - The `stats` have likes, comments, shares and saves. Douyin shows no play counts, so `views` is `null`. - A post's `ext.kind` is `video` or `images` (a photo set, whose pictures are its `media`). - A video's `media` has its cover, size and length; its file is signed for the address that asked, so no link is given. - Its `ext` has its title, its sound, its series and Douyin's categories for it. ### Comments and Replies [#comments-and-replies] Comments come 20 a page, each with its author, likes, reply count and where it was written from (`ext.ipLabel`), at 1 credit a comment. Replies are read by the comment's `id` as `commentId`: the first 50, which is what Douyin shows a visitor, each naming its comment as `parentId` and the reply it answers as `ext.replyTo`, at 1 credit a reply. ## Discovery [#discovery] | Endpoint | Returns | Credits | | --- | --- | :---: | | [`/v1/douyin/hashtag`](/docs/api-reference/douyin/hashtag) | A hashtag with its views. | 1 | | [`/v1/douyin/search/suggestions`](/docs/api-reference/douyin/search-suggestions) | What Douyin's search box suggests for a query. | 1 | | [`/v1/douyin/sound`](/docs/api-reference/douyin/sound) | A sound with the number of posts using it. | 1 | | [`/v1/douyin/sound/posts`](/docs/api-reference/douyin/sound-posts) | Posts using a sound. | 1 | | [`/v1/douyin/trending`](/docs/api-reference/douyin/trending) | Douyin's hot search list, about 50. | 10 | | [`/v1/douyin/trending/posts`](/docs/api-reference/douyin/trending-posts) | Recommended posts, 10, or a category's. | 1 | - Trending is Douyin's hot search list (抖音热榜), about 50 searches with their rank, heat and page; `board` picks `hot`, `entertainment`, `society` or `challenge` (hashtags). It costs 10 credits. - Trending posts are what Douyin recommends now, 10 at a time, from its home page or a `category`: `food`, `games`, `anime`, `sports`, `music`, `knowledge`, `film`, `cars` or `pets`. - A hashtag has its views; a sound the number of posts using it, and its posts. - Search suggestions are what Douyin's search box offers for a query. # Facebook (/docs/facebook) Read Pages and public people with their posts, photos and videos, posts with their comments and captions, and Marketplace listings and events. ## Quick Reference [#quick-reference] | Property | Value | | --- | --- | | Endpoints | 13 | | Accounts by | `handle` or `url` | | Posts by | `url` | | Posts a page | 3 | | Comments a page | 10, with replies | | Transcripts | 10 credits | | Counts | Rounded, such as "28M" | ## Pages and People [#pages-and-people] | Endpoint | Returns | Credits | | --- | --- | :---: | | [`/v1/facebook/profile`](/docs/api-reference/facebook/profile) | A Page or a public person, with its follower count. | 1 | | [`/v1/facebook/profile/photos`](/docs/api-reference/facebook/profile-photos) | A Page's or person's photos, 8 a page. | 1 | | [`/v1/facebook/profile/posts`](/docs/api-reference/facebook/profile-posts) | A Page's or person's posts, newest first, 3 a page. | 1 | | [`/v1/facebook/profile/videos`](/docs/api-reference/facebook/profile-videos) | A Page's videos with their plays, about 6 a page. | 1 | ### Read a Profile [#read-a-profile] **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.facebook.profile({ handle: "NASA" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.facebook.profile(handle="NASA").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/facebook/profile \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=NASA" ``` **Response** ```json { "data": { "id": "100044561550831", "username": "NASA", "displayName": "NASA - National Aeronautics and Space Administration", "bio": null, "avatarUrl": "https://scontent-ham3-1.xx.fbcdn.net/v/t39.30808-1/243095782_416661036495945_3843362260429099279_n.png?stp=dst-png&cstp=mx800x800&ctp=s200x200&_nc_cat=1&ccb=1-7&_nc_sid=2d3e12&_nc_ohc=9L3SyA6O4hMQ7kNvwFFAvxF&_nc_oc=AdpybpYhMw8jWVtu_JxDWUdMtLI5Czq9TSbYuo76Tt_Ox7pjEOtGt-zaWMbXtwrefdE&_nc_zt=24&_nc_ht=scontent-ham3-1.xx&_nc_gid=T5i9pWIous68P_Bvr73CIQ&_nc_ss=79389&oh=00_AQSM-2Yh4eXf9cZZwPB8BzXgNMEWSvNW3yHgzBkVrWdheQ&oe=6B0CCF95", "url": "https://www.facebook.com/NASA", "verified": true, "private": false, "followers": 28000000, "following": 53, "likes": null, "posts": null, "externalUrl": "https://www.nasa.gov/nasa-app/", "createdAt": null, "ext": { "pageId": "54971236771", "category": "Government organization", "followersLabel": "28M followers", "followingLabel": "53 following", "coverUrl": "https://scontent-ham3-1.xx.fbcdn.net/v/t39.99422-6/809146614_4484013928506139_3181913787670602881_n.png?stp=dst-jpg_tt6&cstp=mx2047x1487&ctp=s960x960&_nc_cat=110&_nc_map=urlgen_bucketless&ccb=1-7&_nc_sid=cc71e4&_nc_ohc=GVR710ihTyEQ7kNvwHoC3xD&_nc_oc=AdrCE6VeeQD4Y3D241kJ12-Iay1yW4-xHohgIU2E_l-MxAObvtEm-CmlFH7rAhOwXXU&_nc_zt=14&_nc_ht=scontent-ham3-1.xx&_nc_gid=T5i9pWIous68P_Bvr73CIQ&_nc_ss=79389&oh=00_AQR060AGMvQOt9YGGAfnInfe0lHPcITapSQoOhUfSrNIYA&oe=6B0CD367", "intro": [ { "kind": "category", "text": "Page · Government organization", "url": null }, { "kind": "confirmed_owner_label", "text": "NATIONAL AERONAUTICS AND SPACE ADMINISTRATION is responsible for this Page", "url": null }, { "kind": "email", "text": "public-inquiries@hq.nasa.gov", "url": null } ] } } } ``` - A handle is the vanity name, or the numeric id, which is followed to the name. - A profile's `ext` has its `pageId`, `category`, `coverUrl` and the intro's lines. ### Rounded Counts [#rounded-counts] Facebook rounds its counts for a visitor, so "28M" comes as `28000000`. Its `ext.followersLabel` keeps the text. ### Lists [#lists] - Posts come 3 a page, as Facebook pages them. - Photos come 8 a page, and videos about 6 with their plays as `views`. - Only a Page has a videos tab. ## Posts [#posts] | Endpoint | Returns | Credits | | --- | --- | :---: | | [`/v1/facebook/post`](/docs/api-reference/facebook/post) | One post, reel or video with its counts and media. | 1 | | [`/v1/facebook/post/comments`](/docs/api-reference/facebook/post-comments) | A post's comments, most relevant first, 10 a page. | 1 | | [`/v1/facebook/post/comment/replies`](/docs/api-reference/facebook/post-comment-replies) | The replies to one comment, about 10 a page. | 1 | | [`/v1/facebook/post/transcript`](/docs/api-reference/facebook/post-transcript) | A video's captions as text with their times. | 10 | ### Post Links [#post-links] A `/posts/pfbid…` link is read at once. Any other link is opened once to find its post, then cached for a day. ### Reactions [#reactions] Likes in `stats.likes` are every reaction together. Their kinds are in `ext.reactions`. ### Comments and Replies [#comments-and-replies] - Comments come 10 a page, most relevant first. - A comment with replies has `ext.repliesToken`. Pass it as `token` to read them. ### Transcripts [#transcripts] - Transcripts read Facebook's own caption track. - Where the video's language has none, they are a translation, with `translated: true`. - A post lists its tracks in `ext.captions`. ## Marketplace and Events [#marketplace-and-events] | Endpoint | Returns | Credits | | --- | --- | :---: | | [`/v1/facebook/marketplace/item`](/docs/api-reference/facebook/marketplace-item) | One Marketplace listing. | 1 | | [`/v1/facebook/marketplace/search`](/docs/api-reference/facebook/marketplace-search) | Marketplace listings for a query near a point. | 1 | | Endpoint | Returns | Credits | | --- | --- | :---: | | [`/v1/facebook/event`](/docs/api-reference/facebook/event) | One event, with its time, place and host. | 1 | | [`/v1/facebook/events`](/docs/api-reference/facebook/events) | A city's upcoming events, 12 a page. | 1 | | [`/v1/facebook/events/search`](/docs/api-reference/facebook/events-search) | Events matching a query. | 1 | - Marketplace search takes a `query`, a `latitude` and `longitude`, and `radiusKm` (40 by default). - It gives the first page, about 14 listings. - A city's events are read by its events page's `url` or `cityId`, 12 a page. - Event search gives two short pages. ## Share Links [#share-links] Short links such as `fb.watch/…` and `facebook.com/share/…` return `400 INVALID_REQUEST`. Open the link and send the full link it leads to. # Instagram (/docs/instagram) Read profiles with their posts, reels and highlights, posts with their comments, and what Instagram shows by keyword, place, sound and trend. ## Quick Reference [#quick-reference] | Property | Value | | --- | --- | | Endpoints | 15 | | Accounts by | `handle` or `url` | | Posts by | `url` or `id` | | Posts a page | 12 | | Comments a page | About 22, no replies | | Transcripts | No | | Counts | Exact, no post count | ## Accounts [#accounts] | Endpoint | Returns | Credits | | --- | --- | :---: | | [`/v1/instagram/profile`](/docs/api-reference/instagram/profile) | A profile with its follower and following counts. | 1 | | [`/v1/instagram/profile/highlights`](/docs/api-reference/instagram/profile-highlights) | An account's story highlights, with their covers. | 1 | | [`/v1/instagram/profile/posts`](/docs/api-reference/instagram/profile-posts) | An account's posts, newest first, 12 a page. | 1 | | [`/v1/instagram/profile/reels`](/docs/api-reference/instagram/profile-reels) | An account's reels with their plays, 12 a page. | 1 | | [`/v1/instagram/profile/similar`](/docs/api-reference/instagram/profile-similar) | Accounts like this one, as Instagram suggests them. | 5 | | [`/v1/instagram/highlight`](/docs/api-reference/instagram/highlight) | A story highlight's stories, with their media. | 1 | ### Read a Profile [#read-a-profile] **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.instagram.profile({ handle: "natgeo" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.instagram.profile(handle="natgeo").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/instagram/profile \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=natgeo" ``` **Response** ```json { "data": { "id": "787132", "username": "natgeo", "displayName": "National Geographic", "bio": "Step into wonder and find your inner explorer with National Geographic 🌎", "avatarUrl": "https://scontent-bos5-1.cdninstagram.com/v/t51.82787-19/683576066_18653628823019133_9051036240972105113_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_cat=1&ig_cache_key=GAKLvih9nsRnYEVCAJlFVLiBvZt9bmNDAQAB1501500j-ccb7-5&ccb=7-5&_nc_sid=669407&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLnd3dy40MDAuQzMifQ%3D%3D&_nc_ohc=Fzq-SLmj7IoQ7kNvwGv6Q-m&_nc_oc=Adqba9tyEQDxQEp3-B2IZh6tpjHxc5VaFSfndZ5toAR85RUYhlNWPGd0hJZIDC29xxg&_nc_zt=24&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_gid=DKToTpAPnxQ3-31AVDAh2w&_nc_ss=79b8c&_nc_ct=RQosPBUCFQIAAAA&oh=00_AQQjsSzc6M516mz06KVhu_tGEUutW9TNo7UVxSYTkJDp-g&oe=6B0CB22B", "url": "https://www.instagram.com/natgeo/", "verified": true, "private": false, "followers": 267265090, "following": 195, "likes": null, "posts": null, "externalUrl": "http://visitstore.bio/natgeo", "createdAt": null, "ext": { "bioLinks": [ { "url": "http://visitstore.bio/natgeo", "title": null }, { "url": "https://ngmdomsubs.nationalgeographic.com/servlet/OrdersGateway?cds_mag_code=NGM&cds_page_id=283562&cds_response_key=I5FX10002", "title": "Subscribe Here!" } ], "category": null, "latestStoryAt": "2026-11-24T23:09:17.000Z", "hasReels": true, "threadsUsername": "natgeo", "memorialized": false, "moreHighlights": false } } } ``` A profile's `posts` is `null`. ### Reels and Highlights [#reels-and-highlights] - Reels come with their plays, likes and comments, without captions or times. - Read a reel with `post` for its caption and time. - Highlights are the first 10. A profile's `ext.moreHighlights` says when there are more. ### Similar Accounts [#similar-accounts] Up to 50, without their counts. Some accounts have none. ### Private Accounts [#private-accounts] A private account's profile reads, and its posts return `403 PRIVATE`. ## Posts [#posts] | Endpoint | Returns | Credits | | --- | --- | :---: | | [`/v1/instagram/post`](/docs/api-reference/instagram/post) | One post or reel with its counts, media and tags. | 1 | | [`/v1/instagram/post/comments`](/docs/api-reference/instagram/post-comments) | A post's comments with their likes, about 22 a page. | 5 | ### Post Fields [#post-fields] A post's `ext` has its `code`, `kind`, `location`, `sound`, `tagged` accounts and `paidPartnership`. ### Comments [#comments] Comments come about 22 a page with their likes. ## Discovery [#discovery] | Endpoint | Returns | Credits | | --- | --- | :---: | | [`/v1/instagram/location`](/docs/api-reference/instagram/location) | A place, with how many posts are tagged at it. | 1 | | [`/v1/instagram/location/posts`](/docs/api-reference/instagram/location-posts) | A place's top posts with their likes and comments. | 5 | | [`/v1/instagram/search`](/docs/api-reference/instagram/search) | Popular posts for a word or hashtag, 12 a page. | 1 | | [`/v1/instagram/sound`](/docs/api-reference/instagram/sound) | A sound, and how many reels use it. | 1 | | [`/v1/instagram/sound/posts`](/docs/api-reference/instagram/sound-posts) | The reels that use a sound, 12 a page. | 1 | | [`/v1/instagram/trending`](/docs/api-reference/instagram/trending) | The reels feed Instagram gives a visitor, 8 a page. | 5 | | [`/v1/instagram/trending/topics`](/docs/api-reference/instagram/trending-topics) | The explore page's trending keywords and accounts. | 1 | ### Search [#search] - Search takes a word or a hashtag as `query`. - It returns the popular posts, mostly reels, 12 a page and about 100 in all. - Some words have none and return an empty list. ### Places and Trends [#places-and-trends] - A place's posts are its top 18, on one page. - Trending topics are the explore page's keywords and accounts. # Kick (/docs/kick) Read channels with their live status, videos and clips, a video with its chat replay, a video's or clip's captions, a category with what is live in it, and what Kick shows by search and by viewers. ## Quick Reference [#quick-reference] | Property | Value | | --- | --- | | Endpoints | 16 | | Channels by | `handle` or `url` | | Videos and clips by | `url` or `id` | | Categories by | `slug` or `url` | | Clips a page | 20 | | Live broadcasts a page | 50 | | Chat messages a page | 25 | | Transcripts | Yes | | Counts | Views; likes on clips; followers on channels | ## Channels [#channels] | Endpoint | Returns | Credits | | --- | --- | :---: | | [`/v1/kick/profile`](/docs/api-reference/kick/profile) | A channel with its follower count and links. | 1 | | [`/v1/kick/profile/clips`](/docs/api-reference/kick/profile-clips) | A channel's clips, 20 a page. | 1 | | [`/v1/kick/profile/posts`](/docs/api-reference/kick/profile-posts) | A channel's videos, every one it keeps. | 1 | | [`/v1/kick/live`](/docs/api-reference/kick/live) | Whether a channel is live, with its broadcast. | 1 | ### Read a Channel [#read-a-channel] **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.kick.profile({ handle: "xqc" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.kick.profile(handle="xqc").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/kick/profile \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=xqc" ``` **Response** ```json { "data": { "id": "668", "username": "xqc", "displayName": "xQc", "bio": "THE BEST AT ABSOLUTELY EVERYTHING. THE JUICER. LEADER OF THE JUICERS.", "avatarUrl": "https://files.kick.com/images/user/676/profile_image/conversion/931b4e8f-5445-427c-bd82-b473530390cc-fullsize.webp", "url": "https://kick.com/xqc", "verified": true, "private": false, "followers": 1879042, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": "2022-10-22T06:59:51.000Z", "ext": { "userId": "676", "live": false, "affiliate": false, "videosEnabled": true, "subscriptionsEnabled": true, "bannerUrl": "https://files.kick.com/images/channel/668/banner_image/6fcf7418-df00-460b-9467-1fa95b8eb981", "offlineBannerUrl": null, "socials": [ { "network": "instagram", "name": "xqcow1/", "url": "https://www.instagram.com/xqcow1/" }, { "network": "x", "name": "xqc", "url": "https://x.com/xqc" }, { "network": "youtube", "name": "channel/UCmDTrq0LNgPodDOFZiSbsww", "url": "https://www.youtube.com/channel/UCmDTrq0LNgPodDOFZiSbsww" } ], "links": [ { "title": null, "description": null, "url": "https://streamelements.com/xqc/tip", "imageUrl": "https://files.kick.com/images/channel-links/605185/image/conversion/4d8e57a6-2c10-4a3c-9dff-c19d861d073c-image.webp" }, { "title": null, "description": null, "url": "https://www.youtube.com/channel/UCmDTrq0LNgPodDOFZiSbsww", "imageUrl": "https://files.kick.com/images/channel-links/605197/image/conversion/9e82a1f8-b742-4fdc-807a-ddc679fa7bc1-image.webp" }, { "title": null, "description": null, "url": "https://discord.gg/xqcow", "imageUrl": "https://files.kick.com/images/channel-links/605147/image/conversion/1dfb542b-59d4-4b65-925b-9f7ccbdc521a-image.webp" } ], "recentCategories": [ { "id": "15", "name": "Just Chatting", "slug": "just-chatting", "url": "https://kick.com/category/just-chatting" }, { "id": "19671", "name": "The Legend of Zelda: Ocarina of Time", "slug": "the-legend-of-zelda-ocarina-of-time-1", "url": "https://kick.com/category/the-legend-of-zelda-ocarina-of-time-1" }, { "id": "13155", "name": "Grand Theft Auto VI (GTA)", "slug": "grand-theft-auto-vi", "url": "https://kick.com/category/grand-theft-auto-vi" } ], "chatroomId": "668" } } } ``` - A channel's `followers` is exact, and `verified` is Kick's checkmark. - Its `ext` has its banners, the accounts elsewhere it names (`socials`), the links under its player and the categories it last broadcast in. - Its `ext.live` says whether it is on air now. ### Live Status [#live-status] - On air, a live has its title, viewers, start time, category, language and tags. - Its `ext.playbackUrl` is the stream's playlist, with a token that expires. - Off air, `live` is `false`, with the channel as its `host`. - Live status is kept for a minute. ### Channel Lists [#channel-lists] - Videos are every past broadcast the channel keeps, about 30 days of them, newest first, in one page. - Clips come most viewed or newest first (`sort`: `views` or `latest`), over a `period`: `day`, `week` (the default), `month` or `all`. ## Videos and Clips [#videos-and-clips] | Endpoint | Returns | Credits | | --- | --- | :---: | | [`/v1/kick/post`](/docs/api-reference/kick/post) | One video or clip with its views and a link to play it. | 1 | | [`/v1/kick/post/comments`](/docs/api-reference/kick/post-comments) | A video's chat replay, 25 messages a page. | 1 | | [`/v1/kick/post/transcript`](/docs/api-reference/kick/post-transcript) | A video's or clip's captions as text, with timings. | 10 | ### Post Fields [#post-fields] - The `text` and `ext.title` are the title. - A video's `stats` have views; a clip's views and likes. - A video's `ext.kind` is `video`, and a clip's `clip`. - A clip's `ext` has who cut it, the video it is from and where in it. - Its `media` has a link to play it: an HLS playlist. ### Chat Replay [#chat-replay] A video's comments are the messages written in its channel's chat while it was live, newest first, back to the start of the video. Each has its author, its `ext.offsetSeconds` into the video, the message it answers (`parentId`), its badges and its emotes. Start from any moment with `offset`, in seconds; without it, the replay starts at the video's end. ### Transcripts [#transcripts] A transcript is Kick's own captions, in the broadcast's language unless `language` asks for another; `languages` lists every one Kick has. A clip is read whole. A video is read ten minutes at a time from `offset`, in seconds, so a long broadcast is read in steps. It costs 10 credits and is kept 30 days. ## Categories [#categories] | Endpoint | Returns | Credits | | --- | --- | :---: | | [`/v1/kick/category`](/docs/api-reference/kick/category) | A category with its viewers and followers. | 1 | | [`/v1/kick/category/clips`](/docs/api-reference/kick/category-clips) | A category's clips, 20 a page. | 1 | | [`/v1/kick/category/lives`](/docs/api-reference/kick/category-lives) | A category's live broadcasts, most watched first. | 1 | - A category is a game, or a kind of broadcast such as Just Chatting. - It has its viewers now, its followers, its genres and the group it is in. - Its live broadcasts take `sort` (`viewers` or `featured`) and `language`, and its clips `sort` and `period`. ## Discovery [#discovery] | Endpoint | Returns | Credits | | --- | --- | :---: | | [`/v1/kick/search/categories`](/docs/api-reference/kick/search-categories) | Categories matching a search, up to 50. | 1 | | [`/v1/kick/search/lives`](/docs/api-reference/kick/search-lives) | Live broadcasts matching a search, up to 10. | 1 | | [`/v1/kick/search/users`](/docs/api-reference/kick/search-users) | Channels matching a search, up to 50. | 1 | | [`/v1/kick/trending`](/docs/api-reference/kick/trending) | The live broadcasts most watched now, 50 a page. | 1 | | [`/v1/kick/trending/categories`](/docs/api-reference/kick/trending-categories) | The categories most watched now. | 1 | | [`/v1/kick/trending/clips`](/docs/api-reference/kick/trending-clips) | The site's most viewed clips, 20 a page. | 1 | - Search finds channels, live broadcasts or categories, each by its own endpoint. - Trending is the live broadcasts most watched now, or Kick's own pick with `sort` set to `featured`, by `language` if asked. - Trending categories are the categories most watched now, and trending clips the most viewed of a `period`. # LinkedIn (/docs/linkedin) Read a member's profile with its posts and articles, a company with its posts and open jobs, a post with its first comments and its video's captions, an article, job search with its filters, the members of a name, and LinkedIn's Ad Library. ## Quick Reference [#quick-reference] | Property | Value | | --- | --- | | Endpoints | 17 | | Members and companies by | `handle` or `url` | | Posts by | `url` or `id` | | A member's posts | Its latest, about 10 | | A company's posts | About 70, 10 a page | | Comments | The first, about 10 | | Jobs a page | 10, up to 1,000 | | Ads a page | 24 | | Transcripts | Yes | | Counts | Exact followers; reactions and comments on posts | ## Accounts [#accounts] | Endpoint | Returns | Credits | | --- | --- | :---: | | [`/v1/linkedin/profile`](/docs/api-reference/linkedin/profile) | A member's public profile with its followers. | 1 | | [`/v1/linkedin/profile/articles`](/docs/api-reference/linkedin/profile-articles) | A member's articles, up to 10. | 1 | | [`/v1/linkedin/profile/posts`](/docs/api-reference/linkedin/profile-posts) | A member's latest posts, about 10. | 1 | ### Read a Profile [#read-a-profile] **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.linkedin.profile({ handle: "williamhgates" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.linkedin.profile(handle="williamhgates").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/linkedin/profile \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=williamhgates" ``` **Response** ```json { "data": { "id": "williamhgates", "username": "williamhgates", "displayName": "Bill Gates", "bio": "Chair of the Gates Foundation. Founder of Breakthrough Energy. Co-founder of Microsoft. Voracious reader. Avid traveler. Active blogger.", "avatarUrl": "https://media.licdn.com/dms/image/v2/D5603AQF-RYZP55jmXA/profile-displayphoto-shrink_200_200/B56ZRi8g.aGsAY-/0/1736826818802?e=2147483647&v=beta&t=bKWfN6UwwtiCqFWsG7rBELbd48qJOAMLdxhBzzkJV0k", "url": "https://www.linkedin.com/in/williamhgates", "verified": false, "private": false, "followers": 40865050, "following": null, "likes": null, "posts": null, "externalUrl": "https://gatesnot.es/sourcecode-li", "createdAt": null, "ext": { "headline": "Chair, Gates Foundation and Founder, Breakthrough Energy", "location": "Seattle, Washington, United States", "country": "US", "connections": 8, "connectionsMore": false, "labels": [ "Creator", "Top Voice" ], "influencer": true, "coverUrl": "https://media.licdn.com/dms/image/v2/D5616AQEjhPbTCeblYg/profile-displaybackgroundimage-shrink_200_800/B56ZcytR5SGsAc-/0/1748902420393?e=2147483647&v=beta&t=a-tBeZkxzWTHWYY6MAjxt0oTEuxlW33EUkK3gm5_te4", "current": [ { "name": "Gates Foundation", "url": "https://www.linkedin.com/company/gates-foundation" } ], "schools": [ { "name": "Harvard University", "url": "https://www.linkedin.com/school/harvard-university/" } ], "hidden": false, "experience": [ { "title": "Co-chair", "subtitle": "Gates Foundation", "url": "https://www.linkedin.com/company/gates-foundation", "starts": "2000", "ends": null, "current": true, "location": null, "description": null }, { "title": "Founder", "subtitle": "Breakthrough Energy", "url": "https://www.linkedin.com/company/breakthrough-energy", "starts": "2015", "ends": null, "current": true, "location": null, "description": null }, { "title": "Co-founder", "subtitle": "Microsoft", "url": "https://www.linkedin.com/company/microsoft", "starts": "1975", "ends": null, "current": true, "location": null, "description": null } ], "education": [ { "title": "Harvard University", "subtitle": null, "url": "https://www.linkedin.com/school/harvard-university/", "starts": "1973", "ends": "1975", "current": false, "location": null, "description": null }, { "title": "Lakeside School", "subtitle": null, "url": "https://www.linkedin.com/school/lakeside-school/", "starts": null, "ends": null, "current": false, "location": null, "description": null } ], "volunteering": [], "certifications": [], "publications": [], "patents": [], "projects": [], "honors": [], "languages": [], "courses": [], "testScores": [], "organizations": [], "skills": [], "recommendations": [], "websites": [ "https://gatesnot.es/sourcecode-li" ], "similar": [ { "name": "Melinda French Gates", "url": "https://www.linkedin.com/in/melindagates", "subtitle": "Pivotal", "location": "United States", "followers": 7000000 }, { "name": "Tyler Alterman", "url": "https://www.linkedin.com/in/tyleralterman", "subtitle": "Fractal University", "location": "Brooklyn, NY", "followers": 7000 }, { "name": "Todd J. Duckett", "url": "https://www.linkedin.com/in/toddjduckett", "subtitle": "Duckett Enterprises", "location": "Lansing, MI", "followers": 9000 } ] } } } ``` - A member's `followers` is exact, and its `ext.connections` is shown up to 500 (`connectionsMore` past it). - Its `ext` has its location, its current company and school, its websites and every section it filled in: volunteering, certifications, publications, patents, projects, honors, languages, courses, test scores, organizations, skills and recommendations, and similar profiles. - Positions and schools are whole for members LinkedIn features, such as Top Voices. For most members LinkedIn hides them: `ext.hidden` is `true`, and `ext.current` and `ext.schools` name the current company and school. ### Posts and Articles [#posts-and-articles] - A member's posts are its latest, about 10, each with its reactions and, where its page counts them, comments. - Its articles are its latest 10, each with its title and cover; `/v1/linkedin/article` reads one whole. ## Companies [#companies] | Endpoint | Returns | Credits | | --- | --- | :---: | | [`/v1/linkedin/company`](/docs/api-reference/linkedin/company) | A company's page with its followers and employees. | 1 | | [`/v1/linkedin/company/jobs`](/docs/api-reference/linkedin/company-jobs) | A company's open jobs, 10 a page. | 1 | | [`/v1/linkedin/company/posts`](/docs/api-reference/linkedin/company-posts) | A company's posts, newest first. | 1 | | [`/v1/linkedin/search/companies`](/docs/api-reference/linkedin/search-companies) | Companies matching a name, with their ids. | 1 | ### Company Fields [#company-fields] - A company has its exact `followers`, its members on LinkedIn (`ext.employees`), its industry, size, headquarters, type, founding year, specialties and addresses, and its affiliated and similar pages. - A showcase page (a brand's or a product's) is read the same way, by its link or its name. - Its posts come newest first, about 70 in all, including the members' posts it reposted (`ext.repostedBy`). - Its jobs are the ones its page lists, its subsidiaries' included. By its `companyId` they are its own jobs alone, with no page read first. - Search companies finds the companies of a name, up to 10, the best match first, each with the `id` that `companyId` takes. ## Posts [#posts] | Endpoint | Returns | Credits | | --- | --- | :---: | | [`/v1/linkedin/article`](/docs/api-reference/linkedin/article) | An article with its text, reactions and comments. | 1 | | [`/v1/linkedin/post`](/docs/api-reference/linkedin/post) | One post with its reactions and comments. | 1 | | [`/v1/linkedin/post/comments`](/docs/api-reference/linkedin/post-comments) | A post's first comments, about 10. | 1 | | [`/v1/linkedin/post/transcript`](/docs/api-reference/linkedin/post-transcript) | A post's video's captions as text, with timings. | 10 | ### Post Fields [#post-fields] - A post's `id` is its activity's number, and its time comes from it, to the millisecond. - The `stats` have reactions as `likes`, and comments. LinkedIn shows no views. - Its `media` has its pictures, or its video with its file and poster; `ext.linkPreview` the link it shares, and `ext.reshared` the post it shares. - Its comments are the first ones its page shows, about 10, each with its author, time and reactions. ### Transcripts [#transcripts] A transcript is LinkedIn's own captions of a post's video, whole, with `generated` set when LinkedIn made them from its speech. It costs 10 credits and is kept 30 days. A post without a captioned video returns `404`, at no cost. ## Jobs [#jobs] | Endpoint | Returns | Credits | | --- | --- | :---: | | [`/v1/linkedin/job`](/docs/api-reference/linkedin/job) | One job posting with its description. | 1 | | [`/v1/linkedin/search/jobs`](/docs/api-reference/linkedin/search-jobs) | Job postings for a search, 10 a page. | 1 | | [`/v1/linkedin/search/locations`](/docs/api-reference/linkedin/search-locations) | Places matching a name, with their ids. | 1 | - Job search takes `query` and a place, and filters by `posted` (`day`, `week`, `month`), `type`, `experience` and `workplace`, each a comma-separated list; `sort` is `relevance` or `recent`. - The place is a `location` as written, or a `locationId` from Search Locations, which finds the places of a name (`Berlin, Berlin, Germany`, `Berlin, Connecticut, United States`) so the one meant is searched. - Results come 10 a page, up to 1,000, each with its company, location, the day it was posted, its pay where given and LinkedIn's notes on it. - A job's posting has its whole text, its applicants, its seniority, employment type, job function and industries. ## Ads [#ads] | Endpoint | Returns | Credits | | --- | --- | :---: | | [`/v1/linkedin/ad`](/docs/api-reference/linkedin/ad) | One ad with who paid for it and its reach. | 1 | | [`/v1/linkedin/ads/search`](/docs/api-reference/linkedin/ads-search) | Ads from LinkedIn's Ad Library, 24 a page. | 1 | - Ad search finds the ads of an `advertiser`, a `payer` or with words (`query`), shown in a `country` and over a `period`, up to a year back. - An ad has its advertiser, payer, format, text, media and link. - An ad shown in the EU also has when it ran, its impressions and their split by country, and its targeting. ## Discovery [#discovery] | Endpoint | Returns | Credits | | --- | --- | :---: | | [`/v1/linkedin/search/users`](/docs/api-reference/linkedin/search-users) | Members with a first and last name, up to 50. | 1 | Search users finds the members of a first and a last name, up to 50, each with their location and current companies. # Pinterest (/docs/pinterest) Read accounts with their pins and boards, a board with its sections, a pin with its comments, and what Pinterest shows by search, topic and trend. ## Quick Reference [#quick-reference] | Property | Value | | --- | --- | | Endpoints | 19 | | Accounts by | `handle` or `url` | | Boards by | `url` or `id` | | Pins by | `url`, `id` or a `pin.it` link | | Pins a page | 25 | | Transcripts | No | | Counts | Saves, reactions and shares | ## Accounts [#accounts] | Endpoint | Returns | Credits | | --- | --- | :---: | | [`/v1/pinterest/profile`](/docs/api-reference/pinterest/profile) | A profile with its follower and pin counts. | 1 | | [`/v1/pinterest/profile/boards`](/docs/api-reference/pinterest/profile-boards) | An account's boards, 25 a page. | 1 | | [`/v1/pinterest/profile/posts`](/docs/api-reference/pinterest/profile-posts) | The pins an account created, newest first, 25 a page. | 1 | ### Read a Profile [#read-a-profile] **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.pinterest.profile({ handle: "nasa" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.pinterest.profile(handle="nasa").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/pinterest/profile \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=nasa" ``` **Response** ```json { "data": { "id": "142567281862381039", "username": "nasa", "displayName": "NASA", "bio": "Explore the universe and discover our home planet with the official NASA boards on Pinterest. Visit us at www.nasa.gov", "avatarUrl": "https://i.pinimg.com/280x280_RS/37/a1/75/37a175e6d2431425576f0b8f81389394.jpg", "url": "https://www.pinterest.com/nasa/", "verified": true, "private": false, "followers": 556819, "following": 5, "likes": null, "posts": 10555, "externalUrl": "http://www.nasa.gov/", "createdAt": "2012-03-05T16:37:07.000Z", "ext": { "boards": 82, "monthlyViews": 4677213, "coverUrl": "https://i.pinimg.com/originals/53/29/e7/5329e71b2f85d2758cd3ec1d18452c26.jpg", "domain": "www.nasa.gov", "verifiedMerchant": false, "lastSavedAt": "2026-11-20T16:39:34.000Z" } } } ``` - A profile's `posts` is its pin count, and `ext.boards` its board count. - Its `ext` also has its monthly views, its cover and its website. ## Boards [#boards] | Endpoint | Returns | Credits | | --- | --- | :---: | | [`/v1/pinterest/board`](/docs/api-reference/pinterest/board) | A board with its pin and follower counts. | 1 | | [`/v1/pinterest/board/posts`](/docs/api-reference/pinterest/board-posts) | A board's pins, 25 a page. | 1 | | [`/v1/pinterest/board/section/posts`](/docs/api-reference/pinterest/board-section-posts) | A board section's pins, about 25 a page. | 1 | | [`/v1/pinterest/board/sections`](/docs/api-reference/pinterest/board-sections) | A board's sections with their pin counts. | 1 | - A board has its pins, followers and sections, its owner and its category. - A section's pins come by the section's `id`, from `board/sections`. ## Pins [#pins] | Endpoint | Returns | Credits | | --- | --- | :---: | | [`/v1/pinterest/post`](/docs/api-reference/pinterest/post) | One pin with its saves, reactions and comment count. | 1 | | [`/v1/pinterest/post/comments`](/docs/api-reference/pinterest/post-comments) | A pin's comments, 25 a page. | 1 | | [`/v1/pinterest/post/comment/replies`](/docs/api-reference/pinterest/post-comment-replies) | A comment's replies, 25 a page. | 1 | ### Pin Fields [#pin-fields] - The `text` is the description, and `ext.title` the title. - The `stats` have reactions as `likes`, and its saves and shares. - Its `media` is its image, its video or each slide. ### Encrypted Pins [#encrypted-pins] Pinterest gives most pins in search and on others' boards an encrypted id (`e1_…`), which `post` cannot open: their `ext.openable` is `false`. Their comments are read by their `ext.commentsId`, which every pin has. ## Discovery [#discovery] | Endpoint | Returns | Credits | | --- | --- | :---: | | [`/v1/pinterest/search`](/docs/api-reference/pinterest/search) | Pins matching a query, about 25 a page. | 1 | | [`/v1/pinterest/search/boards`](/docs/api-reference/pinterest/search-boards) | Boards matching a query, about 50 a page. | 1 | | [`/v1/pinterest/search/suggestions`](/docs/api-reference/pinterest/search-suggestions) | What the search box suggests for a few letters. | 1 | | [`/v1/pinterest/search/users`](/docs/api-reference/pinterest/search-users) | Accounts matching a query, about 48 a page. | 1 | | [`/v1/pinterest/search/videos`](/docs/api-reference/pinterest/search-videos) | Video pins matching a query, 25 a page. | 1 | | [`/v1/pinterest/topic`](/docs/api-reference/pinterest/topic) | A topic's Ideas page with its followers and searches. | 1 | | [`/v1/pinterest/topic/posts`](/docs/api-reference/pinterest/topic-posts) | A topic's top pins, about 20. | 1 | | [`/v1/pinterest/trending`](/docs/api-reference/pinterest/trending) | What a country searches for on Pinterest Trends. | 10 | | [`/v1/pinterest/url`](/docs/api-reference/pinterest/url) | How many times a web page was saved to Pinterest. | 1 | - Search finds pins, videos, boards or accounts, each by its own endpoint. - A topic is an Ideas page, with its followers and what people search under it. - Trending is Pinterest Trends: a country's terms growing fastest, or the month's, year's or season's most searched. - Url says how many times a web page was saved to Pinterest. # Compare Platforms (/docs/platforms) Every platform SocialAPI reads, side by side. Check what each one offers here, then open its page for endpoints and limits. ## Endpoints [#endpoints] | Platform | Endpoints | Accounts by | Posts by | | :---: | :---: | :---: | :---: | | [TikTok](/docs/tiktok) | 22 | `handle`, `url`, `secUid` | `url`, `id` | | [Instagram](/docs/instagram) | 15 | `handle`, `url` | `url`, `id` | | [YouTube](/docs/youtube) | 26 | `handle`, `url`, `channelId` | `url`, `id` | | [Facebook](/docs/facebook) | 13 | `handle`, `url` | `url` | | [Threads](/docs/threads) | 10 | `handle`, `url` | `url`, `id` | | [Reddit](/docs/reddit) | 17 | `handle`, `url` | `url`, `id` | | [Pinterest](/docs/pinterest) | 19 | `handle`, `url` | `url`, `id` | | [Twitch](/docs/twitch) | 20 | `handle`, `url`, `id` | `url`, `id` | | [Bluesky](/docs/bluesky) | 30 | `handle`, `url` | `url`, `id` | | [X (Twitter)](/docs/x) | 13 | `handle`, `url` | `url`, `id` | | [Telegram](/docs/telegram) | 6 | `handle`, `url` | `url`, `id` | | [Kick](/docs/kick) | 16 | `handle`, `url` | `url`, `id` | | [Douyin](/docs/douyin) | 15 | `secUid`, `url` | `url`, `id` | | [LinkedIn](/docs/linkedin) | 17 | `handle`, `url` | `url`, `id` | TikTok, Pinterest and Douyin also take share links (`vm.tiktok.com/…`, `pin.it/…`, `v.douyin.com/…`). See [Identifiers](/docs/identifiers). ## Accounts [#accounts] | Platform | Profile | Posts | Videos | Followers | Following | | :---: | :---: | :---: | :---: | :---: | :---: | | [TikTok](/docs/tiktok#accounts) | Yes | Yes | In posts | Yes | Yes | | [Instagram](/docs/instagram#accounts) | Yes | Yes | Reels | No | No | | [YouTube](/docs/youtube#channels) | Yes | Yes | Shorts, live | No | No | | [Facebook](/docs/facebook#pages-and-people) | Yes | Yes | Yes | No | No | | [Threads](/docs/threads#accounts) | Yes | Yes | Media | No | No | | [Reddit](/docs/reddit#accounts) | Yes | Yes | In posts | No | No | | [Pinterest](/docs/pinterest#accounts) | Yes | Yes | In posts | No | No | | [Twitch](/docs/twitch#channels) | Yes | Yes | Clips | No | No | | [Bluesky](/docs/bluesky#accounts) | Yes | Yes | Yes | Yes | Yes | | [X (Twitter)](/docs/x#accounts) | Yes | Yes | In posts | No | No | | [Telegram](/docs/telegram#channels-and-groups) | Yes | Channels | In posts | No | No | | [Kick](/docs/kick#channels) | Yes | Yes | Clips | No | No | | [Douyin](/docs/douyin#accounts) | Yes | Latest | In posts | No | No | | [LinkedIn](/docs/linkedin#accounts) | Yes | Latest | In posts | No | No | - TikTok also has reposts, liked posts, playlists and the live room. - LinkedIn also has a member's articles, and companies with their posts and jobs. - Twitch also has a channel's live status and schedule. Kick has its live status. - Douyin gives an account's latest posts, about 10, and has its series and live rooms. - Bluesky also has replies, and the lists, feeds and starter packs an account made. - Instagram also has story highlights and similar accounts. - YouTube also has playlists, community posts, podcasts and a channel's search. - Threads also has replies and reposts. Facebook also has photos. - Reddit also has an account's comments, and communities with their posts. - Pinterest also has boards and their sections. - X also has highlights and similar accounts. - Telegram also has a search inside a channel, and what an invite link opens. - A private account's posts return `403 PRIVATE`, at no cost. ### Profile Counts [#profile-counts] | Platform | Followers | Following | Likes | Posts | | :---: | :---: | :---: | :---: | :---: | | [TikTok](/docs/tiktok) | Yes | Yes | Yes | Yes | | [Instagram](/docs/instagram) | Yes | Yes | No | No | | [YouTube](/docs/youtube) | Rounded | No | No | Yes | | [Facebook](/docs/facebook) | Rounded | Rounded | No | No | | [Threads](/docs/threads) | Yes | No | No | No | | [Reddit](/docs/reddit) | No | No | No | No | | [Pinterest](/docs/pinterest) | Yes | Yes | No | Yes | | [Twitch](/docs/twitch) | Yes | No | No | Yes | | [Bluesky](/docs/bluesky) | Yes | Yes | No | Yes | | [X (Twitter)](/docs/x) | Yes | Yes | No | Yes | | [Telegram](/docs/telegram) | Yes | No | No | No | | [Kick](/docs/kick) | Yes | No | No | No | | [Douyin](/docs/douyin) | Yes | Yes | Yes | Yes | | [LinkedIn](/docs/linkedin) | Yes | No | No | No | - Facebook and YouTube round their counts, so "28M" comes as `28000000`. - Telegram's followers are a channel's subscribers or a group's members. - Reddit gives an account's karma instead, in `ext.karma`. - A missing count is `null`, never `0`. ## Posts [#posts] | Platform | Post | Comments | Replies | Transcript | | :---: | :---: | :---: | :---: | :---: | | [TikTok](/docs/tiktok#posts) | Yes | Yes | Yes | Yes | | [Instagram](/docs/instagram#posts) | Yes | Yes | No | No | | [YouTube](/docs/youtube#videos) | Yes | Yes | Yes | Yes | | [Facebook](/docs/facebook#posts) | Yes | Yes | Yes | Yes | | [Threads](/docs/threads#posts) | Yes | Yes | No | No | | [Reddit](/docs/reddit#posts) | Yes | Yes | Yes | Yes | | [Pinterest](/docs/pinterest#pins) | Yes | Yes | Yes | No | | [Twitch](/docs/twitch#videos-and-clips) | Yes | Chat replay | No | No | | [Bluesky](/docs/bluesky#posts) | Yes | Yes | In comments | No | | [X (Twitter)](/docs/x#posts) | Yes | Top replies | In comments | Yes | | [Telegram](/docs/telegram#posts) | Yes | Yes | In comments | No | | [Kick](/docs/kick#videos-and-clips) | Yes | Chat replay | In comments | Yes | | [Douyin](/docs/douyin#posts) | Yes | Yes | First 50 | No | | [LinkedIn](/docs/linkedin#posts) | Yes | First 10 | No | Yes | On Threads, Bluesky and X, a post's replies are its comments. On YouTube a post is a video, a Short or a community post; on Pinterest, a pin; on Twitch and Kick, a video or a clip; on Telegram, a channel's post or a group's message; on LinkedIn, a post or an article. ### Post Counts [#post-counts] | Platform | Views | Likes | Comments | Shares | Saves | | :---: | :---: | :---: | :---: | :---: | :---: | | [TikTok](/docs/tiktok#posts) | Yes | Yes | Yes | Yes | Yes | | [Instagram](/docs/instagram#posts) | Reels | Yes | Yes | No | No | | [YouTube](/docs/youtube#videos) | Yes | Yes | Rounded | No | No | | [Facebook](/docs/facebook#posts) | Videos | Yes | Yes | Yes | No | | [Threads](/docs/threads#posts) | No | Yes | Yes | Yes | No | | [Reddit](/docs/reddit#posts) | No | Score | Yes | No | No | | [Pinterest](/docs/pinterest#pins) | No | Yes | Yes | Yes | Yes | | [Twitch](/docs/twitch#videos-and-clips) | Yes | No | No | No | No | | [Bluesky](/docs/bluesky#posts) | No | Yes | Yes | Yes | Yes | | [X (Twitter)](/docs/x#posts) | Yes | Yes | Yes | Yes | Yes | | [Telegram](/docs/telegram#posts) | Rounded | Reactions | No | No | No | | [Kick](/docs/kick#videos-and-clips) | Yes | Clips | No | No | No | | [Douyin](/docs/douyin#posts) | No | Yes | Yes | Yes | Yes | | [LinkedIn](/docs/linkedin#posts) | No | Reactions | Yes | No | No | - Instagram shows views on reels in lists, Facebook on videos in `profile/videos`. - Facebook's `likes` is every reaction together, split by kind in `ext.reactions`. - TikTok and Threads add `reposts` in `ext`, and Threads adds `quotes`. - Reddit's `likes` is a post's score, upvotes less downvotes, with `ext.upvoteRatio`. - Pinterest gives a pin's comment count on `post` alone. - On Bluesky and X, `shares` are reposts and `saves` bookmarks, with quotes in `ext.quotes`. - Telegram's `likes` is every reaction together, each in `ext.reactions`, and its views and reactions are rounded past 1,000. ## Comments [#comments] | Platform | A page | Order | Replies | | :---: | :---: | :---: | :---: | | [TikTok](/docs/tiktok#posts) | 50 | TikTok's | Yes | | [Instagram](/docs/instagram#posts) | About 22 | Instagram's | No | | [YouTube](/docs/youtube#videos) | About 20 | Top or newest | Yes | | [Facebook](/docs/facebook#posts) | 10 | Most relevant | Yes | | [Threads](/docs/threads#posts) | About 15 | Top or recent | No | | [Reddit](/docs/reddit#posts) | About 25 | Best, top, new… | Yes | | [Pinterest](/docs/pinterest#pins) | 25 | Pinterest's | Yes | | [Twitch](/docs/twitch#videos-and-clips) | About 60 | By time | No | | [Bluesky](/docs/bluesky#posts) | One page | Top, newest, oldest | Yes | | [X (Twitter)](/docs/x#posts) | About 3 to 5 | X's | Yes | | [Telegram](/docs/telegram#comments) | 100, then 50 | Newest | Yes | | [Kick](/docs/kick#chat-replay) | 25 | Newest | Yes | | [Douyin](/docs/douyin#comments-and-replies) | 20 | Douyin's | Yes | | [LinkedIn](/docs/linkedin#post-fields) | About 10 | LinkedIn's | No | - TikTok reads replies by the comment's `id` as `commentId`, 50 a page. - Facebook and YouTube read replies by the comment's `ext.repliesToken`. - Reddit gives a comment's replies with it, and the rest by the comment's `ext.url`. - Pinterest reads replies by the comment's `id`. - Threads gives one page, and takes `sort`: `top` or `recent`. - Twitch reads a video's chat from any second of it, with `offset`. Kick reads it back from any second, each reply naming the message it answers. - Douyin reads a comment's first 50 replies by its `id` as `commentId`. - Bluesky gives a reply's own replies with it, and more by the reply's `id`. - X gives a post's top replies, on one page. - Telegram gives a channel post's comments, and the thread a group's message is in, each reply naming its parent. ## Transcripts [#transcripts] | Platform | Transcript | Source | Translated | Tracks in | | :---: | :---: | :---: | :---: | :---: | | [TikTok](/docs/tiktok#posts) | Yes | Captions | No | `ext.subtitles` | | [YouTube](/docs/youtube#videos) | Yes | Caption track | No | `languages` | | [Facebook](/docs/facebook#posts) | Yes | Caption track | When needed | `ext.captions` | | [Reddit](/docs/reddit#posts) | Yes | Caption track | No | | | [X (Twitter)](/docs/x#posts) | Yes | Caption track | No | | | [Kick](/docs/kick#transcripts) | Yes | Caption track | No | `languages` | | [LinkedIn](/docs/linkedin#transcripts) | Yes | Caption track | No | | | [Instagram](/docs/instagram) | No | | | | | [Threads](/docs/threads) | No | | | | | [Pinterest](/docs/pinterest) | No | | | | | [Twitch](/docs/twitch) | No | | | | | [Bluesky](/docs/bluesky) | No | | | | | [Telegram](/docs/telegram) | No | | | | | [Douyin](/docs/douyin) | No | | | | A transcript costs 10 credits, YouTube's 5, and is kept 30 days. A video without captions returns `404`, at no cost. Kick reads a clip whole and a video ten minutes at a time. ## Discovery [#discovery] | Platform | Search | Accounts | Trending | Hashtags | Sounds | Places | | :---: | :---: | :---: | :---: | :---: | :---: | :---: | | [TikTok](/docs/tiktok#discovery) | Yes | Yes | Yes | Yes | Yes | No | | [Instagram](/docs/instagram#discovery) | Yes | No | Yes | No | Yes | Yes | | [YouTube](/docs/youtube#discovery) | Yes | Channels | Yes | Yes | No | No | | [Facebook](/docs/facebook#marketplace-and-events) | No | No | No | No | No | No | | [Threads](/docs/threads#discovery) | Yes | Yes | Yes | No | No | No | | [Reddit](/docs/reddit#discovery) | Yes | Yes | Yes | No | No | No | | [Pinterest](/docs/pinterest#discovery) | Yes | Yes | Yes | No | No | No | | [Twitch](/docs/twitch#discovery) | Yes | Yes | Yes | No | No | No | | [Bluesky](/docs/bluesky#discovery) | Yes | Yes | Yes | Yes | No | No | | [X (Twitter)](/docs/x#discovery) | No | No | Yes | No | No | No | | [Telegram](/docs/telegram#channel-posts) | In a channel | No | No | In a channel | No | No | | [Douyin](/docs/douyin#discovery) | No | No | Yes | Yes | Yes | No | | [Kick](/docs/kick#discovery) | No | Yes | Yes | No | No | No | | [LinkedIn](/docs/linkedin#discovery) | Jobs, ads | By name | No | No | No | No | - TikTok searches 30 posts a page. Instagram gives about 100, mostly reels. - YouTube's search filters by type, upload date, length and features. - Reddit searches posts, comments, media and communities. - Pinterest searches pins, videos, boards and accounts, and has its Trends. - Threads gives about 30 top or 20 recent threads, on one page. - Instagram also has trending topics. Facebook has Marketplace and events. - Twitch searches videos, channels, categories and live channels, and has its categories. - Bluesky searches posts, accounts, feeds and starter packs, and has trending topics. - X has a country's trending topics and the day's trending posts, communities, broadcasts and Spaces. - Telegram searches one channel's posts, by words or a hashtag. - Kick searches channels, live broadcasts and categories, and has its categories and the site's top clips. - Douyin has its hot search list, recommended posts by category, and its search box's suggestions. - LinkedIn searches jobs and its Ad Library, and finds members by their first and last name. ## Choosing Platforms [#choosing-platforms] | If you need | Use | | --- | --- | | Followers lists | TikTok, Bluesky | | Who liked a post | Bluesky | | Who is live now | Twitch, Kick | | Comment replies | TikTok, YouTube, Facebook, Reddit, Pinterest, Bluesky | | What a video says | TikTok, YouTube, Facebook, Reddit, X, Kick, LinkedIn | | Exact counts | TikTok, Instagram, Pinterest, Twitch, Bluesky, X, Kick, Douyin, LinkedIn | | Chinese platforms | Douyin | | Search | Every platform but Facebook, X, Douyin and LinkedIn | | Jobs | LinkedIn | | Ads and who paid for them | LinkedIn | | Long histories | TikTok, 30 posts a page; YouTube playlists, 100; Telegram channels, to their first post | | Communities | Reddit, X | | Live audio | X Spaces | | Search trends | Pinterest | # Reddit (/docs/reddit) Read accounts with their posts and comments, communities with their rules and posts, a post with its comment thread, and what Reddit shows by search and trend. ## Quick Reference [#quick-reference] | Property | Value | | --- | --- | | Endpoints | 17 | | Accounts by | `handle` or `url` | | Communities by | `name` or `url` | | Posts by | `url` or `id` | | Posts a page | 25 | | Transcripts | Yes, 10 credits | | Counts | Score and comments, no views | ## Accounts [#accounts] | Endpoint | Returns | Credits | | --- | --- | :---: | | [`/v1/reddit/profile`](/docs/api-reference/reddit/profile) | A profile with its karma and trophies. | 1 | | [`/v1/reddit/profile/comments`](/docs/api-reference/reddit/profile-comments) | An account's comments, newest first, 25 a page. | 2 | | [`/v1/reddit/profile/posts`](/docs/api-reference/reddit/profile-posts) | An account's posts, newest first, 25 a page. | 1 | ### Read a Profile [#read-a-profile] **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.reddit.profile({ handle: "spez" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.reddit.profile(handle="spez").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/reddit/profile \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=spez" ``` **Response** ```json { "data": { "id": "1w72", "username": "spez", "displayName": null, "bio": "Reddit CEO", "avatarUrl": "https://styles.redditmedia.com/t5_3k30p/styles/profileIcon_uj015iwx9s7g1.png?width=256&height=256&crop=256:256,smart&s=aa819b0964f6e3019e769d1cc8ede7318c3869a3", "url": "https://www.reddit.com/user/spez/", "verified": true, "private": false, "followers": null, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": "2005-06-06T04:00:00.000Z", "ext": { "karma": { "total": 941417, "post": 184793, "comment": 756624, "awardee": 0, "awarder": 0 }, "employee": true, "moderator": true, "premium": true, "suspended": false, "bannerUrl": "https://b.thumbs.redditmedia.com/KWeEpVxXOGLoloMbM0IxGt9EiKPXizpwFgcSeWqtpZM.png", "trophies": [ { "name": "15-Year Club", "iconUrl": "https://www.redditstatic.com/awards2/15_year_club-70.png", "grantedAt": "2026-06-06T04:00:00.000Z" }, { "name": "Second", "iconUrl": "https://www.redditstatic.com/awards2/second_participant-70.png", "grantedAt": "2021-04-08T03:50:00.000Z" }, { "name": "Inciteful Link", "iconUrl": "https://www.redditstatic.com/awards2/inciteful_link-70.png", "grantedAt": "2021-03-25T08:28:08.000Z" } ] } } } ``` - A profile's `ext.karma` splits its karma by posts, comments and awards. - Its `ext` also says whether it is an employee or a moderator, with its trophies. - A suspended account returns `410 SUSPENDED`, at no cost. - An account's posts and comments take `sort`: `new` (the default), `hot`, `top` or `controversial`, and `time`. ## Communities [#communities] | Endpoint | Returns | Credits | | --- | --- | :---: | | [`/v1/reddit/subreddit`](/docs/api-reference/reddit/subreddit) | A community with its members, rules and weekly visitors. | 1 | | [`/v1/reddit/subreddit/posts`](/docs/api-reference/reddit/subreddit-posts) | A community's posts, 25 a page. | 1 | | [`/v1/reddit/subreddit/search`](/docs/api-reference/reddit/subreddit-search) | Posts in one community matching a query, about 7 a page. | 1 | - A community has its members, its visitors and contributions over the week, and its rules. - Its posts take `sort`: `hot` (the default), `new`, `top`, `rising` or `controversial`. - Top and controversial posts take `time`: `hour`, `day`, `week`, `month`, `year` or `all`. - The `new` feed has titles, scores and comment counts; read a post for its text and media. ## Posts [#posts] | Endpoint | Returns | Credits | | --- | --- | :---: | | [`/v1/reddit/post`](/docs/api-reference/reddit/post) | One post with its score, comment count and media. | 1 | | [`/v1/reddit/post/comments`](/docs/api-reference/reddit/post-comments) | A post's comments with their replies, a page at a time. | 5 | | [`/v1/reddit/post/comment/replies`](/docs/api-reference/reddit/post-comment-replies) | A comment's replies, 10 a page. | 1 | | [`/v1/reddit/post/transcript`](/docs/api-reference/reddit/post-transcript) | A video post's captions as text. | 10 | ### Post Fields [#post-fields] - The `text` is the body, and `ext.title` the title. - The `stats.likes` is its score, with `ext.upvoteRatio`. - Its `media` is its video, its gallery or its image, and a crosspost's are the original's. ### Comments [#comments] - A page has about 25 comments with their replies a few levels deep, 10 more a next page. - A reply's `parentId` names the comment it answers, and `ext.depth` how deep it sits. - Comments take `sort`: `best` (the default), `top`, `new`, `old`, `controversial` or `qa`. - A comment's further replies come from `post/comment/replies`, by its `ext.url`. ### Transcripts [#transcripts] A transcript is the caption track Reddit made for a video post. A video without one returns `404`, at no cost. ## Discovery [#discovery] | Endpoint | Returns | Credits | | --- | --- | :---: | | [`/v1/reddit/search`](/docs/api-reference/reddit/search) | Posts matching a query across Reddit, about 7 a page. | 1 | | [`/v1/reddit/search/comments`](/docs/api-reference/reddit/search-comments) | Comments matching a query across Reddit, about 9 a page. | 1 | | [`/v1/reddit/search/media`](/docs/api-reference/reddit/search-media) | Image and video posts matching a query, about 7 a page. | 1 | | [`/v1/reddit/search/subreddits`](/docs/api-reference/reddit/search-subreddits) | Communities matching a query, 25 a page. | 1 | | [`/v1/reddit/search/users`](/docs/api-reference/reddit/search-users) | Accounts matching a name, the first 25. | 1 | | [`/v1/reddit/trending`](/docs/api-reference/reddit/trending) | What is hot on Reddit now, 25 a page. | 1 | | [`/v1/reddit/trending/searches`](/docs/api-reference/reddit/trending-searches) | The searches Reddit shows as trending now. | 1 | - Search takes `sort`: `relevance` (the default), `hot`, `top`, `new` or `comments`, and `time`. - A search result has the words it matched in `ext.snippet`. - Trending is `r/popular` where the request is answered from, and the searches Reddit shows as trending. # Telegram (/docs/telegram) Read a channel, group, account or bot, a public channel's posts back to its first, a search inside a channel, one channel post or group message with its comments, and what an invite link opens. ## Quick Reference [#quick-reference] | Property | Value | | --- | --- | | Endpoints | 6 | | Channels and groups by | `handle` or `url` | | Posts by | `url` or `id` (`durov/574`) | | Invites by | `url` or `code` | | Posts a page | 20 | | Comments a page | 100, then 50 | | Counts | Subscribers, members, views, reactions | ## Channels and Groups [#channels-and-groups] | Endpoint | Returns | Credits | | --- | --- | :---: | | [`/v1/telegram/profile`](/docs/api-reference/telegram/profile) | A channel, group, account or bot with its counts. | 1 | | [`/v1/telegram/profile/posts`](/docs/api-reference/telegram/profile-posts) | A channel's posts, newest first. | 1 | | [`/v1/telegram/profile/search`](/docs/api-reference/telegram/profile-search) | A search inside a channel, newest first. | 1 | | [`/v1/telegram/invite`](/docs/api-reference/telegram/invite) | What an invite link opens. | 1 | ### Read a Profile [#read-a-profile] **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.telegram.profile({ handle: "durov" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.telegram.profile(handle="durov").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/telegram/profile \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=durov" ``` **Response** ```json { "data": { "id": "durov", "username": "durov", "displayName": "Pavel Durov", "bio": "Founder/CEO/Owner of Telegram.\n\nFounder of TON/Gram.\n\nHalf-part troll.", "avatarUrl": "https://cdn4.telesco.pe/file/hP1ROci3RQKSNiu0EqKtHT5U_iI_Jm-E7UrJ9lbUzyu6QI_qMAaKFwsVjzz49Sdy_ZR-18Ft4p7oI__K_XxnxDuQg_nn2dDVt4LT7kqv93S7jMBPAcoh_jubhlQGSekmhXOaYWT-Y6n3ZFghrHSd0ACzcmJb4lreWP4RvCfBKWRK2ivBsagTBrZe4lrXobwh4Ukti7XlIoRQduwiGjHrQoW0TRpcvKq3KINvKqmKvAmiAlWb-072JjjclzFbFL9otA3RHqetfL3fHXLTUWwp3yFy4zhTQezX_iYheYVQ3RqiV8JyGB9pPmjh7EmwJxyJ_BDy3pZCVZA4U21uBq8mbw.jpg", "url": "https://t.me/durov", "verified": true, "private": false, "followers": 9853398, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": null, "ext": { "kind": "channel", "online": null, "monthlyUsers": null, "channelId": "1006503122", "photos": 106, "videos": 47, "files": null, "links": 204, "previewable": true } } } ``` - A profile is a channel, a group, an account or a bot, as `ext.kind` says. - A channel's `followers` are its subscribers and a group's its members, both exact. A group also has `ext.online`, and a bot `ext.monthlyUsers`. - A channel's `ext` also has its photo, video, file and link counts and its numeric id (`channelId`). - A `handle` is taken with or without `@`, and a `url` as `t.me/durov` or `t.me/s/durov`. ### Channel Posts [#channel-posts] - A channel's posts come newest first, 20 a page, back to its first post. - A search finds the posts of one channel with every word of `query`, or a `#hashtag`'s, 20 a page. - A group's messages are read one at a time, with a message's link. A group, an account or a bot asked for its posts returns `400`, at no cost. ### Invites [#invites] An invite link (`t.me/+…`) opens a private channel or group: its title, description, picture and subscribers or members. An invite that opens nothing returns `404`, at no cost. ## Posts [#posts] | Endpoint | Returns | Credits | | --- | --- | :---: | | [`/v1/telegram/post`](/docs/api-reference/telegram/post) | One channel post or group message. | 1 | | [`/v1/telegram/post/comments`](/docs/api-reference/telegram/post-comments) | A post's comments, newest first. | 1 | ### Post Fields [#post-fields] - A post's `id` is its chat's name and its number there (`durov/574`), as its link ends. - The `stats` have its views and its reactions summed as `likes`. Each reaction is in `ext.reactions`, and stars paid as reactions in `ext.stars`. - Views and reactions past 1,000 are rounded, as Telegram shows them (`596K`). The figure as shown is in `ext.viewsShown`. - Its `media` is its photos, videos and sticker. A video's `url` is its file, signed for a few hours. A video too large for the web has its cover alone, and `ext.mediaHidden`. - Its `ext` also has its link preview, the post it was forwarded from, the message it answers, its signature and whether it was edited. - A group's message names its sender as `author` and has no views. ### Comments [#comments] A channel post's comments are its linked group's replies to it, and a group message's are the thread it is in. The newest 100 come first, then 50 a page, each with its sender, media and reactions, and the comment it answers as `parentId`. A commenter without a public name has no `author`, only `ext.authorName`. A post without comments returns an empty list. # Threads (/docs/threads) Read profiles with their threads, replies, media and reposts, a thread with its replies, and what Threads shows by search and trend. ## Quick Reference [#quick-reference] | Property | Value | | --- | --- | | Endpoints | 10 | | Accounts by | `handle` or `url` | | Threads by | `url` or `id` | | Threads a page | 25 | | Replies | About 15, one page | | Transcripts | No | | Counts | Followers, no views | ## Accounts [#accounts] | Endpoint | Returns | Credits | | --- | --- | :---: | | [`/v1/threads/profile`](/docs/api-reference/threads/profile) | A profile with its follower count. | 1 | | [`/v1/threads/profile/media`](/docs/api-reference/threads/profile-media) | An account's threads with photos or videos, 25 a page. | 1 | | [`/v1/threads/profile/posts`](/docs/api-reference/threads/profile-posts) | An account's threads, newest first, 25 a page. | 1 | | [`/v1/threads/profile/replies`](/docs/api-reference/threads/profile-replies) | An account's replies to other threads, 25 a page. | 1 | | [`/v1/threads/profile/reposts`](/docs/api-reference/threads/profile-reposts) | Other people's threads an account reposted. | 1 | ### Read a Profile [#read-a-profile] **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.threads.profile({ handle: "zuck" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.threads.profile(handle="zuck").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/threads/profile \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=zuck" ``` **Response** ```json { "data": { "id": "63055343223", "username": "zuck", "displayName": "Mark Zuckerberg", "bio": "Mostly superintelligence and MMA takes", "avatarUrl": "https://scontent-nrt6-1.cdninstagram.com/v/t51.82787-19/825322135_17989325280103224_1252773933700107438_n.jpg?stp=dst-jpg_s640x640_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby4xMDgwLmMyIn0&_nc_ht=scontent-nrt6-1.cdninstagram.com&_nc_cat=100&_nc_oc=Q6cZ2gEbJAaY4VAfsA-SdUiOuyyefB_PaDbIjArtHdBA5E9_oz8s23mkKO8K36do2sY94fk&_nc_ohc=TcNBs21yW1gQ7kNvwHHOsMz&_nc_gid=3utomVOdhJVr5GxFQLdxgQ&edm=AAZTMJEBAAAA&ccb=7-5&_nc_ct=RQAsPBUCFQIAAAA&oh=00_AQQ7XHzV0_X-JdqIiVqvgiHTaON1Otu3q1X6WoaBBg9WbA&oe=6B0BE5EB&_nc_sid=49cb7f", "url": "https://www.threads.com/@zuck", "verified": true, "private": false, "followers": 5783862, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": null, "ext": { "bioLinks": [], "interests": [ "AI Threads", "UFC Threads", "AI" ] } } } ``` A profile's `ext` has its `bioLinks` and `interests`. ### Profile Tabs [#profile-tabs] - Threads come newest first, pinned ones first of all. - Each reply names the thread it answers in `ext.replyTo`. - Each repost says when in `ext.repostedAt`. ## Posts [#posts] | Endpoint | Returns | Credits | | --- | --- | :---: | | [`/v1/threads/post`](/docs/api-reference/threads/post) | One thread with its counts, media and links. | 1 | | [`/v1/threads/post/comments`](/docs/api-reference/threads/post-comments) | A thread's replies, top or latest first. | 1 | ### Thread Fields [#thread-fields] - The `stats` have its likes, replies and shares. - Its `ext.reposts` and `ext.quotes` have the rest. - The thread it quotes or answers is in `ext.quoted` or `ext.replyTo`. ### Replies [#replies] A thread's comments are its replies, the first 15 or so, on one page. Their `sort` takes `top` (the default) or `recent`. ## Discovery [#discovery] | Endpoint | Returns | Credits | | --- | --- | :---: | | [`/v1/threads/search`](/docs/api-reference/threads/search) | Threads matching a query, top or latest first. | 1 | | [`/v1/threads/search/users`](/docs/api-reference/threads/search-users) | Accounts matching a name, the first 10. | 1 | | [`/v1/threads/trending`](/docs/api-reference/threads/trending) | The feed Threads gives a visitor now. | 1 | - Search takes `sort` too: about 30 `top` or 20 `recent` threads, on one page. - Account search gives the first 10 accounts, without their counts. - Trending is the feed a visitor gets, about 20 threads in all. # TikTok (/docs/tiktok) Read profiles and every list on them, posts with their comments and captions, and what TikTok shows by hashtag, sound, search and trend. ## Quick Reference [#quick-reference] | Property | Value | | --- | --- | | Endpoints | 22 | | Accounts by | `handle`, `url` or `secUid` | | Posts by | `url`, `id` or a share link | | Posts a page | 30 | | Comments a page | 50, with replies | | Transcripts | 10 credits | | Counts | Exact | ## Accounts [#accounts] | Endpoint | Returns | Credits | | --- | --- | :---: | | [`/v1/tiktok/profile`](/docs/api-reference/tiktok/profile) | A profile with its exact follower and like counts. | 1 | | [`/v1/tiktok/profile/followers`](/docs/api-reference/tiktok/profile-followers) | An account's followers, newest first, 30 a page. | 1 | | [`/v1/tiktok/profile/following`](/docs/api-reference/tiktok/profile-following) | The accounts an account follows, when it shows them. | 1 | | [`/v1/tiktok/profile/liked`](/docs/api-reference/tiktok/profile-liked) | Posts an account liked, when its likes are public. | 1 | | [`/v1/tiktok/profile/playlists`](/docs/api-reference/tiktok/profile-playlists) | The playlists an account made. | 1 | | [`/v1/tiktok/profile/posts`](/docs/api-reference/tiktok/profile-posts) | An account's posts, newest first, 30 a page. | 1 | | [`/v1/tiktok/profile/reposts`](/docs/api-reference/tiktok/profile-reposts) | Other people's posts an account reposted. | 1 | | [`/v1/tiktok/live`](/docs/api-reference/tiktok/live) | Whether an account is live, and its room. | 1 | ### Read a Profile [#read-a-profile] **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.tiktok.profile({ handle: "nike" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.tiktok.profile(handle="nike").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/tiktok/profile \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=nike" ``` **Response** ```json { "data": { "id": "208464585232822272", "username": "nike", "displayName": "Nike", "bio": "Just Do It.", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-maliva-avt-0068/e0b0ac7b6ad6447a8e923fd1eb162f2c~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=c73b1f8a&x-expires=1795730400&x-signature=WFCAToitWtbkgo5qXRwrQmcX%2FZY%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=my", "url": "https://www.tiktok.com/@nike", "verified": true, "private": false, "followers": 9440793, "following": 94, "likes": 51312842, "posts": 1131, "externalUrl": "http://empli.fi/niketiktok", "createdAt": null, "ext": { "secUid": "MS4wLjABAAAA_3ndMt8d_tECTdpKgCxcx238tOnQZX-20wqN01aMui5zQ7hsqSdff-jC5qYC-Cl_", "friends": 47, "liked": 0, "category": "Sports, Fitness & Outdoors", "seller": false, "likesPublic": false, "roomId": null } } } ``` Every count is exact: followers, following, likes and posts. ### After a Rename [#after-a-rename] An account's `ext.secUid` stays the same when its handle changes. Pass it as `secUid` to read the account by it. ### Hidden Lists [#hidden-lists] - Following returns `403 PRIVATE` when the account hides it. - Liked posts are an empty list when its likes are private. Its `ext.likesPublic` says which. - A private account's posts and lists return `403 PRIVATE`, at no cost. ### Live Rooms [#live-rooms] Read a room by its account, or by `roomId`. By its id, the room also says how many entered and when it ended. ## Posts [#posts] | Endpoint | Returns | Credits | | --- | --- | :---: | | [`/v1/tiktok/playlist/posts`](/docs/api-reference/tiktok/playlist-posts) | The posts of a playlist, 30 a page. | 1 | | [`/v1/tiktok/post`](/docs/api-reference/tiktok/post) | One post with its counts, media and sound. | 1 | | [`/v1/tiktok/post/comments`](/docs/api-reference/tiktok/post-comments) | A post's top-level comments, 50 a page. | 1 | | [`/v1/tiktok/post/comment/replies`](/docs/api-reference/tiktok/post-comment-replies) | The replies to one comment, 50 a page. | 1 | | [`/v1/tiktok/post/related`](/docs/api-reference/tiktok/post-related) | Posts TikTok recommends beside one post. | 1 | | [`/v1/tiktok/post/transcript`](/docs/api-reference/tiktok/post-transcript) | A post's captions as text with their times. | 10 | ### Post Fields [#post-fields] - The text on the video is in `ext.screenText`. - TikTok's guess of the caption's language is in `ext.language`. - The caption tracks are in `ext.subtitles`. ### Comments and Replies [#comments-and-replies] Comments come 50 a page. Read a comment's replies with the post and its `id` as `commentId`. ### Transcripts [#transcripts] **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.tiktok.postTranscript({ url: "https://www.tiktok.com/@nike/video/7711414040114892045" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.tiktok.post_transcript(url="https://www.tiktok.com/@nike/video/7711414040114892045").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/tiktok/post/transcript \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://www.tiktok.com/@nike/video/7711414040114892045" ``` **Response** ```json { "data": { "postId": "7711414040114892045", "language": "eng-US", "source": "ASR", "text": "Pole or podium?\nPodium. Podium.\nPole. Podium.\nUh, podium. Podium.\nStart soft. Transition of hard. Hard.\nHard or do it.\nHe knows him more than I do.\nUh, let's go soft.\nGotta be fast. Soft.\nGoing for the win. The win.\nEasy. The win,\nthe win. I mean,\nthe win is the win. But like if you got the fastest lap.\nI'm a stats girl. And you can wave that around and be like,\nwell, I was faster.\nUh. Oh, rain.\nI…", "cues": [ { "startSeconds": 0.02, "endSeconds": 1.2, "text": "Pole or podium?" }, { "startSeconds": 1.74, "endSeconds": 2.9, "text": "Podium. Podium." }, { "startSeconds": 2.901, "endSeconds": 4.121, "text": "Pole. Podium." } ] } } ``` - The captions are TikTok's own, generated or the author's. - A post without tracks returns `404`, at no cost. - A transcript costs 10 credits and is kept 30 days. ## Discovery [#discovery] | Endpoint | Returns | Credits | | --- | --- | :---: | | [`/v1/tiktok/collection/posts`](/docs/api-reference/tiktok/collection-posts) | The posts of a public saved collection, 30 a page. | 1 | | [`/v1/tiktok/hashtag`](/docs/api-reference/tiktok/hashtag) | A hashtag with its post and view counts. | 1 | | [`/v1/tiktok/hashtag/posts`](/docs/api-reference/tiktok/hashtag-posts) | Posts under a hashtag, 30 a page. | 1 | | [`/v1/tiktok/search`](/docs/api-reference/tiktok/search) | Posts matching a query, 30 a page. | 1 | | [`/v1/tiktok/search/users`](/docs/api-reference/tiktok/search-users) | Accounts matching a query. | 1 | | [`/v1/tiktok/sound`](/docs/api-reference/tiktok/sound) | A sound, and how many posts use it. | 1 | | [`/v1/tiktok/sound/posts`](/docs/api-reference/tiktok/sound-posts) | Posts that use a sound, 30 a page. | 1 | | [`/v1/tiktok/trending`](/docs/api-reference/tiktok/trending) | What the explore page shows now, by category. | 5 | ### Trending [#trending] - Trending takes the explore page's `category`, such as `comedy` or `daily-life`. - Without one, it reads `all`. - Each call outside the cache gives a fresh set of about 30 posts. ### Hashtags, Sounds and Playlists [#hashtags-sounds-and-playlists] - A hashtag is named by `name` (`fyp`, without `#`), `id` or `url`. - A sound, playlist or collection is named by `id` or `url`. ## Share Links [#share-links] Share links work wherever a `url` does: `vm.tiktok.com/…`, `vt.tiktok.com/…` and `tiktok.com/t/…`. - Each is followed once and cached for a day. - A link to the wrong kind of thing returns `400 INVALID_REQUEST`. # Twitch (/docs/twitch) Read channels with their live status, videos, clips and schedule, a video with its chat replay, a category with what is live in it, and what Twitch shows by search and by viewers. ## Quick Reference [#quick-reference] | Property | Value | | --- | --- | | Endpoints | 20 | | Channels by | `handle`, `url` or `id` | | Videos and clips by | `url` or `id` | | Categories by | `name`, `slug`, `id` or `url` | | Items a page | 30 | | Chat messages a page | About 60 | | Transcripts | No | | Counts | Views; followers on channels | ## Channels [#channels] | Endpoint | Returns | Credits | | --- | --- | :---: | | [`/v1/twitch/profile`](/docs/api-reference/twitch/profile) | A channel with its follower count and links. | 1 | | [`/v1/twitch/profile/clips`](/docs/api-reference/twitch/profile-clips) | A channel's clips, most viewed first, 30 a page. | 1 | | [`/v1/twitch/profile/posts`](/docs/api-reference/twitch/profile-posts) | A channel's videos, 30 a page. | 1 | | [`/v1/twitch/profile/schedule`](/docs/api-reference/twitch/profile-schedule) | A channel's coming broadcasts, 30 a page. | 1 | | [`/v1/twitch/live`](/docs/api-reference/twitch/live) | Whether a channel is live, with its broadcast. | 1 | ### Read a Channel [#read-a-channel] **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.twitch.profile({ handle: "shroud" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.twitch.profile(handle="shroud").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/twitch/profile \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=shroud" ``` **Response** ```json { "data": { "id": "37402112", "username": "shroud", "displayName": "shroud", "bio": "I'm back baby", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/c754eebf-745b-4e0a-814a-10bcaecaabbc-profile_image-300x300.png", "url": "https://www.twitch.tv/shroud", "verified": true, "private": false, "followers": 11286234, "following": null, "likes": null, "posts": 1624, "externalUrl": null, "createdAt": "2012-11-03T15:50:32.878Z", "ext": { "partner": true, "affiliate": false, "live": true, "bannerUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/dbee25e8-55b7-4565-87f0-e9d4661dcc66-profile_banner-480.jpeg", "offlineImageUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/0e68b939-5868-4ee5-b2b8-fdb51521c84d-channel_offline_image-1920x1080.jpeg", "color": "#00ADFF", "language": "EN", "links": [ { "name": "discord", "title": "Discord", "url": "https://discord.gg/shroud" }, { "name": "twitter", "title": "Twitter", "url": "https://twitter.com/shroud" }, { "name": "youtube", "title": "YouTube", "url": "https://youtube.com/shroud" } ], "panels": [ { "title": null, "description": null, "imageUrl": "https://panels.twitch.tv/panel-37402112-image-b4e05d8f-d6ac-44d4-bd27-ee2cc7f3c13a", "linkUrl": "https://load.gg/shroud-palworldocg" }, { "title": null, "description": null, "imageUrl": "https://panels.twitch.tv/panel-37402112-image-407517f5-8549-42ec-9433-d19837869c09", "linkUrl": "https://load.gg/shroudLogitech" }, { "title": null, "description": null, "imageUrl": "https://panels.twitch.tv/panel-37402112-image-503ca1b8-22d5-4eab-b610-e673c13860d8", "linkUrl": "https://www.youtube.com/shroud" } ], "team": { "name": "loadedllc", "displayName": "Loaded", "url": "https://www.twitch.tv/team/loadedllc" }, "lastLiveAt": "2026-11-25T17:38:22.069Z", "lastTitle": "day3.. we finally got lucia the real main character YAHOO!", "lastCategory": { "id": "1867279146", "name": "Grand Theft Auto VI", "slug": "grand-theft-auto-vi", "url": "https://www.twitch.tv/directory/category/grand-theft-auto-vi", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/1867279146_IGDB-285x380.jpg" }, "updatedAt": "2026-11-25T17:35:01.451Z" } } } ``` - A channel's `followers` is exact, and its `posts` the number of its videos. - Its `verified` says it is a Twitch Partner, and `ext.affiliate` an Affiliate. - Its `ext` also has its banner, its links and panels, its team and when it was last live. ### Live Status [#live-status] - On air, a live has its title, category, viewers, start time, language and tags. - Its `ext.chatters` is the accounts in its chat, and `ext.videoId` the video it is recorded to. - Off air, `live` is `false`, with the title and category the channel is set to. - Live status is kept for a minute. ### Channel Lists [#channel-lists] - Videos take `type`: `archive` (past broadcasts), `highlight` or `upload`, and `sort`: `latest` or `views`. - Clips come most viewed first, over a `period`: `day`, `week` (the default), `month` or `all`. - Clips also take `featured`, for the ones the channel features. - A schedule lists the coming broadcasts, each with its start, end and categories. ## Videos and Clips [#videos-and-clips] | Endpoint | Returns | Credits | | --- | --- | :---: | | [`/v1/twitch/post`](/docs/api-reference/twitch/post) | One video or clip with its views and a link to play it. | 1 | | [`/v1/twitch/post/comments`](/docs/api-reference/twitch/post-comments) | A video's chat replay, about 60 messages a page. | 1 | ### Post Fields [#post-fields] - The `ext.title` is the title, and `text` a video's description. - The `stats` have views. - A video's `ext.kind` is `archive`, `highlight` or `upload`, and a clip's `clip`. - A video's `ext.chapters` are the stretches of its broadcast in each category. - A clip's `ext` has who cut it, the video it is from and where in it. - Its `media` has a link to play it: a clip's file, or a video's playlist. The links last about 20 hours. ### Chat Replay [#chat-replay] A video's comments are the messages written in its chat while it was live, in order. Each has its author, its `ext.offsetSeconds` into the video, its badges and its emotes. Start anywhere in the video with `offset`, in seconds. ## Categories [#categories] | Endpoint | Returns | Credits | | --- | --- | :---: | | [`/v1/twitch/category`](/docs/api-reference/twitch/category) | A category with its viewers, channels and followers. | 1 | | [`/v1/twitch/category/clips`](/docs/api-reference/twitch/category-clips) | A category's clips, most viewed first, 30 a page. | 1 | | [`/v1/twitch/category/lives`](/docs/api-reference/twitch/category-lives) | A category's live channels, most watched first. | 1 | | [`/v1/twitch/category/posts`](/docs/api-reference/twitch/category-posts) | A category's videos, 30 a page. | 1 | - A category is a game, or a kind of broadcast such as Just Chatting. - It has its viewers and channels now, its followers and its genres. - Its live channels take `language` and `tag`, its videos `sort` and `language`, its clips `period` and `language`. ## Discovery [#discovery] | Endpoint | Returns | Credits | | --- | --- | :---: | | [`/v1/twitch/search`](/docs/api-reference/twitch/search) | Videos matching a query, 20 a page. | 1 | | [`/v1/twitch/search/categories`](/docs/api-reference/twitch/search-categories) | Categories matching a query, 30 a page. | 1 | | [`/v1/twitch/search/lives`](/docs/api-reference/twitch/search-lives) | Live channels matching a query, 30 a page. | 1 | | [`/v1/twitch/search/suggestions`](/docs/api-reference/twitch/search-suggestions) | What the search box suggests for a few letters. | 1 | | [`/v1/twitch/search/users`](/docs/api-reference/twitch/search-users) | Channels matching a query, 30 a page. | 1 | | [`/v1/twitch/trending`](/docs/api-reference/twitch/trending) | The live channels most watched now, 30 a page. | 1 | | [`/v1/twitch/trending/categories`](/docs/api-reference/twitch/trending-categories) | The categories most watched now, 30 a page. | 1 | - Search finds videos, channels, categories or live channels, each by its own endpoint. - Trending is the live channels most watched now, by `language` or `tag` if asked. - Trending categories are the categories most watched now. ## Batch [#batch] | Endpoint | Returns | Credits | | --- | --- | :---: | | [`/v1/twitch/batch/live`](/docs/api-reference/twitch/batch-live) | Up to 100 channels' live status at once. | 1 | | [`/v1/twitch/batch/profiles`](/docs/api-reference/twitch/batch-profiles) | Up to 50 channels at once, by their logins. | 1 | - Batch live reads up to 100 channels at once, and batch profiles up to 50. - Each channel is read as its own endpoint answers it, and one served from the cache is free. - A login that names no channel is left out of the answer, and costs nothing. # X (Twitter) (/docs/x) Read accounts with their posts, highlights and similar accounts, a post with its top replies and its video's transcript, what is trending in a country, communities with their top posts, live broadcasts and Spaces. ## Quick Reference [#quick-reference] | Property | Value | | --- | --- | | Endpoints | 13 | | Accounts by | `handle` or `url` | | Posts by | `url` or `id` | | Communities, broadcasts, Spaces by | `url` or `id` | | Posts a page | 20 | | Transcripts | Yes | | Counts | Views, likes, replies, reposts, quotes, bookmarks | ## Accounts [#accounts] | Endpoint | Returns | Credits | | --- | --- | :---: | | [`/v1/x/profile`](/docs/api-reference/x/profile) | An account with its follower and post counts. | 1 | | [`/v1/x/profile/highlights`](/docs/api-reference/x/profile-highlights) | The posts an account highlighted, newest first. | 1 | | [`/v1/x/profile/posts`](/docs/api-reference/x/profile-posts) | An account's posts and reposts, newest first. | 1 | | [`/v1/x/profile/similar`](/docs/api-reference/x/profile-similar) | Accounts like one, as X suggests them. | 1 | ### Read a Profile [#read-a-profile] **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.x.profile({ handle: "NASA" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.x.profile(handle="NASA").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/x/profile \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=NASA" ``` **Response** ```json { "data": { "id": "11348282", "username": "NASA", "displayName": "NASA", "bio": "Making the seemingly impossible, possible. ✨", "avatarUrl": "https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB_400x400.jpg", "url": "https://x.com/NASA", "verified": true, "private": false, "followers": 92078384, "following": 115, "likes": null, "posts": 74589, "externalUrl": "http://www.nasa.gov/", "createdAt": "2007-12-19T20:20:32.000Z", "ext": { "bannerUrl": "https://pbs.twimg.com/profile_banners/11348282/1788992290", "location": "Pale Blue Dot", "blueVerified": true, "verifiedType": "Government", "verifiedSince": "2009-08-07T19:53:50.941Z", "mediaPosts": 28267, "highlights": 296, "likesGiven": 17125, "pinnedPosts": [] } } } ``` - A profile has its follower, following and post counts, and its media posts in `ext.mediaPosts`. - Its `ext` has its banner, location, checkmark (`blueVerified`, `verifiedType`), highlights, the likes it gave and its pinned posts. - A `handle` is taken with or without `@`. ### Account Lists [#account-lists] - Posts are the account's posts and reposts, newest first, 20 a page and about 600 in all. A repost has `ext.repost`, with who reposted it and when. - Highlights are the posts the account highlighted, every one of them, 20 a page. - Similar accounts are the 20 accounts X suggests beside it, each with its counts. - A protected account's posts return `403 PRIVATE`, at no cost. ## Posts [#posts] | Endpoint | Returns | Credits | | --- | --- | :---: | | [`/v1/x/post`](/docs/api-reference/x/post) | One post with its views, likes, replies and reposts. | 1 | | [`/v1/x/post/comments`](/docs/api-reference/x/post-comments) | The top replies to a post. | 1 | | [`/v1/x/post/transcript`](/docs/api-reference/x/post-transcript) | A video post's captions as text. | 10 | ### Post Fields [#post-fields] - A post's `id` is X's, the digits its link ends with. - The `stats` have views, likes, comments (its replies), shares (its reposts) and saves (its bookmarks). - Its `ext.quotes` is the posts quoting it, and `ext.quoted` the post it quotes. - Its text has its links written out in full, also listed in `ext.links`, and a long post's whole text. - Its `media` is its images, videos and GIFs. A video's `url` is its best MP4, and `ext.playlists` its HLS playlist. ### Replies [#replies] A post's comments are its top replies, a few threads on one page. A reply to another reply names it as `parentId`, and a reply by the post's author has `ext.byAuthor`. ### Transcripts [#transcripts] A video post's transcript is X's own caption track, as timed lines and as plain text. It is either the track uploaded with the video or the one X made from its speech, which has `generated`. A transcript costs 10 credits and is kept 30 days. A post without a video, or a video without captions, returns `404`, at no cost. ## Communities [#communities] | Endpoint | Returns | Credits | | --- | --- | :---: | | [`/v1/x/community`](/docs/api-reference/x/community) | A community with its members, rules and topic. | 1 | | [`/v1/x/community/posts`](/docs/api-reference/x/community-posts) | A community's top posts. | 1 | - A community has its members, creation date, topic, rules, creator and the hashtags trending in it. - Its posts are its 20 top posts, ranked by X, on one page. ## Discovery [#discovery] | Endpoint | Returns | Credits | | --- | --- | :---: | | [`/v1/x/trending`](/docs/api-reference/x/trending) | The topics trending in a country, or worldwide. | 1 | | [`/v1/x/trending/posts`](/docs/api-reference/x/trending-posts) | The posts trending on X today. | 1 | - Trending takes `country`, an ISO code (`us`, `gb`, `tr`), and is worldwide without one. Each topic has its search on X and, when X counts one, its volume of posts. - Trending posts are the day's trending posts worldwide, on one page. ## Live [#live] | Endpoint | Returns | Credits | | --- | --- | :---: | | [`/v1/x/live`](/docs/api-reference/x/live) | A live video broadcast, running or ended. | 1 | | [`/v1/x/space`](/docs/api-reference/x/space) | A Space with its hosts, speakers and audience. | 1 | - A broadcast is a live video, running or ended, with its viewers while it runs and its views in all. - A Space is a live audio conversation, with its hosts, speakers, listeners and replays. - Both have their stream's playlist in `ext`: live while they run, their recording after. # YouTube (/docs/youtube) Read channels with their videos, Shorts, live streams, playlists and community posts, a video with its comments and captions, and what YouTube shows by search, hashtag and trend. ## Quick Reference [#quick-reference] | Property | Value | | --- | --- | | Endpoints | 26 | | Channels by | `handle`, `channelId` or `url` | | Videos by | `url` or `id` | | Videos a page | 30 | | Comments a page | About 20 | | Transcripts | Yes, 5 credits | | Counts | Views and likes; subscribers rounded | ## Channels [#channels] | Endpoint | Returns | Credits | | --- | --- | :---: | | [`/v1/youtube/profile`](/docs/api-reference/youtube/profile) | A channel with its subscribers, videos and views. | 1 | | [`/v1/youtube/profile/community`](/docs/api-reference/youtube/profile-community) | A channel's community posts, 10 a page. | 1 | | [`/v1/youtube/profile/lives`](/docs/api-reference/youtube/profile-lives) | A channel's live streams, on now and past, 30 a page. | 1 | | [`/v1/youtube/profile/playlists`](/docs/api-reference/youtube/profile-playlists) | A channel's playlists, 30 a page. | 1 | | [`/v1/youtube/profile/podcasts`](/docs/api-reference/youtube/profile-podcasts) | A channel's podcasts. | 1 | | [`/v1/youtube/profile/posts`](/docs/api-reference/youtube/profile-posts) | A channel's videos, 30 a page. | 1 | | [`/v1/youtube/profile/search`](/docs/api-reference/youtube/profile-search) | A search within one channel's videos, about 30 a page. | 1 | | [`/v1/youtube/profile/shorts`](/docs/api-reference/youtube/profile-shorts) | A channel's Shorts, about 48 a page. | 1 | ### Read a Channel [#read-a-channel] **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.youtube.profile({ handle: "LinusTechTips" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.youtube.profile(handle="LinusTechTips").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/youtube/profile \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=LinusTechTips" ``` **Response** ```json { "data": { "id": "UCXuqSBlHAE6Xw-yeJA0Tunw", "username": "LinusTechTips", "displayName": "Linus Tech Tips", "bio": "Linus Tech Tips is a passionate team of \"professionally curious\" experts in consumer technology and video production who aim to educate and entertain.\n\nSponsorship Inquiries: partnerships@linusmediagroup.com", "avatarUrl": "https://yt3.googleusercontent.com/gnvYLhXy8FAlPXZ2RTrkrgj-5kyt0vdE2FUGVOiKGdEZIa-wN5A-7nwZBlWJLzUMmoh1NWAU=s160-c-k-c0x00ffffff-no-rj", "url": "https://www.youtube.com/@LinusTechTips", "verified": true, "private": false, "followers": 16900000, "following": null, "likes": null, "posts": 8011, "externalUrl": "https://www.lttstore.com/", "createdAt": "2008-11-24T00:00:00.000Z", "ext": { "views": 10045352646, "country": "Canada", "bannerUrl": "https://yt3.googleusercontent.com/U_7GWetO6k4sq3pAkbFEIIWzZLKcIJlGJqNz6NQAhgqF6DVD5pllwWF6trSUWEIRn4MkhNlhy9Y=w2560-fcrop64=1,00005a57ffffa5a8-k-c0xffffffff-no-nd-rj", "links": [ { "title": "lttstore.com", "url": "https://www.lttstore.com/" }, { "title": "Floatplane", "url": "https://www.floatplane.com/ltt" }, { "title": "Labs", "url": "https://www.lttlabs.com/" } ], "subscribersText": "16.9M subscribers" } } } ``` - A channel's `followers` are its subscribers, rounded as YouTube shows them (`16.9M`). - Its `posts` is its video count, and `ext.views` its total views, both exact. - Its `ext` also has its country, banner and links. ### Channel Tabs [#channel-tabs] - Videos, Shorts and live streams take `sort`: `latest` (the default), `popular` or `oldest`. - A list gives when a video was published as YouTube writes it, in `ext.publishedText`. - Members-only videos have `ext.membersOnly`, and no views. - Podcasts are playlists of their episodes. ## Videos [#videos] | Endpoint | Returns | Credits | | --- | --- | :---: | | [`/v1/youtube/community`](/docs/api-reference/youtube/community) | One community post with its likes and images. | 1 | | [`/v1/youtube/playlist`](/docs/api-reference/youtube/playlist) | A playlist with its owner and video count. | 1 | | [`/v1/youtube/playlist/posts`](/docs/api-reference/youtube/playlist-posts) | A playlist's videos in order, 100 a page. | 1 | | [`/v1/youtube/post`](/docs/api-reference/youtube/post) | One video or Short with its views, likes and chapters. | 1 | | [`/v1/youtube/post/comments`](/docs/api-reference/youtube/post-comments) | A video's comments, top or newest first, about 20 a page. | 1 | | [`/v1/youtube/post/comment/replies`](/docs/api-reference/youtube/post-comment-replies) | A comment's replies, 10 a page. | 1 | | [`/v1/youtube/post/related`](/docs/api-reference/youtube/post-related) | The videos YouTube suggests beside one, about 20 a page. | 1 | | [`/v1/youtube/post/transcript`](/docs/api-reference/youtube/post-transcript) | A video's captions as text. | 5 | ### Video Fields [#video-fields] - The `text` is the description, and `ext.title` the title. - The `stats` have views and likes; comments are rounded as YouTube shows them. - Its `ext` has its length, category, tags, chapters and the songs it credits. - A Short's `ext.kind` is `short`, a live stream's `live`, a community post's `community`. ### Comments [#comments] Comments take `sort`: `top` (the default) or `newest`. A comment with replies has `ext.repliesToken`, which `post/comment/replies` takes as `token`, 10 a page. ### Transcripts [#transcripts] A transcript is the uploader's captions in the `language` you ask for, else YouTube's own in the language spoken. Its `languages` lists every language the video has, and `generated` says when YouTube wrote it. ## Discovery [#discovery] | Endpoint | Returns | Credits | | --- | --- | :---: | | [`/v1/youtube/hashtag`](/docs/api-reference/youtube/hashtag) | A hashtag with its video and channel counts. | 1 | | [`/v1/youtube/hashtag/posts`](/docs/api-reference/youtube/hashtag-posts) | A hashtag's videos or Shorts, about 36 a page. | 1 | | [`/v1/youtube/search`](/docs/api-reference/youtube/search) | Videos matching a query, about 20 a page. | 1 | | [`/v1/youtube/search/channels`](/docs/api-reference/youtube/search-channels) | Channels matching a query, about 20 a page. | 1 | | [`/v1/youtube/search/playlists`](/docs/api-reference/youtube/search-playlists) | Playlists matching a query, about 20 a page. | 1 | | [`/v1/youtube/search/suggestions`](/docs/api-reference/youtube/search-suggestions) | What the search box suggests for a few letters. | 1 | | [`/v1/youtube/trending`](/docs/api-reference/youtube/trending) | What is trending in a country, about 20 videos. | 1 | - Search takes `type` (`videos`, `shorts`, `live`), `uploaded`, `duration`, `features` and `sort`. - Trending is YouTube's chart of a country's trending videos, by `country`. - A hashtag's videos take `shorts` for its Shorts alone. ## Batch [#batch] | Endpoint | Returns | Credits | | --- | --- | :---: | | [`/v1/youtube/batch/posts`](/docs/api-reference/youtube/batch-posts) | Up to 50 videos at once, by their ids. | 1 | | [`/v1/youtube/batch/profiles`](/docs/api-reference/youtube/batch-profiles) | Up to 20 channels at once, by their ids or handles. | 1 | | [`/v1/youtube/batch/transcripts`](/docs/api-reference/youtube/batch-transcripts) | Up to 20 videos' captions at once, by their ids. | 5 | - Each item is read as its own endpoint answers it, and one served from the cache is free. - An item not found is left out of the answer, and costs nothing. # Credits (/docs/api-reference/account/credits) The credits left in your workspace. `GET https://api.socialapi.sh/v1/credits` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const answer = await client.account.getCredits(); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) answer = client.account.get_credits() ``` **cURL** ```bash curl https://api.socialapi.sh/v1/credits \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" ``` **Response** ```json { "balance": 319668 } ``` **OpenAPI** ```json { "paths": { "/v1/credits": { "get": { "tags": [ "Account" ], "summary": "The credits left in your workspace.", "description": "Free, and not counted against the rate limit.", "operationId": "getCredits", "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreditsBody" }, "example": { "balance": 319668 } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst answer = await client.account.getCredits();" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\nanswer = client.account.get_credits()" }, { "lang": "bash", "label": "cURL", "source": "curl https://api.socialapi.sh/v1/credits \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "CreditsBody": { "type": "object", "required": [ "balance" ], "properties": { "balance": { "type": "integer", "format": "int64", "description": "Credits available to this API key's workspace." } } } } } } ``` # Account (/docs/api-reference/account) Your workspace's own endpoints. They are free to call. ## Quick Reference [#quick-reference] | Property | Value | | --- | --- | | Base path | `/v1` | | Endpoints | 1 | | Credits | Free | | Guide | [Credits](/docs/credits) | ## Endpoints [#endpoints] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/credits`](/docs/api-reference/account/credits) | The credits left in your workspace. | Free | ## Example Request [#example-request] Read your balance. It does not count against the rate limit. **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const answer = await client.account.getCredits(); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) answer = client.account.get_credits() ``` **cURL** ```bash curl https://api.socialapi.sh/v1/credits \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" ``` **Response** ```json { "balance": 319668 } ``` ## Errors [#errors] A call that fails costs nothing. See [Errors](/docs/errors) for every code. # Batch Posts (/docs/api-reference/bluesky/batch-posts) Up to 25 posts at once, by their ids or links. `GET https://api.socialapi.sh/v1/bluesky/batch/posts` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.bluesky.batchPosts({ ids: "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3l6oveex3ii2l,at://did:plc:dalbbospvxinrzc7a5clbnyj/app.bsky.feed.post/3n2xthjwiac22,at://did:plc:e6n7jxtu2qrhwvp3j6ib6sq6/app.bsky.feed.post/3n2u4lvqty227" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.bluesky.batch_posts(ids="at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3l6oveex3ii2l,at://did:plc:dalbbospvxinrzc7a5clbnyj/app.bsky.feed.post/3n2xthjwiac22,at://did:plc:e6n7jxtu2qrhwvp3j6ib6sq6/app.bsky.feed.post/3n2u4lvqty227") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/bluesky/batch/posts \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "ids=at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3l6oveex3ii2l,at://did:plc:dalbbospvxinrzc7a5clbnyj/app.bsky.feed.post/3n2xthjwiac22,at://did:plc:e6n7jxtu2qrhwvp3j6ib6sq6/app.bsky.feed.post/3n2u4lvqty227" ``` **Response** ```json { "data": [ { "id": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3l6oveex3ii2l", "url": "https://bsky.app/profile/bsky.app/post/3l6oveex3ii2l", "text": "👋 Bluesky is an open social network that gives creators independence from platforms, developers the freedom to build, and users a choice in their experience. We're so excited to have you here! \n\nWe share Bluesky updates & news from this account. A quick orientation thread: 🧵✨", "createdAt": "2024-10-17T07:06:51.491Z", "author": { "id": "did:plc:z72i7hdynmk6r22z27h6tvur", "username": "bsky.app", "displayName": "Bluesky", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreihwihm6kpd6zuwhhlro75p5qks5qtrcu55jp3gddbfjsieiv7wuka", "verified": false, "url": "https://bsky.app/profile/bsky.app" }, "stats": { "views": null, "likes": 63842, "comments": 8779, "shares": 9585, "saves": 290, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "cid": "bafyreicnt42y6vo6pfpvyro234ac4o6ijug6adwwrh7awflgrqlt4zibxq", "rkey": "3l6oveex3ii2l", "quotes": 729, "langs": [ "en" ], "replyTo": null, "repost": null, "pinned": false, "quoted": null, "link": null, "altTexts": [], "repliesRestricted": true, "labels": [], "indexedAt": "2024-10-17T07:06:51.491Z" } }, { "id": "at://did:plc:dalbbospvxinrzc7a5clbnyj/app.bsky.feed.post/3n2xthjwiac22", "url": "https://bsky.app/profile/odpomery.bsky.social/post/3n2xthjwiac22", "text": "Night and day illustrations I did for @bsky.app earlier this year!", "createdAt": "2026-11-23T09:38:25.356Z", "author": { "id": "did:plc:dalbbospvxinrzc7a5clbnyj", "username": "odpomery.bsky.social", "displayName": "Owen D. Pomery", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:dalbbospvxinrzc7a5clbnyj/bafkreigbxpqxwqgngqy35jgpzh7pguqtklvfbffjr523hubgpcqgobnc5e", "verified": false, "url": "https://bsky.app/profile/odpomery.bsky.social" }, "stats": { "views": null, "likes": 1536, "comments": 21, "shares": 93, "saves": 42, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://video.bsky.app/watch/did%3Aplc%3Adalbbospvxinrzc7a5clbnyj/bafkreidgg5yet4cavzeyh3hdljkh5ttfum7o27rqjvhyqpf7gslt55irsu/playlist.m3u8", "thumbnailUrl": "https://video.bsky.app/watch/did%3Aplc%3Adalbbospvxinrzc7a5clbnyj/bafkreidgg5yet4cavzeyh3hdljkh5ttfum7o27rqjvhyqpf7gslt55irsu/thumbnail.jpg", "width": 800, "height": 1302, "durationSeconds": null } ], "hashtags": [], "mentions": [ "bsky.app" ], "ext": { "cid": "bafyreicahfeh6pb3htyefflu7fcjjle7pqetqypmx2ko3ymvr6hbo2fi3e", "rkey": "3n2xthjwiac22", "quotes": 4, "langs": [ "en" ], "replyTo": null, "repost": null, "pinned": false, "quoted": null, "link": null, "altTexts": [], "repliesRestricted": false, "labels": [], "indexedAt": "2026-11-23T09:38:28.548Z" } } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/bluesky/batch/posts": { "get": { "tags": [ "Bluesky" ], "summary": "Up to 25 posts at once, by their ids or links.", "description": "Each as `/post` answers it; one not found is left out. 1 credit a post found (one\nserved from the cache is free).", "operationId": "blueskyBatchPosts", "parameters": [ { "name": "ids", "in": "query", "description": "Up to 25 posts, comma-separated: their AT-URIs (their `id`s) or bsky.app links.", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_BlueskyPost" }, "example": { "data": [ { "id": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3l6oveex3ii2l", "url": "https://bsky.app/profile/bsky.app/post/3l6oveex3ii2l", "text": "👋 Bluesky is an open social network that gives creators independence from platforms, developers the freedom to build, and users a choice in their experience. We're so excited to have you here! \n\nWe share Bluesky updates & news from this account. A quick orientation thread: 🧵✨", "createdAt": "2024-10-17T07:06:51.491Z", "author": { "id": "did:plc:z72i7hdynmk6r22z27h6tvur", "username": "bsky.app", "displayName": "Bluesky", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreihwihm6kpd6zuwhhlro75p5qks5qtrcu55jp3gddbfjsieiv7wuka", "verified": false, "url": "https://bsky.app/profile/bsky.app" }, "stats": { "views": null, "likes": 63842, "comments": 8779, "shares": 9585, "saves": 290, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "cid": "bafyreicnt42y6vo6pfpvyro234ac4o6ijug6adwwrh7awflgrqlt4zibxq", "rkey": "3l6oveex3ii2l", "quotes": 729, "langs": [ "en" ], "replyTo": null, "repost": null, "pinned": false, "quoted": null, "link": null, "altTexts": [], "repliesRestricted": true, "labels": [], "indexedAt": "2024-10-17T07:06:51.491Z" } }, { "id": "at://did:plc:dalbbospvxinrzc7a5clbnyj/app.bsky.feed.post/3n2xthjwiac22", "url": "https://bsky.app/profile/odpomery.bsky.social/post/3n2xthjwiac22", "text": "Night and day illustrations I did for @bsky.app earlier this year!", "createdAt": "2026-11-23T09:38:25.356Z", "author": { "id": "did:plc:dalbbospvxinrzc7a5clbnyj", "username": "odpomery.bsky.social", "displayName": "Owen D. Pomery", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:dalbbospvxinrzc7a5clbnyj/bafkreigbxpqxwqgngqy35jgpzh7pguqtklvfbffjr523hubgpcqgobnc5e", "verified": false, "url": "https://bsky.app/profile/odpomery.bsky.social" }, "stats": { "views": null, "likes": 1536, "comments": 21, "shares": 93, "saves": 42, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://video.bsky.app/watch/did%3Aplc%3Adalbbospvxinrzc7a5clbnyj/bafkreidgg5yet4cavzeyh3hdljkh5ttfum7o27rqjvhyqpf7gslt55irsu/playlist.m3u8", "thumbnailUrl": "https://video.bsky.app/watch/did%3Aplc%3Adalbbospvxinrzc7a5clbnyj/bafkreidgg5yet4cavzeyh3hdljkh5ttfum7o27rqjvhyqpf7gslt55irsu/thumbnail.jpg", "width": 800, "height": 1302, "durationSeconds": null } ], "hashtags": [], "mentions": [ "bsky.app" ], "ext": { "cid": "bafyreicahfeh6pb3htyefflu7fcjjle7pqetqypmx2ko3ymvr6hbo2fi3e", "rkey": "3n2xthjwiac22", "quotes": 4, "langs": [ "en" ], "replyTo": null, "repost": null, "pinned": false, "quoted": null, "link": null, "altTexts": [], "repliesRestricted": false, "labels": [], "indexedAt": "2026-11-23T09:38:28.548Z" } } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.bluesky.batchPosts({ ids: \"at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3l6oveex3ii2l,at://did:plc:dalbbospvxinrzc7a5clbnyj/app.bsky.feed.post/3n2xthjwiac22,at://did:plc:e6n7jxtu2qrhwvp3j6ib6sq6/app.bsky.feed.post/3n2u4lvqty227\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.bluesky.batch_posts(ids=\"at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3l6oveex3ii2l,at://did:plc:dalbbospvxinrzc7a5clbnyj/app.bsky.feed.post/3n2xthjwiac22,at://did:plc:e6n7jxtu2qrhwvp3j6ib6sq6/app.bsky.feed.post/3n2u4lvqty227\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/bluesky/batch/posts \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"ids=at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3l6oveex3ii2l,at://did:plc:dalbbospvxinrzc7a5clbnyj/app.bsky.feed.post/3n2xthjwiac22,at://did:plc:e6n7jxtu2qrhwvp3j6ib6sq6/app.bsky.feed.post/3n2u4lvqty227\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_BlueskyPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/BlueskyPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "BlueskyPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "cid", "rkey", "langs", "pinned", "altTexts", "repliesRestricted", "labels" ], "properties": { "altTexts": { "type": "array", "items": { "type": "string" }, "description": "Each image's or video's description for screen readers, in `media`'s order; empty\nwhen none has one." }, "cid": { "type": "string", "description": "The record's content hash and its key (the last part of its link)." }, "indexedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "When Bluesky indexed it." }, { "type": "null" } ] }, "labels": { "type": "array", "items": { "type": "string" }, "description": "Labels on the post, by value (`porn`, `graphic-media`…)." }, "langs": { "type": "array", "items": { "type": "string" }, "description": "The languages its author set." }, "link": { "oneOf": [ { "$ref": "#/components/schemas/BlueskyLinkCard" }, { "type": "null" } ] }, "pinned": { "type": "boolean", "description": "Pinned to its author's profile, in that account's posts." }, "quoted": { "oneOf": [ { "$ref": "#/components/schemas/BlueskyQuoted" }, { "type": "null" } ] }, "quotes": { "type": [ "integer", "null" ], "format": "int64", "description": "Posts quoting it.", "minimum": 0 }, "repliesRestricted": { "type": "boolean", "description": "Whether its author limited who may reply." }, "replyTo": { "oneOf": [ { "$ref": "#/components/schemas/BlueskyReplyRef", "description": "What it replies to, when it is a reply." }, { "type": "null" } ] }, "repost": { "oneOf": [ { "$ref": "#/components/schemas/BlueskyRepost", "description": "Who reposted it into this list, in an account's posts." }, { "type": "null" } ] }, "rkey": { "type": "string" } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A post: text, images, a video, a link or a quote." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "BlueskyRepost": { "type": "object", "description": "Who reposted a post into the list it is in, and when.", "required": [ "by" ], "properties": { "at": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "by": { "$ref": "#/components/schemas/Author" } } }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } }, "Timestamp": { "type": "string", "format": "date-time" }, "BlueskyReplyRef": { "type": "object", "description": "The post a reply answers, and the thread's first post.", "required": [ "parent", "root" ], "properties": { "parent": { "type": "string" }, "root": { "type": "string" } } }, "BlueskyQuoted": { "type": "object", "description": "What a post quotes: a post, or a feed, list or starter pack it embeds.", "required": [ "id" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "id": { "type": "string", "description": "Its AT-URI." }, "text": { "type": [ "string", "null" ], "description": "A quoted post's text, or the name of a feed, list or starter pack." }, "url": { "type": [ "string", "null" ] } } }, "BlueskyLinkCard": { "type": "object", "description": "The link a post shares, as its card shows it.", "required": [ "url" ], "properties": { "description": { "type": [ "string", "null" ] }, "thumbnailUrl": { "type": [ "string", "null" ] }, "title": { "type": [ "string", "null" ] }, "url": { "type": "string" } } } } } } ``` # Batch Profiles (/docs/api-reference/bluesky/batch-profiles) Up to 25 accounts at once, by handle or DID. `GET https://api.socialapi.sh/v1/bluesky/batch/profiles` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.bluesky.batchProfiles({ handles: "bsky.app,jay.bsky.team" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.bluesky.batch_profiles(handles="bsky.app,jay.bsky.team") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/bluesky/batch/profiles \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handles=bsky.app,jay.bsky.team" ``` **Response** ```json { "data": [ { "id": "did:plc:z72i7hdynmk6r22z27h6tvur", "username": "bsky.app", "displayName": "Bluesky", "bio": "official Bluesky account (check username👆)\n\nBugs, feature requests, feedback: support@bsky.app", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreihwihm6kpd6zuwhhlro75p5qks5qtrcu55jp3gddbfjsieiv7wuka", "url": "https://bsky.app/profile/bsky.app", "verified": false, "private": false, "followers": 35847780, "following": 44, "likes": null, "posts": 928, "externalUrl": null, "createdAt": "2023-04-12T04:53:57.057Z", "ext": { "bannerUrl": "https://cdn.bsky.app/img/banner/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreichzyovokfzmymz36p5jibbjrhsur6n7hjnzxrpbt5jaydp2szvna", "pronouns": null, "pinnedPost": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3l6oveex3ii2l", "lists": 26, "feeds": 7, "starterPacks": 23, "trustedVerifier": true, "labeler": false, "liveUrl": null, "labels": [], "indexedAt": "2026-11-04T15:41:10.973Z" } }, { "id": "did:plc:oky5czdrnfjpqslsw2a5iclo", "username": "jay.bsky.team", "displayName": "Jay 🦋", "bio": "Founder & Chief Innovation Officer @ Bluesky\n\nWorking on @attie.ai\n\n🌱 🪴 🌳", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:oky5czdrnfjpqslsw2a5iclo/bafkreihxtnc37g7jqdcgidtkknwuswtjiijcdnc6cx4imc4oq33cnsc5da", "url": "https://bsky.app/profile/jay.bsky.team", "verified": true, "private": false, "followers": 594411, "following": 3995, "likes": null, "posts": 4188, "externalUrl": null, "createdAt": "2022-11-17T06:31:40.296Z", "ext": { "bannerUrl": "https://cdn.bsky.app/img/banner/plain/did:plc:oky5czdrnfjpqslsw2a5iclo/bafkreicgnmvhtmj4arcvwhueygbwvkucd3odvom3lxtfmn6wlqbh3yf7p4", "pronouns": null, "pinnedPost": null, "lists": 0, "feeds": 0, "starterPacks": 0, "trustedVerifier": false, "labeler": false, "liveUrl": null, "labels": [], "indexedAt": "2026-03-29T21:16:33.460Z" } } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/bluesky/batch/profiles": { "get": { "tags": [ "Bluesky" ], "summary": "Up to 25 accounts at once, by handle or DID.", "description": "Each as `/profile` answers it; one not found is left out. 1 credit an account found\n(one served from the cache is free).", "operationId": "blueskyBatchProfiles", "parameters": [ { "name": "handles", "in": "query", "description": "Up to 25 handles or DIDs, comma-separated.", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_BlueskyProfile" }, "example": { "data": [ { "id": "did:plc:z72i7hdynmk6r22z27h6tvur", "username": "bsky.app", "displayName": "Bluesky", "bio": "official Bluesky account (check username👆)\n\nBugs, feature requests, feedback: support@bsky.app", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreihwihm6kpd6zuwhhlro75p5qks5qtrcu55jp3gddbfjsieiv7wuka", "url": "https://bsky.app/profile/bsky.app", "verified": false, "private": false, "followers": 35847780, "following": 44, "likes": null, "posts": 928, "externalUrl": null, "createdAt": "2023-04-12T04:53:57.057Z", "ext": { "bannerUrl": "https://cdn.bsky.app/img/banner/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreichzyovokfzmymz36p5jibbjrhsur6n7hjnzxrpbt5jaydp2szvna", "pronouns": null, "pinnedPost": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3l6oveex3ii2l", "lists": 26, "feeds": 7, "starterPacks": 23, "trustedVerifier": true, "labeler": false, "liveUrl": null, "labels": [], "indexedAt": "2026-11-04T15:41:10.973Z" } }, { "id": "did:plc:oky5czdrnfjpqslsw2a5iclo", "username": "jay.bsky.team", "displayName": "Jay 🦋", "bio": "Founder & Chief Innovation Officer @ Bluesky\n\nWorking on @attie.ai\n\n🌱 🪴 🌳", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:oky5czdrnfjpqslsw2a5iclo/bafkreihxtnc37g7jqdcgidtkknwuswtjiijcdnc6cx4imc4oq33cnsc5da", "url": "https://bsky.app/profile/jay.bsky.team", "verified": true, "private": false, "followers": 594411, "following": 3995, "likes": null, "posts": 4188, "externalUrl": null, "createdAt": "2022-11-17T06:31:40.296Z", "ext": { "bannerUrl": "https://cdn.bsky.app/img/banner/plain/did:plc:oky5czdrnfjpqslsw2a5iclo/bafkreicgnmvhtmj4arcvwhueygbwvkucd3odvom3lxtfmn6wlqbh3yf7p4", "pronouns": null, "pinnedPost": null, "lists": 0, "feeds": 0, "starterPacks": 0, "trustedVerifier": false, "labeler": false, "liveUrl": null, "labels": [], "indexedAt": "2026-03-29T21:16:33.460Z" } } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.bluesky.batchProfiles({ handles: \"bsky.app,jay.bsky.team\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.bluesky.batch_profiles(handles=\"bsky.app,jay.bsky.team\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/bluesky/batch/profiles \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handles=bsky.app,jay.bsky.team\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_BlueskyProfile": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/BlueskyProfile" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "BlueskyProfile": { "allOf": [ { "type": "object", "description": "An account.", "required": [ "id", "username", "url", "verified", "private", "ext" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "bio": { "type": [ "string", "null" ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "displayName": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "trustedVerifier", "labeler", "labels" ], "properties": { "bannerUrl": { "type": [ "string", "null" ], "description": "The profile's banner picture." }, "feeds": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "indexedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "When Bluesky last indexed the profile." }, { "type": "null" } ] }, "labeler": { "type": "boolean", "description": "A labeler: a moderation service others subscribe to." }, "labels": { "type": "array", "items": { "type": "string" }, "description": "Labels on the account, by value. `!no-unauthenticated` is the account asking apps\nnot to show it to visitors who are not signed in." }, "lists": { "type": [ "integer", "null" ], "format": "int64", "description": "The lists, feeds and starter packs it made.", "minimum": 0 }, "liveUrl": { "type": [ "string", "null" ], "description": "Where it is live now, while it says it is." }, "pinnedPost": { "type": [ "string", "null" ], "description": "The post pinned to it, as `/v1/bluesky/post` takes it." }, "pronouns": { "type": [ "string", "null" ], "description": "The pronouns it lists." }, "starterPacks": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "trustedVerifier": { "type": "boolean", "description": "A trusted verifier: an account whose word verifies others." } } }, { "type": "object", "description": "What only this platform has." } ] }, "externalUrl": { "type": [ "string", "null" ], "description": "The link in the bio." }, "followers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "following": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "id": { "type": "string", "description": "The platform's id for the account." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "description": "Likes the account's posts received in total.", "minimum": 0 }, "posts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "private": { "type": "boolean" }, "url": { "type": "string", "description": "The profile's page." }, "username": { "type": "string", "description": "The handle, without `@`." }, "verified": { "type": "boolean" } } }, { "type": "object", "description": "A Bluesky account." } ] }, "Timestamp": { "type": "string", "format": "date-time" } } } } ``` # Feed Posts (/docs/api-reference/bluesky/feed-posts) A feed's posts, 50 a page. `GET https://api.socialapi.sh/v1/bluesky/feed/posts` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.bluesky.feedPosts({ url: "https://bsky.app/profile/bsky.app/feed/whats-hot" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.bluesky.feed_posts(url="https://bsky.app/profile/bsky.app/feed/whats-hot") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/bluesky/feed/posts \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://bsky.app/profile/bsky.app/feed/whats-hot" ``` **Response** ```json { "data": [ { "id": "at://did:plc:ccscygoww4uf76s5eyu7pqut/app.bsky.feed.post/3n34y7mq2wk2a", "url": "https://bsky.app/profile/michaelwarburton.bsky.social/post/3n34y7mq2wk2a", "text": "17yr old KEITH MOON drumming with ‘The Beachcombers’ in 1963.", "createdAt": "2026-11-25T10:46:47.250Z", "author": { "id": "did:plc:ccscygoww4uf76s5eyu7pqut", "username": "michaelwarburton.bsky.social", "displayName": "Michael Warburton", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:ccscygoww4uf76s5eyu7pqut/bafkreidmpkaqp4kohchovol6fjmztvlnsw7gkgsn4255m27ipj4eu4b2bu", "verified": true, "url": "https://bsky.app/profile/michaelwarburton.bsky.social" }, "stats": { "views": null, "likes": 370, "comments": 8, "shares": 40, "saves": 4, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://cdn.bsky.app/img/feed_fullsize/plain/did:plc:ccscygoww4uf76s5eyu7pqut/bafkreia25nn6n2vl4xmoy57mcachic6n6vhcvrfsqa2r27dz3rylgwm5ui", "thumbnailUrl": "https://cdn.bsky.app/img/feed_thumbnail/plain/did:plc:ccscygoww4uf76s5eyu7pqut/bafkreia25nn6n2vl4xmoy57mcachic6n6vhcvrfsqa2r27dz3rylgwm5ui", "width": 526, "height": 694, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "cid": "bafyreihxjctvwrnvv5ovaqzt3yhzj6q4locdik2z65pivagqohuvsnscyy", "rkey": "3n34y7mq2wk2a", "quotes": 2, "langs": [ "en" ], "replyTo": null, "repost": null, "pinned": false, "quoted": null, "link": null, "altTexts": [], "repliesRestricted": false, "labels": [], "indexedAt": "2026-11-25T10:46:48.443Z" } }, { "id": "at://did:plc:sv2ivxvf7fxchmo2xamo3wwx/app.bsky.feed.post/3n35frnokzc22", "url": "https://bsky.app/profile/eldiario.es/post/3n35frnokzc22", "text": "Una víctima de violencia machista, frente a Almeida: \"Vuestras políticas y vuestros aliados no me representan\" www.eldiario.es/sociedad/25n...", "createdAt": "2026-11-25T14:49:30.881Z", "author": { "id": "did:plc:sv2ivxvf7fxchmo2xamo3wwx", "username": "eldiario.es", "displayName": "elDiario.es", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:sv2ivxvf7fxchmo2xamo3wwx/bafkreic6hwtxsuep467l2d3gja5viqcth62xtzsjvyimuhrfzdweh67vwe", "verified": true, "url": "https://bsky.app/profile/eldiario.es" }, "stats": { "views": null, "likes": 622, "comments": 11, "shares": 335, "saves": 14, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://video.bsky.app/watch/did%3Aplc%3Asv2ivxvf7fxchmo2xamo3wwx/bafkreihw5fxymkf3i73plx5sn35ujurmutcdz42ajceph5guu2wxu7eapa/playlist.m3u8", "thumbnailUrl": "https://video.bsky.app/watch/did%3Aplc%3Asv2ivxvf7fxchmo2xamo3wwx/bafkreihw5fxymkf3i73plx5sn35ujurmutcdz42ajceph5guu2wxu7eapa/thumbnail.jpg", "width": 1080, "height": 1920, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "cid": "bafyreicvobvv4w3ykbjskgpfkmxl7gkgvdsgqabdfngkskg5zqqihxdk34", "rkey": "3n35frnokzc22", "quotes": 14, "langs": [ "es" ], "replyTo": null, "repost": null, "pinned": false, "quoted": null, "link": null, "altTexts": [], "repliesRestricted": false, "labels": [], "indexedAt": "2026-11-25T14:49:32.343Z" } } ], "pagination": { "nextCursor": "eyJvIjoiMjAyNi0xMS0yNVQwNjo1MzozNi4zMDgyOTExMzZaIiwibiI6IjIwMjYtMTEtMjVUMTg6NTM6MzYuMzA4MjkxMTM2WiIsInNzIjoiMjAyNi0xMS0yNVQxODo1MzozNi4zMDgyOTExMzZaIiwibHUiOiIyMDI2LTExLTI1VDE4OjUzOjM2LjMxNTA2NjI4NVoiLCJwZyI6MSwibSI6IkFRQUFBQUFBQUFBSkFBQUFPakFBQUJZQUFBQ0x6d0FBak04QUFJN1BBQUNQendBQWxNOEFBSnZQQUFDa3p3QUFwYzhBQUtiUEFnQ3N6d0VBcmM4Q0FLN1BBd0N2endFQXNNOEFBTEhQQWdDeXp3RUFzODhGQUxUUEFnQzF6d0VBdHM4RkFMblBB…", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/bluesky/feed/posts": { "get": { "tags": [ "Bluesky" ], "summary": "A feed's posts, 50 a page.", "description": "In the feed's own order. 1 credit a page.", "operationId": "blueskyFeedPosts", "parameters": [ { "name": "url", "in": "query", "description": "Its bsky.app link.", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "Its AT-URI (the `id` its answers give it), instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_BlueskyPost" }, "example": { "data": [ { "id": "at://did:plc:ccscygoww4uf76s5eyu7pqut/app.bsky.feed.post/3n34y7mq2wk2a", "url": "https://bsky.app/profile/michaelwarburton.bsky.social/post/3n34y7mq2wk2a", "text": "17yr old KEITH MOON drumming with ‘The Beachcombers’ in 1963.", "createdAt": "2026-11-25T10:46:47.250Z", "author": { "id": "did:plc:ccscygoww4uf76s5eyu7pqut", "username": "michaelwarburton.bsky.social", "displayName": "Michael Warburton", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:ccscygoww4uf76s5eyu7pqut/bafkreidmpkaqp4kohchovol6fjmztvlnsw7gkgsn4255m27ipj4eu4b2bu", "verified": true, "url": "https://bsky.app/profile/michaelwarburton.bsky.social" }, "stats": { "views": null, "likes": 370, "comments": 8, "shares": 40, "saves": 4, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://cdn.bsky.app/img/feed_fullsize/plain/did:plc:ccscygoww4uf76s5eyu7pqut/bafkreia25nn6n2vl4xmoy57mcachic6n6vhcvrfsqa2r27dz3rylgwm5ui", "thumbnailUrl": "https://cdn.bsky.app/img/feed_thumbnail/plain/did:plc:ccscygoww4uf76s5eyu7pqut/bafkreia25nn6n2vl4xmoy57mcachic6n6vhcvrfsqa2r27dz3rylgwm5ui", "width": 526, "height": 694, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "cid": "bafyreihxjctvwrnvv5ovaqzt3yhzj6q4locdik2z65pivagqohuvsnscyy", "rkey": "3n34y7mq2wk2a", "quotes": 2, "langs": [ "en" ], "replyTo": null, "repost": null, "pinned": false, "quoted": null, "link": null, "altTexts": [], "repliesRestricted": false, "labels": [], "indexedAt": "2026-11-25T10:46:48.443Z" } }, { "id": "at://did:plc:sv2ivxvf7fxchmo2xamo3wwx/app.bsky.feed.post/3n35frnokzc22", "url": "https://bsky.app/profile/eldiario.es/post/3n35frnokzc22", "text": "Una víctima de violencia machista, frente a Almeida: \"Vuestras políticas y vuestros aliados no me representan\" www.eldiario.es/sociedad/25n...", "createdAt": "2026-11-25T14:49:30.881Z", "author": { "id": "did:plc:sv2ivxvf7fxchmo2xamo3wwx", "username": "eldiario.es", "displayName": "elDiario.es", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:sv2ivxvf7fxchmo2xamo3wwx/bafkreic6hwtxsuep467l2d3gja5viqcth62xtzsjvyimuhrfzdweh67vwe", "verified": true, "url": "https://bsky.app/profile/eldiario.es" }, "stats": { "views": null, "likes": 622, "comments": 11, "shares": 335, "saves": 14, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://video.bsky.app/watch/did%3Aplc%3Asv2ivxvf7fxchmo2xamo3wwx/bafkreihw5fxymkf3i73plx5sn35ujurmutcdz42ajceph5guu2wxu7eapa/playlist.m3u8", "thumbnailUrl": "https://video.bsky.app/watch/did%3Aplc%3Asv2ivxvf7fxchmo2xamo3wwx/bafkreihw5fxymkf3i73plx5sn35ujurmutcdz42ajceph5guu2wxu7eapa/thumbnail.jpg", "width": 1080, "height": 1920, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "cid": "bafyreicvobvv4w3ykbjskgpfkmxl7gkgvdsgqabdfngkskg5zqqihxdk34", "rkey": "3n35frnokzc22", "quotes": 14, "langs": [ "es" ], "replyTo": null, "repost": null, "pinned": false, "quoted": null, "link": null, "altTexts": [], "repliesRestricted": false, "labels": [], "indexedAt": "2026-11-25T14:49:32.343Z" } } ], "pagination": { "nextCursor": "eyJvIjoiMjAyNi0xMS0yNVQwNjo1MzozNi4zMDgyOTExMzZaIiwibiI6IjIwMjYtMTEtMjVUMTg6NTM6MzYuMzA4MjkxMTM2WiIsInNzIjoiMjAyNi0xMS0yNVQxODo1MzozNi4zMDgyOTExMzZaIiwibHUiOiIyMDI2LTExLTI1VDE4OjUzOjM2LjMxNTA2NjI4NVoiLCJwZyI6MSwibSI6IkFRQUFBQUFBQUFBSkFBQUFPakFBQUJZQUFBQ0x6d0FBak04QUFJN1BBQUNQendBQWxNOEFBSnZQQUFDa3p3QUFwYzhBQUtiUEFnQ3N6d0VBcmM4Q0FLN1BBd0N2endFQXNNOEFBTEhQQWdDeXp3RUFzODhGQUxUUEFnQzF6d0VBdHM4RkFMblBB…", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.bluesky.feedPosts({ url: \"https://bsky.app/profile/bsky.app/feed/whats-hot\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.bluesky.feed_posts(url=\"https://bsky.app/profile/bsky.app/feed/whats-hot\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/bluesky/feed/posts \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://bsky.app/profile/bsky.app/feed/whats-hot\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_BlueskyPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/BlueskyPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "BlueskyPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "cid", "rkey", "langs", "pinned", "altTexts", "repliesRestricted", "labels" ], "properties": { "altTexts": { "type": "array", "items": { "type": "string" }, "description": "Each image's or video's description for screen readers, in `media`'s order; empty\nwhen none has one." }, "cid": { "type": "string", "description": "The record's content hash and its key (the last part of its link)." }, "indexedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "When Bluesky indexed it." }, { "type": "null" } ] }, "labels": { "type": "array", "items": { "type": "string" }, "description": "Labels on the post, by value (`porn`, `graphic-media`…)." }, "langs": { "type": "array", "items": { "type": "string" }, "description": "The languages its author set." }, "link": { "oneOf": [ { "$ref": "#/components/schemas/BlueskyLinkCard" }, { "type": "null" } ] }, "pinned": { "type": "boolean", "description": "Pinned to its author's profile, in that account's posts." }, "quoted": { "oneOf": [ { "$ref": "#/components/schemas/BlueskyQuoted" }, { "type": "null" } ] }, "quotes": { "type": [ "integer", "null" ], "format": "int64", "description": "Posts quoting it.", "minimum": 0 }, "repliesRestricted": { "type": "boolean", "description": "Whether its author limited who may reply." }, "replyTo": { "oneOf": [ { "$ref": "#/components/schemas/BlueskyReplyRef", "description": "What it replies to, when it is a reply." }, { "type": "null" } ] }, "repost": { "oneOf": [ { "$ref": "#/components/schemas/BlueskyRepost", "description": "Who reposted it into this list, in an account's posts." }, { "type": "null" } ] }, "rkey": { "type": "string" } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A post: text, images, a video, a link or a quote." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "BlueskyRepost": { "type": "object", "description": "Who reposted a post into the list it is in, and when.", "required": [ "by" ], "properties": { "at": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "by": { "$ref": "#/components/schemas/Author" } } }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } }, "Timestamp": { "type": "string", "format": "date-time" }, "BlueskyReplyRef": { "type": "object", "description": "The post a reply answers, and the thread's first post.", "required": [ "parent", "root" ], "properties": { "parent": { "type": "string" }, "root": { "type": "string" } } }, "BlueskyQuoted": { "type": "object", "description": "What a post quotes: a post, or a feed, list or starter pack it embeds.", "required": [ "id" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "id": { "type": "string", "description": "Its AT-URI." }, "text": { "type": [ "string", "null" ], "description": "A quoted post's text, or the name of a feed, list or starter pack." }, "url": { "type": [ "string", "null" ] } } }, "BlueskyLinkCard": { "type": "object", "description": "The link a post shares, as its card shows it.", "required": [ "url" ], "properties": { "description": { "type": [ "string", "null" ] }, "thumbnailUrl": { "type": [ "string", "null" ] }, "title": { "type": [ "string", "null" ] }, "url": { "type": "string" } } } } } } ``` # Feed (/docs/api-reference/bluesky/feed) A feed with its description and likes. `GET https://api.socialapi.sh/v1/bluesky/feed` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.bluesky.feed({ url: "https://bsky.app/profile/bsky.app/feed/whats-hot" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.bluesky.feed(url="https://bsky.app/profile/bsky.app/feed/whats-hot").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/bluesky/feed \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://bsky.app/profile/bsky.app/feed/whats-hot" ``` **Response** ```json { "data": { "id": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.generator/whats-hot", "name": "Discover", "description": "Trending content from your personal network", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreidljdg62x3zhlweyzshoekrw2znokytt5tmib7g4xsngwvpnf6ule", "url": "https://bsky.app/profile/bsky.app/feed/whats-hot", "likes": 39666, "creator": { "id": "did:plc:z72i7hdynmk6r22z27h6tvur", "username": "bsky.app", "displayName": "Bluesky", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreihwihm6kpd6zuwhhlro75p5qks5qtrcu55jp3gddbfjsieiv7wuka", "verified": false, "url": "https://bsky.app/profile/bsky.app" }, "service": "did:web:discover.bsky.app", "online": true, "valid": true, "cid": "bafyreifquqn7pyvhhtrfmhlj3mmlgjnd3xtqnifrskkm3vjlqr3ur6pwwq", "labels": [], "indexedAt": "2026-10-28T17:14:14.580Z" } } ``` **OpenAPI** ```json { "paths": { "/v1/bluesky/feed": { "get": { "tags": [ "Bluesky" ], "summary": "A feed with its description and likes.", "description": "A custom feed: its name, who made it, its likes and whether its service is answering.\n1 credit.", "operationId": "blueskyFeed", "parameters": [ { "name": "url", "in": "query", "description": "Its bsky.app link.", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "Its AT-URI (the `id` its answers give it), instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_BlueskyFeed" }, "example": { "data": { "id": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.generator/whats-hot", "name": "Discover", "description": "Trending content from your personal network", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreidljdg62x3zhlweyzshoekrw2znokytt5tmib7g4xsngwvpnf6ule", "url": "https://bsky.app/profile/bsky.app/feed/whats-hot", "likes": 39666, "creator": { "id": "did:plc:z72i7hdynmk6r22z27h6tvur", "username": "bsky.app", "displayName": "Bluesky", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreihwihm6kpd6zuwhhlro75p5qks5qtrcu55jp3gddbfjsieiv7wuka", "verified": false, "url": "https://bsky.app/profile/bsky.app" }, "service": "did:web:discover.bsky.app", "online": true, "valid": true, "cid": "bafyreifquqn7pyvhhtrfmhlj3mmlgjnd3xtqnifrskkm3vjlqr3ur6pwwq", "labels": [], "indexedAt": "2026-10-28T17:14:14.580Z" } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.bluesky.feed({ url: \"https://bsky.app/profile/bsky.app/feed/whats-hot\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.bluesky.feed(url=\"https://bsky.app/profile/bsky.app/feed/whats-hot\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/bluesky/feed \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://bsky.app/profile/bsky.app/feed/whats-hot\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_BlueskyFeed": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/BlueskyFeed" } } }, "BlueskyFeed": { "type": "object", "description": "A feed: an algorithm an account runs, which anyone can read.", "required": [ "id", "name", "cid", "labels" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "cid": { "type": "string" }, "creator": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "description": { "type": [ "string", "null" ] }, "id": { "type": "string", "description": "Its AT-URI." }, "indexedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "labels": { "type": "array", "items": { "type": "string" } }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "name": { "type": "string" }, "online": { "type": [ "boolean", "null" ], "description": "Whether its service is answering and its record valid; only `/v1/bluesky/feed`\nsays." }, "service": { "type": [ "string", "null" ], "description": "The service that runs it (`did:web:discover.bsky.app`)." }, "url": { "type": [ "string", "null" ] }, "valid": { "type": [ "boolean", "null" ] } } }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Hashtag Posts (/docs/api-reference/bluesky/hashtag-posts) A hashtag's posts, 50 a page. `GET https://api.socialapi.sh/v1/bluesky/hashtag/posts` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.bluesky.hashtagPosts({ name: "caturday" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.bluesky.hashtag_posts(name="caturday") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/bluesky/hashtag/posts \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "name=caturday" ``` **Response** ```json { "data": [ { "id": "at://did:plc:gachswit6caz2ad2ljkgsgg6/app.bsky.feed.post/3n322rkuq6k2i", "url": "https://bsky.app/profile/cats-are-evil.bsky.social/post/3n322rkuq6k2i", "text": "#caturday #cats", "createdAt": "2026-11-24T06:54:37.559Z", "author": { "id": "did:plc:gachswit6caz2ad2ljkgsgg6", "username": "cats-are-evil.bsky.social", "displayName": "Irrefutable proof cats are evil", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:gachswit6caz2ad2ljkgsgg6/bafkreihknlc6r5oc3uiddlltp62sj2llsjecmglckmtsau4nxvfuym33vi", "verified": false, "url": "https://bsky.app/profile/cats-are-evil.bsky.social" }, "stats": { "views": null, "likes": 468, "comments": 13, "shares": 71, "saves": 12, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://cdn.bsky.app/img/feed_fullsize/plain/did:plc:gachswit6caz2ad2ljkgsgg6/bafkreigy5ynfjteiln5743pen6ujw3qd7ahmu4vhsqfdts27cl5vxbteoe", "thumbnailUrl": "https://cdn.bsky.app/img/feed_thumbnail/plain/did:plc:gachswit6caz2ad2ljkgsgg6/bafkreigy5ynfjteiln5743pen6ujw3qd7ahmu4vhsqfdts27cl5vxbteoe", "width": 1200, "height": 1040, "durationSeconds": null } ], "hashtags": [ "caturday", "cats" ], "mentions": [], "ext": { "cid": "bafyreiftzuh36yzhpszqpbewi3un7hjxjgrutaxe4eluquwc2lcq5u5vda", "rkey": "3n322rkuq6k2i", "quotes": 3, "langs": [ "en" ], "replyTo": null, "repost": null, "pinned": false, "quoted": null, "link": null, "altTexts": [], "repliesRestricted": false, "labels": [], "indexedAt": "2026-11-24T06:54:39.041Z" } }, { "id": "at://did:plc:gachswit6caz2ad2ljkgsgg6/app.bsky.feed.post/3n34lilsodc2x", "url": "https://bsky.app/profile/cats-are-evil.bsky.social/post/3n34lilsodc2x", "text": "#caturday #cats", "createdAt": "2026-11-25T06:59:09.636Z", "author": { "id": "did:plc:gachswit6caz2ad2ljkgsgg6", "username": "cats-are-evil.bsky.social", "displayName": "Irrefutable proof cats are evil", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:gachswit6caz2ad2ljkgsgg6/bafkreihknlc6r5oc3uiddlltp62sj2llsjecmglckmtsau4nxvfuym33vi", "verified": false, "url": "https://bsky.app/profile/cats-are-evil.bsky.social" }, "stats": { "views": null, "likes": 305, "comments": 7, "shares": 28, "saves": 6, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://cdn.bsky.app/img/feed_fullsize/plain/did:plc:gachswit6caz2ad2ljkgsgg6/bafkreialoytdl3c2j4bftgavjcodteaypjxnlrek22xbcceuisaft6qktq", "thumbnailUrl": "https://cdn.bsky.app/img/feed_thumbnail/plain/did:plc:gachswit6caz2ad2ljkgsgg6/bafkreialoytdl3c2j4bftgavjcodteaypjxnlrek22xbcceuisaft6qktq", "width": 1080, "height": 1350, "durationSeconds": null } ], "hashtags": [ "caturday", "cats" ], "mentions": [], "ext": { "cid": "bafyreig4ys5xgfwjtgwiitpk6mra5pzsauo6f7izrcn2xnq6hztfhxfjmm", "rkey": "3n34lilsodc2x", "quotes": 2, "langs": [ "en" ], "replyTo": null, "repost": null, "pinned": false, "quoted": null, "link": null, "altTexts": [], "repliesRestricted": false, "labels": [], "indexedAt": "2026-11-25T06:59:11.440Z" } } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/bluesky/hashtag/posts": { "get": { "tags": [ "Bluesky" ], "summary": "A hashtag's posts, 50 a page.", "description": "By relevance (one page) or newest first (paged). 1 credit a page.", "operationId": "blueskyHashtagPosts", "parameters": [ { "name": "name", "in": "query", "description": "The hashtag, without `#`.", "required": true, "schema": { "type": "string" } }, { "name": "sort", "in": "query", "description": "`top` (by relevance, the default: one page) or `latest` (newest first, paged).", "required": false, "schema": { "type": "string", "description": "How a search orders its posts.", "enum": [ "top", "latest" ] } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page (with `sort=latest`).", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_BlueskyPost" }, "example": { "data": [ { "id": "at://did:plc:gachswit6caz2ad2ljkgsgg6/app.bsky.feed.post/3n322rkuq6k2i", "url": "https://bsky.app/profile/cats-are-evil.bsky.social/post/3n322rkuq6k2i", "text": "#caturday #cats", "createdAt": "2026-11-24T06:54:37.559Z", "author": { "id": "did:plc:gachswit6caz2ad2ljkgsgg6", "username": "cats-are-evil.bsky.social", "displayName": "Irrefutable proof cats are evil", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:gachswit6caz2ad2ljkgsgg6/bafkreihknlc6r5oc3uiddlltp62sj2llsjecmglckmtsau4nxvfuym33vi", "verified": false, "url": "https://bsky.app/profile/cats-are-evil.bsky.social" }, "stats": { "views": null, "likes": 468, "comments": 13, "shares": 71, "saves": 12, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://cdn.bsky.app/img/feed_fullsize/plain/did:plc:gachswit6caz2ad2ljkgsgg6/bafkreigy5ynfjteiln5743pen6ujw3qd7ahmu4vhsqfdts27cl5vxbteoe", "thumbnailUrl": "https://cdn.bsky.app/img/feed_thumbnail/plain/did:plc:gachswit6caz2ad2ljkgsgg6/bafkreigy5ynfjteiln5743pen6ujw3qd7ahmu4vhsqfdts27cl5vxbteoe", "width": 1200, "height": 1040, "durationSeconds": null } ], "hashtags": [ "caturday", "cats" ], "mentions": [], "ext": { "cid": "bafyreiftzuh36yzhpszqpbewi3un7hjxjgrutaxe4eluquwc2lcq5u5vda", "rkey": "3n322rkuq6k2i", "quotes": 3, "langs": [ "en" ], "replyTo": null, "repost": null, "pinned": false, "quoted": null, "link": null, "altTexts": [], "repliesRestricted": false, "labels": [], "indexedAt": "2026-11-24T06:54:39.041Z" } }, { "id": "at://did:plc:gachswit6caz2ad2ljkgsgg6/app.bsky.feed.post/3n34lilsodc2x", "url": "https://bsky.app/profile/cats-are-evil.bsky.social/post/3n34lilsodc2x", "text": "#caturday #cats", "createdAt": "2026-11-25T06:59:09.636Z", "author": { "id": "did:plc:gachswit6caz2ad2ljkgsgg6", "username": "cats-are-evil.bsky.social", "displayName": "Irrefutable proof cats are evil", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:gachswit6caz2ad2ljkgsgg6/bafkreihknlc6r5oc3uiddlltp62sj2llsjecmglckmtsau4nxvfuym33vi", "verified": false, "url": "https://bsky.app/profile/cats-are-evil.bsky.social" }, "stats": { "views": null, "likes": 305, "comments": 7, "shares": 28, "saves": 6, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://cdn.bsky.app/img/feed_fullsize/plain/did:plc:gachswit6caz2ad2ljkgsgg6/bafkreialoytdl3c2j4bftgavjcodteaypjxnlrek22xbcceuisaft6qktq", "thumbnailUrl": "https://cdn.bsky.app/img/feed_thumbnail/plain/did:plc:gachswit6caz2ad2ljkgsgg6/bafkreialoytdl3c2j4bftgavjcodteaypjxnlrek22xbcceuisaft6qktq", "width": 1080, "height": 1350, "durationSeconds": null } ], "hashtags": [ "caturday", "cats" ], "mentions": [], "ext": { "cid": "bafyreig4ys5xgfwjtgwiitpk6mra5pzsauo6f7izrcn2xnq6hztfhxfjmm", "rkey": "3n34lilsodc2x", "quotes": 2, "langs": [ "en" ], "replyTo": null, "repost": null, "pinned": false, "quoted": null, "link": null, "altTexts": [], "repliesRestricted": false, "labels": [], "indexedAt": "2026-11-25T06:59:11.440Z" } } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.bluesky.hashtagPosts({ name: \"caturday\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.bluesky.hashtag_posts(name=\"caturday\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/bluesky/hashtag/posts \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"name=caturday\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_BlueskyPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/BlueskyPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "BlueskyPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "cid", "rkey", "langs", "pinned", "altTexts", "repliesRestricted", "labels" ], "properties": { "altTexts": { "type": "array", "items": { "type": "string" }, "description": "Each image's or video's description for screen readers, in `media`'s order; empty\nwhen none has one." }, "cid": { "type": "string", "description": "The record's content hash and its key (the last part of its link)." }, "indexedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "When Bluesky indexed it." }, { "type": "null" } ] }, "labels": { "type": "array", "items": { "type": "string" }, "description": "Labels on the post, by value (`porn`, `graphic-media`…)." }, "langs": { "type": "array", "items": { "type": "string" }, "description": "The languages its author set." }, "link": { "oneOf": [ { "$ref": "#/components/schemas/BlueskyLinkCard" }, { "type": "null" } ] }, "pinned": { "type": "boolean", "description": "Pinned to its author's profile, in that account's posts." }, "quoted": { "oneOf": [ { "$ref": "#/components/schemas/BlueskyQuoted" }, { "type": "null" } ] }, "quotes": { "type": [ "integer", "null" ], "format": "int64", "description": "Posts quoting it.", "minimum": 0 }, "repliesRestricted": { "type": "boolean", "description": "Whether its author limited who may reply." }, "replyTo": { "oneOf": [ { "$ref": "#/components/schemas/BlueskyReplyRef", "description": "What it replies to, when it is a reply." }, { "type": "null" } ] }, "repost": { "oneOf": [ { "$ref": "#/components/schemas/BlueskyRepost", "description": "Who reposted it into this list, in an account's posts." }, { "type": "null" } ] }, "rkey": { "type": "string" } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A post: text, images, a video, a link or a quote." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "BlueskyRepost": { "type": "object", "description": "Who reposted a post into the list it is in, and when.", "required": [ "by" ], "properties": { "at": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "by": { "$ref": "#/components/schemas/Author" } } }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } }, "Timestamp": { "type": "string", "format": "date-time" }, "BlueskyReplyRef": { "type": "object", "description": "The post a reply answers, and the thread's first post.", "required": [ "parent", "root" ], "properties": { "parent": { "type": "string" }, "root": { "type": "string" } } }, "BlueskyQuoted": { "type": "object", "description": "What a post quotes: a post, or a feed, list or starter pack it embeds.", "required": [ "id" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "id": { "type": "string", "description": "Its AT-URI." }, "text": { "type": [ "string", "null" ], "description": "A quoted post's text, or the name of a feed, list or starter pack." }, "url": { "type": [ "string", "null" ] } } }, "BlueskyLinkCard": { "type": "object", "description": "The link a post shares, as its card shows it.", "required": [ "url" ], "properties": { "description": { "type": [ "string", "null" ] }, "thumbnailUrl": { "type": [ "string", "null" ] }, "title": { "type": [ "string", "null" ] }, "url": { "type": "string" } } } } } } ``` # Bluesky API (/docs/api-reference/bluesky) Every Bluesky endpoint, by group. Each is a `GET` under `/v1/bluesky`. ## Quick Reference [#quick-reference] | Property | Value | | --- | --- | | Base path | `/v1/bluesky` | | Endpoints | 30 | | Credits | 1 a call | | Guide | [Bluesky](/docs/bluesky) | ## Accounts [#accounts] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/bluesky/profile`](/docs/api-reference/bluesky/profile) | An account with its follower and post counts. | 1 | | [`GET /v1/bluesky/profile/feeds`](/docs/api-reference/bluesky/profile-feeds) | The feeds an account made, 50 a page. | 1 | | [`GET /v1/bluesky/profile/followers`](/docs/api-reference/bluesky/profile-followers) | The accounts following an account, 100 a page. | 1 | | [`GET /v1/bluesky/profile/following`](/docs/api-reference/bluesky/profile-following) | The accounts an account follows, 100 a page. | 1 | | [`GET /v1/bluesky/profile/lists`](/docs/api-reference/bluesky/profile-lists) | The lists an account made, 50 a page. | 1 | | [`GET /v1/bluesky/profile/media`](/docs/api-reference/bluesky/profile-media) | An account's posts with images or video. | 1 | | [`GET /v1/bluesky/profile/posts`](/docs/api-reference/bluesky/profile-posts) | An account's posts and reposts, newest first. | 1 | | [`GET /v1/bluesky/profile/replies`](/docs/api-reference/bluesky/profile-replies) | An account's posts with its replies, newest first. | 1 | | [`GET /v1/bluesky/profile/starter-packs`](/docs/api-reference/bluesky/profile-starter-packs) | The starter packs an account made, 50 a page. | 1 | | [`GET /v1/bluesky/profile/videos`](/docs/api-reference/bluesky/profile-videos) | An account's posts with video. | 1 | ## Posts [#posts] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/bluesky/post`](/docs/api-reference/bluesky/post) | One post with its likes, replies, reposts and quotes. | 1 | | [`GET /v1/bluesky/post/comments`](/docs/api-reference/bluesky/post-comments) | A post's replies, and the replies to them. | 1 | | [`GET /v1/bluesky/post/likes`](/docs/api-reference/bluesky/post-likes) | The accounts that liked a post, 100 a page. | 1 | | [`GET /v1/bluesky/post/quotes`](/docs/api-reference/bluesky/post-quotes) | The posts quoting a post, 50 a page. | 1 | | [`GET /v1/bluesky/post/reposts`](/docs/api-reference/bluesky/post-reposts) | The accounts that reposted a post, 100 a page. | 1 | ## Feeds and Lists [#feeds-and-lists] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/bluesky/feed`](/docs/api-reference/bluesky/feed) | A feed with its description and likes. | 1 | | [`GET /v1/bluesky/feed/posts`](/docs/api-reference/bluesky/feed-posts) | A feed's posts, 50 a page. | 1 | | [`GET /v1/bluesky/list`](/docs/api-reference/bluesky/list) | A list with its purpose and member count. | 1 | | [`GET /v1/bluesky/list/members`](/docs/api-reference/bluesky/list-members) | A list's accounts, 100 a page. | 1 | | [`GET /v1/bluesky/list/posts`](/docs/api-reference/bluesky/list-posts) | The posts of a list's accounts, 50 a page. | 1 | | [`GET /v1/bluesky/starter-pack`](/docs/api-reference/bluesky/starter-pack) | A starter pack with its accounts' list and feeds. | 1 | ## Discovery [#discovery] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/bluesky/hashtag/posts`](/docs/api-reference/bluesky/hashtag-posts) | A hashtag's posts, 50 a page. | 1 | | [`GET /v1/bluesky/search`](/docs/api-reference/bluesky/search) | Posts matching a query, 50 a page. | 1 | | [`GET /v1/bluesky/search/feeds`](/docs/api-reference/bluesky/search-feeds) | Feeds matching a query, the most liked first. | 1 | | [`GET /v1/bluesky/search/starter-packs`](/docs/api-reference/bluesky/search-starter-packs) | Starter packs matching a query, 50 a page. | 1 | | [`GET /v1/bluesky/search/users`](/docs/api-reference/bluesky/search-users) | Accounts matching a query, 100 a page. | 1 | | [`GET /v1/bluesky/trending`](/docs/api-reference/bluesky/trending) | The posts of Bluesky's Discover feed, 50 a page. | 1 | | [`GET /v1/bluesky/trending/topics`](/docs/api-reference/bluesky/trending-topics) | The topics trending now, up to 25. | 1 | ## Batch [#batch] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/bluesky/batch/posts`](/docs/api-reference/bluesky/batch-posts) | Up to 25 posts at once, by their ids or links. | 1 | | [`GET /v1/bluesky/batch/profiles`](/docs/api-reference/bluesky/batch-profiles) | Up to 25 accounts at once, by handle or DID. | 1 | ## Example Request [#example-request] Every Bluesky endpoint is called this way: its path, and what to read as query parameters. **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.bluesky.profile({ handle: "bsky.app" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.bluesky.profile(handle="bsky.app").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/bluesky/profile \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=bsky.app" ``` **Response** ```json { "data": { "id": "did:plc:z72i7hdynmk6r22z27h6tvur", "username": "bsky.app", "displayName": "Bluesky", "bio": "official Bluesky account (check username👆)\n\nBugs, feature requests, feedback: support@bsky.app", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreihwihm6kpd6zuwhhlro75p5qks5qtrcu55jp3gddbfjsieiv7wuka", "url": "https://bsky.app/profile/bsky.app", "verified": false, "private": false, "followers": 35847780, "following": 44, "likes": null, "posts": 928, "externalUrl": null, "createdAt": "2023-04-12T04:53:57.057Z", "ext": { "bannerUrl": "https://cdn.bsky.app/img/banner/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreichzyovokfzmymz36p5jibbjrhsur6n7hjnzxrpbt5jaydp2szvna", "pronouns": null, "pinnedPost": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3l6oveex3ii2l", "lists": 26, "feeds": 7, "starterPacks": 23, "trustedVerifier": true, "labeler": false, "liveUrl": null, "labels": [], "indexedAt": "2026-11-04T15:41:10.973Z" } } } ``` ## Errors [#errors] A call that fails costs nothing. See [Errors](/docs/errors) for every code. # List Members (/docs/api-reference/bluesky/list-members) A list's accounts, 100 a page. `GET https://api.socialapi.sh/v1/bluesky/list/members` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.bluesky.listMembers({ id: "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.graph.list/3lvpca43j5z26" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.bluesky.list_members(id="at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.graph.list/3lvpca43j5z26") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/bluesky/list/members \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "id=at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.graph.list/3lvpca43j5z26" ``` **Response** ```json { "data": [ { "id": "did:plc:e5sycehmo2p3ze6qvrrsurcc", "username": "boostblue.bsky.social", "displayName": "Boost Blue", "bio": "Alt Bluesky app for iOS and Android:\n- Saved reading position\n- Post editing\n- Feed filters\n- Custom themes and fonts\n- More\n\nCreated by @jaxonevans.social\nUpcoming Sportsky app: @sideline.sln.social\n\nMade with Flutter!", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:e5sycehmo2p3ze6qvrrsurcc/bafkreign763zvptacxkc4ltywllblyyw2uejgw5ygo6sedc2vs6bnn5s3y", "url": "https://bsky.app/profile/boostblue.bsky.social", "verified": false, "private": false, "followers": null, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": "2025-03-25T18:41:38.975Z", "ext": { "bannerUrl": null, "pronouns": null, "pinnedPost": null, "lists": null, "feeds": null, "starterPacks": null, "trustedVerifier": false, "labeler": false, "liveUrl": null, "labels": [], "indexedAt": "2026-11-25T14:37:38.049Z" } }, { "id": "did:plc:wshs7t2adsemcrrd4snkeqli", "username": "tangled.org", "displayName": "Tangled", "bio": "Your code forge for the next decade.", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:wshs7t2adsemcrrd4snkeqli/bafkreif6z53z4ukqmdgwstspwh5asmhxheblcd2adisoccl4fflozc3kva", "url": "https://bsky.app/profile/tangled.org", "verified": true, "private": false, "followers": null, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": "2025-02-10T12:31:23.044Z", "ext": { "bannerUrl": null, "pronouns": null, "pinnedPost": null, "lists": null, "feeds": null, "starterPacks": null, "trustedVerifier": false, "labeler": false, "liveUrl": null, "labels": [], "indexedAt": "2026-10-30T16:20:22.082Z" } } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/bluesky/list/members": { "get": { "tags": [ "Bluesky" ], "summary": "A list's accounts, 100 a page.", "description": "Also a starter pack's, by its list's id. 1 credit a page.", "operationId": "blueskyListMembers", "parameters": [ { "name": "url", "in": "query", "description": "Its bsky.app link.", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "Its AT-URI (the `id` its answers give it), instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_BlueskyProfile" }, "example": { "data": [ { "id": "did:plc:e5sycehmo2p3ze6qvrrsurcc", "username": "boostblue.bsky.social", "displayName": "Boost Blue", "bio": "Alt Bluesky app for iOS and Android:\n- Saved reading position\n- Post editing\n- Feed filters\n- Custom themes and fonts\n- More\n\nCreated by @jaxonevans.social\nUpcoming Sportsky app: @sideline.sln.social\n\nMade with Flutter!", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:e5sycehmo2p3ze6qvrrsurcc/bafkreign763zvptacxkc4ltywllblyyw2uejgw5ygo6sedc2vs6bnn5s3y", "url": "https://bsky.app/profile/boostblue.bsky.social", "verified": false, "private": false, "followers": null, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": "2025-03-25T18:41:38.975Z", "ext": { "bannerUrl": null, "pronouns": null, "pinnedPost": null, "lists": null, "feeds": null, "starterPacks": null, "trustedVerifier": false, "labeler": false, "liveUrl": null, "labels": [], "indexedAt": "2026-11-25T14:37:38.049Z" } }, { "id": "did:plc:wshs7t2adsemcrrd4snkeqli", "username": "tangled.org", "displayName": "Tangled", "bio": "Your code forge for the next decade.", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:wshs7t2adsemcrrd4snkeqli/bafkreif6z53z4ukqmdgwstspwh5asmhxheblcd2adisoccl4fflozc3kva", "url": "https://bsky.app/profile/tangled.org", "verified": true, "private": false, "followers": null, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": "2025-02-10T12:31:23.044Z", "ext": { "bannerUrl": null, "pronouns": null, "pinnedPost": null, "lists": null, "feeds": null, "starterPacks": null, "trustedVerifier": false, "labeler": false, "liveUrl": null, "labels": [], "indexedAt": "2026-10-30T16:20:22.082Z" } } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.bluesky.listMembers({ id: \"at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.graph.list/3lvpca43j5z26\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.bluesky.list_members(id=\"at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.graph.list/3lvpca43j5z26\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/bluesky/list/members \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"id=at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.graph.list/3lvpca43j5z26\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_BlueskyProfile": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/BlueskyProfile" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "BlueskyProfile": { "allOf": [ { "type": "object", "description": "An account.", "required": [ "id", "username", "url", "verified", "private", "ext" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "bio": { "type": [ "string", "null" ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "displayName": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "trustedVerifier", "labeler", "labels" ], "properties": { "bannerUrl": { "type": [ "string", "null" ], "description": "The profile's banner picture." }, "feeds": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "indexedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "When Bluesky last indexed the profile." }, { "type": "null" } ] }, "labeler": { "type": "boolean", "description": "A labeler: a moderation service others subscribe to." }, "labels": { "type": "array", "items": { "type": "string" }, "description": "Labels on the account, by value. `!no-unauthenticated` is the account asking apps\nnot to show it to visitors who are not signed in." }, "lists": { "type": [ "integer", "null" ], "format": "int64", "description": "The lists, feeds and starter packs it made.", "minimum": 0 }, "liveUrl": { "type": [ "string", "null" ], "description": "Where it is live now, while it says it is." }, "pinnedPost": { "type": [ "string", "null" ], "description": "The post pinned to it, as `/v1/bluesky/post` takes it." }, "pronouns": { "type": [ "string", "null" ], "description": "The pronouns it lists." }, "starterPacks": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "trustedVerifier": { "type": "boolean", "description": "A trusted verifier: an account whose word verifies others." } } }, { "type": "object", "description": "What only this platform has." } ] }, "externalUrl": { "type": [ "string", "null" ], "description": "The link in the bio." }, "followers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "following": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "id": { "type": "string", "description": "The platform's id for the account." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "description": "Likes the account's posts received in total.", "minimum": 0 }, "posts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "private": { "type": "boolean" }, "url": { "type": "string", "description": "The profile's page." }, "username": { "type": "string", "description": "The handle, without `@`." }, "verified": { "type": "boolean" } } }, { "type": "object", "description": "A Bluesky account." } ] }, "Timestamp": { "type": "string", "format": "date-time" } } } } ``` # List Posts (/docs/api-reference/bluesky/list-posts) The posts of a list's accounts, 50 a page. `GET https://api.socialapi.sh/v1/bluesky/list/posts` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.bluesky.listPosts({ id: "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.graph.list/3lvpca43j5z26" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.bluesky.list_posts(id="at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.graph.list/3lvpca43j5z26") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/bluesky/list/posts \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "id=at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.graph.list/3lvpca43j5z26" ``` **Response** ```json { "data": [ { "id": "at://did:plc:4yvwfwxfz5sney4twepuzdu7/app.bsky.feed.post/3n35pu2ugw22m", "url": "https://bsky.app/profile/germnetwork.com/post/3n35pu2ugw22m", "text": "🦠 Be like Ray 🦠", "createdAt": "2026-11-25T17:49:49.232Z", "author": { "id": "did:plc:4yvwfwxfz5sney4twepuzdu7", "username": "germnetwork.com", "displayName": "Germ Network", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:4yvwfwxfz5sney4twepuzdu7/bafkreib2zhhtby6ctjxqjgcoqqjvowd6a5cgmi3g2smo25ot4yk2gaxjvy", "verified": true, "url": "https://bsky.app/profile/germnetwork.com" }, "stats": { "views": null, "likes": 7, "comments": 0, "shares": 0, "saves": 0, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "cid": "bafyreif4vcs6hd2wol63sc2wqvu2woen2pilulyvyb76gk6e4d5q4ope7q", "rkey": "3n35pu2ugw22m", "quotes": 0, "langs": [ "en" ], "replyTo": null, "repost": null, "pinned": false, "quoted": { "id": "at://did:plc:6fqk5cjsiazqekfyjdrlrha7/app.bsky.feed.post/3n34fm4she22v", "url": "https://bsky.app/profile/ray.blacksky.app/post/3n34fm4she22v", "author": { "id": "did:plc:6fqk5cjsiazqekfyjdrlrha7", "username": "ray.blacksky.app", "displayName": "Ra¥mundo. ⁂", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:6fqk5cjsiazqekfyjdrlrha7/bafkreigcjwqe7cl7ltnx6sdzq5nuckuagfefbnrw2xtql3mcr5cmxvhdmy", "verified": false, "url": "https://bsky.app/profile/ray.blacksky.app" }, "text": "Onboarded two of my AT Proto homies onto Germ today!\n\nGerm is spreading fast!" }, "link": null, "altTexts": [], "repliesRestricted": false, "labels": [], "indexedAt": "2026-11-25T17:49:50.048Z" } }, { "id": "at://did:plc:e5sycehmo2p3ze6qvrrsurcc/app.bsky.feed.post/3n35mje6dec2e", "url": "https://bsky.app/profile/boostblue.bsky.social/post/3n35mje6dec2e", "text": "And I found a fix! So after the next version you should be able to re-enable that setting without issue.", "createdAt": "2026-11-25T16:50:08.668Z", "author": { "id": "did:plc:e5sycehmo2p3ze6qvrrsurcc", "username": "boostblue.bsky.social", "displayName": "Boost Blue", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:e5sycehmo2p3ze6qvrrsurcc/bafkreign763zvptacxkc4ltywllblyyw2uejgw5ygo6sedc2vs6bnn5s3y", "verified": false, "url": "https://bsky.app/profile/boostblue.bsky.social" }, "stats": { "views": null, "likes": 1, "comments": 0, "shares": 0, "saves": 0, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "cid": "bafyreiavxdvbnqrdk353n7stys7dxiao54c7e2w2kr3knffqjc6az2fuyu", "rkey": "3n35mje6dec2e", "quotes": 0, "langs": [ "en" ], "replyTo": { "parent": "at://did:plc:hkx57h5aljo7a2xsfzv2dynk/app.bsky.feed.post/3n35mhixrgm2f", "root": "at://did:plc:e5sycehmo2p3ze6qvrrsurcc/app.bsky.feed.post/3n334jgsbsk2a" }, "repost": null, "pinned": false, "quoted": null, "link": null, "altTexts": [], "repliesRestricted": false, "labels": [], "indexedAt": "2026-11-25T16:50:09.251Z" } } ], "pagination": { "nextCursor": "2026-11-23T16:35:02.967Z", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/bluesky/list/posts": { "get": { "tags": [ "Bluesky" ], "summary": "The posts of a list's accounts, 50 a page.", "description": "Newest first. 1 credit a page.", "operationId": "blueskyListPosts", "parameters": [ { "name": "url", "in": "query", "description": "Its bsky.app link.", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "Its AT-URI (the `id` its answers give it), instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_BlueskyPost" }, "example": { "data": [ { "id": "at://did:plc:4yvwfwxfz5sney4twepuzdu7/app.bsky.feed.post/3n35pu2ugw22m", "url": "https://bsky.app/profile/germnetwork.com/post/3n35pu2ugw22m", "text": "🦠 Be like Ray 🦠", "createdAt": "2026-11-25T17:49:49.232Z", "author": { "id": "did:plc:4yvwfwxfz5sney4twepuzdu7", "username": "germnetwork.com", "displayName": "Germ Network", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:4yvwfwxfz5sney4twepuzdu7/bafkreib2zhhtby6ctjxqjgcoqqjvowd6a5cgmi3g2smo25ot4yk2gaxjvy", "verified": true, "url": "https://bsky.app/profile/germnetwork.com" }, "stats": { "views": null, "likes": 7, "comments": 0, "shares": 0, "saves": 0, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "cid": "bafyreif4vcs6hd2wol63sc2wqvu2woen2pilulyvyb76gk6e4d5q4ope7q", "rkey": "3n35pu2ugw22m", "quotes": 0, "langs": [ "en" ], "replyTo": null, "repost": null, "pinned": false, "quoted": { "id": "at://did:plc:6fqk5cjsiazqekfyjdrlrha7/app.bsky.feed.post/3n34fm4she22v", "url": "https://bsky.app/profile/ray.blacksky.app/post/3n34fm4she22v", "author": { "id": "did:plc:6fqk5cjsiazqekfyjdrlrha7", "username": "ray.blacksky.app", "displayName": "Ra¥mundo. ⁂", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:6fqk5cjsiazqekfyjdrlrha7/bafkreigcjwqe7cl7ltnx6sdzq5nuckuagfefbnrw2xtql3mcr5cmxvhdmy", "verified": false, "url": "https://bsky.app/profile/ray.blacksky.app" }, "text": "Onboarded two of my AT Proto homies onto Germ today!\n\nGerm is spreading fast!" }, "link": null, "altTexts": [], "repliesRestricted": false, "labels": [], "indexedAt": "2026-11-25T17:49:50.048Z" } }, { "id": "at://did:plc:e5sycehmo2p3ze6qvrrsurcc/app.bsky.feed.post/3n35mje6dec2e", "url": "https://bsky.app/profile/boostblue.bsky.social/post/3n35mje6dec2e", "text": "And I found a fix! So after the next version you should be able to re-enable that setting without issue.", "createdAt": "2026-11-25T16:50:08.668Z", "author": { "id": "did:plc:e5sycehmo2p3ze6qvrrsurcc", "username": "boostblue.bsky.social", "displayName": "Boost Blue", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:e5sycehmo2p3ze6qvrrsurcc/bafkreign763zvptacxkc4ltywllblyyw2uejgw5ygo6sedc2vs6bnn5s3y", "verified": false, "url": "https://bsky.app/profile/boostblue.bsky.social" }, "stats": { "views": null, "likes": 1, "comments": 0, "shares": 0, "saves": 0, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "cid": "bafyreiavxdvbnqrdk353n7stys7dxiao54c7e2w2kr3knffqjc6az2fuyu", "rkey": "3n35mje6dec2e", "quotes": 0, "langs": [ "en" ], "replyTo": { "parent": "at://did:plc:hkx57h5aljo7a2xsfzv2dynk/app.bsky.feed.post/3n35mhixrgm2f", "root": "at://did:plc:e5sycehmo2p3ze6qvrrsurcc/app.bsky.feed.post/3n334jgsbsk2a" }, "repost": null, "pinned": false, "quoted": null, "link": null, "altTexts": [], "repliesRestricted": false, "labels": [], "indexedAt": "2026-11-25T16:50:09.251Z" } } ], "pagination": { "nextCursor": "2026-11-23T16:35:02.967Z", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.bluesky.listPosts({ id: \"at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.graph.list/3lvpca43j5z26\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.bluesky.list_posts(id=\"at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.graph.list/3lvpca43j5z26\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/bluesky/list/posts \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"id=at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.graph.list/3lvpca43j5z26\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_BlueskyPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/BlueskyPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "BlueskyPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "cid", "rkey", "langs", "pinned", "altTexts", "repliesRestricted", "labels" ], "properties": { "altTexts": { "type": "array", "items": { "type": "string" }, "description": "Each image's or video's description for screen readers, in `media`'s order; empty\nwhen none has one." }, "cid": { "type": "string", "description": "The record's content hash and its key (the last part of its link)." }, "indexedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "When Bluesky indexed it." }, { "type": "null" } ] }, "labels": { "type": "array", "items": { "type": "string" }, "description": "Labels on the post, by value (`porn`, `graphic-media`…)." }, "langs": { "type": "array", "items": { "type": "string" }, "description": "The languages its author set." }, "link": { "oneOf": [ { "$ref": "#/components/schemas/BlueskyLinkCard" }, { "type": "null" } ] }, "pinned": { "type": "boolean", "description": "Pinned to its author's profile, in that account's posts." }, "quoted": { "oneOf": [ { "$ref": "#/components/schemas/BlueskyQuoted" }, { "type": "null" } ] }, "quotes": { "type": [ "integer", "null" ], "format": "int64", "description": "Posts quoting it.", "minimum": 0 }, "repliesRestricted": { "type": "boolean", "description": "Whether its author limited who may reply." }, "replyTo": { "oneOf": [ { "$ref": "#/components/schemas/BlueskyReplyRef", "description": "What it replies to, when it is a reply." }, { "type": "null" } ] }, "repost": { "oneOf": [ { "$ref": "#/components/schemas/BlueskyRepost", "description": "Who reposted it into this list, in an account's posts." }, { "type": "null" } ] }, "rkey": { "type": "string" } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A post: text, images, a video, a link or a quote." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "BlueskyRepost": { "type": "object", "description": "Who reposted a post into the list it is in, and when.", "required": [ "by" ], "properties": { "at": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "by": { "$ref": "#/components/schemas/Author" } } }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } }, "Timestamp": { "type": "string", "format": "date-time" }, "BlueskyReplyRef": { "type": "object", "description": "The post a reply answers, and the thread's first post.", "required": [ "parent", "root" ], "properties": { "parent": { "type": "string" }, "root": { "type": "string" } } }, "BlueskyQuoted": { "type": "object", "description": "What a post quotes: a post, or a feed, list or starter pack it embeds.", "required": [ "id" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "id": { "type": "string", "description": "Its AT-URI." }, "text": { "type": [ "string", "null" ], "description": "A quoted post's text, or the name of a feed, list or starter pack." }, "url": { "type": [ "string", "null" ] } } }, "BlueskyLinkCard": { "type": "object", "description": "The link a post shares, as its card shows it.", "required": [ "url" ], "properties": { "description": { "type": [ "string", "null" ] }, "thumbnailUrl": { "type": [ "string", "null" ] }, "title": { "type": [ "string", "null" ] }, "url": { "type": "string" } } } } } } ``` # List (/docs/api-reference/bluesky/list) A list with its purpose and member count. `GET https://api.socialapi.sh/v1/bluesky/list` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.bluesky.list({ id: "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.graph.list/3lvpca43j5z26" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.bluesky.list(id="at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.graph.list/3lvpca43j5z26").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/bluesky/list \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "id=at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.graph.list/3lvpca43j5z26" ``` **Response** ```json { "data": { "id": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.graph.list/3lvpca43j5z26", "name": "Community Showcase", "description": "Community projects built on the Bluesky API ✨", "purpose": "curate", "avatarUrl": null, "url": "https://bsky.app/profile/bsky.app/lists/3lvpca43j5z26", "members": 21, "creator": { "id": "did:plc:z72i7hdynmk6r22z27h6tvur", "username": "bsky.app", "displayName": "Bluesky", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreihwihm6kpd6zuwhhlro75p5qks5qtrcu55jp3gddbfjsieiv7wuka", "verified": false, "url": "https://bsky.app/profile/bsky.app" }, "cid": "bafyreidikdsr75erlyyzcxbpkqzlsglmedgsclv7kbh5bgx4xhz67egwwi", "labels": [], "indexedAt": "2025-08-06T03:43:31.609Z" } } ``` **OpenAPI** ```json { "paths": { "/v1/bluesky/list": { "get": { "tags": [ "Bluesky" ], "summary": "A list with its purpose and member count.", "description": "Its name, description, who made it and how many accounts are on it. 1 credit.", "operationId": "blueskyList", "parameters": [ { "name": "url", "in": "query", "description": "Its bsky.app link.", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "Its AT-URI (the `id` its answers give it), instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_BlueskyList" }, "example": { "data": { "id": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.graph.list/3lvpca43j5z26", "name": "Community Showcase", "description": "Community projects built on the Bluesky API ✨", "purpose": "curate", "avatarUrl": null, "url": "https://bsky.app/profile/bsky.app/lists/3lvpca43j5z26", "members": 21, "creator": { "id": "did:plc:z72i7hdynmk6r22z27h6tvur", "username": "bsky.app", "displayName": "Bluesky", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreihwihm6kpd6zuwhhlro75p5qks5qtrcu55jp3gddbfjsieiv7wuka", "verified": false, "url": "https://bsky.app/profile/bsky.app" }, "cid": "bafyreidikdsr75erlyyzcxbpkqzlsglmedgsclv7kbh5bgx4xhz67egwwi", "labels": [], "indexedAt": "2025-08-06T03:43:31.609Z" } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.bluesky.list({ id: \"at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.graph.list/3lvpca43j5z26\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.bluesky.list(id=\"at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.graph.list/3lvpca43j5z26\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/bluesky/list \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"id=at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.graph.list/3lvpca43j5z26\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_BlueskyList": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/BlueskyList" } } }, "BlueskyList": { "type": "object", "description": "A list of accounts.", "required": [ "id", "name", "cid", "labels" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "cid": { "type": "string" }, "creator": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "description": { "type": [ "string", "null" ] }, "id": { "type": "string", "description": "Its AT-URI." }, "indexedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "labels": { "type": "array", "items": { "type": "string" } }, "members": { "type": [ "integer", "null" ], "format": "int64", "description": "Accounts on it.", "minimum": 0 }, "name": { "type": "string" }, "purpose": { "oneOf": [ { "$ref": "#/components/schemas/BlueskyListPurpose" }, { "type": "null" } ] }, "url": { "type": [ "string", "null" ] } } }, "BlueskyListPurpose": { "type": "string", "description": "What a list is for.", "enum": [ "curate", "moderation", "reference" ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Post Comments (/docs/api-reference/bluesky/post-comments) A post's replies, and the replies to them. `GET https://api.socialapi.sh/v1/bluesky/post/comments` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.bluesky.postComments({ url: "https://bsky.app/profile/bsky.app/post/3l6oveex3ii2l", sort: "top" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.bluesky.post_comments(url="https://bsky.app/profile/bsky.app/post/3l6oveex3ii2l", sort="top") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/bluesky/post/comments \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://bsky.app/profile/bsky.app/post/3l6oveex3ii2l" \ --data-urlencode "sort=top" ``` **Response** ```json { "data": [ { "id": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3l6ovfftinx2m", "postId": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3l6oveex3ii2l", "parentId": null, "text": "• Anyone can create and subscribe to feeds. There are 50k+ feeds here, like posts from mutuals, news, or cat photos!\n\nbsky.app/feeds\n\n• The Discover feed shows you posts that we think you'll like. Help us fine-tune it for you by using the \"Show more\" & \"Show less\" buttons in the three-dot menu.", "createdAt": "2024-10-17T07:07:26.071Z", "author": { "id": "did:plc:z72i7hdynmk6r22z27h6tvur", "username": "bsky.app", "displayName": "Bluesky", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreihwihm6kpd6zuwhhlro75p5qks5qtrcu55jp3gddbfjsieiv7wuka", "verified": false, "url": "https://bsky.app/profile/bsky.app" }, "likes": 3245, "replies": 61, "ext": { "url": "https://bsky.app/profile/bsky.app/post/3l6ovfftinx2m", "cid": "bafyreid5gnc6nuo4jcnjkp52xu66otq3qioorrrowzlqrnc6l7pupii2eq", "depth": 1, "reposts": 283, "quotes": 41, "saves": 10, "media": [], "link": null, "langs": [ "en" ], "moreReplies": 15, "byAuthor": true, "labels": [] } }, { "id": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3l6ovgyi7ah2t", "postId": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3l6oveex3ii2l", "parentId": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3l6ovfftinx2m", "text": "• On Bluesky, you own your online identity. If you own a website, you can set that as your username. We highly recommend official organizations / brands to do this — it's one form of self-verification here!", "createdAt": "2024-10-17T07:08:19.185Z", "author": { "id": "did:plc:z72i7hdynmk6r22z27h6tvur", "username": "bsky.app", "displayName": "Bluesky", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreihwihm6kpd6zuwhhlro75p5qks5qtrcu55jp3gddbfjsieiv7wuka", "verified": false, "url": "https://bsky.app/profile/bsky.app" }, "likes": 3058, "replies": 52, "ext": { "url": "https://bsky.app/profile/bsky.app/post/3l6ovgyi7ah2t", "cid": "bafyreifvkmpdgo4cbarvbt6he56cjchz5y2bpszsftrdackoobsba2lgiq", "depth": 2, "reposts": 323, "quotes": 83, "saves": 11, "media": [], "link": { "url": "https://bsky.social/about/blog/4-28-2023-domain-handle-tutorial", "title": "How to set your domain as your handle - Bluesky", "description": "Using a domain as your handle helps with account identity, verification, and portability. Here's how to set your domain as your handle.", "thumbnailUrl": null }, "langs": [ "en" ], "moreReplies": 52, "byAuthor": true, "labels": [] } } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/bluesky/post/comments": { "get": { "tags": [ "Bluesky" ], "summary": "A post's replies, and the replies to them.", "description": "One page: as many as Bluesky answers for a thread (about 165 of a very large one's),\nordered by likes or time among those. A reply to a reply names its parent. 1 credit.", "operationId": "blueskyPostComments", "parameters": [ { "name": "url", "in": "query", "description": "The post's bsky.app link.", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The post's AT-URI (its `id`), instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "sort", "in": "query", "description": "`top` (the most liked first, the default), `newest` or `oldest`.", "required": false, "schema": { "type": "string", "description": "How a post's replies are ordered.", "enum": [ "top", "newest", "oldest" ] } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_BlueskyComment" }, "example": { "data": [ { "id": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3l6ovfftinx2m", "postId": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3l6oveex3ii2l", "parentId": null, "text": "• Anyone can create and subscribe to feeds. There are 50k+ feeds here, like posts from mutuals, news, or cat photos!\n\nbsky.app/feeds\n\n• The Discover feed shows you posts that we think you'll like. Help us fine-tune it for you by using the \"Show more\" & \"Show less\" buttons in the three-dot menu.", "createdAt": "2024-10-17T07:07:26.071Z", "author": { "id": "did:plc:z72i7hdynmk6r22z27h6tvur", "username": "bsky.app", "displayName": "Bluesky", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreihwihm6kpd6zuwhhlro75p5qks5qtrcu55jp3gddbfjsieiv7wuka", "verified": false, "url": "https://bsky.app/profile/bsky.app" }, "likes": 3245, "replies": 61, "ext": { "url": "https://bsky.app/profile/bsky.app/post/3l6ovfftinx2m", "cid": "bafyreid5gnc6nuo4jcnjkp52xu66otq3qioorrrowzlqrnc6l7pupii2eq", "depth": 1, "reposts": 283, "quotes": 41, "saves": 10, "media": [], "link": null, "langs": [ "en" ], "moreReplies": 15, "byAuthor": true, "labels": [] } }, { "id": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3l6ovgyi7ah2t", "postId": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3l6oveex3ii2l", "parentId": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3l6ovfftinx2m", "text": "• On Bluesky, you own your online identity. If you own a website, you can set that as your username. We highly recommend official organizations / brands to do this — it's one form of self-verification here!", "createdAt": "2024-10-17T07:08:19.185Z", "author": { "id": "did:plc:z72i7hdynmk6r22z27h6tvur", "username": "bsky.app", "displayName": "Bluesky", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreihwihm6kpd6zuwhhlro75p5qks5qtrcu55jp3gddbfjsieiv7wuka", "verified": false, "url": "https://bsky.app/profile/bsky.app" }, "likes": 3058, "replies": 52, "ext": { "url": "https://bsky.app/profile/bsky.app/post/3l6ovgyi7ah2t", "cid": "bafyreifvkmpdgo4cbarvbt6he56cjchz5y2bpszsftrdackoobsba2lgiq", "depth": 2, "reposts": 323, "quotes": 83, "saves": 11, "media": [], "link": { "url": "https://bsky.social/about/blog/4-28-2023-domain-handle-tutorial", "title": "How to set your domain as your handle - Bluesky", "description": "Using a domain as your handle helps with account identity, verification, and portability. Here's how to set your domain as your handle.", "thumbnailUrl": null }, "langs": [ "en" ], "moreReplies": 52, "byAuthor": true, "labels": [] } } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.bluesky.postComments({ url: \"https://bsky.app/profile/bsky.app/post/3l6oveex3ii2l\", sort: \"top\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.bluesky.post_comments(url=\"https://bsky.app/profile/bsky.app/post/3l6oveex3ii2l\", sort=\"top\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/bluesky/post/comments \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://bsky.app/profile/bsky.app/post/3l6oveex3ii2l\" \\\n --data-urlencode \"sort=top\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_BlueskyComment": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/BlueskyComment" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "BlueskyComment": { "allOf": [ { "type": "object", "description": "A comment or a reply.", "required": [ "id", "postId", "text", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "description": "A reply is a post of its own on Bluesky: what the comment schema has no room for.", "required": [ "url", "cid", "depth", "media", "langs", "moreReplies", "byAuthor", "labels" ], "properties": { "byAuthor": { "type": "boolean", "description": "Written by the post's own author." }, "cid": { "type": "string" }, "depth": { "type": "integer", "format": "int32", "description": "How deep under the post it is: 1 for a reply to the post itself.", "minimum": 0 }, "labels": { "type": "array", "items": { "type": "string" } }, "langs": { "type": "array", "items": { "type": "string" } }, "link": { "oneOf": [ { "$ref": "#/components/schemas/BlueskyLinkCard" }, { "type": "null" } ] }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" }, "description": "Images or video in it." }, "moreReplies": { "type": "integer", "format": "int64", "description": "Replies to it that this answer leaves out; read them with its `id` as the post.", "minimum": 0 }, "quotes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "reposts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Bookmarks.", "minimum": 0 }, "url": { "type": "string" } } }, { "type": "object", "description": "What only this platform has." } ] }, "id": { "type": "string" }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "parentId": { "type": [ "string", "null" ], "description": "The comment this replies to; absent on a top-level comment." }, "postId": { "type": "string" }, "replies": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "text": { "type": "string" } } }, { "type": "object", "description": "A reply to a post." } ] }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "BlueskyLinkCard": { "type": "object", "description": "The link a post shares, as its card shows it.", "required": [ "url" ], "properties": { "description": { "type": [ "string", "null" ] }, "thumbnailUrl": { "type": [ "string", "null" ] }, "title": { "type": [ "string", "null" ] }, "url": { "type": "string" } } }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Post Likes (/docs/api-reference/bluesky/post-likes) The accounts that liked a post, 100 a page. `GET https://api.socialapi.sh/v1/bluesky/post/likes` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.bluesky.postLikes({ url: "https://bsky.app/profile/bsky.app/post/3l6oveex3ii2l" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.bluesky.post_likes(url="https://bsky.app/profile/bsky.app/post/3l6oveex3ii2l") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/bluesky/post/likes \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://bsky.app/profile/bsky.app/post/3l6oveex3ii2l" ``` **Response** ```json { "data": [ { "actor": { "id": "did:plc:737ywpbdizqo775oevldgzmv", "username": "devtest04.bsky.social", "displayName": null, "bio": "AI writes software. Humans build companies. Drytis is the human part.", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:737ywpbdizqo775oevldgzmv/bafkreig23kiutj52uqvzakqaprye5qcsed7l2wullooocw5sh5ew3s3mom", "url": "https://bsky.app/profile/devtest04.bsky.social", "verified": false, "private": false, "followers": null, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": "2026-11-05T21:51:43.179Z", "ext": { "bannerUrl": null, "pronouns": null, "pinnedPost": null, "lists": null, "feeds": null, "starterPacks": null, "trustedVerifier": false, "labeler": false, "liveUrl": null, "labels": [], "indexedAt": "2026-11-25T18:45:47.442Z" } }, "createdAt": "2026-11-25T18:49:39.305Z" }, { "actor": { "id": "did:plc:uqvjreoujcrii4r2rzryztfk", "username": "heavenlysharon198.bsky.social", "displayName": null, "bio": "\"Please keep your comments respectful and kind. Any inappropriate comments will not be tolerated.\nTo those who follow me — you are always welcome to message me. I respect you, I appreciate you, and I love hearing from you. 🇺🇸🌎 🎤 🎸 🤠 ✍️”", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:uqvjreoujcrii4r2rzryztfk/bafkreibe7gnvjkeherzylccqlam5u7ya43d4dypbdpz3wuivykbbxrbln4", "url": "https://bsky.app/profile/heavenlysharon198.bsky.social", "verified": false, "private": false, "followers": null, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": "2025-10-26T12:58:53.350Z", "ext": { "bannerUrl": null, "pronouns": null, "pinnedPost": null, "lists": null, "feeds": null, "starterPacks": null, "trustedVerifier": false, "labeler": false, "liveUrl": null, "labels": [ "!no-unauthenticated" ], "indexedAt": "2026-11-25T16:32:22.650Z" } }, "createdAt": "2026-11-25T16:50:01.995Z" } ], "pagination": { "nextCursor": "2026-11-09T12:36:48.608Z", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/bluesky/post/likes": { "get": { "tags": [ "Bluesky" ], "summary": "The accounts that liked a post, 100 a page.", "description": "Newest first, each with when it liked. 1 credit a page.", "operationId": "blueskyPostLikes", "parameters": [ { "name": "url", "in": "query", "description": "Its bsky.app link.", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "Its AT-URI (the `id` its answers give it), instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_BlueskyLike" }, "example": { "data": [ { "actor": { "id": "did:plc:737ywpbdizqo775oevldgzmv", "username": "devtest04.bsky.social", "displayName": null, "bio": "AI writes software. Humans build companies. Drytis is the human part.", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:737ywpbdizqo775oevldgzmv/bafkreig23kiutj52uqvzakqaprye5qcsed7l2wullooocw5sh5ew3s3mom", "url": "https://bsky.app/profile/devtest04.bsky.social", "verified": false, "private": false, "followers": null, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": "2026-11-05T21:51:43.179Z", "ext": { "bannerUrl": null, "pronouns": null, "pinnedPost": null, "lists": null, "feeds": null, "starterPacks": null, "trustedVerifier": false, "labeler": false, "liveUrl": null, "labels": [], "indexedAt": "2026-11-25T18:45:47.442Z" } }, "createdAt": "2026-11-25T18:49:39.305Z" }, { "actor": { "id": "did:plc:uqvjreoujcrii4r2rzryztfk", "username": "heavenlysharon198.bsky.social", "displayName": null, "bio": "\"Please keep your comments respectful and kind. Any inappropriate comments will not be tolerated.\nTo those who follow me — you are always welcome to message me. I respect you, I appreciate you, and I love hearing from you. 🇺🇸🌎 🎤 🎸 🤠 ✍️”", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:uqvjreoujcrii4r2rzryztfk/bafkreibe7gnvjkeherzylccqlam5u7ya43d4dypbdpz3wuivykbbxrbln4", "url": "https://bsky.app/profile/heavenlysharon198.bsky.social", "verified": false, "private": false, "followers": null, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": "2025-10-26T12:58:53.350Z", "ext": { "bannerUrl": null, "pronouns": null, "pinnedPost": null, "lists": null, "feeds": null, "starterPacks": null, "trustedVerifier": false, "labeler": false, "liveUrl": null, "labels": [ "!no-unauthenticated" ], "indexedAt": "2026-11-25T16:32:22.650Z" } }, "createdAt": "2026-11-25T16:50:01.995Z" } ], "pagination": { "nextCursor": "2026-11-09T12:36:48.608Z", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.bluesky.postLikes({ url: \"https://bsky.app/profile/bsky.app/post/3l6oveex3ii2l\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.bluesky.post_likes(url=\"https://bsky.app/profile/bsky.app/post/3l6oveex3ii2l\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/bluesky/post/likes \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://bsky.app/profile/bsky.app/post/3l6oveex3ii2l\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_BlueskyLike": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/BlueskyLike" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "BlueskyLike": { "type": "object", "description": "A like: who, and when.", "required": [ "actor" ], "properties": { "actor": { "$ref": "#/components/schemas/Profile" }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] } } }, "Timestamp": { "type": "string", "format": "date-time" }, "Profile": { "type": "object", "description": "An account.", "required": [ "id", "username", "url", "verified", "private", "ext" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "bio": { "type": [ "string", "null" ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "displayName": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "trustedVerifier", "labeler", "labels" ], "properties": { "bannerUrl": { "type": [ "string", "null" ], "description": "The profile's banner picture." }, "feeds": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "indexedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "When Bluesky last indexed the profile." }, { "type": "null" } ] }, "labeler": { "type": "boolean", "description": "A labeler: a moderation service others subscribe to." }, "labels": { "type": "array", "items": { "type": "string" }, "description": "Labels on the account, by value. `!no-unauthenticated` is the account asking apps\nnot to show it to visitors who are not signed in." }, "lists": { "type": [ "integer", "null" ], "format": "int64", "description": "The lists, feeds and starter packs it made.", "minimum": 0 }, "liveUrl": { "type": [ "string", "null" ], "description": "Where it is live now, while it says it is." }, "pinnedPost": { "type": [ "string", "null" ], "description": "The post pinned to it, as `/v1/bluesky/post` takes it." }, "pronouns": { "type": [ "string", "null" ], "description": "The pronouns it lists." }, "starterPacks": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "trustedVerifier": { "type": "boolean", "description": "A trusted verifier: an account whose word verifies others." } } }, { "type": "object", "description": "What only this platform has." } ] }, "externalUrl": { "type": [ "string", "null" ], "description": "The link in the bio." }, "followers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "following": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "id": { "type": "string", "description": "The platform's id for the account." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "description": "Likes the account's posts received in total.", "minimum": 0 }, "posts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "private": { "type": "boolean" }, "url": { "type": "string", "description": "The profile's page." }, "username": { "type": "string", "description": "The handle, without `@`." }, "verified": { "type": "boolean" } } } } } } ``` # Post Quotes (/docs/api-reference/bluesky/post-quotes) The posts quoting a post, 50 a page. `GET https://api.socialapi.sh/v1/bluesky/post/quotes` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.bluesky.postQuotes({ url: "https://bsky.app/profile/bsky.app/post/3l6oveex3ii2l" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.bluesky.post_quotes(url="https://bsky.app/profile/bsky.app/post/3l6oveex3ii2l") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/bluesky/post/quotes \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://bsky.app/profile/bsky.app/post/3l6oveex3ii2l" ``` **Response** ```json { "data": [ { "id": "at://did:plc:d2ovw6zn5kjxxlpirfuvyqdr/app.bsky.feed.post/3mzxu5ruamk2f", "url": "https://bsky.app/profile/ggyungog.bsky.social/post/3mzxu5ruamk2f", "text": null, "createdAt": "2026-11-10T16:25:40.241Z", "author": { "id": "did:plc:d2ovw6zn5kjxxlpirfuvyqdr", "username": "ggyungog.bsky.social", "displayName": "G 💯", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:d2ovw6zn5kjxxlpirfuvyqdr/bafkreifzkqgkqprwynuiif4e4iuhqzvw6p2nozi7iypnhq74ua4vw6lony", "verified": false, "url": "https://bsky.app/profile/ggyungog.bsky.social" }, "stats": { "views": null, "likes": 0, "comments": 0, "shares": 0, "saves": 0, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "cid": "bafyreidbw2syix7gqu6ymdoq6wqgkjjmavkjfrx7gyeztimsicxni5orjq", "rkey": "3mzxu5ruamk2f", "quotes": 0, "langs": [ "en" ], "replyTo": null, "repost": null, "pinned": false, "quoted": { "id": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3l6oveex3ii2l", "url": "https://bsky.app/profile/bsky.app/post/3l6oveex3ii2l", "author": { "id": "did:plc:z72i7hdynmk6r22z27h6tvur", "username": "bsky.app", "displayName": "Bluesky", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreihwihm6kpd6zuwhhlro75p5qks5qtrcu55jp3gddbfjsieiv7wuka", "verified": false, "url": "https://bsky.app/profile/bsky.app" }, "text": "👋 Bluesky is an open social network that gives creators independence from platforms, developers the freedom to build, and users a choice in their experience. We're so excited to have you here! \n\nWe share Bluesky updates & news from this account. A quick orientation thread: 🧵✨" }, "link": null, "altTexts": [], "repliesRestricted": false, "labels": [], "indexedAt": "2026-11-10T16:25:40.569Z" } }, { "id": "at://did:plc:gicrck3mwknnrgns5u6roj6n/app.bsky.feed.post/3mzud6qcpds2h", "url": "https://bsky.app/profile/avenirash72.bsky.social/post/3mzud6qcpds2h", "text": "bsky.app/profile/bsky...", "createdAt": "2026-11-09T06:43:59.347Z", "author": { "id": "did:plc:gicrck3mwknnrgns5u6roj6n", "username": "avenirash72.bsky.social", "displayName": null, "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:gicrck3mwknnrgns5u6roj6n/bafkreigdkh2l4vbunboxyqr2jkgxdphe6xiszfeppzu6rsm3o7ogi5g25e", "verified": false, "url": "https://bsky.app/profile/avenirash72.bsky.social" }, "stats": { "views": null, "likes": 2, "comments": 0, "shares": 0, "saves": 0, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "cid": "bafyreieh7sucdrv3g7dyp2w3bccfs6hknt3srsy46cxbocw3o4c7wwkkdq", "rkey": "3mzud6qcpds2h", "quotes": 0, "langs": [ "en" ], "replyTo": null, "repost": null, "pinned": false, "quoted": { "id": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3l6oveex3ii2l", "url": "https://bsky.app/profile/bsky.app/post/3l6oveex3ii2l", "author": { "id": "did:plc:z72i7hdynmk6r22z27h6tvur", "username": "bsky.app", "displayName": "Bluesky", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreihwihm6kpd6zuwhhlro75p5qks5qtrcu55jp3gddbfjsieiv7wuka", "verified": false, "url": "https://bsky.app/profile/bsky.app" }, "text": "👋 Bluesky is an open social network that gives creators independence from platforms, developers the freedom to build, and users a choice in their experience. We're so excited to have you here! \n\nWe share Bluesky updates & news from this account. A quick orientation thread: 🧵✨" }, "link": null, "altTexts": [], "repliesRestricted": false, "labels": [], "indexedAt": "2026-11-09T06:44:00.973Z" } } ], "pagination": { "nextCursor": "2026-02-21T13:52:08.912Z", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/bluesky/post/quotes": { "get": { "tags": [ "Bluesky" ], "summary": "The posts quoting a post, 50 a page.", "description": "Newest first. 1 credit a page.", "operationId": "blueskyPostQuotes", "parameters": [ { "name": "url", "in": "query", "description": "Its bsky.app link.", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "Its AT-URI (the `id` its answers give it), instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_BlueskyPost" }, "example": { "data": [ { "id": "at://did:plc:d2ovw6zn5kjxxlpirfuvyqdr/app.bsky.feed.post/3mzxu5ruamk2f", "url": "https://bsky.app/profile/ggyungog.bsky.social/post/3mzxu5ruamk2f", "text": null, "createdAt": "2026-11-10T16:25:40.241Z", "author": { "id": "did:plc:d2ovw6zn5kjxxlpirfuvyqdr", "username": "ggyungog.bsky.social", "displayName": "G 💯", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:d2ovw6zn5kjxxlpirfuvyqdr/bafkreifzkqgkqprwynuiif4e4iuhqzvw6p2nozi7iypnhq74ua4vw6lony", "verified": false, "url": "https://bsky.app/profile/ggyungog.bsky.social" }, "stats": { "views": null, "likes": 0, "comments": 0, "shares": 0, "saves": 0, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "cid": "bafyreidbw2syix7gqu6ymdoq6wqgkjjmavkjfrx7gyeztimsicxni5orjq", "rkey": "3mzxu5ruamk2f", "quotes": 0, "langs": [ "en" ], "replyTo": null, "repost": null, "pinned": false, "quoted": { "id": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3l6oveex3ii2l", "url": "https://bsky.app/profile/bsky.app/post/3l6oveex3ii2l", "author": { "id": "did:plc:z72i7hdynmk6r22z27h6tvur", "username": "bsky.app", "displayName": "Bluesky", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreihwihm6kpd6zuwhhlro75p5qks5qtrcu55jp3gddbfjsieiv7wuka", "verified": false, "url": "https://bsky.app/profile/bsky.app" }, "text": "👋 Bluesky is an open social network that gives creators independence from platforms, developers the freedom to build, and users a choice in their experience. We're so excited to have you here! \n\nWe share Bluesky updates & news from this account. A quick orientation thread: 🧵✨" }, "link": null, "altTexts": [], "repliesRestricted": false, "labels": [], "indexedAt": "2026-11-10T16:25:40.569Z" } }, { "id": "at://did:plc:gicrck3mwknnrgns5u6roj6n/app.bsky.feed.post/3mzud6qcpds2h", "url": "https://bsky.app/profile/avenirash72.bsky.social/post/3mzud6qcpds2h", "text": "bsky.app/profile/bsky...", "createdAt": "2026-11-09T06:43:59.347Z", "author": { "id": "did:plc:gicrck3mwknnrgns5u6roj6n", "username": "avenirash72.bsky.social", "displayName": null, "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:gicrck3mwknnrgns5u6roj6n/bafkreigdkh2l4vbunboxyqr2jkgxdphe6xiszfeppzu6rsm3o7ogi5g25e", "verified": false, "url": "https://bsky.app/profile/avenirash72.bsky.social" }, "stats": { "views": null, "likes": 2, "comments": 0, "shares": 0, "saves": 0, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "cid": "bafyreieh7sucdrv3g7dyp2w3bccfs6hknt3srsy46cxbocw3o4c7wwkkdq", "rkey": "3mzud6qcpds2h", "quotes": 0, "langs": [ "en" ], "replyTo": null, "repost": null, "pinned": false, "quoted": { "id": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3l6oveex3ii2l", "url": "https://bsky.app/profile/bsky.app/post/3l6oveex3ii2l", "author": { "id": "did:plc:z72i7hdynmk6r22z27h6tvur", "username": "bsky.app", "displayName": "Bluesky", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreihwihm6kpd6zuwhhlro75p5qks5qtrcu55jp3gddbfjsieiv7wuka", "verified": false, "url": "https://bsky.app/profile/bsky.app" }, "text": "👋 Bluesky is an open social network that gives creators independence from platforms, developers the freedom to build, and users a choice in their experience. We're so excited to have you here! \n\nWe share Bluesky updates & news from this account. A quick orientation thread: 🧵✨" }, "link": null, "altTexts": [], "repliesRestricted": false, "labels": [], "indexedAt": "2026-11-09T06:44:00.973Z" } } ], "pagination": { "nextCursor": "2026-02-21T13:52:08.912Z", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.bluesky.postQuotes({ url: \"https://bsky.app/profile/bsky.app/post/3l6oveex3ii2l\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.bluesky.post_quotes(url=\"https://bsky.app/profile/bsky.app/post/3l6oveex3ii2l\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/bluesky/post/quotes \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://bsky.app/profile/bsky.app/post/3l6oveex3ii2l\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_BlueskyPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/BlueskyPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "BlueskyPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "cid", "rkey", "langs", "pinned", "altTexts", "repliesRestricted", "labels" ], "properties": { "altTexts": { "type": "array", "items": { "type": "string" }, "description": "Each image's or video's description for screen readers, in `media`'s order; empty\nwhen none has one." }, "cid": { "type": "string", "description": "The record's content hash and its key (the last part of its link)." }, "indexedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "When Bluesky indexed it." }, { "type": "null" } ] }, "labels": { "type": "array", "items": { "type": "string" }, "description": "Labels on the post, by value (`porn`, `graphic-media`…)." }, "langs": { "type": "array", "items": { "type": "string" }, "description": "The languages its author set." }, "link": { "oneOf": [ { "$ref": "#/components/schemas/BlueskyLinkCard" }, { "type": "null" } ] }, "pinned": { "type": "boolean", "description": "Pinned to its author's profile, in that account's posts." }, "quoted": { "oneOf": [ { "$ref": "#/components/schemas/BlueskyQuoted" }, { "type": "null" } ] }, "quotes": { "type": [ "integer", "null" ], "format": "int64", "description": "Posts quoting it.", "minimum": 0 }, "repliesRestricted": { "type": "boolean", "description": "Whether its author limited who may reply." }, "replyTo": { "oneOf": [ { "$ref": "#/components/schemas/BlueskyReplyRef", "description": "What it replies to, when it is a reply." }, { "type": "null" } ] }, "repost": { "oneOf": [ { "$ref": "#/components/schemas/BlueskyRepost", "description": "Who reposted it into this list, in an account's posts." }, { "type": "null" } ] }, "rkey": { "type": "string" } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A post: text, images, a video, a link or a quote." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "BlueskyRepost": { "type": "object", "description": "Who reposted a post into the list it is in, and when.", "required": [ "by" ], "properties": { "at": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "by": { "$ref": "#/components/schemas/Author" } } }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } }, "Timestamp": { "type": "string", "format": "date-time" }, "BlueskyReplyRef": { "type": "object", "description": "The post a reply answers, and the thread's first post.", "required": [ "parent", "root" ], "properties": { "parent": { "type": "string" }, "root": { "type": "string" } } }, "BlueskyQuoted": { "type": "object", "description": "What a post quotes: a post, or a feed, list or starter pack it embeds.", "required": [ "id" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "id": { "type": "string", "description": "Its AT-URI." }, "text": { "type": [ "string", "null" ], "description": "A quoted post's text, or the name of a feed, list or starter pack." }, "url": { "type": [ "string", "null" ] } } }, "BlueskyLinkCard": { "type": "object", "description": "The link a post shares, as its card shows it.", "required": [ "url" ], "properties": { "description": { "type": [ "string", "null" ] }, "thumbnailUrl": { "type": [ "string", "null" ] }, "title": { "type": [ "string", "null" ] }, "url": { "type": "string" } } } } } } ``` # Post Reposts (/docs/api-reference/bluesky/post-reposts) The accounts that reposted a post, 100 a page. `GET https://api.socialapi.sh/v1/bluesky/post/reposts` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.bluesky.postReposts({ url: "https://bsky.app/profile/bsky.app/post/3l6oveex3ii2l" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.bluesky.post_reposts(url="https://bsky.app/profile/bsky.app/post/3l6oveex3ii2l") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/bluesky/post/reposts \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://bsky.app/profile/bsky.app/post/3l6oveex3ii2l" ``` **Response** ```json { "data": [ { "id": "did:plc:zzwq6jhjnv4irlwhl5okzdut", "username": "sykhotic.bsky.social", "displayName": "Hunter/Hubris (XIV 7.x Spoilers)", "bio": "They/He | 30s | 🔞 (18+) | Furry\nExtremely part-time Let's Player. Canadian. Severely addicted to FFXIV (Hubris Tymbaent/Bozica Tirasch - Faerie, Aether)! Rodent women <3 <3 <3 <3\n\nAvatar by @anaugi.bsky.social\nBanner by @yooshark.bsky.social", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:zzwq6jhjnv4irlwhl5okzdut/bafkreih55oxjgxzskvtxgpn2engdny2mfz6536w7vgk5ylgi37zmwnf3zq", "url": "https://bsky.app/profile/sykhotic.bsky.social", "verified": false, "private": false, "followers": null, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": "2023-08-03T15:59:32.413Z", "ext": { "bannerUrl": null, "pronouns": "they/he", "pinnedPost": null, "lists": null, "feeds": null, "starterPacks": null, "trustedVerifier": false, "labeler": false, "liveUrl": null, "labels": [], "indexedAt": "2026-11-05T01:33:25.683Z" } }, { "id": "did:plc:zzpvr2ggjv764eawpnqvehvc", "username": "ettios.bsky.social", "displayName": "ETTIOS.io", "bio": "Ecosistema Tecnocripto\nTokens Nativos: ETTiA / SHERLOCK / CANABLOK \nwww.ettios.io", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:zzpvr2ggjv764eawpnqvehvc/bafkreihqfnajuu26eolslqporop5b4f73c6xtg5nejislsp7hbguihecu4", "url": "https://bsky.app/profile/ettios.bsky.social", "verified": false, "private": false, "followers": null, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": "2024-11-23T14:04:25.145Z", "ext": { "bannerUrl": null, "pronouns": null, "pinnedPost": null, "lists": null, "feeds": null, "starterPacks": null, "trustedVerifier": false, "labeler": false, "liveUrl": null, "labels": [], "indexedAt": "2025-03-07T20:15:03.542Z" } } ], "pagination": { "nextCursor": "did:plc:zpm6a5a2ncsl7z3vdqmfylkt", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/bluesky/post/reposts": { "get": { "tags": [ "Bluesky" ], "summary": "The accounts that reposted a post, 100 a page.", "description": "1 credit a page.", "operationId": "blueskyPostReposts", "parameters": [ { "name": "url", "in": "query", "description": "Its bsky.app link.", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "Its AT-URI (the `id` its answers give it), instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_BlueskyProfile" }, "example": { "data": [ { "id": "did:plc:zzwq6jhjnv4irlwhl5okzdut", "username": "sykhotic.bsky.social", "displayName": "Hunter/Hubris (XIV 7.x Spoilers)", "bio": "They/He | 30s | 🔞 (18+) | Furry\nExtremely part-time Let's Player. Canadian. Severely addicted to FFXIV (Hubris Tymbaent/Bozica Tirasch - Faerie, Aether)! Rodent women <3 <3 <3 <3\n\nAvatar by @anaugi.bsky.social\nBanner by @yooshark.bsky.social", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:zzwq6jhjnv4irlwhl5okzdut/bafkreih55oxjgxzskvtxgpn2engdny2mfz6536w7vgk5ylgi37zmwnf3zq", "url": "https://bsky.app/profile/sykhotic.bsky.social", "verified": false, "private": false, "followers": null, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": "2023-08-03T15:59:32.413Z", "ext": { "bannerUrl": null, "pronouns": "they/he", "pinnedPost": null, "lists": null, "feeds": null, "starterPacks": null, "trustedVerifier": false, "labeler": false, "liveUrl": null, "labels": [], "indexedAt": "2026-11-05T01:33:25.683Z" } }, { "id": "did:plc:zzpvr2ggjv764eawpnqvehvc", "username": "ettios.bsky.social", "displayName": "ETTIOS.io", "bio": "Ecosistema Tecnocripto\nTokens Nativos: ETTiA / SHERLOCK / CANABLOK \nwww.ettios.io", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:zzpvr2ggjv764eawpnqvehvc/bafkreihqfnajuu26eolslqporop5b4f73c6xtg5nejislsp7hbguihecu4", "url": "https://bsky.app/profile/ettios.bsky.social", "verified": false, "private": false, "followers": null, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": "2024-11-23T14:04:25.145Z", "ext": { "bannerUrl": null, "pronouns": null, "pinnedPost": null, "lists": null, "feeds": null, "starterPacks": null, "trustedVerifier": false, "labeler": false, "liveUrl": null, "labels": [], "indexedAt": "2025-03-07T20:15:03.542Z" } } ], "pagination": { "nextCursor": "did:plc:zpm6a5a2ncsl7z3vdqmfylkt", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.bluesky.postReposts({ url: \"https://bsky.app/profile/bsky.app/post/3l6oveex3ii2l\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.bluesky.post_reposts(url=\"https://bsky.app/profile/bsky.app/post/3l6oveex3ii2l\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/bluesky/post/reposts \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://bsky.app/profile/bsky.app/post/3l6oveex3ii2l\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_BlueskyProfile": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/BlueskyProfile" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "BlueskyProfile": { "allOf": [ { "type": "object", "description": "An account.", "required": [ "id", "username", "url", "verified", "private", "ext" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "bio": { "type": [ "string", "null" ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "displayName": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "trustedVerifier", "labeler", "labels" ], "properties": { "bannerUrl": { "type": [ "string", "null" ], "description": "The profile's banner picture." }, "feeds": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "indexedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "When Bluesky last indexed the profile." }, { "type": "null" } ] }, "labeler": { "type": "boolean", "description": "A labeler: a moderation service others subscribe to." }, "labels": { "type": "array", "items": { "type": "string" }, "description": "Labels on the account, by value. `!no-unauthenticated` is the account asking apps\nnot to show it to visitors who are not signed in." }, "lists": { "type": [ "integer", "null" ], "format": "int64", "description": "The lists, feeds and starter packs it made.", "minimum": 0 }, "liveUrl": { "type": [ "string", "null" ], "description": "Where it is live now, while it says it is." }, "pinnedPost": { "type": [ "string", "null" ], "description": "The post pinned to it, as `/v1/bluesky/post` takes it." }, "pronouns": { "type": [ "string", "null" ], "description": "The pronouns it lists." }, "starterPacks": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "trustedVerifier": { "type": "boolean", "description": "A trusted verifier: an account whose word verifies others." } } }, { "type": "object", "description": "What only this platform has." } ] }, "externalUrl": { "type": [ "string", "null" ], "description": "The link in the bio." }, "followers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "following": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "id": { "type": "string", "description": "The platform's id for the account." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "description": "Likes the account's posts received in total.", "minimum": 0 }, "posts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "private": { "type": "boolean" }, "url": { "type": "string", "description": "The profile's page." }, "username": { "type": "string", "description": "The handle, without `@`." }, "verified": { "type": "boolean" } } }, { "type": "object", "description": "A Bluesky account." } ] }, "Timestamp": { "type": "string", "format": "date-time" } } } } ``` # Post (/docs/api-reference/bluesky/post) One post with its likes, replies, reposts and quotes. `GET https://api.socialapi.sh/v1/bluesky/post` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.bluesky.post({ url: "https://bsky.app/profile/bsky.app/post/3l6oveex3ii2l" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.bluesky.post(url="https://bsky.app/profile/bsky.app/post/3l6oveex3ii2l").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/bluesky/post \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://bsky.app/profile/bsky.app/post/3l6oveex3ii2l" ``` **Response** ```json { "data": { "id": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3l6oveex3ii2l", "url": "https://bsky.app/profile/bsky.app/post/3l6oveex3ii2l", "text": "👋 Bluesky is an open social network that gives creators independence from platforms, developers the freedom to build, and users a choice in their experience. We're so excited to have you here! \n\nWe share Bluesky updates & news from this account. A quick orientation thread: 🧵✨", "createdAt": "2024-10-17T07:06:51.491Z", "author": { "id": "did:plc:z72i7hdynmk6r22z27h6tvur", "username": "bsky.app", "displayName": "Bluesky", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreihwihm6kpd6zuwhhlro75p5qks5qtrcu55jp3gddbfjsieiv7wuka", "verified": false, "url": "https://bsky.app/profile/bsky.app" }, "stats": { "views": null, "likes": 63842, "comments": 8779, "shares": 9585, "saves": 290, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "cid": "bafyreicnt42y6vo6pfpvyro234ac4o6ijug6adwwrh7awflgrqlt4zibxq", "rkey": "3l6oveex3ii2l", "quotes": 729, "langs": [ "en" ], "replyTo": null, "repost": null, "pinned": false, "quoted": null, "link": null, "altTexts": [], "repliesRestricted": true, "labels": [], "indexedAt": "2024-10-17T07:06:51.491Z" } } } ``` **OpenAPI** ```json { "paths": { "/v1/bluesky/post": { "get": { "tags": [ "Bluesky" ], "summary": "One post with its likes, replies, reposts and quotes.", "description": "Text, media, link card, the post it quotes or answers, its languages and labels, and\nits counts, bookmarks included. 1 credit.", "operationId": "blueskyPost", "parameters": [ { "name": "url", "in": "query", "description": "Its bsky.app link.", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "Its AT-URI (the `id` its answers give it), instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_BlueskyPost" }, "example": { "data": { "id": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3l6oveex3ii2l", "url": "https://bsky.app/profile/bsky.app/post/3l6oveex3ii2l", "text": "👋 Bluesky is an open social network that gives creators independence from platforms, developers the freedom to build, and users a choice in their experience. We're so excited to have you here! \n\nWe share Bluesky updates & news from this account. A quick orientation thread: 🧵✨", "createdAt": "2024-10-17T07:06:51.491Z", "author": { "id": "did:plc:z72i7hdynmk6r22z27h6tvur", "username": "bsky.app", "displayName": "Bluesky", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreihwihm6kpd6zuwhhlro75p5qks5qtrcu55jp3gddbfjsieiv7wuka", "verified": false, "url": "https://bsky.app/profile/bsky.app" }, "stats": { "views": null, "likes": 63842, "comments": 8779, "shares": 9585, "saves": 290, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "cid": "bafyreicnt42y6vo6pfpvyro234ac4o6ijug6adwwrh7awflgrqlt4zibxq", "rkey": "3l6oveex3ii2l", "quotes": 729, "langs": [ "en" ], "replyTo": null, "repost": null, "pinned": false, "quoted": null, "link": null, "altTexts": [], "repliesRestricted": true, "labels": [], "indexedAt": "2024-10-17T07:06:51.491Z" } } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.bluesky.post({ url: \"https://bsky.app/profile/bsky.app/post/3l6oveex3ii2l\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.bluesky.post(url=\"https://bsky.app/profile/bsky.app/post/3l6oveex3ii2l\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/bluesky/post \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://bsky.app/profile/bsky.app/post/3l6oveex3ii2l\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_BlueskyPost": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/BlueskyPost" } } }, "BlueskyPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "cid", "rkey", "langs", "pinned", "altTexts", "repliesRestricted", "labels" ], "properties": { "altTexts": { "type": "array", "items": { "type": "string" }, "description": "Each image's or video's description for screen readers, in `media`'s order; empty\nwhen none has one." }, "cid": { "type": "string", "description": "The record's content hash and its key (the last part of its link)." }, "indexedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "When Bluesky indexed it." }, { "type": "null" } ] }, "labels": { "type": "array", "items": { "type": "string" }, "description": "Labels on the post, by value (`porn`, `graphic-media`…)." }, "langs": { "type": "array", "items": { "type": "string" }, "description": "The languages its author set." }, "link": { "oneOf": [ { "$ref": "#/components/schemas/BlueskyLinkCard" }, { "type": "null" } ] }, "pinned": { "type": "boolean", "description": "Pinned to its author's profile, in that account's posts." }, "quoted": { "oneOf": [ { "$ref": "#/components/schemas/BlueskyQuoted" }, { "type": "null" } ] }, "quotes": { "type": [ "integer", "null" ], "format": "int64", "description": "Posts quoting it.", "minimum": 0 }, "repliesRestricted": { "type": "boolean", "description": "Whether its author limited who may reply." }, "replyTo": { "oneOf": [ { "$ref": "#/components/schemas/BlueskyReplyRef", "description": "What it replies to, when it is a reply." }, { "type": "null" } ] }, "repost": { "oneOf": [ { "$ref": "#/components/schemas/BlueskyRepost", "description": "Who reposted it into this list, in an account's posts." }, { "type": "null" } ] }, "rkey": { "type": "string" } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A post: text, images, a video, a link or a quote." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "BlueskyRepost": { "type": "object", "description": "Who reposted a post into the list it is in, and when.", "required": [ "by" ], "properties": { "at": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "by": { "$ref": "#/components/schemas/Author" } } }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } }, "Timestamp": { "type": "string", "format": "date-time" }, "BlueskyReplyRef": { "type": "object", "description": "The post a reply answers, and the thread's first post.", "required": [ "parent", "root" ], "properties": { "parent": { "type": "string" }, "root": { "type": "string" } } }, "BlueskyQuoted": { "type": "object", "description": "What a post quotes: a post, or a feed, list or starter pack it embeds.", "required": [ "id" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "id": { "type": "string", "description": "Its AT-URI." }, "text": { "type": [ "string", "null" ], "description": "A quoted post's text, or the name of a feed, list or starter pack." }, "url": { "type": [ "string", "null" ] } } }, "BlueskyLinkCard": { "type": "object", "description": "The link a post shares, as its card shows it.", "required": [ "url" ], "properties": { "description": { "type": [ "string", "null" ] }, "thumbnailUrl": { "type": [ "string", "null" ] }, "title": { "type": [ "string", "null" ] }, "url": { "type": "string" } } } } } } ``` # Profile Feeds (/docs/api-reference/bluesky/profile-feeds) The feeds an account made, 50 a page. `GET https://api.socialapi.sh/v1/bluesky/profile/feeds` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.bluesky.profileFeeds({ handle: "bsky.app" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.bluesky.profile_feeds(handle="bsky.app") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/bluesky/profile/feeds \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=bsky.app" ``` **Response** ```json { "data": [ { "id": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.generator/with-friends", "name": "Popular With Friends", "description": "A mix of popular content from accounts you follow and content that your follows like.", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreieppnjpayqgjbyqnbeqzwj3pzqtiwbe5a4m6whzqnp3k7gpqs2gai", "url": "https://bsky.app/profile/bsky.app/feed/with-friends", "likes": 41422, "creator": { "id": "did:plc:z72i7hdynmk6r22z27h6tvur", "username": "bsky.app", "displayName": "Bluesky", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreihwihm6kpd6zuwhhlro75p5qks5qtrcu55jp3gddbfjsieiv7wuka", "verified": false, "url": "https://bsky.app/profile/bsky.app" }, "service": "did:web:discover.bsky.app", "online": null, "valid": null, "cid": "bafyreig6odglhywpzwm36p4h5jzlc7kbiushd5wbf44woap2kab74fwrju", "labels": [], "indexedAt": "2026-10-28T17:12:54.788Z" }, { "id": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.generator/whats-hot", "name": "Discover", "description": "Trending content from your personal network", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreidljdg62x3zhlweyzshoekrw2znokytt5tmib7g4xsngwvpnf6ule", "url": "https://bsky.app/profile/bsky.app/feed/whats-hot", "likes": 39666, "creator": { "id": "did:plc:z72i7hdynmk6r22z27h6tvur", "username": "bsky.app", "displayName": "Bluesky", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreihwihm6kpd6zuwhhlro75p5qks5qtrcu55jp3gddbfjsieiv7wuka", "verified": false, "url": "https://bsky.app/profile/bsky.app" }, "service": "did:web:discover.bsky.app", "online": null, "valid": null, "cid": "bafyreifquqn7pyvhhtrfmhlj3mmlgjnd3xtqnifrskkm3vjlqr3ur6pwwq", "labels": [], "indexedAt": "2026-10-28T17:14:14.580Z" } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/bluesky/profile/feeds": { "get": { "tags": [ "Bluesky" ], "summary": "The feeds an account made, 50 a page.", "description": "Each with its description and its likes. 1 credit a page.", "operationId": "blueskyProfileFeeds", "parameters": [ { "name": "handle", "in": "query", "description": "The account's handle (`bsky.app`) or DID.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "The profile's link, instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_BlueskyFeed" }, "example": { "data": [ { "id": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.generator/with-friends", "name": "Popular With Friends", "description": "A mix of popular content from accounts you follow and content that your follows like.", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreieppnjpayqgjbyqnbeqzwj3pzqtiwbe5a4m6whzqnp3k7gpqs2gai", "url": "https://bsky.app/profile/bsky.app/feed/with-friends", "likes": 41422, "creator": { "id": "did:plc:z72i7hdynmk6r22z27h6tvur", "username": "bsky.app", "displayName": "Bluesky", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreihwihm6kpd6zuwhhlro75p5qks5qtrcu55jp3gddbfjsieiv7wuka", "verified": false, "url": "https://bsky.app/profile/bsky.app" }, "service": "did:web:discover.bsky.app", "online": null, "valid": null, "cid": "bafyreig6odglhywpzwm36p4h5jzlc7kbiushd5wbf44woap2kab74fwrju", "labels": [], "indexedAt": "2026-10-28T17:12:54.788Z" }, { "id": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.generator/whats-hot", "name": "Discover", "description": "Trending content from your personal network", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreidljdg62x3zhlweyzshoekrw2znokytt5tmib7g4xsngwvpnf6ule", "url": "https://bsky.app/profile/bsky.app/feed/whats-hot", "likes": 39666, "creator": { "id": "did:plc:z72i7hdynmk6r22z27h6tvur", "username": "bsky.app", "displayName": "Bluesky", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreihwihm6kpd6zuwhhlro75p5qks5qtrcu55jp3gddbfjsieiv7wuka", "verified": false, "url": "https://bsky.app/profile/bsky.app" }, "service": "did:web:discover.bsky.app", "online": null, "valid": null, "cid": "bafyreifquqn7pyvhhtrfmhlj3mmlgjnd3xtqnifrskkm3vjlqr3ur6pwwq", "labels": [], "indexedAt": "2026-10-28T17:14:14.580Z" } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.bluesky.profileFeeds({ handle: \"bsky.app\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.bluesky.profile_feeds(handle=\"bsky.app\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/bluesky/profile/feeds \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=bsky.app\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_BlueskyFeed": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/BlueskyFeed" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "BlueskyFeed": { "type": "object", "description": "A feed: an algorithm an account runs, which anyone can read.", "required": [ "id", "name", "cid", "labels" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "cid": { "type": "string" }, "creator": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "description": { "type": [ "string", "null" ] }, "id": { "type": "string", "description": "Its AT-URI." }, "indexedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "labels": { "type": "array", "items": { "type": "string" } }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "name": { "type": "string" }, "online": { "type": [ "boolean", "null" ], "description": "Whether its service is answering and its record valid; only `/v1/bluesky/feed`\nsays." }, "service": { "type": [ "string", "null" ], "description": "The service that runs it (`did:web:discover.bsky.app`)." }, "url": { "type": [ "string", "null" ] }, "valid": { "type": [ "boolean", "null" ] } } }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Profile Followers (/docs/api-reference/bluesky/profile-followers) The accounts following an account, 100 a page. `GET https://api.socialapi.sh/v1/bluesky/profile/followers` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.bluesky.profileFollowers({ handle: "bsky.app" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.bluesky.profile_followers(handle="bsky.app") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/bluesky/profile/followers \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=bsky.app" ``` **Response** ```json { "data": [ { "id": "did:plc:sdo6kumfbnroeho6zllkzc2z", "username": "handle.invalid", "displayName": "Dev Test Account", "bio": null, "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:sdo6kumfbnroeho6zllkzc2z/bafkreidlettqkts2ru3b7wscewep5mbkxjfppdrqbhyfgcqgbrk2zdfrvi", "url": "https://bsky.app/profile/did:plc:sdo6kumfbnroeho6zllkzc2z", "verified": false, "private": false, "followers": null, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": "2025-12-22T12:18:03.125Z", "ext": { "bannerUrl": null, "pronouns": null, "pinnedPost": null, "lists": null, "feeds": null, "starterPacks": null, "trustedVerifier": false, "labeler": false, "liveUrl": null, "labels": [], "indexedAt": "2025-12-22T12:18:03.125Z" } }, { "id": "did:plc:cmpq4hjclhrobdveeydljp56", "username": "handle.invalid", "displayName": null, "bio": null, "avatarUrl": null, "url": "https://bsky.app/profile/did:plc:cmpq4hjclhrobdveeydljp56", "verified": false, "private": false, "followers": null, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": null, "ext": { "bannerUrl": null, "pronouns": null, "pinnedPost": null, "lists": null, "feeds": null, "starterPacks": null, "trustedVerifier": false, "labeler": false, "liveUrl": null, "labels": [], "indexedAt": null } } ], "pagination": { "nextCursor": "3n35takukx32r", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/bluesky/profile/followers": { "get": { "tags": [ "Bluesky" ], "summary": "The accounts following an account, 100 a page.", "description": "Newest first, each with its name, bio and picture; no counts. 1 credit a page.", "operationId": "blueskyProfileFollowers", "parameters": [ { "name": "handle", "in": "query", "description": "The account's handle (`bsky.app`) or DID.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "The profile's link, instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_BlueskyProfile" }, "example": { "data": [ { "id": "did:plc:sdo6kumfbnroeho6zllkzc2z", "username": "handle.invalid", "displayName": "Dev Test Account", "bio": null, "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:sdo6kumfbnroeho6zllkzc2z/bafkreidlettqkts2ru3b7wscewep5mbkxjfppdrqbhyfgcqgbrk2zdfrvi", "url": "https://bsky.app/profile/did:plc:sdo6kumfbnroeho6zllkzc2z", "verified": false, "private": false, "followers": null, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": "2025-12-22T12:18:03.125Z", "ext": { "bannerUrl": null, "pronouns": null, "pinnedPost": null, "lists": null, "feeds": null, "starterPacks": null, "trustedVerifier": false, "labeler": false, "liveUrl": null, "labels": [], "indexedAt": "2025-12-22T12:18:03.125Z" } }, { "id": "did:plc:cmpq4hjclhrobdveeydljp56", "username": "handle.invalid", "displayName": null, "bio": null, "avatarUrl": null, "url": "https://bsky.app/profile/did:plc:cmpq4hjclhrobdveeydljp56", "verified": false, "private": false, "followers": null, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": null, "ext": { "bannerUrl": null, "pronouns": null, "pinnedPost": null, "lists": null, "feeds": null, "starterPacks": null, "trustedVerifier": false, "labeler": false, "liveUrl": null, "labels": [], "indexedAt": null } } ], "pagination": { "nextCursor": "3n35takukx32r", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.bluesky.profileFollowers({ handle: \"bsky.app\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.bluesky.profile_followers(handle=\"bsky.app\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/bluesky/profile/followers \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=bsky.app\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_BlueskyProfile": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/BlueskyProfile" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "BlueskyProfile": { "allOf": [ { "type": "object", "description": "An account.", "required": [ "id", "username", "url", "verified", "private", "ext" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "bio": { "type": [ "string", "null" ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "displayName": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "trustedVerifier", "labeler", "labels" ], "properties": { "bannerUrl": { "type": [ "string", "null" ], "description": "The profile's banner picture." }, "feeds": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "indexedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "When Bluesky last indexed the profile." }, { "type": "null" } ] }, "labeler": { "type": "boolean", "description": "A labeler: a moderation service others subscribe to." }, "labels": { "type": "array", "items": { "type": "string" }, "description": "Labels on the account, by value. `!no-unauthenticated` is the account asking apps\nnot to show it to visitors who are not signed in." }, "lists": { "type": [ "integer", "null" ], "format": "int64", "description": "The lists, feeds and starter packs it made.", "minimum": 0 }, "liveUrl": { "type": [ "string", "null" ], "description": "Where it is live now, while it says it is." }, "pinnedPost": { "type": [ "string", "null" ], "description": "The post pinned to it, as `/v1/bluesky/post` takes it." }, "pronouns": { "type": [ "string", "null" ], "description": "The pronouns it lists." }, "starterPacks": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "trustedVerifier": { "type": "boolean", "description": "A trusted verifier: an account whose word verifies others." } } }, { "type": "object", "description": "What only this platform has." } ] }, "externalUrl": { "type": [ "string", "null" ], "description": "The link in the bio." }, "followers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "following": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "id": { "type": "string", "description": "The platform's id for the account." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "description": "Likes the account's posts received in total.", "minimum": 0 }, "posts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "private": { "type": "boolean" }, "url": { "type": "string", "description": "The profile's page." }, "username": { "type": "string", "description": "The handle, without `@`." }, "verified": { "type": "boolean" } } }, { "type": "object", "description": "A Bluesky account." } ] }, "Timestamp": { "type": "string", "format": "date-time" } } } } ``` # Profile Following (/docs/api-reference/bluesky/profile-following) The accounts an account follows, 100 a page. `GET https://api.socialapi.sh/v1/bluesky/profile/following` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.bluesky.profileFollowing({ handle: "bsky.app" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.bluesky.profile_following(handle="bsky.app") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/bluesky/profile/following \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=bsky.app" ``` **Response** ```json { "data": [ { "id": "did:plc:jutmjylg2h4tpev7wrvy2ay3", "username": "alyankovic.bsky.social", "displayName": "Al Yankovic", "bio": "You know... the weird one.", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:jutmjylg2h4tpev7wrvy2ay3/bafkreibrr7aidte4qfvmgvozn54c44eb4gfxj7ywy3wjmrpjsxzdyjnwpe", "url": "https://bsky.app/profile/alyankovic.bsky.social", "verified": true, "private": false, "followers": null, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": "2023-05-24T22:03:10.185Z", "ext": { "bannerUrl": null, "pronouns": null, "pinnedPost": null, "lists": null, "feeds": null, "starterPacks": null, "trustedVerifier": false, "labeler": false, "liveUrl": null, "labels": [], "indexedAt": "2024-01-20T05:08:34.606Z" } }, { "id": "did:plc:cguwfiesizkt4ssgx6q7d6yy", "username": "marawilson.bsky.social", "displayName": "Mara Wilson", "bio": "Writer, actor, audiobook narrator, notorious tryhard", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:cguwfiesizkt4ssgx6q7d6yy/bafkreigtvfvdpptvyc5bj4teuyxr4nxwfvpkmj4jfidykmskfyl5vmhhoe", "url": "https://bsky.app/profile/marawilson.bsky.social", "verified": true, "private": false, "followers": null, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": "2023-06-01T22:34:31.107Z", "ext": { "bannerUrl": null, "pronouns": null, "pinnedPost": null, "lists": null, "feeds": null, "starterPacks": null, "trustedVerifier": false, "labeler": false, "liveUrl": null, "labels": [ "!no-unauthenticated" ], "indexedAt": "2024-08-10T23:40:28.474Z" } } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/bluesky/profile/following": { "get": { "tags": [ "Bluesky" ], "summary": "The accounts an account follows, 100 a page.", "description": "Newest first, each with its name, bio and picture; no counts. 1 credit a page.", "operationId": "blueskyProfileFollowing", "parameters": [ { "name": "handle", "in": "query", "description": "The account's handle (`bsky.app`) or DID.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "The profile's link, instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_BlueskyProfile" }, "example": { "data": [ { "id": "did:plc:jutmjylg2h4tpev7wrvy2ay3", "username": "alyankovic.bsky.social", "displayName": "Al Yankovic", "bio": "You know... the weird one.", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:jutmjylg2h4tpev7wrvy2ay3/bafkreibrr7aidte4qfvmgvozn54c44eb4gfxj7ywy3wjmrpjsxzdyjnwpe", "url": "https://bsky.app/profile/alyankovic.bsky.social", "verified": true, "private": false, "followers": null, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": "2023-05-24T22:03:10.185Z", "ext": { "bannerUrl": null, "pronouns": null, "pinnedPost": null, "lists": null, "feeds": null, "starterPacks": null, "trustedVerifier": false, "labeler": false, "liveUrl": null, "labels": [], "indexedAt": "2024-01-20T05:08:34.606Z" } }, { "id": "did:plc:cguwfiesizkt4ssgx6q7d6yy", "username": "marawilson.bsky.social", "displayName": "Mara Wilson", "bio": "Writer, actor, audiobook narrator, notorious tryhard", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:cguwfiesizkt4ssgx6q7d6yy/bafkreigtvfvdpptvyc5bj4teuyxr4nxwfvpkmj4jfidykmskfyl5vmhhoe", "url": "https://bsky.app/profile/marawilson.bsky.social", "verified": true, "private": false, "followers": null, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": "2023-06-01T22:34:31.107Z", "ext": { "bannerUrl": null, "pronouns": null, "pinnedPost": null, "lists": null, "feeds": null, "starterPacks": null, "trustedVerifier": false, "labeler": false, "liveUrl": null, "labels": [ "!no-unauthenticated" ], "indexedAt": "2024-08-10T23:40:28.474Z" } } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.bluesky.profileFollowing({ handle: \"bsky.app\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.bluesky.profile_following(handle=\"bsky.app\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/bluesky/profile/following \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=bsky.app\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_BlueskyProfile": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/BlueskyProfile" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "BlueskyProfile": { "allOf": [ { "type": "object", "description": "An account.", "required": [ "id", "username", "url", "verified", "private", "ext" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "bio": { "type": [ "string", "null" ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "displayName": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "trustedVerifier", "labeler", "labels" ], "properties": { "bannerUrl": { "type": [ "string", "null" ], "description": "The profile's banner picture." }, "feeds": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "indexedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "When Bluesky last indexed the profile." }, { "type": "null" } ] }, "labeler": { "type": "boolean", "description": "A labeler: a moderation service others subscribe to." }, "labels": { "type": "array", "items": { "type": "string" }, "description": "Labels on the account, by value. `!no-unauthenticated` is the account asking apps\nnot to show it to visitors who are not signed in." }, "lists": { "type": [ "integer", "null" ], "format": "int64", "description": "The lists, feeds and starter packs it made.", "minimum": 0 }, "liveUrl": { "type": [ "string", "null" ], "description": "Where it is live now, while it says it is." }, "pinnedPost": { "type": [ "string", "null" ], "description": "The post pinned to it, as `/v1/bluesky/post` takes it." }, "pronouns": { "type": [ "string", "null" ], "description": "The pronouns it lists." }, "starterPacks": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "trustedVerifier": { "type": "boolean", "description": "A trusted verifier: an account whose word verifies others." } } }, { "type": "object", "description": "What only this platform has." } ] }, "externalUrl": { "type": [ "string", "null" ], "description": "The link in the bio." }, "followers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "following": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "id": { "type": "string", "description": "The platform's id for the account." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "description": "Likes the account's posts received in total.", "minimum": 0 }, "posts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "private": { "type": "boolean" }, "url": { "type": "string", "description": "The profile's page." }, "username": { "type": "string", "description": "The handle, without `@`." }, "verified": { "type": "boolean" } } }, { "type": "object", "description": "A Bluesky account." } ] }, "Timestamp": { "type": "string", "format": "date-time" } } } } ``` # Profile Lists (/docs/api-reference/bluesky/profile-lists) The lists an account made, 50 a page. `GET https://api.socialapi.sh/v1/bluesky/profile/lists` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.bluesky.profileLists({ handle: "bsky.app" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.bluesky.profile_lists(handle="bsky.app") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/bluesky/profile/lists \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=bsky.app" ``` **Response** ```json { "data": [ { "id": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.graph.list/3lvpca43j5z26", "name": "Community Showcase", "description": "Community projects built on the Bluesky API ✨", "purpose": "curate", "avatarUrl": null, "url": "https://bsky.app/profile/bsky.app/lists/3lvpca43j5z26", "members": 21, "creator": { "id": "did:plc:z72i7hdynmk6r22z27h6tvur", "username": "bsky.app", "displayName": "Bluesky", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreihwihm6kpd6zuwhhlro75p5qks5qtrcu55jp3gddbfjsieiv7wuka", "verified": false, "url": "https://bsky.app/profile/bsky.app" }, "cid": "bafyreidikdsr75erlyyzcxbpkqzlsglmedgsclv7kbh5bgx4xhz67egwwi", "labels": [], "indexedAt": "2025-08-06T03:43:31.609Z" } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/bluesky/profile/lists": { "get": { "tags": [ "Bluesky" ], "summary": "The lists an account made, 50 a page.", "description": "Each with its purpose and how many accounts are on it. 1 credit a page.", "operationId": "blueskyProfileLists", "parameters": [ { "name": "handle", "in": "query", "description": "The account's handle (`bsky.app`) or DID.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "The profile's link, instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_BlueskyList" }, "example": { "data": [ { "id": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.graph.list/3lvpca43j5z26", "name": "Community Showcase", "description": "Community projects built on the Bluesky API ✨", "purpose": "curate", "avatarUrl": null, "url": "https://bsky.app/profile/bsky.app/lists/3lvpca43j5z26", "members": 21, "creator": { "id": "did:plc:z72i7hdynmk6r22z27h6tvur", "username": "bsky.app", "displayName": "Bluesky", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreihwihm6kpd6zuwhhlro75p5qks5qtrcu55jp3gddbfjsieiv7wuka", "verified": false, "url": "https://bsky.app/profile/bsky.app" }, "cid": "bafyreidikdsr75erlyyzcxbpkqzlsglmedgsclv7kbh5bgx4xhz67egwwi", "labels": [], "indexedAt": "2025-08-06T03:43:31.609Z" } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.bluesky.profileLists({ handle: \"bsky.app\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.bluesky.profile_lists(handle=\"bsky.app\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/bluesky/profile/lists \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=bsky.app\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_BlueskyList": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/BlueskyList" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "BlueskyList": { "type": "object", "description": "A list of accounts.", "required": [ "id", "name", "cid", "labels" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "cid": { "type": "string" }, "creator": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "description": { "type": [ "string", "null" ] }, "id": { "type": "string", "description": "Its AT-URI." }, "indexedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "labels": { "type": "array", "items": { "type": "string" } }, "members": { "type": [ "integer", "null" ], "format": "int64", "description": "Accounts on it.", "minimum": 0 }, "name": { "type": "string" }, "purpose": { "oneOf": [ { "$ref": "#/components/schemas/BlueskyListPurpose" }, { "type": "null" } ] }, "url": { "type": [ "string", "null" ] } } }, "BlueskyListPurpose": { "type": "string", "description": "What a list is for.", "enum": [ "curate", "moderation", "reference" ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Profile Media (/docs/api-reference/bluesky/profile-media) An account's posts with images or video. `GET https://api.socialapi.sh/v1/bluesky/profile/media` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.bluesky.profileMedia({ handle: "bsky.app" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.bluesky.profile_media(handle="bsky.app") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/bluesky/profile/media \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=bsky.app" ``` **Response** ```json { "data": [ { "id": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3n2opitysuc2j", "url": "https://bsky.app/profile/bsky.app/post/3n2opitysuc2j", "text": "We’ve also made it easier to share posts from Bluesky. When you tap the arrow icon on mobile, you’ll now have the option of sharing directly to your other apps.", "createdAt": "2026-11-19T18:33:36.814Z", "author": { "id": "did:plc:z72i7hdynmk6r22z27h6tvur", "username": "bsky.app", "displayName": "Bluesky", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreihwihm6kpd6zuwhhlro75p5qks5qtrcu55jp3gddbfjsieiv7wuka", "verified": false, "url": "https://bsky.app/profile/bsky.app" }, "stats": { "views": null, "likes": 1009, "comments": 46, "shares": 89, "saves": 42, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://video.bsky.app/watch/did%3Aplc%3Az72i7hdynmk6r22z27h6tvur/bafkreiapzmyzxc72yow7zhko4fgykat7ppbcvnz4wv7okwcwnesbasy5um/playlist.m3u8", "thumbnailUrl": "https://video.bsky.app/watch/did%3Aplc%3Az72i7hdynmk6r22z27h6tvur/bafkreiapzmyzxc72yow7zhko4fgykat7ppbcvnz4wv7okwcwnesbasy5um/thumbnail.jpg", "width": 1080, "height": 1620, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "cid": "bafyreicukrrriqobyd7rnkyheos3afuubvwrqddmhvjjkxu4bpt6bz2jnq", "rkey": "3n2opitysuc2j", "quotes": 15, "langs": [ "en" ], "replyTo": { "parent": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3n2opitxdyc2j", "root": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3n2opitxdyc2j" }, "repost": null, "pinned": false, "quoted": null, "link": null, "altTexts": [ "A video demonstrating the new share sheet. Kiki (a cat) has posted a snarling selfie with the text \"My face when someone says they're 'not really a cat person.' Send this to someone who needs to hear it.\" When the share button is tapped, we see the share sheet pop up with profile images of Kiki's animal friends, plus icons of messaging and social apps on Kiki's phone. Kiki chooses \"Messages\" and s…" ], "repliesRestricted": false, "labels": [], "indexedAt": "2026-11-19T18:33:38.544Z" } }, { "id": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3n2opitxdyc2j", "url": "https://bsky.app/profile/bsky.app/post/3n2opitxdyc2j", "text": "v1.138 is live!\n\nView counts are available in beta! Now you can see how many people your posts are reaching. The numbers are private — they only appear on your own posts and only to you. To turn them on, enable beta features here: bsky.app/settings/bet.... Let us know what you think.", "createdAt": "2026-11-19T18:33:36.813Z", "author": { "id": "did:plc:z72i7hdynmk6r22z27h6tvur", "username": "bsky.app", "displayName": "Bluesky", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreihwihm6kpd6zuwhhlro75p5qks5qtrcu55jp3gddbfjsieiv7wuka", "verified": false, "url": "https://bsky.app/profile/bsky.app" }, "stats": { "views": null, "likes": 2038, "comments": 787, "shares": 349, "saves": 218, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://video.bsky.app/watch/did%3Aplc%3Az72i7hdynmk6r22z27h6tvur/bafkreiavlqznqay24hdpwzzr7tjsy65gbjggiwug2djr6nfw7lszaztrk4/playlist.m3u8", "thumbnailUrl": "https://video.bsky.app/watch/did%3Aplc%3Az72i7hdynmk6r22z27h6tvur/bafkreiavlqznqay24hdpwzzr7tjsy65gbjggiwug2djr6nfw7lszaztrk4/thumbnail.jpg", "width": 1080, "height": 1728, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "cid": "bafyreihjpuz225u5djer7b6oqj5aszoqcblsjogyzlkr2ipw65cz3sk45m", "rkey": "3n2opitxdyc2j", "quotes": 1173, "langs": [ "en" ], "replyTo": null, "repost": null, "pinned": false, "quoted": null, "link": null, "altTexts": [ "A video demonstrating the new post views feature—now in beta. Hoagie the dog has posted, \"Day 47 of asking for a second breakfast. Morale remains high.\" We zoom in and see the view count pop up in small gray type between the date and the reply settings." ], "repliesRestricted": true, "labels": [], "indexedAt": "2026-11-19T18:33:38.543Z" } } ], "pagination": { "nextCursor": "2025-08-29T16:49:14.626Z", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/bluesky/profile/media": { "get": { "tags": [ "Bluesky" ], "summary": "An account's posts with images or video.", "description": "50 a page, newest first. 1 credit a page.", "operationId": "blueskyProfileMedia", "parameters": [ { "name": "handle", "in": "query", "description": "The account's handle (`bsky.app`) or DID.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "The profile's link, instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_BlueskyPost" }, "example": { "data": [ { "id": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3n2opitysuc2j", "url": "https://bsky.app/profile/bsky.app/post/3n2opitysuc2j", "text": "We’ve also made it easier to share posts from Bluesky. When you tap the arrow icon on mobile, you’ll now have the option of sharing directly to your other apps.", "createdAt": "2026-11-19T18:33:36.814Z", "author": { "id": "did:plc:z72i7hdynmk6r22z27h6tvur", "username": "bsky.app", "displayName": "Bluesky", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreihwihm6kpd6zuwhhlro75p5qks5qtrcu55jp3gddbfjsieiv7wuka", "verified": false, "url": "https://bsky.app/profile/bsky.app" }, "stats": { "views": null, "likes": 1009, "comments": 46, "shares": 89, "saves": 42, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://video.bsky.app/watch/did%3Aplc%3Az72i7hdynmk6r22z27h6tvur/bafkreiapzmyzxc72yow7zhko4fgykat7ppbcvnz4wv7okwcwnesbasy5um/playlist.m3u8", "thumbnailUrl": "https://video.bsky.app/watch/did%3Aplc%3Az72i7hdynmk6r22z27h6tvur/bafkreiapzmyzxc72yow7zhko4fgykat7ppbcvnz4wv7okwcwnesbasy5um/thumbnail.jpg", "width": 1080, "height": 1620, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "cid": "bafyreicukrrriqobyd7rnkyheos3afuubvwrqddmhvjjkxu4bpt6bz2jnq", "rkey": "3n2opitysuc2j", "quotes": 15, "langs": [ "en" ], "replyTo": { "parent": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3n2opitxdyc2j", "root": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3n2opitxdyc2j" }, "repost": null, "pinned": false, "quoted": null, "link": null, "altTexts": [ "A video demonstrating the new share sheet. Kiki (a cat) has posted a snarling selfie with the text \"My face when someone says they're 'not really a cat person.' Send this to someone who needs to hear it.\" When the share button is tapped, we see the share sheet pop up with profile images of Kiki's animal friends, plus icons of messaging and social apps on Kiki's phone. Kiki chooses \"Messages\" and s…" ], "repliesRestricted": false, "labels": [], "indexedAt": "2026-11-19T18:33:38.544Z" } }, { "id": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3n2opitxdyc2j", "url": "https://bsky.app/profile/bsky.app/post/3n2opitxdyc2j", "text": "v1.138 is live!\n\nView counts are available in beta! Now you can see how many people your posts are reaching. The numbers are private — they only appear on your own posts and only to you. To turn them on, enable beta features here: bsky.app/settings/bet.... Let us know what you think.", "createdAt": "2026-11-19T18:33:36.813Z", "author": { "id": "did:plc:z72i7hdynmk6r22z27h6tvur", "username": "bsky.app", "displayName": "Bluesky", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreihwihm6kpd6zuwhhlro75p5qks5qtrcu55jp3gddbfjsieiv7wuka", "verified": false, "url": "https://bsky.app/profile/bsky.app" }, "stats": { "views": null, "likes": 2038, "comments": 787, "shares": 349, "saves": 218, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://video.bsky.app/watch/did%3Aplc%3Az72i7hdynmk6r22z27h6tvur/bafkreiavlqznqay24hdpwzzr7tjsy65gbjggiwug2djr6nfw7lszaztrk4/playlist.m3u8", "thumbnailUrl": "https://video.bsky.app/watch/did%3Aplc%3Az72i7hdynmk6r22z27h6tvur/bafkreiavlqznqay24hdpwzzr7tjsy65gbjggiwug2djr6nfw7lszaztrk4/thumbnail.jpg", "width": 1080, "height": 1728, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "cid": "bafyreihjpuz225u5djer7b6oqj5aszoqcblsjogyzlkr2ipw65cz3sk45m", "rkey": "3n2opitxdyc2j", "quotes": 1173, "langs": [ "en" ], "replyTo": null, "repost": null, "pinned": false, "quoted": null, "link": null, "altTexts": [ "A video demonstrating the new post views feature—now in beta. Hoagie the dog has posted, \"Day 47 of asking for a second breakfast. Morale remains high.\" We zoom in and see the view count pop up in small gray type between the date and the reply settings." ], "repliesRestricted": true, "labels": [], "indexedAt": "2026-11-19T18:33:38.543Z" } } ], "pagination": { "nextCursor": "2025-08-29T16:49:14.626Z", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.bluesky.profileMedia({ handle: \"bsky.app\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.bluesky.profile_media(handle=\"bsky.app\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/bluesky/profile/media \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=bsky.app\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_BlueskyPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/BlueskyPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "BlueskyPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "cid", "rkey", "langs", "pinned", "altTexts", "repliesRestricted", "labels" ], "properties": { "altTexts": { "type": "array", "items": { "type": "string" }, "description": "Each image's or video's description for screen readers, in `media`'s order; empty\nwhen none has one." }, "cid": { "type": "string", "description": "The record's content hash and its key (the last part of its link)." }, "indexedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "When Bluesky indexed it." }, { "type": "null" } ] }, "labels": { "type": "array", "items": { "type": "string" }, "description": "Labels on the post, by value (`porn`, `graphic-media`…)." }, "langs": { "type": "array", "items": { "type": "string" }, "description": "The languages its author set." }, "link": { "oneOf": [ { "$ref": "#/components/schemas/BlueskyLinkCard" }, { "type": "null" } ] }, "pinned": { "type": "boolean", "description": "Pinned to its author's profile, in that account's posts." }, "quoted": { "oneOf": [ { "$ref": "#/components/schemas/BlueskyQuoted" }, { "type": "null" } ] }, "quotes": { "type": [ "integer", "null" ], "format": "int64", "description": "Posts quoting it.", "minimum": 0 }, "repliesRestricted": { "type": "boolean", "description": "Whether its author limited who may reply." }, "replyTo": { "oneOf": [ { "$ref": "#/components/schemas/BlueskyReplyRef", "description": "What it replies to, when it is a reply." }, { "type": "null" } ] }, "repost": { "oneOf": [ { "$ref": "#/components/schemas/BlueskyRepost", "description": "Who reposted it into this list, in an account's posts." }, { "type": "null" } ] }, "rkey": { "type": "string" } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A post: text, images, a video, a link or a quote." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "BlueskyRepost": { "type": "object", "description": "Who reposted a post into the list it is in, and when.", "required": [ "by" ], "properties": { "at": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "by": { "$ref": "#/components/schemas/Author" } } }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } }, "Timestamp": { "type": "string", "format": "date-time" }, "BlueskyReplyRef": { "type": "object", "description": "The post a reply answers, and the thread's first post.", "required": [ "parent", "root" ], "properties": { "parent": { "type": "string" }, "root": { "type": "string" } } }, "BlueskyQuoted": { "type": "object", "description": "What a post quotes: a post, or a feed, list or starter pack it embeds.", "required": [ "id" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "id": { "type": "string", "description": "Its AT-URI." }, "text": { "type": [ "string", "null" ], "description": "A quoted post's text, or the name of a feed, list or starter pack." }, "url": { "type": [ "string", "null" ] } } }, "BlueskyLinkCard": { "type": "object", "description": "The link a post shares, as its card shows it.", "required": [ "url" ], "properties": { "description": { "type": [ "string", "null" ] }, "thumbnailUrl": { "type": [ "string", "null" ] }, "title": { "type": [ "string", "null" ] }, "url": { "type": "string" } } } } } } ``` # Profile Posts (/docs/api-reference/bluesky/profile-posts) An account's posts and reposts, newest first. `GET https://api.socialapi.sh/v1/bluesky/profile/posts` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.bluesky.profilePosts({ handle: "bsky.app" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.bluesky.profile_posts(handle="bsky.app") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/bluesky/profile/posts \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=bsky.app" ``` **Response** ```json { "data": [ { "id": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3l6oveex3ii2l", "url": "https://bsky.app/profile/bsky.app/post/3l6oveex3ii2l", "text": "👋 Bluesky is an open social network that gives creators independence from platforms, developers the freedom to build, and users a choice in their experience. We're so excited to have you here! \n\nWe share Bluesky updates & news from this account. A quick orientation thread: 🧵✨", "createdAt": "2024-10-17T07:06:51.491Z", "author": { "id": "did:plc:z72i7hdynmk6r22z27h6tvur", "username": "bsky.app", "displayName": "Bluesky", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreihwihm6kpd6zuwhhlro75p5qks5qtrcu55jp3gddbfjsieiv7wuka", "verified": false, "url": "https://bsky.app/profile/bsky.app" }, "stats": { "views": null, "likes": 63842, "comments": 8779, "shares": 9585, "saves": 290, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "cid": "bafyreicnt42y6vo6pfpvyro234ac4o6ijug6adwwrh7awflgrqlt4zibxq", "rkey": "3l6oveex3ii2l", "quotes": 729, "langs": [ "en" ], "replyTo": null, "repost": null, "pinned": true, "quoted": null, "link": null, "altTexts": [], "repliesRestricted": true, "labels": [], "indexedAt": "2024-10-17T07:06:51.491Z" } }, { "id": "at://did:plc:dalbbospvxinrzc7a5clbnyj/app.bsky.feed.post/3n2xthjwiac22", "url": "https://bsky.app/profile/odpomery.bsky.social/post/3n2xthjwiac22", "text": "Night and day illustrations I did for @bsky.app earlier this year!", "createdAt": "2026-11-23T09:38:25.356Z", "author": { "id": "did:plc:dalbbospvxinrzc7a5clbnyj", "username": "odpomery.bsky.social", "displayName": "Owen D. Pomery", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:dalbbospvxinrzc7a5clbnyj/bafkreigbxpqxwqgngqy35jgpzh7pguqtklvfbffjr523hubgpcqgobnc5e", "verified": false, "url": "https://bsky.app/profile/odpomery.bsky.social" }, "stats": { "views": null, "likes": 1536, "comments": 21, "shares": 93, "saves": 42, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://video.bsky.app/watch/did%3Aplc%3Adalbbospvxinrzc7a5clbnyj/bafkreidgg5yet4cavzeyh3hdljkh5ttfum7o27rqjvhyqpf7gslt55irsu/playlist.m3u8", "thumbnailUrl": "https://video.bsky.app/watch/did%3Aplc%3Adalbbospvxinrzc7a5clbnyj/bafkreidgg5yet4cavzeyh3hdljkh5ttfum7o27rqjvhyqpf7gslt55irsu/thumbnail.jpg", "width": 800, "height": 1302, "durationSeconds": null } ], "hashtags": [], "mentions": [ "bsky.app" ], "ext": { "cid": "bafyreicahfeh6pb3htyefflu7fcjjle7pqetqypmx2ko3ymvr6hbo2fi3e", "rkey": "3n2xthjwiac22", "quotes": 4, "langs": [ "en" ], "replyTo": null, "repost": { "by": { "id": "did:plc:z72i7hdynmk6r22z27h6tvur", "username": "bsky.app", "displayName": "Bluesky", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreihwihm6kpd6zuwhhlro75p5qks5qtrcu55jp3gddbfjsieiv7wuka", "verified": false, "url": "https://bsky.app/profile/bsky.app" }, "at": "2026-11-23T16:29:58.241Z" }, "pinned": false, "quoted": null, "link": null, "altTexts": [], "repliesRestricted": false, "labels": [], "indexedAt": "2026-11-23T09:38:28.548Z" } } ], "pagination": { "nextCursor": "2026-10-22T16:11:13.754Z", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/bluesky/profile/posts": { "get": { "tags": [ "Bluesky" ], "summary": "An account's posts and reposts, newest first.", "description": "50 a page, without its replies; its pinned post leads the first page, and a repost says\nwho reposted it. 1 credit a page.", "operationId": "blueskyProfilePosts", "parameters": [ { "name": "handle", "in": "query", "description": "The account's handle (`bsky.app`) or DID.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "The profile's link, instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_BlueskyPost" }, "example": { "data": [ { "id": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3l6oveex3ii2l", "url": "https://bsky.app/profile/bsky.app/post/3l6oveex3ii2l", "text": "👋 Bluesky is an open social network that gives creators independence from platforms, developers the freedom to build, and users a choice in their experience. We're so excited to have you here! \n\nWe share Bluesky updates & news from this account. A quick orientation thread: 🧵✨", "createdAt": "2024-10-17T07:06:51.491Z", "author": { "id": "did:plc:z72i7hdynmk6r22z27h6tvur", "username": "bsky.app", "displayName": "Bluesky", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreihwihm6kpd6zuwhhlro75p5qks5qtrcu55jp3gddbfjsieiv7wuka", "verified": false, "url": "https://bsky.app/profile/bsky.app" }, "stats": { "views": null, "likes": 63842, "comments": 8779, "shares": 9585, "saves": 290, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "cid": "bafyreicnt42y6vo6pfpvyro234ac4o6ijug6adwwrh7awflgrqlt4zibxq", "rkey": "3l6oveex3ii2l", "quotes": 729, "langs": [ "en" ], "replyTo": null, "repost": null, "pinned": true, "quoted": null, "link": null, "altTexts": [], "repliesRestricted": true, "labels": [], "indexedAt": "2024-10-17T07:06:51.491Z" } }, { "id": "at://did:plc:dalbbospvxinrzc7a5clbnyj/app.bsky.feed.post/3n2xthjwiac22", "url": "https://bsky.app/profile/odpomery.bsky.social/post/3n2xthjwiac22", "text": "Night and day illustrations I did for @bsky.app earlier this year!", "createdAt": "2026-11-23T09:38:25.356Z", "author": { "id": "did:plc:dalbbospvxinrzc7a5clbnyj", "username": "odpomery.bsky.social", "displayName": "Owen D. Pomery", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:dalbbospvxinrzc7a5clbnyj/bafkreigbxpqxwqgngqy35jgpzh7pguqtklvfbffjr523hubgpcqgobnc5e", "verified": false, "url": "https://bsky.app/profile/odpomery.bsky.social" }, "stats": { "views": null, "likes": 1536, "comments": 21, "shares": 93, "saves": 42, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://video.bsky.app/watch/did%3Aplc%3Adalbbospvxinrzc7a5clbnyj/bafkreidgg5yet4cavzeyh3hdljkh5ttfum7o27rqjvhyqpf7gslt55irsu/playlist.m3u8", "thumbnailUrl": "https://video.bsky.app/watch/did%3Aplc%3Adalbbospvxinrzc7a5clbnyj/bafkreidgg5yet4cavzeyh3hdljkh5ttfum7o27rqjvhyqpf7gslt55irsu/thumbnail.jpg", "width": 800, "height": 1302, "durationSeconds": null } ], "hashtags": [], "mentions": [ "bsky.app" ], "ext": { "cid": "bafyreicahfeh6pb3htyefflu7fcjjle7pqetqypmx2ko3ymvr6hbo2fi3e", "rkey": "3n2xthjwiac22", "quotes": 4, "langs": [ "en" ], "replyTo": null, "repost": { "by": { "id": "did:plc:z72i7hdynmk6r22z27h6tvur", "username": "bsky.app", "displayName": "Bluesky", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreihwihm6kpd6zuwhhlro75p5qks5qtrcu55jp3gddbfjsieiv7wuka", "verified": false, "url": "https://bsky.app/profile/bsky.app" }, "at": "2026-11-23T16:29:58.241Z" }, "pinned": false, "quoted": null, "link": null, "altTexts": [], "repliesRestricted": false, "labels": [], "indexedAt": "2026-11-23T09:38:28.548Z" } } ], "pagination": { "nextCursor": "2026-10-22T16:11:13.754Z", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.bluesky.profilePosts({ handle: \"bsky.app\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.bluesky.profile_posts(handle=\"bsky.app\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/bluesky/profile/posts \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=bsky.app\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_BlueskyPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/BlueskyPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "BlueskyPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "cid", "rkey", "langs", "pinned", "altTexts", "repliesRestricted", "labels" ], "properties": { "altTexts": { "type": "array", "items": { "type": "string" }, "description": "Each image's or video's description for screen readers, in `media`'s order; empty\nwhen none has one." }, "cid": { "type": "string", "description": "The record's content hash and its key (the last part of its link)." }, "indexedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "When Bluesky indexed it." }, { "type": "null" } ] }, "labels": { "type": "array", "items": { "type": "string" }, "description": "Labels on the post, by value (`porn`, `graphic-media`…)." }, "langs": { "type": "array", "items": { "type": "string" }, "description": "The languages its author set." }, "link": { "oneOf": [ { "$ref": "#/components/schemas/BlueskyLinkCard" }, { "type": "null" } ] }, "pinned": { "type": "boolean", "description": "Pinned to its author's profile, in that account's posts." }, "quoted": { "oneOf": [ { "$ref": "#/components/schemas/BlueskyQuoted" }, { "type": "null" } ] }, "quotes": { "type": [ "integer", "null" ], "format": "int64", "description": "Posts quoting it.", "minimum": 0 }, "repliesRestricted": { "type": "boolean", "description": "Whether its author limited who may reply." }, "replyTo": { "oneOf": [ { "$ref": "#/components/schemas/BlueskyReplyRef", "description": "What it replies to, when it is a reply." }, { "type": "null" } ] }, "repost": { "oneOf": [ { "$ref": "#/components/schemas/BlueskyRepost", "description": "Who reposted it into this list, in an account's posts." }, { "type": "null" } ] }, "rkey": { "type": "string" } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A post: text, images, a video, a link or a quote." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "BlueskyRepost": { "type": "object", "description": "Who reposted a post into the list it is in, and when.", "required": [ "by" ], "properties": { "at": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "by": { "$ref": "#/components/schemas/Author" } } }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } }, "Timestamp": { "type": "string", "format": "date-time" }, "BlueskyReplyRef": { "type": "object", "description": "The post a reply answers, and the thread's first post.", "required": [ "parent", "root" ], "properties": { "parent": { "type": "string" }, "root": { "type": "string" } } }, "BlueskyQuoted": { "type": "object", "description": "What a post quotes: a post, or a feed, list or starter pack it embeds.", "required": [ "id" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "id": { "type": "string", "description": "Its AT-URI." }, "text": { "type": [ "string", "null" ], "description": "A quoted post's text, or the name of a feed, list or starter pack." }, "url": { "type": [ "string", "null" ] } } }, "BlueskyLinkCard": { "type": "object", "description": "The link a post shares, as its card shows it.", "required": [ "url" ], "properties": { "description": { "type": [ "string", "null" ] }, "thumbnailUrl": { "type": [ "string", "null" ] }, "title": { "type": [ "string", "null" ] }, "url": { "type": "string" } } } } } } ``` # Profile Replies (/docs/api-reference/bluesky/profile-replies) An account's posts with its replies, newest first. `GET https://api.socialapi.sh/v1/bluesky/profile/replies` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.bluesky.profileReplies({ handle: "bsky.app" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.bluesky.profile_replies(handle="bsky.app") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/bluesky/profile/replies \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=bsky.app" ``` **Response** ```json { "data": [ { "id": "at://did:plc:dalbbospvxinrzc7a5clbnyj/app.bsky.feed.post/3n2xthjwiac22", "url": "https://bsky.app/profile/odpomery.bsky.social/post/3n2xthjwiac22", "text": "Night and day illustrations I did for @bsky.app earlier this year!", "createdAt": "2026-11-23T09:38:25.356Z", "author": { "id": "did:plc:dalbbospvxinrzc7a5clbnyj", "username": "odpomery.bsky.social", "displayName": "Owen D. Pomery", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:dalbbospvxinrzc7a5clbnyj/bafkreigbxpqxwqgngqy35jgpzh7pguqtklvfbffjr523hubgpcqgobnc5e", "verified": false, "url": "https://bsky.app/profile/odpomery.bsky.social" }, "stats": { "views": null, "likes": 1536, "comments": 21, "shares": 93, "saves": 42, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://video.bsky.app/watch/did%3Aplc%3Adalbbospvxinrzc7a5clbnyj/bafkreidgg5yet4cavzeyh3hdljkh5ttfum7o27rqjvhyqpf7gslt55irsu/playlist.m3u8", "thumbnailUrl": "https://video.bsky.app/watch/did%3Aplc%3Adalbbospvxinrzc7a5clbnyj/bafkreidgg5yet4cavzeyh3hdljkh5ttfum7o27rqjvhyqpf7gslt55irsu/thumbnail.jpg", "width": 800, "height": 1302, "durationSeconds": null } ], "hashtags": [], "mentions": [ "bsky.app" ], "ext": { "cid": "bafyreicahfeh6pb3htyefflu7fcjjle7pqetqypmx2ko3ymvr6hbo2fi3e", "rkey": "3n2xthjwiac22", "quotes": 4, "langs": [ "en" ], "replyTo": null, "repost": { "by": { "id": "did:plc:z72i7hdynmk6r22z27h6tvur", "username": "bsky.app", "displayName": "Bluesky", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreihwihm6kpd6zuwhhlro75p5qks5qtrcu55jp3gddbfjsieiv7wuka", "verified": false, "url": "https://bsky.app/profile/bsky.app" }, "at": "2026-11-23T16:29:58.241Z" }, "pinned": false, "quoted": null, "link": null, "altTexts": [], "repliesRestricted": false, "labels": [], "indexedAt": "2026-11-23T09:38:28.548Z" } }, { "id": "at://did:plc:e6n7jxtu2qrhwvp3j6ib6sq6/app.bsky.feed.post/3n2u4lvqty227", "url": "https://bsky.app/profile/proptermalone.bsky.social/post/3n2u4lvqty227", "text": "every type of Bluesky poster is represented in this image", "createdAt": "2026-11-21T22:11:16.696Z", "author": { "id": "did:plc:e6n7jxtu2qrhwvp3j6ib6sq6", "username": "proptermalone.bsky.social", "displayName": "post malone ergo propter malone", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:e6n7jxtu2qrhwvp3j6ib6sq6/bafkreicrqm2b2nqblriaoymlpnlgnmmktrnjnlrr5dzfdwzansbvxdr7yu", "verified": false, "url": "https://bsky.app/profile/proptermalone.bsky.social" }, "stats": { "views": null, "likes": 5319, "comments": 158, "shares": 562, "saves": 252, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "cid": "bafyreiadimpp7flgqs23qmaz7e74lqpdtiimrj5tevjrojtcz3hv2e7eoy", "rkey": "3n2u4lvqty227", "quotes": 41, "langs": [ "en" ], "replyTo": null, "repost": { "by": { "id": "did:plc:z72i7hdynmk6r22z27h6tvur", "username": "bsky.app", "displayName": "Bluesky", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreihwihm6kpd6zuwhhlro75p5qks5qtrcu55jp3gddbfjsieiv7wuka", "verified": false, "url": "https://bsky.app/profile/bsky.app" }, "at": "2026-11-22T00:48:44.245Z" }, "pinned": false, "quoted": { "id": "at://did:plc:aoe22eezaju7jmmsz7xxxlmp/app.bsky.feed.post/3n2tplw4nms2z", "url": "https://bsky.app/profile/ggold328.bsky.social/post/3n2tplw4nms2z", "author": { "id": "did:plc:aoe22eezaju7jmmsz7xxxlmp", "username": "ggold328.bsky.social", "displayName": "gg", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:aoe22eezaju7jmmsz7xxxlmp/bafkreigmj6nzs5flst2ruc6l666zmrevzusclryhnr6hp6uu4ymjtrkijq", "verified": false, "url": "https://bsky.app/profile/ggold328.bsky.social" }, "text": "i really love the colors in this krampus piece by jane dashley" }, "link": null, "altTexts": [], "repliesRestricted": false, "labels": [], "indexedAt": "2026-11-21T22:11:16.947Z" } } ], "pagination": { "nextCursor": "2026-10-30T17:34:58.469Z", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/bluesky/profile/replies": { "get": { "tags": [ "Bluesky" ], "summary": "An account's posts with its replies, newest first.", "description": "50 a page; a reply names the post it answers. 1 credit a page.", "operationId": "blueskyProfileReplies", "parameters": [ { "name": "handle", "in": "query", "description": "The account's handle (`bsky.app`) or DID.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "The profile's link, instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_BlueskyPost" }, "example": { "data": [ { "id": "at://did:plc:dalbbospvxinrzc7a5clbnyj/app.bsky.feed.post/3n2xthjwiac22", "url": "https://bsky.app/profile/odpomery.bsky.social/post/3n2xthjwiac22", "text": "Night and day illustrations I did for @bsky.app earlier this year!", "createdAt": "2026-11-23T09:38:25.356Z", "author": { "id": "did:plc:dalbbospvxinrzc7a5clbnyj", "username": "odpomery.bsky.social", "displayName": "Owen D. Pomery", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:dalbbospvxinrzc7a5clbnyj/bafkreigbxpqxwqgngqy35jgpzh7pguqtklvfbffjr523hubgpcqgobnc5e", "verified": false, "url": "https://bsky.app/profile/odpomery.bsky.social" }, "stats": { "views": null, "likes": 1536, "comments": 21, "shares": 93, "saves": 42, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://video.bsky.app/watch/did%3Aplc%3Adalbbospvxinrzc7a5clbnyj/bafkreidgg5yet4cavzeyh3hdljkh5ttfum7o27rqjvhyqpf7gslt55irsu/playlist.m3u8", "thumbnailUrl": "https://video.bsky.app/watch/did%3Aplc%3Adalbbospvxinrzc7a5clbnyj/bafkreidgg5yet4cavzeyh3hdljkh5ttfum7o27rqjvhyqpf7gslt55irsu/thumbnail.jpg", "width": 800, "height": 1302, "durationSeconds": null } ], "hashtags": [], "mentions": [ "bsky.app" ], "ext": { "cid": "bafyreicahfeh6pb3htyefflu7fcjjle7pqetqypmx2ko3ymvr6hbo2fi3e", "rkey": "3n2xthjwiac22", "quotes": 4, "langs": [ "en" ], "replyTo": null, "repost": { "by": { "id": "did:plc:z72i7hdynmk6r22z27h6tvur", "username": "bsky.app", "displayName": "Bluesky", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreihwihm6kpd6zuwhhlro75p5qks5qtrcu55jp3gddbfjsieiv7wuka", "verified": false, "url": "https://bsky.app/profile/bsky.app" }, "at": "2026-11-23T16:29:58.241Z" }, "pinned": false, "quoted": null, "link": null, "altTexts": [], "repliesRestricted": false, "labels": [], "indexedAt": "2026-11-23T09:38:28.548Z" } }, { "id": "at://did:plc:e6n7jxtu2qrhwvp3j6ib6sq6/app.bsky.feed.post/3n2u4lvqty227", "url": "https://bsky.app/profile/proptermalone.bsky.social/post/3n2u4lvqty227", "text": "every type of Bluesky poster is represented in this image", "createdAt": "2026-11-21T22:11:16.696Z", "author": { "id": "did:plc:e6n7jxtu2qrhwvp3j6ib6sq6", "username": "proptermalone.bsky.social", "displayName": "post malone ergo propter malone", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:e6n7jxtu2qrhwvp3j6ib6sq6/bafkreicrqm2b2nqblriaoymlpnlgnmmktrnjnlrr5dzfdwzansbvxdr7yu", "verified": false, "url": "https://bsky.app/profile/proptermalone.bsky.social" }, "stats": { "views": null, "likes": 5319, "comments": 158, "shares": 562, "saves": 252, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "cid": "bafyreiadimpp7flgqs23qmaz7e74lqpdtiimrj5tevjrojtcz3hv2e7eoy", "rkey": "3n2u4lvqty227", "quotes": 41, "langs": [ "en" ], "replyTo": null, "repost": { "by": { "id": "did:plc:z72i7hdynmk6r22z27h6tvur", "username": "bsky.app", "displayName": "Bluesky", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreihwihm6kpd6zuwhhlro75p5qks5qtrcu55jp3gddbfjsieiv7wuka", "verified": false, "url": "https://bsky.app/profile/bsky.app" }, "at": "2026-11-22T00:48:44.245Z" }, "pinned": false, "quoted": { "id": "at://did:plc:aoe22eezaju7jmmsz7xxxlmp/app.bsky.feed.post/3n2tplw4nms2z", "url": "https://bsky.app/profile/ggold328.bsky.social/post/3n2tplw4nms2z", "author": { "id": "did:plc:aoe22eezaju7jmmsz7xxxlmp", "username": "ggold328.bsky.social", "displayName": "gg", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:aoe22eezaju7jmmsz7xxxlmp/bafkreigmj6nzs5flst2ruc6l666zmrevzusclryhnr6hp6uu4ymjtrkijq", "verified": false, "url": "https://bsky.app/profile/ggold328.bsky.social" }, "text": "i really love the colors in this krampus piece by jane dashley" }, "link": null, "altTexts": [], "repliesRestricted": false, "labels": [], "indexedAt": "2026-11-21T22:11:16.947Z" } } ], "pagination": { "nextCursor": "2026-10-30T17:34:58.469Z", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.bluesky.profileReplies({ handle: \"bsky.app\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.bluesky.profile_replies(handle=\"bsky.app\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/bluesky/profile/replies \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=bsky.app\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_BlueskyPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/BlueskyPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "BlueskyPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "cid", "rkey", "langs", "pinned", "altTexts", "repliesRestricted", "labels" ], "properties": { "altTexts": { "type": "array", "items": { "type": "string" }, "description": "Each image's or video's description for screen readers, in `media`'s order; empty\nwhen none has one." }, "cid": { "type": "string", "description": "The record's content hash and its key (the last part of its link)." }, "indexedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "When Bluesky indexed it." }, { "type": "null" } ] }, "labels": { "type": "array", "items": { "type": "string" }, "description": "Labels on the post, by value (`porn`, `graphic-media`…)." }, "langs": { "type": "array", "items": { "type": "string" }, "description": "The languages its author set." }, "link": { "oneOf": [ { "$ref": "#/components/schemas/BlueskyLinkCard" }, { "type": "null" } ] }, "pinned": { "type": "boolean", "description": "Pinned to its author's profile, in that account's posts." }, "quoted": { "oneOf": [ { "$ref": "#/components/schemas/BlueskyQuoted" }, { "type": "null" } ] }, "quotes": { "type": [ "integer", "null" ], "format": "int64", "description": "Posts quoting it.", "minimum": 0 }, "repliesRestricted": { "type": "boolean", "description": "Whether its author limited who may reply." }, "replyTo": { "oneOf": [ { "$ref": "#/components/schemas/BlueskyReplyRef", "description": "What it replies to, when it is a reply." }, { "type": "null" } ] }, "repost": { "oneOf": [ { "$ref": "#/components/schemas/BlueskyRepost", "description": "Who reposted it into this list, in an account's posts." }, { "type": "null" } ] }, "rkey": { "type": "string" } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A post: text, images, a video, a link or a quote." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "BlueskyRepost": { "type": "object", "description": "Who reposted a post into the list it is in, and when.", "required": [ "by" ], "properties": { "at": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "by": { "$ref": "#/components/schemas/Author" } } }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } }, "Timestamp": { "type": "string", "format": "date-time" }, "BlueskyReplyRef": { "type": "object", "description": "The post a reply answers, and the thread's first post.", "required": [ "parent", "root" ], "properties": { "parent": { "type": "string" }, "root": { "type": "string" } } }, "BlueskyQuoted": { "type": "object", "description": "What a post quotes: a post, or a feed, list or starter pack it embeds.", "required": [ "id" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "id": { "type": "string", "description": "Its AT-URI." }, "text": { "type": [ "string", "null" ], "description": "A quoted post's text, or the name of a feed, list or starter pack." }, "url": { "type": [ "string", "null" ] } } }, "BlueskyLinkCard": { "type": "object", "description": "The link a post shares, as its card shows it.", "required": [ "url" ], "properties": { "description": { "type": [ "string", "null" ] }, "thumbnailUrl": { "type": [ "string", "null" ] }, "title": { "type": [ "string", "null" ] }, "url": { "type": "string" } } } } } } ``` # Profile Starter Packs (/docs/api-reference/bluesky/profile-starter-packs) The starter packs an account made, 50 a page. `GET https://api.socialapi.sh/v1/bluesky/profile/starter-packs` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.bluesky.profileStarterPacks({ handle: "bsky.app" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.bluesky.profile_starter_packs(handle="bsky.app") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/bluesky/profile/starter-packs \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=bsky.app" ``` **Response** ```json { "data": [ { "id": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.graph.starterpack/3mzdvli2fkq23", "name": "Midterms 2026: Battleground", "description": null, "url": "https://bsky.app/starter-pack/bsky.app/3mzdvli2fkq23", "creator": { "id": "did:plc:z72i7hdynmk6r22z27h6tvur", "username": "bsky.app", "displayName": "Bluesky", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreihwihm6kpd6zuwhhlro75p5qks5qtrcu55jp3gddbfjsieiv7wuka", "verified": false, "url": "https://bsky.app/profile/bsky.app" }, "listId": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.graph.list/3mzdvlhcw5l2g", "members": null, "feedIds": [ "at://did:plc:qrllvid7s54k4hnwtqxwetrf/app.bsky.feed.generator/battleground", "at://did:plc:qrllvid7s54k4hnwtqxwetrf/app.bsky.feed.generator/midterms2026" ], "joinedWeek": 0, "joinedAllTime": 8, "cid": "bafyreib3qzothdjrpu3zf2t6qkvnkoitgusvgksotlbf7yyvys5xnegcfi", "labels": [], "createdAt": "2026-11-02T17:57:58.528Z", "updatedAt": "2026-11-03T20:32:38.803Z", "indexedAt": "2026-11-03T20:32:39.080Z" }, { "id": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.graph.starterpack/3mzdvlg4n5s2x", "name": "Midterms 2026: Pacific", "description": null, "url": "https://bsky.app/starter-pack/bsky.app/3mzdvlg4n5s2x", "creator": { "id": "did:plc:z72i7hdynmk6r22z27h6tvur", "username": "bsky.app", "displayName": "Bluesky", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreihwihm6kpd6zuwhhlro75p5qks5qtrcu55jp3gddbfjsieiv7wuka", "verified": false, "url": "https://bsky.app/profile/bsky.app" }, "listId": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.graph.list/3mzdvlfmrzo2g", "members": null, "feedIds": [ "at://did:plc:qrllvid7s54k4hnwtqxwetrf/app.bsky.feed.generator/pacific", "at://did:plc:qrllvid7s54k4hnwtqxwetrf/app.bsky.feed.generator/midterms2026" ], "joinedWeek": 0, "joinedAllTime": 0, "cid": "bafyreibpie64iihbee27wxobl2s64bxgw6ol52mwsfywaghlbxzjzu5p7i", "labels": [], "createdAt": "2026-11-02T17:57:56.503Z", "updatedAt": "2026-11-03T00:21:13.544Z", "indexedAt": "2026-11-03T00:21:13.679Z" } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/bluesky/profile/starter-packs": { "get": { "tags": [ "Bluesky" ], "summary": "The starter packs an account made, 50 a page.", "description": "1 credit a page.", "operationId": "blueskyProfileStarterPacks", "parameters": [ { "name": "handle", "in": "query", "description": "The account's handle (`bsky.app`) or DID.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "The profile's link, instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_BlueskyStarterPack" }, "example": { "data": [ { "id": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.graph.starterpack/3mzdvli2fkq23", "name": "Midterms 2026: Battleground", "description": null, "url": "https://bsky.app/starter-pack/bsky.app/3mzdvli2fkq23", "creator": { "id": "did:plc:z72i7hdynmk6r22z27h6tvur", "username": "bsky.app", "displayName": "Bluesky", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreihwihm6kpd6zuwhhlro75p5qks5qtrcu55jp3gddbfjsieiv7wuka", "verified": false, "url": "https://bsky.app/profile/bsky.app" }, "listId": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.graph.list/3mzdvlhcw5l2g", "members": null, "feedIds": [ "at://did:plc:qrllvid7s54k4hnwtqxwetrf/app.bsky.feed.generator/battleground", "at://did:plc:qrllvid7s54k4hnwtqxwetrf/app.bsky.feed.generator/midterms2026" ], "joinedWeek": 0, "joinedAllTime": 8, "cid": "bafyreib3qzothdjrpu3zf2t6qkvnkoitgusvgksotlbf7yyvys5xnegcfi", "labels": [], "createdAt": "2026-11-02T17:57:58.528Z", "updatedAt": "2026-11-03T20:32:38.803Z", "indexedAt": "2026-11-03T20:32:39.080Z" }, { "id": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.graph.starterpack/3mzdvlg4n5s2x", "name": "Midterms 2026: Pacific", "description": null, "url": "https://bsky.app/starter-pack/bsky.app/3mzdvlg4n5s2x", "creator": { "id": "did:plc:z72i7hdynmk6r22z27h6tvur", "username": "bsky.app", "displayName": "Bluesky", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreihwihm6kpd6zuwhhlro75p5qks5qtrcu55jp3gddbfjsieiv7wuka", "verified": false, "url": "https://bsky.app/profile/bsky.app" }, "listId": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.graph.list/3mzdvlfmrzo2g", "members": null, "feedIds": [ "at://did:plc:qrllvid7s54k4hnwtqxwetrf/app.bsky.feed.generator/pacific", "at://did:plc:qrllvid7s54k4hnwtqxwetrf/app.bsky.feed.generator/midterms2026" ], "joinedWeek": 0, "joinedAllTime": 0, "cid": "bafyreibpie64iihbee27wxobl2s64bxgw6ol52mwsfywaghlbxzjzu5p7i", "labels": [], "createdAt": "2026-11-02T17:57:56.503Z", "updatedAt": "2026-11-03T00:21:13.544Z", "indexedAt": "2026-11-03T00:21:13.679Z" } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.bluesky.profileStarterPacks({ handle: \"bsky.app\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.bluesky.profile_starter_packs(handle=\"bsky.app\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/bluesky/profile/starter-packs \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=bsky.app\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_BlueskyStarterPack": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/BlueskyStarterPack" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "BlueskyStarterPack": { "type": "object", "description": "A starter pack: accounts and feeds to follow together.", "required": [ "id", "name", "feedIds", "cid", "labels" ], "properties": { "cid": { "type": "string" }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "creator": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "description": { "type": [ "string", "null" ] }, "feedIds": { "type": "array", "items": { "type": "string" }, "description": "The feeds it suggests, by AT-URI." }, "id": { "type": "string", "description": "Its AT-URI." }, "indexedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "joinedAllTime": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "joinedWeek": { "type": [ "integer", "null" ], "format": "int64", "description": "Accounts that joined Bluesky through it, in the last week and in all.", "minimum": 0 }, "labels": { "type": "array", "items": { "type": "string" } }, "listId": { "type": [ "string", "null" ], "description": "The list of its accounts, as `/v1/bluesky/list/members` takes it." }, "members": { "type": [ "integer", "null" ], "format": "int64", "description": "Accounts in it; only `/v1/bluesky/starter-pack` says.", "minimum": 0 }, "name": { "type": "string" }, "updatedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "url": { "type": [ "string", "null" ] } } }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Profile Videos (/docs/api-reference/bluesky/profile-videos) An account's posts with video. `GET https://api.socialapi.sh/v1/bluesky/profile/videos` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.bluesky.profileVideos({ handle: "bsky.app" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.bluesky.profile_videos(handle="bsky.app") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/bluesky/profile/videos \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=bsky.app" ``` **Response** ```json { "data": [ { "id": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3n2opitysuc2j", "url": "https://bsky.app/profile/bsky.app/post/3n2opitysuc2j", "text": "We’ve also made it easier to share posts from Bluesky. When you tap the arrow icon on mobile, you’ll now have the option of sharing directly to your other apps.", "createdAt": "2026-11-19T18:33:36.814Z", "author": { "id": "did:plc:z72i7hdynmk6r22z27h6tvur", "username": "bsky.app", "displayName": "Bluesky", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreihwihm6kpd6zuwhhlro75p5qks5qtrcu55jp3gddbfjsieiv7wuka", "verified": false, "url": "https://bsky.app/profile/bsky.app" }, "stats": { "views": null, "likes": 1009, "comments": 46, "shares": 89, "saves": 42, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://video.bsky.app/watch/did%3Aplc%3Az72i7hdynmk6r22z27h6tvur/bafkreiapzmyzxc72yow7zhko4fgykat7ppbcvnz4wv7okwcwnesbasy5um/playlist.m3u8", "thumbnailUrl": "https://video.bsky.app/watch/did%3Aplc%3Az72i7hdynmk6r22z27h6tvur/bafkreiapzmyzxc72yow7zhko4fgykat7ppbcvnz4wv7okwcwnesbasy5um/thumbnail.jpg", "width": 1080, "height": 1620, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "cid": "bafyreicukrrriqobyd7rnkyheos3afuubvwrqddmhvjjkxu4bpt6bz2jnq", "rkey": "3n2opitysuc2j", "quotes": 15, "langs": [ "en" ], "replyTo": { "parent": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3n2opitxdyc2j", "root": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3n2opitxdyc2j" }, "repost": null, "pinned": false, "quoted": null, "link": null, "altTexts": [ "A video demonstrating the new share sheet. Kiki (a cat) has posted a snarling selfie with the text \"My face when someone says they're 'not really a cat person.' Send this to someone who needs to hear it.\" When the share button is tapped, we see the share sheet pop up with profile images of Kiki's animal friends, plus icons of messaging and social apps on Kiki's phone. Kiki chooses \"Messages\" and s…" ], "repliesRestricted": false, "labels": [], "indexedAt": "2026-11-19T18:33:38.544Z" } }, { "id": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3n2opitxdyc2j", "url": "https://bsky.app/profile/bsky.app/post/3n2opitxdyc2j", "text": "v1.138 is live!\n\nView counts are available in beta! Now you can see how many people your posts are reaching. The numbers are private — they only appear on your own posts and only to you. To turn them on, enable beta features here: bsky.app/settings/bet.... Let us know what you think.", "createdAt": "2026-11-19T18:33:36.813Z", "author": { "id": "did:plc:z72i7hdynmk6r22z27h6tvur", "username": "bsky.app", "displayName": "Bluesky", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreihwihm6kpd6zuwhhlro75p5qks5qtrcu55jp3gddbfjsieiv7wuka", "verified": false, "url": "https://bsky.app/profile/bsky.app" }, "stats": { "views": null, "likes": 2038, "comments": 787, "shares": 349, "saves": 218, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://video.bsky.app/watch/did%3Aplc%3Az72i7hdynmk6r22z27h6tvur/bafkreiavlqznqay24hdpwzzr7tjsy65gbjggiwug2djr6nfw7lszaztrk4/playlist.m3u8", "thumbnailUrl": "https://video.bsky.app/watch/did%3Aplc%3Az72i7hdynmk6r22z27h6tvur/bafkreiavlqznqay24hdpwzzr7tjsy65gbjggiwug2djr6nfw7lszaztrk4/thumbnail.jpg", "width": 1080, "height": 1728, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "cid": "bafyreihjpuz225u5djer7b6oqj5aszoqcblsjogyzlkr2ipw65cz3sk45m", "rkey": "3n2opitxdyc2j", "quotes": 1173, "langs": [ "en" ], "replyTo": null, "repost": null, "pinned": false, "quoted": null, "link": null, "altTexts": [ "A video demonstrating the new post views feature—now in beta. Hoagie the dog has posted, \"Day 47 of asking for a second breakfast. Morale remains high.\" We zoom in and see the view count pop up in small gray type between the date and the reply settings." ], "repliesRestricted": true, "labels": [], "indexedAt": "2026-11-19T18:33:38.543Z" } } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/bluesky/profile/videos": { "get": { "tags": [ "Bluesky" ], "summary": "An account's posts with video.", "description": "50 a page, newest first. 1 credit a page.", "operationId": "blueskyProfileVideos", "parameters": [ { "name": "handle", "in": "query", "description": "The account's handle (`bsky.app`) or DID.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "The profile's link, instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_BlueskyPost" }, "example": { "data": [ { "id": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3n2opitysuc2j", "url": "https://bsky.app/profile/bsky.app/post/3n2opitysuc2j", "text": "We’ve also made it easier to share posts from Bluesky. When you tap the arrow icon on mobile, you’ll now have the option of sharing directly to your other apps.", "createdAt": "2026-11-19T18:33:36.814Z", "author": { "id": "did:plc:z72i7hdynmk6r22z27h6tvur", "username": "bsky.app", "displayName": "Bluesky", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreihwihm6kpd6zuwhhlro75p5qks5qtrcu55jp3gddbfjsieiv7wuka", "verified": false, "url": "https://bsky.app/profile/bsky.app" }, "stats": { "views": null, "likes": 1009, "comments": 46, "shares": 89, "saves": 42, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://video.bsky.app/watch/did%3Aplc%3Az72i7hdynmk6r22z27h6tvur/bafkreiapzmyzxc72yow7zhko4fgykat7ppbcvnz4wv7okwcwnesbasy5um/playlist.m3u8", "thumbnailUrl": "https://video.bsky.app/watch/did%3Aplc%3Az72i7hdynmk6r22z27h6tvur/bafkreiapzmyzxc72yow7zhko4fgykat7ppbcvnz4wv7okwcwnesbasy5um/thumbnail.jpg", "width": 1080, "height": 1620, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "cid": "bafyreicukrrriqobyd7rnkyheos3afuubvwrqddmhvjjkxu4bpt6bz2jnq", "rkey": "3n2opitysuc2j", "quotes": 15, "langs": [ "en" ], "replyTo": { "parent": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3n2opitxdyc2j", "root": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3n2opitxdyc2j" }, "repost": null, "pinned": false, "quoted": null, "link": null, "altTexts": [ "A video demonstrating the new share sheet. Kiki (a cat) has posted a snarling selfie with the text \"My face when someone says they're 'not really a cat person.' Send this to someone who needs to hear it.\" When the share button is tapped, we see the share sheet pop up with profile images of Kiki's animal friends, plus icons of messaging and social apps on Kiki's phone. Kiki chooses \"Messages\" and s…" ], "repliesRestricted": false, "labels": [], "indexedAt": "2026-11-19T18:33:38.544Z" } }, { "id": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3n2opitxdyc2j", "url": "https://bsky.app/profile/bsky.app/post/3n2opitxdyc2j", "text": "v1.138 is live!\n\nView counts are available in beta! Now you can see how many people your posts are reaching. The numbers are private — they only appear on your own posts and only to you. To turn them on, enable beta features here: bsky.app/settings/bet.... Let us know what you think.", "createdAt": "2026-11-19T18:33:36.813Z", "author": { "id": "did:plc:z72i7hdynmk6r22z27h6tvur", "username": "bsky.app", "displayName": "Bluesky", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreihwihm6kpd6zuwhhlro75p5qks5qtrcu55jp3gddbfjsieiv7wuka", "verified": false, "url": "https://bsky.app/profile/bsky.app" }, "stats": { "views": null, "likes": 2038, "comments": 787, "shares": 349, "saves": 218, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://video.bsky.app/watch/did%3Aplc%3Az72i7hdynmk6r22z27h6tvur/bafkreiavlqznqay24hdpwzzr7tjsy65gbjggiwug2djr6nfw7lszaztrk4/playlist.m3u8", "thumbnailUrl": "https://video.bsky.app/watch/did%3Aplc%3Az72i7hdynmk6r22z27h6tvur/bafkreiavlqznqay24hdpwzzr7tjsy65gbjggiwug2djr6nfw7lszaztrk4/thumbnail.jpg", "width": 1080, "height": 1728, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "cid": "bafyreihjpuz225u5djer7b6oqj5aszoqcblsjogyzlkr2ipw65cz3sk45m", "rkey": "3n2opitxdyc2j", "quotes": 1173, "langs": [ "en" ], "replyTo": null, "repost": null, "pinned": false, "quoted": null, "link": null, "altTexts": [ "A video demonstrating the new post views feature—now in beta. Hoagie the dog has posted, \"Day 47 of asking for a second breakfast. Morale remains high.\" We zoom in and see the view count pop up in small gray type between the date and the reply settings." ], "repliesRestricted": true, "labels": [], "indexedAt": "2026-11-19T18:33:38.543Z" } } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.bluesky.profileVideos({ handle: \"bsky.app\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.bluesky.profile_videos(handle=\"bsky.app\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/bluesky/profile/videos \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=bsky.app\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_BlueskyPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/BlueskyPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "BlueskyPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "cid", "rkey", "langs", "pinned", "altTexts", "repliesRestricted", "labels" ], "properties": { "altTexts": { "type": "array", "items": { "type": "string" }, "description": "Each image's or video's description for screen readers, in `media`'s order; empty\nwhen none has one." }, "cid": { "type": "string", "description": "The record's content hash and its key (the last part of its link)." }, "indexedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "When Bluesky indexed it." }, { "type": "null" } ] }, "labels": { "type": "array", "items": { "type": "string" }, "description": "Labels on the post, by value (`porn`, `graphic-media`…)." }, "langs": { "type": "array", "items": { "type": "string" }, "description": "The languages its author set." }, "link": { "oneOf": [ { "$ref": "#/components/schemas/BlueskyLinkCard" }, { "type": "null" } ] }, "pinned": { "type": "boolean", "description": "Pinned to its author's profile, in that account's posts." }, "quoted": { "oneOf": [ { "$ref": "#/components/schemas/BlueskyQuoted" }, { "type": "null" } ] }, "quotes": { "type": [ "integer", "null" ], "format": "int64", "description": "Posts quoting it.", "minimum": 0 }, "repliesRestricted": { "type": "boolean", "description": "Whether its author limited who may reply." }, "replyTo": { "oneOf": [ { "$ref": "#/components/schemas/BlueskyReplyRef", "description": "What it replies to, when it is a reply." }, { "type": "null" } ] }, "repost": { "oneOf": [ { "$ref": "#/components/schemas/BlueskyRepost", "description": "Who reposted it into this list, in an account's posts." }, { "type": "null" } ] }, "rkey": { "type": "string" } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A post: text, images, a video, a link or a quote." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "BlueskyRepost": { "type": "object", "description": "Who reposted a post into the list it is in, and when.", "required": [ "by" ], "properties": { "at": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "by": { "$ref": "#/components/schemas/Author" } } }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } }, "Timestamp": { "type": "string", "format": "date-time" }, "BlueskyReplyRef": { "type": "object", "description": "The post a reply answers, and the thread's first post.", "required": [ "parent", "root" ], "properties": { "parent": { "type": "string" }, "root": { "type": "string" } } }, "BlueskyQuoted": { "type": "object", "description": "What a post quotes: a post, or a feed, list or starter pack it embeds.", "required": [ "id" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "id": { "type": "string", "description": "Its AT-URI." }, "text": { "type": [ "string", "null" ], "description": "A quoted post's text, or the name of a feed, list or starter pack." }, "url": { "type": [ "string", "null" ] } } }, "BlueskyLinkCard": { "type": "object", "description": "The link a post shares, as its card shows it.", "required": [ "url" ], "properties": { "description": { "type": [ "string", "null" ] }, "thumbnailUrl": { "type": [ "string", "null" ] }, "title": { "type": [ "string", "null" ] }, "url": { "type": "string" } } } } } } ``` # Profile (/docs/api-reference/bluesky/profile) An account with its follower and post counts. `GET https://api.socialapi.sh/v1/bluesky/profile` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.bluesky.profile({ handle: "bsky.app" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.bluesky.profile(handle="bsky.app").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/bluesky/profile \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=bsky.app" ``` **Response** ```json { "data": { "id": "did:plc:z72i7hdynmk6r22z27h6tvur", "username": "bsky.app", "displayName": "Bluesky", "bio": "official Bluesky account (check username👆)\n\nBugs, feature requests, feedback: support@bsky.app", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreihwihm6kpd6zuwhhlro75p5qks5qtrcu55jp3gddbfjsieiv7wuka", "url": "https://bsky.app/profile/bsky.app", "verified": false, "private": false, "followers": 35847780, "following": 44, "likes": null, "posts": 928, "externalUrl": null, "createdAt": "2023-04-12T04:53:57.057Z", "ext": { "bannerUrl": "https://cdn.bsky.app/img/banner/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreichzyovokfzmymz36p5jibbjrhsur6n7hjnzxrpbt5jaydp2szvna", "pronouns": null, "pinnedPost": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3l6oveex3ii2l", "lists": 26, "feeds": 7, "starterPacks": 23, "trustedVerifier": true, "labeler": false, "liveUrl": null, "labels": [], "indexedAt": "2026-11-04T15:41:10.973Z" } } } ``` **OpenAPI** ```json { "paths": { "/v1/bluesky/profile": { "get": { "tags": [ "Bluesky" ], "summary": "An account with its follower and post counts.", "description": "Name, bio, pictures, followers, following, posts, whether it is verified, its pinned\npost, its labels, and how many lists, feeds and starter packs it made. 1 credit.", "operationId": "blueskyProfile", "parameters": [ { "name": "handle", "in": "query", "description": "The account's handle (`bsky.app`) or DID.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "The profile's link (`https://bsky.app/profile/bsky.app`), instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_BlueskyProfile" }, "example": { "data": { "id": "did:plc:z72i7hdynmk6r22z27h6tvur", "username": "bsky.app", "displayName": "Bluesky", "bio": "official Bluesky account (check username👆)\n\nBugs, feature requests, feedback: support@bsky.app", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreihwihm6kpd6zuwhhlro75p5qks5qtrcu55jp3gddbfjsieiv7wuka", "url": "https://bsky.app/profile/bsky.app", "verified": false, "private": false, "followers": 35847780, "following": 44, "likes": null, "posts": 928, "externalUrl": null, "createdAt": "2023-04-12T04:53:57.057Z", "ext": { "bannerUrl": "https://cdn.bsky.app/img/banner/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreichzyovokfzmymz36p5jibbjrhsur6n7hjnzxrpbt5jaydp2szvna", "pronouns": null, "pinnedPost": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3l6oveex3ii2l", "lists": 26, "feeds": 7, "starterPacks": 23, "trustedVerifier": true, "labeler": false, "liveUrl": null, "labels": [], "indexedAt": "2026-11-04T15:41:10.973Z" } } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.bluesky.profile({ handle: \"bsky.app\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.bluesky.profile(handle=\"bsky.app\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/bluesky/profile \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=bsky.app\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_BlueskyProfile": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/BlueskyProfile" } } }, "BlueskyProfile": { "allOf": [ { "type": "object", "description": "An account.", "required": [ "id", "username", "url", "verified", "private", "ext" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "bio": { "type": [ "string", "null" ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "displayName": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "trustedVerifier", "labeler", "labels" ], "properties": { "bannerUrl": { "type": [ "string", "null" ], "description": "The profile's banner picture." }, "feeds": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "indexedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "When Bluesky last indexed the profile." }, { "type": "null" } ] }, "labeler": { "type": "boolean", "description": "A labeler: a moderation service others subscribe to." }, "labels": { "type": "array", "items": { "type": "string" }, "description": "Labels on the account, by value. `!no-unauthenticated` is the account asking apps\nnot to show it to visitors who are not signed in." }, "lists": { "type": [ "integer", "null" ], "format": "int64", "description": "The lists, feeds and starter packs it made.", "minimum": 0 }, "liveUrl": { "type": [ "string", "null" ], "description": "Where it is live now, while it says it is." }, "pinnedPost": { "type": [ "string", "null" ], "description": "The post pinned to it, as `/v1/bluesky/post` takes it." }, "pronouns": { "type": [ "string", "null" ], "description": "The pronouns it lists." }, "starterPacks": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "trustedVerifier": { "type": "boolean", "description": "A trusted verifier: an account whose word verifies others." } } }, { "type": "object", "description": "What only this platform has." } ] }, "externalUrl": { "type": [ "string", "null" ], "description": "The link in the bio." }, "followers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "following": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "id": { "type": "string", "description": "The platform's id for the account." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "description": "Likes the account's posts received in total.", "minimum": 0 }, "posts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "private": { "type": "boolean" }, "url": { "type": "string", "description": "The profile's page." }, "username": { "type": "string", "description": "The handle, without `@`." }, "verified": { "type": "boolean" } } }, { "type": "object", "description": "A Bluesky account." } ] }, "Timestamp": { "type": "string", "format": "date-time" } } } } ``` # Search Feeds (/docs/api-reference/bluesky/search-feeds) Feeds matching a query, the most liked first. `GET https://api.socialapi.sh/v1/bluesky/search/feeds` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.bluesky.searchFeeds({ query: "news" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.bluesky.search_feeds(query="news") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/bluesky/search/feeds \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "query=news" ``` **Response** ```json { "data": [ { "id": "at://did:plc:kkf4naxqmweop7dv4l2iqqf5/app.bsky.feed.generator/verified-news", "name": "📰 News", "description": "Headlines from verified news organisations in reverse-chronological order. Maintained by @aendra.com. May contain promoted posts, which are designated using the #promoted hashtag.", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:kkf4naxqmweop7dv4l2iqqf5/bafkreidpjmimdsbt22ix4533kfyjvo4s4ptt7knx7awib4i3ujwuglyi3a", "url": "https://bsky.app/profile/aendra.com/feed/verified-news", "likes": 24008, "creator": { "id": "did:plc:kkf4naxqmweop7dv4l2iqqf5", "username": "aendra.com", "displayName": "ændra.", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:kkf4naxqmweop7dv4l2iqqf5/bafkreiaqkfr6ikrkn2hj2tcapzmcxtkc3qo6hqwjvg4kn7r5f2cmbisstu", "verified": true, "url": "https://bsky.app/profile/aendra.com" }, "service": "did:web:api.graze.social", "online": null, "valid": null, "cid": "bafyreigagl55irsa52sluerkb64j6dp7kp5vl4qhbtov7est525h6i6m2i", "labels": [], "indexedAt": "2026-09-30T19:21:50.061Z" }, { "id": "at://did:plc:kkf4naxqmweop7dv4l2iqqf5/app.bsky.feed.generator/news-2-0", "name": "📰 Trending News", "description": "Trending headlines from verified news organisations. Maintained by @aendra.com", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:kkf4naxqmweop7dv4l2iqqf5/bafkreiegwgsltghth64mdvwcbvtbedvd62vgau7tjyzbcsnybigoldfjuq", "url": "https://bsky.app/profile/aendra.com/feed/news-2-0", "likes": 7227, "creator": { "id": "did:plc:kkf4naxqmweop7dv4l2iqqf5", "username": "aendra.com", "displayName": "ændra.", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:kkf4naxqmweop7dv4l2iqqf5/bafkreiaqkfr6ikrkn2hj2tcapzmcxtkc3qo6hqwjvg4kn7r5f2cmbisstu", "verified": true, "url": "https://bsky.app/profile/aendra.com" }, "service": "did:web:api.graze.social", "online": null, "valid": null, "cid": "bafyreihmyri4emequr6n2fv44amv6bne5tixjq5bqb2itdplbszexddta4", "labels": [], "indexedAt": "2026-03-01T01:23:35.455Z" } ], "pagination": { "nextCursor": "eyJzIjpbNjk4Ljg5ODQsNTMsOC41OTY2NjhlLTgsImRpZDpwbGM6Zm11ZzR6ZWdubDdsZjZsanA3YW9rcGVoIiwibWVkc2t5bmV3cyJdfQ", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/bluesky/search/feeds": { "get": { "tags": [ "Bluesky" ], "summary": "Feeds matching a query, the most liked first.", "description": "50 a page. 1 credit a page.", "operationId": "blueskySearchFeeds", "parameters": [ { "name": "query", "in": "query", "description": "What to search for.", "required": true, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_BlueskyFeed" }, "example": { "data": [ { "id": "at://did:plc:kkf4naxqmweop7dv4l2iqqf5/app.bsky.feed.generator/verified-news", "name": "📰 News", "description": "Headlines from verified news organisations in reverse-chronological order. Maintained by @aendra.com. May contain promoted posts, which are designated using the #promoted hashtag.", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:kkf4naxqmweop7dv4l2iqqf5/bafkreidpjmimdsbt22ix4533kfyjvo4s4ptt7knx7awib4i3ujwuglyi3a", "url": "https://bsky.app/profile/aendra.com/feed/verified-news", "likes": 24008, "creator": { "id": "did:plc:kkf4naxqmweop7dv4l2iqqf5", "username": "aendra.com", "displayName": "ændra.", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:kkf4naxqmweop7dv4l2iqqf5/bafkreiaqkfr6ikrkn2hj2tcapzmcxtkc3qo6hqwjvg4kn7r5f2cmbisstu", "verified": true, "url": "https://bsky.app/profile/aendra.com" }, "service": "did:web:api.graze.social", "online": null, "valid": null, "cid": "bafyreigagl55irsa52sluerkb64j6dp7kp5vl4qhbtov7est525h6i6m2i", "labels": [], "indexedAt": "2026-09-30T19:21:50.061Z" }, { "id": "at://did:plc:kkf4naxqmweop7dv4l2iqqf5/app.bsky.feed.generator/news-2-0", "name": "📰 Trending News", "description": "Trending headlines from verified news organisations. Maintained by @aendra.com", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:kkf4naxqmweop7dv4l2iqqf5/bafkreiegwgsltghth64mdvwcbvtbedvd62vgau7tjyzbcsnybigoldfjuq", "url": "https://bsky.app/profile/aendra.com/feed/news-2-0", "likes": 7227, "creator": { "id": "did:plc:kkf4naxqmweop7dv4l2iqqf5", "username": "aendra.com", "displayName": "ændra.", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:kkf4naxqmweop7dv4l2iqqf5/bafkreiaqkfr6ikrkn2hj2tcapzmcxtkc3qo6hqwjvg4kn7r5f2cmbisstu", "verified": true, "url": "https://bsky.app/profile/aendra.com" }, "service": "did:web:api.graze.social", "online": null, "valid": null, "cid": "bafyreihmyri4emequr6n2fv44amv6bne5tixjq5bqb2itdplbszexddta4", "labels": [], "indexedAt": "2026-03-01T01:23:35.455Z" } ], "pagination": { "nextCursor": "eyJzIjpbNjk4Ljg5ODQsNTMsOC41OTY2NjhlLTgsImRpZDpwbGM6Zm11ZzR6ZWdubDdsZjZsanA3YW9rcGVoIiwibWVkc2t5bmV3cyJdfQ", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.bluesky.searchFeeds({ query: \"news\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.bluesky.search_feeds(query=\"news\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/bluesky/search/feeds \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"query=news\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_BlueskyFeed": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/BlueskyFeed" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "BlueskyFeed": { "type": "object", "description": "A feed: an algorithm an account runs, which anyone can read.", "required": [ "id", "name", "cid", "labels" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "cid": { "type": "string" }, "creator": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "description": { "type": [ "string", "null" ] }, "id": { "type": "string", "description": "Its AT-URI." }, "indexedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "labels": { "type": "array", "items": { "type": "string" } }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "name": { "type": "string" }, "online": { "type": [ "boolean", "null" ], "description": "Whether its service is answering and its record valid; only `/v1/bluesky/feed`\nsays." }, "service": { "type": [ "string", "null" ], "description": "The service that runs it (`did:web:discover.bsky.app`)." }, "url": { "type": [ "string", "null" ] }, "valid": { "type": [ "boolean", "null" ] } } }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Search Starter Packs (/docs/api-reference/bluesky/search-starter-packs) Starter packs matching a query, 50 a page. `GET https://api.socialapi.sh/v1/bluesky/search/starter-packs` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.bluesky.searchStarterPacks({ query: "science" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.bluesky.search_starter_packs(query="science") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/bluesky/search/starter-packs \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "query=science" ``` **Response** ```json { "data": [ { "id": "at://did:plc:jbvnehrrdqoulco4rf5gxg5r/app.bsky.graph.starterpack/3lbv5gld6mi25", "name": "Reuters Science & Environment Coverage", "description": "Reuters reporters and editors who cover science, environment, climate and sustainability news globally.", "url": "https://bsky.app/starter-pack/reuters.com/3lbv5gld6mi25", "creator": { "id": "did:plc:jbvnehrrdqoulco4rf5gxg5r", "username": "reuters.com", "displayName": "Reuters", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:jbvnehrrdqoulco4rf5gxg5r/bafkreibl5cibo6e7epl3pomyqeu7pkvb6yo7zg6q3wf2o4syej5yycrepy", "verified": true, "url": "https://bsky.app/profile/reuters.com" }, "listId": "at://did:plc:jbvnehrrdqoulco4rf5gxg5r/app.bsky.graph.list/3lbv5gl3ugm2n", "members": null, "feedIds": [], "joinedWeek": 0, "joinedAllTime": 0, "cid": "bafyreifkrevu5dusollcqmhmrhsuwaiwqifrj5qesdmmzansq3wtnkxhgy", "labels": [], "createdAt": "2024-11-26T23:02:48.535Z", "updatedAt": "2025-01-03T15:42:30.819Z", "indexedAt": "2025-01-03T15:42:31.152Z" }, { "id": "at://did:plc:6q2thhy2ohzog26mmqm4pffk/app.bsky.graph.starterpack/3lcix4jh3um2a", "name": "Flipboard Science Desk: Climate Watch", "description": "Our favorite climate change experts, scientists, journalists and advocates.", "url": "https://bsky.app/starter-pack/flipboard.com/3lcix4jh3um2a", "creator": { "id": "did:plc:6q2thhy2ohzog26mmqm4pffk", "username": "flipboard.com", "displayName": "Flipboard", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:6q2thhy2ohzog26mmqm4pffk/bafkreieq5yod6rhmp3jgshl4lgsawdbcrvftc673ywmbts4vdvoiamps2y", "verified": false, "url": "https://bsky.app/profile/flipboard.com" }, "listId": "at://did:plc:6q2thhy2ohzog26mmqm4pffk/app.bsky.graph.list/3lcix4jee7m2z", "members": null, "feedIds": [], "joinedWeek": 0, "joinedAllTime": 0, "cid": "bafyreicqebnmoihu5y32uqwz55wfcbqpovbmg56tlaqxtwvnirt3nqc6p4", "labels": [], "createdAt": "2024-12-04T20:03:03.380Z", "updatedAt": "2024-12-09T17:24:50.995Z", "indexedAt": "2024-12-09T17:24:51.302Z" } ], "pagination": { "nextCursor": "eyJzIjpbMTAwMCwtMjE0NzQ4MzY0OCwwLjAwMDAwNTg1NywiZGlkOnBsYzpoZnAzZGllNXY1b2pqdDNiZG0ybHVpcHMiLCIzbGF5aGRkZzNveDJhIl19", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/bluesky/search/starter-packs": { "get": { "tags": [ "Bluesky" ], "summary": "Starter packs matching a query, 50 a page.", "description": "1 credit a page.", "operationId": "blueskySearchStarterPacks", "parameters": [ { "name": "query", "in": "query", "description": "What to search for.", "required": true, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_BlueskyStarterPack" }, "example": { "data": [ { "id": "at://did:plc:jbvnehrrdqoulco4rf5gxg5r/app.bsky.graph.starterpack/3lbv5gld6mi25", "name": "Reuters Science & Environment Coverage", "description": "Reuters reporters and editors who cover science, environment, climate and sustainability news globally.", "url": "https://bsky.app/starter-pack/reuters.com/3lbv5gld6mi25", "creator": { "id": "did:plc:jbvnehrrdqoulco4rf5gxg5r", "username": "reuters.com", "displayName": "Reuters", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:jbvnehrrdqoulco4rf5gxg5r/bafkreibl5cibo6e7epl3pomyqeu7pkvb6yo7zg6q3wf2o4syej5yycrepy", "verified": true, "url": "https://bsky.app/profile/reuters.com" }, "listId": "at://did:plc:jbvnehrrdqoulco4rf5gxg5r/app.bsky.graph.list/3lbv5gl3ugm2n", "members": null, "feedIds": [], "joinedWeek": 0, "joinedAllTime": 0, "cid": "bafyreifkrevu5dusollcqmhmrhsuwaiwqifrj5qesdmmzansq3wtnkxhgy", "labels": [], "createdAt": "2024-11-26T23:02:48.535Z", "updatedAt": "2025-01-03T15:42:30.819Z", "indexedAt": "2025-01-03T15:42:31.152Z" }, { "id": "at://did:plc:6q2thhy2ohzog26mmqm4pffk/app.bsky.graph.starterpack/3lcix4jh3um2a", "name": "Flipboard Science Desk: Climate Watch", "description": "Our favorite climate change experts, scientists, journalists and advocates.", "url": "https://bsky.app/starter-pack/flipboard.com/3lcix4jh3um2a", "creator": { "id": "did:plc:6q2thhy2ohzog26mmqm4pffk", "username": "flipboard.com", "displayName": "Flipboard", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:6q2thhy2ohzog26mmqm4pffk/bafkreieq5yod6rhmp3jgshl4lgsawdbcrvftc673ywmbts4vdvoiamps2y", "verified": false, "url": "https://bsky.app/profile/flipboard.com" }, "listId": "at://did:plc:6q2thhy2ohzog26mmqm4pffk/app.bsky.graph.list/3lcix4jee7m2z", "members": null, "feedIds": [], "joinedWeek": 0, "joinedAllTime": 0, "cid": "bafyreicqebnmoihu5y32uqwz55wfcbqpovbmg56tlaqxtwvnirt3nqc6p4", "labels": [], "createdAt": "2024-12-04T20:03:03.380Z", "updatedAt": "2024-12-09T17:24:50.995Z", "indexedAt": "2024-12-09T17:24:51.302Z" } ], "pagination": { "nextCursor": "eyJzIjpbMTAwMCwtMjE0NzQ4MzY0OCwwLjAwMDAwNTg1NywiZGlkOnBsYzpoZnAzZGllNXY1b2pqdDNiZG0ybHVpcHMiLCIzbGF5aGRkZzNveDJhIl19", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.bluesky.searchStarterPacks({ query: \"science\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.bluesky.search_starter_packs(query=\"science\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/bluesky/search/starter-packs \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"query=science\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_BlueskyStarterPack": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/BlueskyStarterPack" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "BlueskyStarterPack": { "type": "object", "description": "A starter pack: accounts and feeds to follow together.", "required": [ "id", "name", "feedIds", "cid", "labels" ], "properties": { "cid": { "type": "string" }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "creator": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "description": { "type": [ "string", "null" ] }, "feedIds": { "type": "array", "items": { "type": "string" }, "description": "The feeds it suggests, by AT-URI." }, "id": { "type": "string", "description": "Its AT-URI." }, "indexedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "joinedAllTime": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "joinedWeek": { "type": [ "integer", "null" ], "format": "int64", "description": "Accounts that joined Bluesky through it, in the last week and in all.", "minimum": 0 }, "labels": { "type": "array", "items": { "type": "string" } }, "listId": { "type": [ "string", "null" ], "description": "The list of its accounts, as `/v1/bluesky/list/members` takes it." }, "members": { "type": [ "integer", "null" ], "format": "int64", "description": "Accounts in it; only `/v1/bluesky/starter-pack` says.", "minimum": 0 }, "name": { "type": "string" }, "updatedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "url": { "type": [ "string", "null" ] } } }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Search Users (/docs/api-reference/bluesky/search-users) Accounts matching a query, 100 a page. `GET https://api.socialapi.sh/v1/bluesky/search/users` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.bluesky.searchUsers({ query: "nasa" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.bluesky.search_users(query="nasa") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/bluesky/search/users \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "query=nasa" ``` **Response** ```json { "data": [ { "id": "did:plc:ocmyknbwkxjyjkactio272im", "username": "nasawebb.extwitter.link", "displayName": "NASA Webb Telescope", "bio": "⚠️ MIRROR OF twitter.com/NASAWebb\n⚠️ If you own the original account and want to claim this, please contact @twttr-mirrors.bsky.social", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:ocmyknbwkxjyjkactio272im/bafkreich4qumrtdmi7xcffg3bqquyijspjftc7ejaaodbujqyoo5lyagcu", "url": "https://bsky.app/profile/nasawebb.extwitter.link", "verified": false, "private": false, "followers": null, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": "2024-02-22T17:10:21.640Z", "ext": { "bannerUrl": null, "pronouns": null, "pinnedPost": null, "lists": null, "feeds": null, "starterPacks": null, "trustedVerifier": false, "labeler": false, "liveUrl": null, "labels": [ "bot" ], "indexedAt": "2026-03-30T15:37:13.249Z" } }, { "id": "did:plc:6udbhveni6zbejqdt5ancvkr", "username": "uahirise.bsky.social", "displayName": "HiRISE Beautiful Mars (NASA)", "bio": "Images from the High Resolution Imaging Science Experiment (HiRISE) on board the Mars Reconnaissance Orbiter (NASA). We are based out of the Lunar and Planetary Laboratory at the University of Arizona in Tucson, AZ. https://uahirise.org", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:6udbhveni6zbejqdt5ancvkr/bafkreicu6s4y4e4nopdrbilvchfij4ar3t2nil4f7ctur67q7ktsdy3n3m", "url": "https://bsky.app/profile/uahirise.bsky.social", "verified": false, "private": false, "followers": null, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": "2023-10-17T23:54:39.050Z", "ext": { "bannerUrl": null, "pronouns": null, "pinnedPost": null, "lists": null, "feeds": null, "starterPacks": null, "trustedVerifier": false, "labeler": false, "liveUrl": null, "labels": [], "indexedAt": "2025-10-01T20:33:55.048Z" } } ], "pagination": { "nextCursor": "eyJzIjpbMTAwMCw5LjQ3OTU2MmUtOSwiZGlkOnBsYzphZDZ6bmh3ZmJkcTZrYWk3NDV4aTc2dmgiXX0", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/bluesky/search/users": { "get": { "tags": [ "Bluesky" ], "summary": "Accounts matching a query, 100 a page.", "description": "Each with its name, bio and picture; no counts. 1 credit a page.", "operationId": "blueskySearchUsers", "parameters": [ { "name": "query", "in": "query", "description": "What to search for.", "required": true, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_BlueskyProfile" }, "example": { "data": [ { "id": "did:plc:ocmyknbwkxjyjkactio272im", "username": "nasawebb.extwitter.link", "displayName": "NASA Webb Telescope", "bio": "⚠️ MIRROR OF twitter.com/NASAWebb\n⚠️ If you own the original account and want to claim this, please contact @twttr-mirrors.bsky.social", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:ocmyknbwkxjyjkactio272im/bafkreich4qumrtdmi7xcffg3bqquyijspjftc7ejaaodbujqyoo5lyagcu", "url": "https://bsky.app/profile/nasawebb.extwitter.link", "verified": false, "private": false, "followers": null, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": "2024-02-22T17:10:21.640Z", "ext": { "bannerUrl": null, "pronouns": null, "pinnedPost": null, "lists": null, "feeds": null, "starterPacks": null, "trustedVerifier": false, "labeler": false, "liveUrl": null, "labels": [ "bot" ], "indexedAt": "2026-03-30T15:37:13.249Z" } }, { "id": "did:plc:6udbhveni6zbejqdt5ancvkr", "username": "uahirise.bsky.social", "displayName": "HiRISE Beautiful Mars (NASA)", "bio": "Images from the High Resolution Imaging Science Experiment (HiRISE) on board the Mars Reconnaissance Orbiter (NASA). We are based out of the Lunar and Planetary Laboratory at the University of Arizona in Tucson, AZ. https://uahirise.org", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:6udbhveni6zbejqdt5ancvkr/bafkreicu6s4y4e4nopdrbilvchfij4ar3t2nil4f7ctur67q7ktsdy3n3m", "url": "https://bsky.app/profile/uahirise.bsky.social", "verified": false, "private": false, "followers": null, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": "2023-10-17T23:54:39.050Z", "ext": { "bannerUrl": null, "pronouns": null, "pinnedPost": null, "lists": null, "feeds": null, "starterPacks": null, "trustedVerifier": false, "labeler": false, "liveUrl": null, "labels": [], "indexedAt": "2025-10-01T20:33:55.048Z" } } ], "pagination": { "nextCursor": "eyJzIjpbMTAwMCw5LjQ3OTU2MmUtOSwiZGlkOnBsYzphZDZ6bmh3ZmJkcTZrYWk3NDV4aTc2dmgiXX0", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.bluesky.searchUsers({ query: \"nasa\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.bluesky.search_users(query=\"nasa\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/bluesky/search/users \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"query=nasa\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_BlueskyProfile": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/BlueskyProfile" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "BlueskyProfile": { "allOf": [ { "type": "object", "description": "An account.", "required": [ "id", "username", "url", "verified", "private", "ext" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "bio": { "type": [ "string", "null" ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "displayName": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "trustedVerifier", "labeler", "labels" ], "properties": { "bannerUrl": { "type": [ "string", "null" ], "description": "The profile's banner picture." }, "feeds": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "indexedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "When Bluesky last indexed the profile." }, { "type": "null" } ] }, "labeler": { "type": "boolean", "description": "A labeler: a moderation service others subscribe to." }, "labels": { "type": "array", "items": { "type": "string" }, "description": "Labels on the account, by value. `!no-unauthenticated` is the account asking apps\nnot to show it to visitors who are not signed in." }, "lists": { "type": [ "integer", "null" ], "format": "int64", "description": "The lists, feeds and starter packs it made.", "minimum": 0 }, "liveUrl": { "type": [ "string", "null" ], "description": "Where it is live now, while it says it is." }, "pinnedPost": { "type": [ "string", "null" ], "description": "The post pinned to it, as `/v1/bluesky/post` takes it." }, "pronouns": { "type": [ "string", "null" ], "description": "The pronouns it lists." }, "starterPacks": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "trustedVerifier": { "type": "boolean", "description": "A trusted verifier: an account whose word verifies others." } } }, { "type": "object", "description": "What only this platform has." } ] }, "externalUrl": { "type": [ "string", "null" ], "description": "The link in the bio." }, "followers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "following": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "id": { "type": "string", "description": "The platform's id for the account." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "description": "Likes the account's posts received in total.", "minimum": 0 }, "posts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "private": { "type": "boolean" }, "url": { "type": "string", "description": "The profile's page." }, "username": { "type": "string", "description": "The handle, without `@`." }, "verified": { "type": "boolean" } } }, { "type": "object", "description": "A Bluesky account." } ] }, "Timestamp": { "type": "string", "format": "date-time" } } } } ``` # Search (/docs/api-reference/bluesky/search) Posts matching a query, 50 a page. `GET https://api.socialapi.sh/v1/bluesky/search` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.bluesky.search({ query: "coffee", sort: "latest", language: "en" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.bluesky.search(query="coffee", sort="latest", language="en") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/bluesky/search \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "query=coffee" \ --data-urlencode "sort=latest" \ --data-urlencode "language=en" ``` **Response** ```json { "data": [ { "id": "at://did:plc:e2v5lqjh2gnw2gweuezbzd5l/app.bsky.feed.post/3n35tfarpif2e", "url": "https://bsky.app/profile/coffeelabadvisor.bsky.social/post/3n35tfarpif2e", "text": "Morning coffee, sorted. Keurig K-Compact Single-Serve K-Cup Pod: single-serve brewing ☕\n\nKeurig K-Compact Single-Serve K-Cup Pod Coffee Maker\n\n☕ https://www.amazon.com/dp/B0BV9HKMNT?tag=choosetoshop-20 #ad #paidlink #AmazonAffiliate #PourOver #Coffee", "createdAt": "2026-11-25T18:53:07.095Z", "author": { "id": "did:plc:e2v5lqjh2gnw2gweuezbzd5l", "username": "coffeelabadvisor.bsky.social", "displayName": "CoffeeLabAdvisor", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:e2v5lqjh2gnw2gweuezbzd5l/bafkreia2esxpt3k4mogsonrytsmaqwxv2w7qmnzzhxnftjrhusr7mzqr4i", "verified": false, "url": "https://bsky.app/profile/coffeelabadvisor.bsky.social" }, "stats": { "views": null, "likes": 0, "comments": 0, "shares": 0, "saves": 0, "engagementRate": null }, "media": [], "hashtags": [ "ad", "paidlink", "AmazonAffiliate" ], "mentions": [], "ext": { "cid": "bafyreib5k4t4cwrcygae66ced5lviceoutcjgwcfvcfo4ypz3tkyfcdpyq", "rkey": "3n35tfarpif2e", "quotes": 0, "langs": [ "en" ], "replyTo": null, "repost": null, "pinned": false, "quoted": null, "link": { "url": "https://www.amazon.com/dp/B0BV9HKMNT?tag=choosetoshop-20", "title": "Keurig K-Compact Single-Serve K-Cup Pod Coffee Maker", "description": "Explore on Amazon", "thumbnailUrl": "https://cdn.bsky.app/img/feed_thumbnail/plain/did:plc:e2v5lqjh2gnw2gweuezbzd5l/bafkreiexxqesndilozdhkspr2eq7uqwwsluwl6texlli73g3nhy5y5obua" }, "altTexts": [], "repliesRestricted": false, "labels": [], "indexedAt": "2026-11-25T18:53:07.244Z" } }, { "id": "at://did:plc:363cn3qkdwze3yu73yqybmms/app.bsky.feed.post/3n35textenk2x", "url": "https://bsky.app/profile/jonbecker.bsky.social/post/3n35textenk2x", "text": "I am in the coolest coffee shop in St. Petersburg, FL. \n\n(I don't see @bubbaprog.xyz though)", "createdAt": "2026-11-25T18:52:57.695Z", "author": { "id": "did:plc:363cn3qkdwze3yu73yqybmms", "username": "jonbecker.bsky.social", "displayName": "Jon Becker", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:363cn3qkdwze3yu73yqybmms/bafkreieemb7in54jnv5f52um37afrdhd4qbe5rxrkth6jvolgxgrcy6nua", "verified": false, "url": "https://bsky.app/profile/jonbecker.bsky.social" }, "stats": { "views": null, "likes": 0, "comments": 0, "shares": 0, "saves": 0, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [ "bubbaprog.xyz" ], "ext": { "cid": "bafyreigmzjqn3tetrgjdzc7xkx3tqmlsxpxwsnx2xkt5e5vembaagu7pmu", "rkey": "3n35textenk2x", "quotes": 0, "langs": [ "en" ], "replyTo": null, "repost": null, "pinned": false, "quoted": null, "link": { "url": "https://thebuzz727.com/password", "title": "The BUZZ", "description": "The BUZZ", "thumbnailUrl": "https://cdn.bsky.app/img/feed_thumbnail/plain/did:plc:363cn3qkdwze3yu73yqybmms/bafkreidmkumyr2tv2nkijeyshuzgm4nk3nusscbtizzsbtqogbonamfqfq" }, "altTexts": [], "repliesRestricted": false, "labels": [], "indexedAt": "2026-11-25T18:52:59.849Z" } } ], "pagination": { "nextCursor": "1795631957|at://did:plc:ukzyde6xpmjmcpumfrbgzwdl/app.bsky.feed.post/3n35smjmlcc2r", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/bluesky/search": { "get": { "tags": [ "Bluesky" ], "summary": "Posts matching a query, 50 a page.", "description": "By relevance (one page) or newest first (paged), narrowed by time, language, author,\nmention, link or hashtag if asked. 1 credit a page.", "operationId": "blueskySearch", "parameters": [ { "name": "query", "in": "query", "description": "What to search for.", "required": true, "schema": { "type": "string" } }, { "name": "sort", "in": "query", "description": "`top` (by relevance, the default: one page) or `latest` (newest first, paged).", "required": false, "schema": { "type": "string", "description": "How a search orders its posts.", "enum": [ "top", "latest" ] } }, { "name": "since", "in": "query", "description": "Only posts from this time on (`2026-11-01T00:00:00Z`, or a date).", "required": false, "schema": { "type": "string" } }, { "name": "until", "in": "query", "description": "Only posts before this time.", "required": false, "schema": { "type": "string" } }, { "name": "language", "in": "query", "description": "Only posts in this language (`en`, `tr`).", "required": false, "schema": { "type": "string" } }, { "name": "author", "in": "query", "description": "Only posts by this account (a handle or a DID).", "required": false, "schema": { "type": "string" } }, { "name": "mentions", "in": "query", "description": "Only posts mentioning this account.", "required": false, "schema": { "type": "string" } }, { "name": "domain", "in": "query", "description": "Only posts linking to this domain (`nytimes.com`).", "required": false, "schema": { "type": "string" } }, { "name": "link", "in": "query", "description": "Only posts linking to this address.", "required": false, "schema": { "type": "string" } }, { "name": "tag", "in": "query", "description": "Only posts with these hashtags, comma-separated, without `#`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page (with `sort=latest`).", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_BlueskyPost" }, "example": { "data": [ { "id": "at://did:plc:e2v5lqjh2gnw2gweuezbzd5l/app.bsky.feed.post/3n35tfarpif2e", "url": "https://bsky.app/profile/coffeelabadvisor.bsky.social/post/3n35tfarpif2e", "text": "Morning coffee, sorted. Keurig K-Compact Single-Serve K-Cup Pod: single-serve brewing ☕\n\nKeurig K-Compact Single-Serve K-Cup Pod Coffee Maker\n\n☕ https://www.amazon.com/dp/B0BV9HKMNT?tag=choosetoshop-20 #ad #paidlink #AmazonAffiliate #PourOver #Coffee", "createdAt": "2026-11-25T18:53:07.095Z", "author": { "id": "did:plc:e2v5lqjh2gnw2gweuezbzd5l", "username": "coffeelabadvisor.bsky.social", "displayName": "CoffeeLabAdvisor", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:e2v5lqjh2gnw2gweuezbzd5l/bafkreia2esxpt3k4mogsonrytsmaqwxv2w7qmnzzhxnftjrhusr7mzqr4i", "verified": false, "url": "https://bsky.app/profile/coffeelabadvisor.bsky.social" }, "stats": { "views": null, "likes": 0, "comments": 0, "shares": 0, "saves": 0, "engagementRate": null }, "media": [], "hashtags": [ "ad", "paidlink", "AmazonAffiliate" ], "mentions": [], "ext": { "cid": "bafyreib5k4t4cwrcygae66ced5lviceoutcjgwcfvcfo4ypz3tkyfcdpyq", "rkey": "3n35tfarpif2e", "quotes": 0, "langs": [ "en" ], "replyTo": null, "repost": null, "pinned": false, "quoted": null, "link": { "url": "https://www.amazon.com/dp/B0BV9HKMNT?tag=choosetoshop-20", "title": "Keurig K-Compact Single-Serve K-Cup Pod Coffee Maker", "description": "Explore on Amazon", "thumbnailUrl": "https://cdn.bsky.app/img/feed_thumbnail/plain/did:plc:e2v5lqjh2gnw2gweuezbzd5l/bafkreiexxqesndilozdhkspr2eq7uqwwsluwl6texlli73g3nhy5y5obua" }, "altTexts": [], "repliesRestricted": false, "labels": [], "indexedAt": "2026-11-25T18:53:07.244Z" } }, { "id": "at://did:plc:363cn3qkdwze3yu73yqybmms/app.bsky.feed.post/3n35textenk2x", "url": "https://bsky.app/profile/jonbecker.bsky.social/post/3n35textenk2x", "text": "I am in the coolest coffee shop in St. Petersburg, FL. \n\n(I don't see @bubbaprog.xyz though)", "createdAt": "2026-11-25T18:52:57.695Z", "author": { "id": "did:plc:363cn3qkdwze3yu73yqybmms", "username": "jonbecker.bsky.social", "displayName": "Jon Becker", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:363cn3qkdwze3yu73yqybmms/bafkreieemb7in54jnv5f52um37afrdhd4qbe5rxrkth6jvolgxgrcy6nua", "verified": false, "url": "https://bsky.app/profile/jonbecker.bsky.social" }, "stats": { "views": null, "likes": 0, "comments": 0, "shares": 0, "saves": 0, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [ "bubbaprog.xyz" ], "ext": { "cid": "bafyreigmzjqn3tetrgjdzc7xkx3tqmlsxpxwsnx2xkt5e5vembaagu7pmu", "rkey": "3n35textenk2x", "quotes": 0, "langs": [ "en" ], "replyTo": null, "repost": null, "pinned": false, "quoted": null, "link": { "url": "https://thebuzz727.com/password", "title": "The BUZZ", "description": "The BUZZ", "thumbnailUrl": "https://cdn.bsky.app/img/feed_thumbnail/plain/did:plc:363cn3qkdwze3yu73yqybmms/bafkreidmkumyr2tv2nkijeyshuzgm4nk3nusscbtizzsbtqogbonamfqfq" }, "altTexts": [], "repliesRestricted": false, "labels": [], "indexedAt": "2026-11-25T18:52:59.849Z" } } ], "pagination": { "nextCursor": "1795631957|at://did:plc:ukzyde6xpmjmcpumfrbgzwdl/app.bsky.feed.post/3n35smjmlcc2r", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.bluesky.search({ query: \"coffee\", sort: \"latest\", language: \"en\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.bluesky.search(query=\"coffee\", sort=\"latest\", language=\"en\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/bluesky/search \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"query=coffee\" \\\n --data-urlencode \"sort=latest\" \\\n --data-urlencode \"language=en\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_BlueskyPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/BlueskyPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "BlueskyPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "cid", "rkey", "langs", "pinned", "altTexts", "repliesRestricted", "labels" ], "properties": { "altTexts": { "type": "array", "items": { "type": "string" }, "description": "Each image's or video's description for screen readers, in `media`'s order; empty\nwhen none has one." }, "cid": { "type": "string", "description": "The record's content hash and its key (the last part of its link)." }, "indexedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "When Bluesky indexed it." }, { "type": "null" } ] }, "labels": { "type": "array", "items": { "type": "string" }, "description": "Labels on the post, by value (`porn`, `graphic-media`…)." }, "langs": { "type": "array", "items": { "type": "string" }, "description": "The languages its author set." }, "link": { "oneOf": [ { "$ref": "#/components/schemas/BlueskyLinkCard" }, { "type": "null" } ] }, "pinned": { "type": "boolean", "description": "Pinned to its author's profile, in that account's posts." }, "quoted": { "oneOf": [ { "$ref": "#/components/schemas/BlueskyQuoted" }, { "type": "null" } ] }, "quotes": { "type": [ "integer", "null" ], "format": "int64", "description": "Posts quoting it.", "minimum": 0 }, "repliesRestricted": { "type": "boolean", "description": "Whether its author limited who may reply." }, "replyTo": { "oneOf": [ { "$ref": "#/components/schemas/BlueskyReplyRef", "description": "What it replies to, when it is a reply." }, { "type": "null" } ] }, "repost": { "oneOf": [ { "$ref": "#/components/schemas/BlueskyRepost", "description": "Who reposted it into this list, in an account's posts." }, { "type": "null" } ] }, "rkey": { "type": "string" } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A post: text, images, a video, a link or a quote." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "BlueskyRepost": { "type": "object", "description": "Who reposted a post into the list it is in, and when.", "required": [ "by" ], "properties": { "at": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "by": { "$ref": "#/components/schemas/Author" } } }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } }, "Timestamp": { "type": "string", "format": "date-time" }, "BlueskyReplyRef": { "type": "object", "description": "The post a reply answers, and the thread's first post.", "required": [ "parent", "root" ], "properties": { "parent": { "type": "string" }, "root": { "type": "string" } } }, "BlueskyQuoted": { "type": "object", "description": "What a post quotes: a post, or a feed, list or starter pack it embeds.", "required": [ "id" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "id": { "type": "string", "description": "Its AT-URI." }, "text": { "type": [ "string", "null" ], "description": "A quoted post's text, or the name of a feed, list or starter pack." }, "url": { "type": [ "string", "null" ] } } }, "BlueskyLinkCard": { "type": "object", "description": "The link a post shares, as its card shows it.", "required": [ "url" ], "properties": { "description": { "type": [ "string", "null" ] }, "thumbnailUrl": { "type": [ "string", "null" ] }, "title": { "type": [ "string", "null" ] }, "url": { "type": "string" } } } } } } ``` # Starter Pack (/docs/api-reference/bluesky/starter-pack) A starter pack with its accounts' list and feeds. `GET https://api.socialapi.sh/v1/bluesky/starter-pack` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.bluesky.starterPack({ id: "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.graph.starterpack/3mzdvli2fkq23" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.bluesky.starter_pack(id="at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.graph.starterpack/3mzdvli2fkq23").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/bluesky/starter-pack \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "id=at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.graph.starterpack/3mzdvli2fkq23" ``` **Response** ```json { "data": { "id": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.graph.starterpack/3mzdvli2fkq23", "name": "Midterms 2026: Battleground", "description": null, "url": "https://bsky.app/starter-pack/bsky.app/3mzdvli2fkq23", "creator": { "id": "did:plc:z72i7hdynmk6r22z27h6tvur", "username": "bsky.app", "displayName": "Bluesky", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreihwihm6kpd6zuwhhlro75p5qks5qtrcu55jp3gddbfjsieiv7wuka", "verified": false, "url": "https://bsky.app/profile/bsky.app" }, "listId": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.graph.list/3mzdvlhcw5l2g", "members": 137, "feedIds": [ "at://did:plc:qrllvid7s54k4hnwtqxwetrf/app.bsky.feed.generator/battleground", "at://did:plc:qrllvid7s54k4hnwtqxwetrf/app.bsky.feed.generator/midterms2026" ], "joinedWeek": 0, "joinedAllTime": 8, "cid": "bafyreib3qzothdjrpu3zf2t6qkvnkoitgusvgksotlbf7yyvys5xnegcfi", "labels": [], "createdAt": "2026-11-02T17:57:58.528Z", "updatedAt": "2026-11-03T20:32:38.803Z", "indexedAt": "2026-11-03T20:32:39.080Z" } } ``` **OpenAPI** ```json { "paths": { "/v1/bluesky/starter-pack": { "get": { "tags": [ "Bluesky" ], "summary": "A starter pack with its accounts' list and feeds.", "description": "Its name, description, who made it, how many accounts it has and joined through it, and\nthe id of the list `/list/members` reads its accounts from. 1 credit.", "operationId": "blueskyStarterPack", "parameters": [ { "name": "url", "in": "query", "description": "Its bsky.app link.", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "Its AT-URI (the `id` its answers give it), instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_BlueskyStarterPack" }, "example": { "data": { "id": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.graph.starterpack/3mzdvli2fkq23", "name": "Midterms 2026: Battleground", "description": null, "url": "https://bsky.app/starter-pack/bsky.app/3mzdvli2fkq23", "creator": { "id": "did:plc:z72i7hdynmk6r22z27h6tvur", "username": "bsky.app", "displayName": "Bluesky", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:z72i7hdynmk6r22z27h6tvur/bafkreihwihm6kpd6zuwhhlro75p5qks5qtrcu55jp3gddbfjsieiv7wuka", "verified": false, "url": "https://bsky.app/profile/bsky.app" }, "listId": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.graph.list/3mzdvlhcw5l2g", "members": 137, "feedIds": [ "at://did:plc:qrllvid7s54k4hnwtqxwetrf/app.bsky.feed.generator/battleground", "at://did:plc:qrllvid7s54k4hnwtqxwetrf/app.bsky.feed.generator/midterms2026" ], "joinedWeek": 0, "joinedAllTime": 8, "cid": "bafyreib3qzothdjrpu3zf2t6qkvnkoitgusvgksotlbf7yyvys5xnegcfi", "labels": [], "createdAt": "2026-11-02T17:57:58.528Z", "updatedAt": "2026-11-03T20:32:38.803Z", "indexedAt": "2026-11-03T20:32:39.080Z" } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.bluesky.starterPack({ id: \"at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.graph.starterpack/3mzdvli2fkq23\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.bluesky.starter_pack(id=\"at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.graph.starterpack/3mzdvli2fkq23\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/bluesky/starter-pack \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"id=at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.graph.starterpack/3mzdvli2fkq23\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_BlueskyStarterPack": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/BlueskyStarterPack" } } }, "BlueskyStarterPack": { "type": "object", "description": "A starter pack: accounts and feeds to follow together.", "required": [ "id", "name", "feedIds", "cid", "labels" ], "properties": { "cid": { "type": "string" }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "creator": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "description": { "type": [ "string", "null" ] }, "feedIds": { "type": "array", "items": { "type": "string" }, "description": "The feeds it suggests, by AT-URI." }, "id": { "type": "string", "description": "Its AT-URI." }, "indexedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "joinedAllTime": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "joinedWeek": { "type": [ "integer", "null" ], "format": "int64", "description": "Accounts that joined Bluesky through it, in the last week and in all.", "minimum": 0 }, "labels": { "type": "array", "items": { "type": "string" } }, "listId": { "type": [ "string", "null" ], "description": "The list of its accounts, as `/v1/bluesky/list/members` takes it." }, "members": { "type": [ "integer", "null" ], "format": "int64", "description": "Accounts in it; only `/v1/bluesky/starter-pack` says.", "minimum": 0 }, "name": { "type": "string" }, "updatedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "url": { "type": [ "string", "null" ] } } }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Trending Topics (/docs/api-reference/bluesky/trending-topics) The topics trending now, up to 25. `GET https://api.socialapi.sh/v1/bluesky/trending/topics` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.bluesky.trendingTopics(); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.bluesky.trending_topics() ``` **cURL** ```bash curl https://api.socialapi.sh/v1/bluesky/trending/topics \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" ``` **Response** ```json { "data": [ { "id": "1ef94576cdfe", "name": "Canned cranberry sauce", "description": "Users defend Ocean Spray's jellied \"Union Goo\" against homemade fresh versions for Thanksgiving.", "rank": 1, "url": "https://bsky.app/profile/did:plc:qrz3lhbyuxbeilrc6nekdqme/feed/1ef94576cdfe", "feedId": "at://did:plc:qrz3lhbyuxbeilrc6nekdqme/app.bsky.feed.generator/1ef94576cdfe", "posts": 221, "status": "trending", "category": "culture", "startedAt": "2026-11-25T18:04:26.055Z", "actors": [ { "id": "did:plc:kqwgubh6vutpu3cli2gll6at", "username": "victoriascott.bsky.social", "displayName": "Victoria Scott", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:kqwgubh6vutpu3cli2gll6at/bafkreiftcu6zzkk5f4cfnobfo4u4xm4lenvdr5x4j2buun3ugm4cr6j2pm", "verified": false, "url": "https://bsky.app/profile/victoriascott.bsky.social" }, { "id": "did:plc:s6uwytvvpihxcqyzvcltzmrr", "username": "airbagged.bsky.social", "displayName": "kate bush’s husband", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:s6uwytvvpihxcqyzvcltzmrr/bafkreift5re3y37sjrsz76ujqa6asxienitlafxw5fjbtbhfpene3zaiwy", "verified": false, "url": "https://bsky.app/profile/airbagged.bsky.social" }, { "id": "did:plc:di7epi7naqi3rharpcogc5sf", "username": "gwensnyder.bsky.social", "displayName": "Gwen Snyder is uncivil", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:di7epi7naqi3rharpcogc5sf/bafkreicogv7dqtkk6rdazgpq3q2fe3m4nv5bkdfewrqcacb7nst3yacsfi", "verified": false, "url": "https://bsky.app/profile/gwensnyder.bsky.social" } ] }, { "id": "4262fbfdeb00", "name": "AI water use compared to golf", "description": "An Enverus report says AI uses less water per dollar spent than almond milk or golf.", "rank": 2, "url": "https://bsky.app/profile/did:plc:qrz3lhbyuxbeilrc6nekdqme/feed/4262fbfdeb00", "feedId": "at://did:plc:qrz3lhbyuxbeilrc6nekdqme/app.bsky.feed.generator/4262fbfdeb00", "posts": 248, "status": "trending", "category": "science-tech", "startedAt": "2026-11-25T15:54:25.283Z", "actors": [ { "id": "did:plc:v23hdor4auyu3lldn6esf72z", "username": "maplecocaine.bsky.social", "displayName": "maple cocaine", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:v23hdor4auyu3lldn6esf72z/bafkreibpz5i6klctpl76ialpxq6fzfrjuhrtkmr7jf5pxspftisfrdbhqq", "verified": false, "url": "https://bsky.app/profile/maplecocaine.bsky.social" }, { "id": "did:plc:njwcnt4qsdno2lhebdq34m2o", "username": "nerdjpg.com", "displayName": "Ahhhhh", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:njwcnt4qsdno2lhebdq34m2o/bafkreigehqbyzwdke7yojkejhszhutubieplrhhhdpvoyjpywwslyxadhm", "verified": false, "url": "https://bsky.app/profile/nerdjpg.com" }, { "id": "did:plc:pzsrpsyeeppu4jbadsab7wjp", "username": "bugsmaytrix.bsky.social", "displayName": "Bugs 🔜 Bed", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:pzsrpsyeeppu4jbadsab7wjp/bafkreicfqqdown5busxybm5p222jb5xghe5iqq6osntiss7xn2hgxhpdd4", "verified": false, "url": "https://bsky.app/profile/bugsmaytrix.bsky.social" } ] } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/bluesky/trending/topics": { "get": { "tags": [ "Bluesky" ], "summary": "The topics trending now, up to 25.", "description": "Each with its post count, its status, when it began and the feed of its posts.\n1 credit.", "operationId": "blueskyTrendingTopics", "parameters": [ { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_BlueskyTrend" }, "example": { "data": [ { "id": "1ef94576cdfe", "name": "Canned cranberry sauce", "description": "Users defend Ocean Spray's jellied \"Union Goo\" against homemade fresh versions for Thanksgiving.", "rank": 1, "url": "https://bsky.app/profile/did:plc:qrz3lhbyuxbeilrc6nekdqme/feed/1ef94576cdfe", "feedId": "at://did:plc:qrz3lhbyuxbeilrc6nekdqme/app.bsky.feed.generator/1ef94576cdfe", "posts": 221, "status": "trending", "category": "culture", "startedAt": "2026-11-25T18:04:26.055Z", "actors": [ { "id": "did:plc:kqwgubh6vutpu3cli2gll6at", "username": "victoriascott.bsky.social", "displayName": "Victoria Scott", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:kqwgubh6vutpu3cli2gll6at/bafkreiftcu6zzkk5f4cfnobfo4u4xm4lenvdr5x4j2buun3ugm4cr6j2pm", "verified": false, "url": "https://bsky.app/profile/victoriascott.bsky.social" }, { "id": "did:plc:s6uwytvvpihxcqyzvcltzmrr", "username": "airbagged.bsky.social", "displayName": "kate bush’s husband", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:s6uwytvvpihxcqyzvcltzmrr/bafkreift5re3y37sjrsz76ujqa6asxienitlafxw5fjbtbhfpene3zaiwy", "verified": false, "url": "https://bsky.app/profile/airbagged.bsky.social" }, { "id": "did:plc:di7epi7naqi3rharpcogc5sf", "username": "gwensnyder.bsky.social", "displayName": "Gwen Snyder is uncivil", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:di7epi7naqi3rharpcogc5sf/bafkreicogv7dqtkk6rdazgpq3q2fe3m4nv5bkdfewrqcacb7nst3yacsfi", "verified": false, "url": "https://bsky.app/profile/gwensnyder.bsky.social" } ] }, { "id": "4262fbfdeb00", "name": "AI water use compared to golf", "description": "An Enverus report says AI uses less water per dollar spent than almond milk or golf.", "rank": 2, "url": "https://bsky.app/profile/did:plc:qrz3lhbyuxbeilrc6nekdqme/feed/4262fbfdeb00", "feedId": "at://did:plc:qrz3lhbyuxbeilrc6nekdqme/app.bsky.feed.generator/4262fbfdeb00", "posts": 248, "status": "trending", "category": "science-tech", "startedAt": "2026-11-25T15:54:25.283Z", "actors": [ { "id": "did:plc:v23hdor4auyu3lldn6esf72z", "username": "maplecocaine.bsky.social", "displayName": "maple cocaine", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:v23hdor4auyu3lldn6esf72z/bafkreibpz5i6klctpl76ialpxq6fzfrjuhrtkmr7jf5pxspftisfrdbhqq", "verified": false, "url": "https://bsky.app/profile/maplecocaine.bsky.social" }, { "id": "did:plc:njwcnt4qsdno2lhebdq34m2o", "username": "nerdjpg.com", "displayName": "Ahhhhh", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:njwcnt4qsdno2lhebdq34m2o/bafkreigehqbyzwdke7yojkejhszhutubieplrhhhdpvoyjpywwslyxadhm", "verified": false, "url": "https://bsky.app/profile/nerdjpg.com" }, { "id": "did:plc:pzsrpsyeeppu4jbadsab7wjp", "username": "bugsmaytrix.bsky.social", "displayName": "Bugs 🔜 Bed", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:pzsrpsyeeppu4jbadsab7wjp/bafkreicfqqdown5busxybm5p222jb5xghe5iqq6osntiss7xn2hgxhpdd4", "verified": false, "url": "https://bsky.app/profile/bugsmaytrix.bsky.social" } ] } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.bluesky.trendingTopics();" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.bluesky.trending_topics()" }, { "lang": "bash", "label": "cURL", "source": "curl https://api.socialapi.sh/v1/bluesky/trending/topics \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_BlueskyTrend": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/BlueskyTrend" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "BlueskyTrend": { "type": "object", "description": "A topic trending on Bluesky.", "required": [ "id", "name", "rank", "actors" ], "properties": { "actors": { "type": "array", "items": { "$ref": "#/components/schemas/Author" }, "description": "A few of the accounts posting about it." }, "category": { "type": [ "string", "null" ], "description": "`politics`, `sports`, `entertainment`…" }, "description": { "type": [ "string", "null" ] }, "feedId": { "type": [ "string", "null" ] }, "id": { "type": "string", "description": "Its id." }, "name": { "type": "string" }, "posts": { "type": [ "integer", "null" ], "format": "int64", "description": "Posts about it.", "minimum": 0 }, "rank": { "type": "integer", "format": "int32", "description": "Its place in the list, from 1.", "minimum": 0 }, "startedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "status": { "type": [ "string", "null" ], "description": "`trending`, `saturating`, `cooling` or `stale`." }, "url": { "type": [ "string", "null" ], "description": "Its page, and its feed as `/v1/bluesky/feed/posts` takes it." } } }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Trending (/docs/api-reference/bluesky/trending) The posts of Bluesky's Discover feed, 50 a page. `GET https://api.socialapi.sh/v1/bluesky/trending` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.bluesky.trending(); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.bluesky.trending() ``` **cURL** ```bash curl https://api.socialapi.sh/v1/bluesky/trending \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" ``` **Response** ```json { "data": [ { "id": "at://did:plc:6bfbhripser5pbn7o3w2yhbi/app.bsky.feed.post/3n34lyluqt22o", "url": "https://bsky.app/profile/gregeoce.bsky.social/post/3n34lyluqt22o", "text": "DEEP DARK NIGHT", "createdAt": "2026-11-25T07:08:06.574Z", "author": { "id": "did:plc:6bfbhripser5pbn7o3w2yhbi", "username": "gregeoce.bsky.social", "displayName": "Gregeoce", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:6bfbhripser5pbn7o3w2yhbi/bafkreicn32q6d2wnypndguz6x5pkdoz3rim5264ea5fgfblduft4v7ft2m", "verified": false, "url": "https://bsky.app/profile/gregeoce.bsky.social" }, "stats": { "views": null, "likes": 296, "comments": 0, "shares": 151, "saves": 12, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://cdn.bsky.app/img/feed_fullsize/plain/did:plc:6bfbhripser5pbn7o3w2yhbi/bafkreiaxtr67vtaniadjlmuekiwkn4fgdrf46wymzbugndmuhcb7qhji6q", "thumbnailUrl": "https://cdn.bsky.app/img/feed_thumbnail/plain/did:plc:6bfbhripser5pbn7o3w2yhbi/bafkreiaxtr67vtaniadjlmuekiwkn4fgdrf46wymzbugndmuhcb7qhji6q", "width": 2100, "height": 2800, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "cid": "bafyreiejbhydi4i25ulafszwbtilx2hp6zcf6sniwavneh2loiofxmociq", "rkey": "3n34lyluqt22o", "quotes": 0, "langs": [ "zh" ], "replyTo": null, "repost": null, "pinned": false, "quoted": null, "link": null, "altTexts": [], "repliesRestricted": false, "labels": [], "indexedAt": "2026-11-25T07:08:18.242Z" } }, { "id": "at://did:plc:lxhcjiftrg5sakpqqmienly5/app.bsky.feed.post/3n35ivln25c2x", "url": "https://bsky.app/profile/capecodfairytales.bsky.social/post/3n35ivln25c2x", "text": "#Poetry #Painting #Home\n\nI know two of the sweetest words are \n“Welcome home”.\n\nWelcome.\nHome.\n\n- Tanner Olson\n\n.\n🎨 Stephanie Lambourne", "createdAt": "2026-11-25T15:45:24.171Z", "author": { "id": "did:plc:lxhcjiftrg5sakpqqmienly5", "username": "capecodfairytales.bsky.social", "displayName": "Art & Nature", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:lxhcjiftrg5sakpqqmienly5/bafkreial2s244fj5nvoy3n6srdkxag7xeu4nh5qhtktpzpcdon3wpds5im", "verified": false, "url": "https://bsky.app/profile/capecodfairytales.bsky.social" }, "stats": { "views": null, "likes": 232, "comments": 2, "shares": 34, "saves": 8, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://cdn.bsky.app/img/feed_fullsize/plain/did:plc:lxhcjiftrg5sakpqqmienly5/bafkreibjkoznnrw53hn47x3pn5f2hzuw2fsvbhgx256j43uudqpy4qjc5m", "thumbnailUrl": "https://cdn.bsky.app/img/feed_thumbnail/plain/did:plc:lxhcjiftrg5sakpqqmienly5/bafkreibjkoznnrw53hn47x3pn5f2hzuw2fsvbhgx256j43uudqpy4qjc5m", "width": 804, "height": 1006, "durationSeconds": null } ], "hashtags": [ "Poetry", "Painting", "Home" ], "mentions": [], "ext": { "cid": "bafyreib22rjrecc6asw6exn6ebaf3ob7dydvyyifxknrwwxs3s2jibjnvm", "rkey": "3n35ivln25c2x", "quotes": 0, "langs": [ "en" ], "replyTo": null, "repost": null, "pinned": false, "quoted": null, "link": null, "altTexts": [], "repliesRestricted": false, "labels": [], "indexedAt": "2026-11-25T15:45:34.648Z" } } ], "pagination": { "nextCursor": "eyJvIjoiMjAyNi0xMS0yNVQwNjo1MzozNC43MzE5Nzk3NThaIiwibiI6IjIwMjYtMTEtMjVUMTg6NTM6MzQuNzMxOTc5NzU4WiIsInNzIjoiMjAyNi0xMS0yNVQxODo1MzozNC43MzE5Nzk3NThaIiwibHUiOiIyMDI2LTExLTI1VDE4OjUzOjM0Ljc1MjY5MDc2M1oiLCJwZyI6MSwibSI6IkFRQUFBQUFBQUFBSkFBQUFPakFBQUJrQUFBQ0x6d0FBanM4QUFJL1BBQUNVendBQW04OEFBSi9QQUFDa3p3QUFwYzhCQUtiUEFnQ3B6d0VBcTg4QUFLM1BBUUN1endJQXI4OEFBTERQQUFDeHp3RUFzczhBQUxQUEJRQzB6d01BdGM4Q0FMYlBB…", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/bluesky/trending": { "get": { "tags": [ "Bluesky" ], "summary": "The posts of Bluesky's Discover feed, 50 a page.", "description": "What a visitor is shown as trending now. 1 credit a page.", "operationId": "blueskyTrending", "parameters": [ { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_BlueskyPost" }, "example": { "data": [ { "id": "at://did:plc:6bfbhripser5pbn7o3w2yhbi/app.bsky.feed.post/3n34lyluqt22o", "url": "https://bsky.app/profile/gregeoce.bsky.social/post/3n34lyluqt22o", "text": "DEEP DARK NIGHT", "createdAt": "2026-11-25T07:08:06.574Z", "author": { "id": "did:plc:6bfbhripser5pbn7o3w2yhbi", "username": "gregeoce.bsky.social", "displayName": "Gregeoce", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:6bfbhripser5pbn7o3w2yhbi/bafkreicn32q6d2wnypndguz6x5pkdoz3rim5264ea5fgfblduft4v7ft2m", "verified": false, "url": "https://bsky.app/profile/gregeoce.bsky.social" }, "stats": { "views": null, "likes": 296, "comments": 0, "shares": 151, "saves": 12, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://cdn.bsky.app/img/feed_fullsize/plain/did:plc:6bfbhripser5pbn7o3w2yhbi/bafkreiaxtr67vtaniadjlmuekiwkn4fgdrf46wymzbugndmuhcb7qhji6q", "thumbnailUrl": "https://cdn.bsky.app/img/feed_thumbnail/plain/did:plc:6bfbhripser5pbn7o3w2yhbi/bafkreiaxtr67vtaniadjlmuekiwkn4fgdrf46wymzbugndmuhcb7qhji6q", "width": 2100, "height": 2800, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "cid": "bafyreiejbhydi4i25ulafszwbtilx2hp6zcf6sniwavneh2loiofxmociq", "rkey": "3n34lyluqt22o", "quotes": 0, "langs": [ "zh" ], "replyTo": null, "repost": null, "pinned": false, "quoted": null, "link": null, "altTexts": [], "repliesRestricted": false, "labels": [], "indexedAt": "2026-11-25T07:08:18.242Z" } }, { "id": "at://did:plc:lxhcjiftrg5sakpqqmienly5/app.bsky.feed.post/3n35ivln25c2x", "url": "https://bsky.app/profile/capecodfairytales.bsky.social/post/3n35ivln25c2x", "text": "#Poetry #Painting #Home\n\nI know two of the sweetest words are \n“Welcome home”.\n\nWelcome.\nHome.\n\n- Tanner Olson\n\n.\n🎨 Stephanie Lambourne", "createdAt": "2026-11-25T15:45:24.171Z", "author": { "id": "did:plc:lxhcjiftrg5sakpqqmienly5", "username": "capecodfairytales.bsky.social", "displayName": "Art & Nature", "avatarUrl": "https://cdn.bsky.app/img/avatar/plain/did:plc:lxhcjiftrg5sakpqqmienly5/bafkreial2s244fj5nvoy3n6srdkxag7xeu4nh5qhtktpzpcdon3wpds5im", "verified": false, "url": "https://bsky.app/profile/capecodfairytales.bsky.social" }, "stats": { "views": null, "likes": 232, "comments": 2, "shares": 34, "saves": 8, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://cdn.bsky.app/img/feed_fullsize/plain/did:plc:lxhcjiftrg5sakpqqmienly5/bafkreibjkoznnrw53hn47x3pn5f2hzuw2fsvbhgx256j43uudqpy4qjc5m", "thumbnailUrl": "https://cdn.bsky.app/img/feed_thumbnail/plain/did:plc:lxhcjiftrg5sakpqqmienly5/bafkreibjkoznnrw53hn47x3pn5f2hzuw2fsvbhgx256j43uudqpy4qjc5m", "width": 804, "height": 1006, "durationSeconds": null } ], "hashtags": [ "Poetry", "Painting", "Home" ], "mentions": [], "ext": { "cid": "bafyreib22rjrecc6asw6exn6ebaf3ob7dydvyyifxknrwwxs3s2jibjnvm", "rkey": "3n35ivln25c2x", "quotes": 0, "langs": [ "en" ], "replyTo": null, "repost": null, "pinned": false, "quoted": null, "link": null, "altTexts": [], "repliesRestricted": false, "labels": [], "indexedAt": "2026-11-25T15:45:34.648Z" } } ], "pagination": { "nextCursor": "eyJvIjoiMjAyNi0xMS0yNVQwNjo1MzozNC43MzE5Nzk3NThaIiwibiI6IjIwMjYtMTEtMjVUMTg6NTM6MzQuNzMxOTc5NzU4WiIsInNzIjoiMjAyNi0xMS0yNVQxODo1MzozNC43MzE5Nzk3NThaIiwibHUiOiIyMDI2LTExLTI1VDE4OjUzOjM0Ljc1MjY5MDc2M1oiLCJwZyI6MSwibSI6IkFRQUFBQUFBQUFBSkFBQUFPakFBQUJrQUFBQ0x6d0FBanM4QUFJL1BBQUNVendBQW04OEFBSi9QQUFDa3p3QUFwYzhCQUtiUEFnQ3B6d0VBcTg4QUFLM1BBUUN1endJQXI4OEFBTERQQUFDeHp3RUFzczhBQUxQUEJRQzB6d01BdGM4Q0FMYlBB…", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.bluesky.trending();" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.bluesky.trending()" }, { "lang": "bash", "label": "cURL", "source": "curl https://api.socialapi.sh/v1/bluesky/trending \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_BlueskyPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/BlueskyPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "BlueskyPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "cid", "rkey", "langs", "pinned", "altTexts", "repliesRestricted", "labels" ], "properties": { "altTexts": { "type": "array", "items": { "type": "string" }, "description": "Each image's or video's description for screen readers, in `media`'s order; empty\nwhen none has one." }, "cid": { "type": "string", "description": "The record's content hash and its key (the last part of its link)." }, "indexedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "When Bluesky indexed it." }, { "type": "null" } ] }, "labels": { "type": "array", "items": { "type": "string" }, "description": "Labels on the post, by value (`porn`, `graphic-media`…)." }, "langs": { "type": "array", "items": { "type": "string" }, "description": "The languages its author set." }, "link": { "oneOf": [ { "$ref": "#/components/schemas/BlueskyLinkCard" }, { "type": "null" } ] }, "pinned": { "type": "boolean", "description": "Pinned to its author's profile, in that account's posts." }, "quoted": { "oneOf": [ { "$ref": "#/components/schemas/BlueskyQuoted" }, { "type": "null" } ] }, "quotes": { "type": [ "integer", "null" ], "format": "int64", "description": "Posts quoting it.", "minimum": 0 }, "repliesRestricted": { "type": "boolean", "description": "Whether its author limited who may reply." }, "replyTo": { "oneOf": [ { "$ref": "#/components/schemas/BlueskyReplyRef", "description": "What it replies to, when it is a reply." }, { "type": "null" } ] }, "repost": { "oneOf": [ { "$ref": "#/components/schemas/BlueskyRepost", "description": "Who reposted it into this list, in an account's posts." }, { "type": "null" } ] }, "rkey": { "type": "string" } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A post: text, images, a video, a link or a quote." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "BlueskyRepost": { "type": "object", "description": "Who reposted a post into the list it is in, and when.", "required": [ "by" ], "properties": { "at": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "by": { "$ref": "#/components/schemas/Author" } } }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } }, "Timestamp": { "type": "string", "format": "date-time" }, "BlueskyReplyRef": { "type": "object", "description": "The post a reply answers, and the thread's first post.", "required": [ "parent", "root" ], "properties": { "parent": { "type": "string" }, "root": { "type": "string" } } }, "BlueskyQuoted": { "type": "object", "description": "What a post quotes: a post, or a feed, list or starter pack it embeds.", "required": [ "id" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "id": { "type": "string", "description": "Its AT-URI." }, "text": { "type": [ "string", "null" ], "description": "A quoted post's text, or the name of a feed, list or starter pack." }, "url": { "type": [ "string", "null" ] } } }, "BlueskyLinkCard": { "type": "object", "description": "The link a post shares, as its card shows it.", "required": [ "url" ], "properties": { "description": { "type": [ "string", "null" ] }, "thumbnailUrl": { "type": [ "string", "null" ] }, "title": { "type": [ "string", "null" ] }, "url": { "type": "string" } } } } } } ``` # Hashtag (/docs/api-reference/douyin/hashtag) A hashtag with its views. `GET https://api.socialapi.sh/v1/douyin/hashtag` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.douyin.hashtag({ id: "7710474074586679337" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.douyin.hashtag(id="7710474074586679337").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/douyin/hashtag \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "id=7710474074586679337" ``` **Response** ```json { "data": { "id": "7710474074586679337", "name": "把生活过成gta", "description": null, "url": "https://www.douyin.com/hashtag/7710474074586679337", "posts": null, "views": 62593487, "ext": { "coverUrl": "https://p26-sign.douyinpic.com/tos-cn-i-0813c000-ce/owYgiqGAiAAu8BBAMPAByxaHEAIAPpAtgE4bw~noop.jpeg?lk3s=21e102be&x-expires=1795842000&x-signature=fDoBtvkS6udHd4zqa3jVWe2hOag%3D&from=568394430&s=PackSourceEnum_CHALLENGE_AWEME&se=false&sc=cover&biz_tag=aweme_challenge&l=202611280116466644AE24FF5AA7739BB9" } } } ``` **OpenAPI** ```json { "paths": { "/v1/douyin/hashtag": { "get": { "tags": [ "Douyin" ], "summary": "A hashtag with its views.", "description": "Its name, description and picture. 1 credit.", "operationId": "douyinHashtag", "parameters": [ { "name": "url", "in": "query", "description": "Its link, or a share link.", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "Its id, instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_DouyinHashtag" }, "example": { "data": { "id": "7710474074586679337", "name": "把生活过成gta", "description": null, "url": "https://www.douyin.com/hashtag/7710474074586679337", "posts": null, "views": 62593487, "ext": { "coverUrl": "https://p26-sign.douyinpic.com/tos-cn-i-0813c000-ce/owYgiqGAiAAu8BBAMPAByxaHEAIAPpAtgE4bw~noop.jpeg?lk3s=21e102be&x-expires=1795842000&x-signature=fDoBtvkS6udHd4zqa3jVWe2hOag%3D&from=568394430&s=PackSourceEnum_CHALLENGE_AWEME&se=false&sc=cover&biz_tag=aweme_challenge&l=202611280116466644AE24FF5AA7739BB9" } } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.douyin.hashtag({ id: \"7710474074586679337\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.douyin.hashtag(id=\"7710474074586679337\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/douyin/hashtag \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"id=7710474074586679337\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_DouyinHashtag": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/DouyinHashtag" } } }, "DouyinHashtag": { "allOf": [ { "type": "object", "description": "A hashtag.", "required": [ "id", "name", "url", "ext" ], "properties": { "description": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "properties": { "coverUrl": { "type": [ "string", "null" ], "description": "Its picture." } } }, { "type": "object", "description": "What only this platform has." } ] }, "id": { "type": "string" }, "name": { "type": "string", "description": "Without `#`." }, "posts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "url": { "type": "string" }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, { "type": "object", "description": "A hashtag (challenge)." } ] } } } } ``` # Douyin API (/docs/api-reference/douyin) Every Douyin endpoint, by group. Each is a `GET` under `/v1/douyin`. ## Quick Reference [#quick-reference] | Property | Value | | --- | --- | | Base path | `/v1/douyin` | | Endpoints | 15 | | Credits | See Below | | Guide | [Douyin](/docs/douyin) | ## Accounts [#accounts] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/douyin/profile`](/docs/api-reference/douyin/profile) | An account with its followers, likes and post count. | 2 | | [`GET /v1/douyin/profile/playlists`](/docs/api-reference/douyin/profile-playlists) | An account's series (合集). | 1 | | [`GET /v1/douyin/profile/posts`](/docs/api-reference/douyin/profile-posts) | An account's latest posts, about 10. | 2 | | [`GET /v1/douyin/live`](/docs/api-reference/douyin/live) | A live room, on air or not. | 1 | ## Posts [#posts] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/douyin/playlist/posts`](/docs/api-reference/douyin/playlist-posts) | A series' posts, in order, 10 a page. | 1 | | [`GET /v1/douyin/post`](/docs/api-reference/douyin/post) | One post with its likes, comments, shares and saves. | 2 | | [`GET /v1/douyin/post/comments`](/docs/api-reference/douyin/post-comments) | A post's comments, 20 a page. | 1 | | [`GET /v1/douyin/post/comment/replies`](/docs/api-reference/douyin/post-comment-replies) | A comment's replies, up to 50. | 1 | | [`GET /v1/douyin/post/related`](/docs/api-reference/douyin/post-related) | Posts like a post, 10. | 1 | ## Discovery [#discovery] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/douyin/hashtag`](/docs/api-reference/douyin/hashtag) | A hashtag with its views. | 1 | | [`GET /v1/douyin/search/suggestions`](/docs/api-reference/douyin/search-suggestions) | What Douyin's search box suggests for a query. | 1 | | [`GET /v1/douyin/sound`](/docs/api-reference/douyin/sound) | A sound with the number of posts using it. | 1 | | [`GET /v1/douyin/sound/posts`](/docs/api-reference/douyin/sound-posts) | Posts using a sound. | 1 | | [`GET /v1/douyin/trending`](/docs/api-reference/douyin/trending) | Douyin's hot search list, about 50. | 10 | | [`GET /v1/douyin/trending/posts`](/docs/api-reference/douyin/trending-posts) | Recommended posts, 10, or a category's. | 1 | ## Example Request [#example-request] Every Douyin endpoint is called this way: its path, and what to read as query parameters. **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.douyin.profile({ secUid: "MS4wLjABAAAA8U_l6rBzmy7bcy6xOJel4v0RzoR_wfAubGPeJimN__4" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.douyin.profile(sec_uid="MS4wLjABAAAA8U_l6rBzmy7bcy6xOJel4v0RzoR_wfAubGPeJimN__4").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/douyin/profile \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "secUid=MS4wLjABAAAA8U_l6rBzmy7bcy6xOJel4v0RzoR_wfAubGPeJimN__4" ``` **Response** ```json { "data": { "id": "104255897823", "username": "rmrbxmt", "displayName": "人民日报", "bio": "参与、沟通、记录时代。", "avatarUrl": "https://p3-pc.douyinpic.com/aweme/1080x1080/aweme-avatar/tos-cn-avt-0015_21b4383e542b8991bcd33d33eeda7d8d.jpeg?from=2956013662", "url": "https://www.douyin.com/user/MS4wLjABAAAA8U_l6rBzmy7bcy6xOJel4v0RzoR_wfAubGPeJimN__4", "verified": true, "private": false, "followers": 203912912, "following": 35, "likes": 19445869999, "posts": 12986, "externalUrl": null, "createdAt": null, "ext": { "secUid": "MS4wLjABAAAA8U_l6rBzmy7bcy6xOJel4v0RzoR_wfAubGPeJimN__4", "shortId": null, "verification": "人民日报官方账号", "ipLocation": null, "live": false, "series": 0, "coverUrl": "https://p3-pc-sign.douyinpic.com/obj/douyin-user-image-file/a0fed342d45f11ee57830326fa8bb1b1?lk3s=93de098e&x-expires=1795971600&x-signature=BQcW6nFUv7nzrCmTA6wyIHE29%2BM%3D&from=2480802190" } } } ``` ## Errors [#errors] A call that fails costs nothing. See [Errors](/docs/errors) for every code. # Live (/docs/api-reference/douyin/live) A live room, on air or not. `GET https://api.socialapi.sh/v1/douyin/live` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.douyin.live({ url: "https://live.douyin.com/80017709309" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.douyin.live(url="https://live.douyin.com/80017709309").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/douyin/live \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://live.douyin.com/80017709309" ``` **Response** ```json { "data": { "live": false, "roomId": "7712820303966997282", "title": "美好生活,尽在东方甄选", "viewers": null, "startedAt": null, "coverUrl": null, "host": { "id": "2384194153219051", "username": "2384194153219051", "displayName": "东方甄选", "avatarUrl": "https://p11.douyinpic.com/aweme/100x100/aweme-avatar/tos-cn-avt-0015_ee06287c378b803c3ce54e33f5b9cfd2.jpeg?from=3067671334", "verified": false, "url": "https://www.douyin.com/user/MS4wLjABAAAAcud_llwUN1kpfpzeb3Xqbq8nsRwU7lxVzg3OSv31hNMPz95UspEw1L53dX-UDrE4" }, "ext": { "webRid": "80017709309", "likes": null, "totalViewers": null, "playbackUrl": null } } } ``` **OpenAPI** ```json { "paths": { "/v1/douyin/live": { "get": { "tags": [ "Douyin" ], "summary": "A live room, on air or not.", "description": "Its title, viewers now, likes, cover, its host and, while on air, its stream's\nplaylist (signed; it expires). Kept a minute. 1 credit.", "operationId": "douyinLive", "parameters": [ { "name": "url", "in": "query", "description": "The room's link (`https://live.douyin.com/80017709309`).", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The number in its link, instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_DouyinLive" }, "example": { "data": { "live": false, "roomId": "7712820303966997282", "title": "美好生活,尽在东方甄选", "viewers": null, "startedAt": null, "coverUrl": null, "host": { "id": "2384194153219051", "username": "2384194153219051", "displayName": "东方甄选", "avatarUrl": "https://p11.douyinpic.com/aweme/100x100/aweme-avatar/tos-cn-avt-0015_ee06287c378b803c3ce54e33f5b9cfd2.jpeg?from=3067671334", "verified": false, "url": "https://www.douyin.com/user/MS4wLjABAAAAcud_llwUN1kpfpzeb3Xqbq8nsRwU7lxVzg3OSv31hNMPz95UspEw1L53dX-UDrE4" }, "ext": { "webRid": "80017709309", "likes": null, "totalViewers": null, "playbackUrl": null } } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.douyin.live({ url: \"https://live.douyin.com/80017709309\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.douyin.live(url=\"https://live.douyin.com/80017709309\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/douyin/live \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://live.douyin.com/80017709309\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_DouyinLive": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/DouyinLive" } } }, "DouyinLive": { "allOf": [ { "type": "object", "description": "An account's live broadcast.", "required": [ "live", "ext" ], "properties": { "coverUrl": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "properties": { "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "playbackUrl": { "type": [ "string", "null" ], "description": "The stream's HLS playlist, signed; it expires." }, "totalViewers": { "type": [ "string", "null" ], "description": "People who have watched, as Douyin shows it (`10万+`)." }, "webRid": { "type": [ "string", "null" ], "description": "The number in the room's link (`live.douyin.com/`)." } } }, { "type": "object", "description": "What only this platform has." } ] }, "host": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "live": { "type": "boolean" }, "roomId": { "type": [ "string", "null" ] }, "startedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "title": { "type": [ "string", "null" ] }, "viewers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, { "type": "object", "description": "A live room." } ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Playlist Posts (/docs/api-reference/douyin/playlist-posts) A series' posts, in order, 10 a page. `GET https://api.socialapi.sh/v1/douyin/playlist/posts` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.douyin.playlistPosts({ id: "7667116913554556968" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.douyin.playlist_posts(id="7667116913554556968") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/douyin/playlist/posts \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "id=7667116913554556968" ``` **Response** ```json { "data": [ { "id": "7700910468847766835", "url": "https://www.douyin.com/video/7700910468847766835", "text": "开心锤锤世界 34集:姐弟情深 #搞笑 #动漫 #开心锤锤世界", "createdAt": "2026-10-27T04:00:00.000Z", "author": { "id": "12449822571", "username": "chuichuikaixin", "displayName": "开心锤锤", "avatarUrl": "https://p3-pc.douyinpic.com/aweme/100x100/aweme-avatar/mosaic-legacy_a1780015deb10ede8a57.jpeg?from=327834062", "verified": true, "url": "https://www.douyin.com/user/MS4wLjABAAAAoDPbeBJwY9IpoMFWKaDAPR7WXPset_2zjILeb65yPeg" }, "stats": { "views": 764871, "likes": 10365, "comments": 82, "shares": 152, "saves": 1720, "engagementRate": 0.0139 }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://p3-pc-sign.douyinpic.com/image-cut-tos-priv/6fe054721e3755d1a9837438290d6ae7~tplv-dy-resize-origshort-autoq-75:330.jpeg?lk3s=138a59ce&x-expires=2111158800&x-signature=N%2BwvXg%2F2R5pOW55KDtVby62E6%2FQ%3D&from=327834062&s=PackSourceEnum_MIX_AWEME&se=false&sc=cover&biz_tag=pcweb_cover&l=20261128011641FCDCD2C84267F6FA0A9A", "width": 1920, "height": 1080, "durationSeconds": 269.189 } ], "hashtags": [ "搞笑", "动漫", "开心锤锤世界" ], "mentions": [], "ext": { "kind": "video", "title": "开心锤锤世界 34集:姐弟情深", "durationSeconds": 269.189, "recommends": 62, "pinned": false, "series": { "id": "7667116913554556968", "name": "《开心锤锤世界》", "episode": 1 }, "sound": { "id": "7700910648506469130", "title": "@开心锤锤创作的原声", "author": "开心锤锤" }, "categories": [ "二次元", "二次元内容", "动漫IP" ] } }, { "id": "7698214616941317385", "url": "https://www.douyin.com/video/7698214616941317385", "text": "开心锤锤世界 35集:王老师的午休 #搞笑 #动漫 #开心锤锤世界", "createdAt": "2026-10-24T04:00:00.000Z", "author": { "id": "12449822571", "username": "chuichuikaixin", "displayName": "开心锤锤", "avatarUrl": "https://p3-pc.douyinpic.com/aweme/100x100/aweme-avatar/mosaic-legacy_a1780015deb10ede8a57.jpeg?from=327834062", "verified": true, "url": "https://www.douyin.com/user/MS4wLjABAAAAoDPbeBJwY9IpoMFWKaDAPR7WXPset_2zjILeb65yPeg" }, "stats": { "views": 810812, "likes": 11515, "comments": 22, "shares": 117, "saves": 1551, "engagementRate": 0.0144 }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://p3-pc-sign.douyinpic.com/image-cut-tos-priv/81b70264561ee1d58ae1221a3ea3e3a2~tplv-dy-resize-origshort-autoq-75:330.jpeg?lk3s=138a59ce&x-expires=2111158800&x-signature=czzFj3KfMs5sTAr8Sz%2Bxo4LGxp0%3D&from=327834062&s=PackSourceEnum_MIX_AWEME&se=false&sc=cover&biz_tag=pcweb_cover&l=20261128011641FCDCD2C84267F6FA0A9A", "width": 1920, "height": 1080, "durationSeconds": 258.995 } ], "hashtags": [ "搞笑", "动漫", "开心锤锤世界" ], "mentions": [], "ext": { "kind": "video", "title": "开心锤锤世界 35集:王老师的午休", "durationSeconds": 258.995, "recommends": 44, "pinned": false, "series": { "id": "7667116913554556968", "name": "《开心锤锤世界》", "episode": 2 }, "sound": { "id": "7698214685874686739", "title": "@开心锤锤创作的原声", "author": "开心锤锤" }, "categories": [ "二次元", "二次元内容", "动漫IP" ] } } ], "pagination": { "nextCursor": "10", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/douyin/playlist/posts": { "get": { "tags": [ "Douyin" ], "summary": "A series' posts, in order, 10 a page.", "description": "A series (合集) pages to its last episode. 1 credit a page.", "operationId": "douyinPlaylistPosts", "parameters": [ { "name": "url", "in": "query", "description": "Its link, or a share link.", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "Its id, instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_DouyinPost" }, "example": { "data": [ { "id": "7700910468847766835", "url": "https://www.douyin.com/video/7700910468847766835", "text": "开心锤锤世界 34集:姐弟情深 #搞笑 #动漫 #开心锤锤世界", "createdAt": "2026-10-27T04:00:00.000Z", "author": { "id": "12449822571", "username": "chuichuikaixin", "displayName": "开心锤锤", "avatarUrl": "https://p3-pc.douyinpic.com/aweme/100x100/aweme-avatar/mosaic-legacy_a1780015deb10ede8a57.jpeg?from=327834062", "verified": true, "url": "https://www.douyin.com/user/MS4wLjABAAAAoDPbeBJwY9IpoMFWKaDAPR7WXPset_2zjILeb65yPeg" }, "stats": { "views": 764871, "likes": 10365, "comments": 82, "shares": 152, "saves": 1720, "engagementRate": 0.0139 }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://p3-pc-sign.douyinpic.com/image-cut-tos-priv/6fe054721e3755d1a9837438290d6ae7~tplv-dy-resize-origshort-autoq-75:330.jpeg?lk3s=138a59ce&x-expires=2111158800&x-signature=N%2BwvXg%2F2R5pOW55KDtVby62E6%2FQ%3D&from=327834062&s=PackSourceEnum_MIX_AWEME&se=false&sc=cover&biz_tag=pcweb_cover&l=20261128011641FCDCD2C84267F6FA0A9A", "width": 1920, "height": 1080, "durationSeconds": 269.189 } ], "hashtags": [ "搞笑", "动漫", "开心锤锤世界" ], "mentions": [], "ext": { "kind": "video", "title": "开心锤锤世界 34集:姐弟情深", "durationSeconds": 269.189, "recommends": 62, "pinned": false, "series": { "id": "7667116913554556968", "name": "《开心锤锤世界》", "episode": 1 }, "sound": { "id": "7700910648506469130", "title": "@开心锤锤创作的原声", "author": "开心锤锤" }, "categories": [ "二次元", "二次元内容", "动漫IP" ] } }, { "id": "7698214616941317385", "url": "https://www.douyin.com/video/7698214616941317385", "text": "开心锤锤世界 35集:王老师的午休 #搞笑 #动漫 #开心锤锤世界", "createdAt": "2026-10-24T04:00:00.000Z", "author": { "id": "12449822571", "username": "chuichuikaixin", "displayName": "开心锤锤", "avatarUrl": "https://p3-pc.douyinpic.com/aweme/100x100/aweme-avatar/mosaic-legacy_a1780015deb10ede8a57.jpeg?from=327834062", "verified": true, "url": "https://www.douyin.com/user/MS4wLjABAAAAoDPbeBJwY9IpoMFWKaDAPR7WXPset_2zjILeb65yPeg" }, "stats": { "views": 810812, "likes": 11515, "comments": 22, "shares": 117, "saves": 1551, "engagementRate": 0.0144 }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://p3-pc-sign.douyinpic.com/image-cut-tos-priv/81b70264561ee1d58ae1221a3ea3e3a2~tplv-dy-resize-origshort-autoq-75:330.jpeg?lk3s=138a59ce&x-expires=2111158800&x-signature=czzFj3KfMs5sTAr8Sz%2Bxo4LGxp0%3D&from=327834062&s=PackSourceEnum_MIX_AWEME&se=false&sc=cover&biz_tag=pcweb_cover&l=20261128011641FCDCD2C84267F6FA0A9A", "width": 1920, "height": 1080, "durationSeconds": 258.995 } ], "hashtags": [ "搞笑", "动漫", "开心锤锤世界" ], "mentions": [], "ext": { "kind": "video", "title": "开心锤锤世界 35集:王老师的午休", "durationSeconds": 258.995, "recommends": 44, "pinned": false, "series": { "id": "7667116913554556968", "name": "《开心锤锤世界》", "episode": 2 }, "sound": { "id": "7698214685874686739", "title": "@开心锤锤创作的原声", "author": "开心锤锤" }, "categories": [ "二次元", "二次元内容", "动漫IP" ] } } ], "pagination": { "nextCursor": "10", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.douyin.playlistPosts({ id: \"7667116913554556968\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.douyin.playlist_posts(id=\"7667116913554556968\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/douyin/playlist/posts \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"id=7667116913554556968\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_DouyinPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/DouyinPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "DouyinPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "kind", "pinned", "categories" ], "properties": { "categories": { "type": "array", "items": { "type": "string" }, "description": "Douyin's categories for it, broadest first (`游戏`, `角色扮演`)." }, "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "kind": { "$ref": "#/components/schemas/DouyinPostKind" }, "pinned": { "type": "boolean", "description": "Pinned to the top of its account." }, "recommends": { "type": [ "integer", "null" ], "format": "int64", "description": "Times recommended to others (推荐).", "minimum": 0 }, "series": { "oneOf": [ { "$ref": "#/components/schemas/DouyinSeriesRef" }, { "type": "null" } ] }, "sound": { "oneOf": [ { "$ref": "#/components/schemas/DouyinSoundRef" }, { "type": "null" } ] }, "title": { "type": [ "string", "null" ], "description": "Its title, where it has one apart from its caption." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A Douyin video or photo set." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "DouyinSoundRef": { "type": "object", "description": "The sound a post uses.", "required": [ "id" ], "properties": { "author": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "title": { "type": [ "string", "null" ] } } }, "DouyinSeriesRef": { "type": "object", "description": "A series (合集) a post is in.", "required": [ "id" ], "properties": { "episode": { "type": [ "integer", "null" ], "format": "int64", "description": "Its place in the series.", "minimum": 0 }, "id": { "type": "string" }, "name": { "type": [ "string", "null" ] } } }, "DouyinPostKind": { "type": "string", "description": "What a post is.", "enum": [ "video", "images" ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Post Comment Replies (/docs/api-reference/douyin/post-comment-replies) A comment's replies, up to 50. `GET https://api.socialapi.sh/v1/douyin/post/comment/replies` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.douyin.postCommentReplies({ url: "https://www.douyin.com/video/7711656915507399971", commentId: "7711706345209463593" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.douyin.post_comment_replies(url="https://www.douyin.com/video/7711656915507399971", comment_id="7711706345209463593") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/douyin/post/comment/replies \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://www.douyin.com/video/7711656915507399971" \ --data-urlencode "commentId=7711706345209463593" ``` **Response** ```json { "data": [ { "id": "7711706993350853414", "postId": "7711656915507399971", "parentId": "7711706345209463593", "text": "相当于你给10块钱", "createdAt": "2026-11-24T12:01:44.000Z", "author": { "id": "72164621177", "username": "72164621177", "displayName": "洗完澡酷似小跳蛙", "avatarUrl": "https://p3-pc.douyinpic.com/aweme/100x100/aweme-avatar/tos-cn-avt-0015_7fe99063f574924466c5ccf6bc4f091b.jpeg?from=2064092626", "verified": false, "url": "https://www.douyin.com/user/MS4wLjABAAAA-2yEKlaPznXdac0w74Hi-0TRApVMKLjkn5RhBG0ZynY" }, "likes": 6325, "replies": null, "ext": { "ipLabel": "湖南", "replyTo": null, "authorLiked": false, "images": [] } }, { "id": "7711708122280641329", "postId": "7711656915507399971", "parentId": "7711706345209463593", "text": "感觉他已经对钱没有概念了[捂脸]", "createdAt": "2026-11-24T12:06:07.000Z", "author": { "id": "2288514064465708", "username": "2288514064465708", "displayName": "乐", "avatarUrl": "https://p3-pc.douyinpic.com/aweme/100x100/aweme-avatar/tos-cn-i-0813c000-ce_oQ2jZANA9IfAuesfjCEArsDqAo9FEEroEw37jt.jpeg?from=2064092626", "verified": false, "url": "https://www.douyin.com/user/MS4wLjABAAAASXlk3mzSCuSI2EZkUJhLkgq-4DdCNSqTCubwWjajom3fduLGg8YY3wJgSN38Ky55" }, "likes": 3306, "replies": null, "ext": { "ipLabel": "江苏", "replyTo": "7711706993350853414", "authorLiked": false, "images": [] } } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/douyin/post/comment/replies": { "get": { "tags": [ "Douyin" ], "summary": "A comment's replies, up to 50.", "description": "The first 50, which is what Douyin shows a visitor, each naming the comment it is\nunder and the reply it answers. 1 credit a reply returned.", "operationId": "douyinPostCommentReplies", "parameters": [ { "name": "url", "in": "query", "description": "The post's link or a share link.", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "Its id, instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "commentId", "in": "query", "description": "The comment's `id`.", "required": true, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_DouyinComment" }, "example": { "data": [ { "id": "7711706993350853414", "postId": "7711656915507399971", "parentId": "7711706345209463593", "text": "相当于你给10块钱", "createdAt": "2026-11-24T12:01:44.000Z", "author": { "id": "72164621177", "username": "72164621177", "displayName": "洗完澡酷似小跳蛙", "avatarUrl": "https://p3-pc.douyinpic.com/aweme/100x100/aweme-avatar/tos-cn-avt-0015_7fe99063f574924466c5ccf6bc4f091b.jpeg?from=2064092626", "verified": false, "url": "https://www.douyin.com/user/MS4wLjABAAAA-2yEKlaPznXdac0w74Hi-0TRApVMKLjkn5RhBG0ZynY" }, "likes": 6325, "replies": null, "ext": { "ipLabel": "湖南", "replyTo": null, "authorLiked": false, "images": [] } }, { "id": "7711708122280641329", "postId": "7711656915507399971", "parentId": "7711706345209463593", "text": "感觉他已经对钱没有概念了[捂脸]", "createdAt": "2026-11-24T12:06:07.000Z", "author": { "id": "2288514064465708", "username": "2288514064465708", "displayName": "乐", "avatarUrl": "https://p3-pc.douyinpic.com/aweme/100x100/aweme-avatar/tos-cn-i-0813c000-ce_oQ2jZANA9IfAuesfjCEArsDqAo9FEEroEw37jt.jpeg?from=2064092626", "verified": false, "url": "https://www.douyin.com/user/MS4wLjABAAAASXlk3mzSCuSI2EZkUJhLkgq-4DdCNSqTCubwWjajom3fduLGg8YY3wJgSN38Ky55" }, "likes": 3306, "replies": null, "ext": { "ipLabel": "江苏", "replyTo": "7711706993350853414", "authorLiked": false, "images": [] } } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.douyin.postCommentReplies({ url: \"https://www.douyin.com/video/7711656915507399971\", commentId: \"7711706345209463593\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.douyin.post_comment_replies(url=\"https://www.douyin.com/video/7711656915507399971\", comment_id=\"7711706345209463593\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/douyin/post/comment/replies \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://www.douyin.com/video/7711656915507399971\" \\\n --data-urlencode \"commentId=7711706345209463593\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_DouyinComment": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/DouyinComment" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "DouyinComment": { "allOf": [ { "type": "object", "description": "A comment or a reply.", "required": [ "id", "postId", "text", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "authorLiked", "images" ], "properties": { "authorLiked": { "type": "boolean", "description": "Liked by the post's author." }, "images": { "type": "array", "items": { "type": "string" }, "description": "The pictures in it." }, "ipLabel": { "type": [ "string", "null" ], "description": "The province or country it was written from (`四川`)." }, "replyTo": { "type": [ "string", "null" ], "description": "The reply it answers, under the same comment." } } }, { "type": "object", "description": "What only this platform has." } ] }, "id": { "type": "string" }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "parentId": { "type": [ "string", "null" ], "description": "The comment this replies to; absent on a top-level comment." }, "postId": { "type": "string" }, "replies": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "text": { "type": "string" } } }, { "type": "object", "description": "A comment or a reply." } ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Post Comments (/docs/api-reference/douyin/post-comments) A post's comments, 20 a page. `GET https://api.socialapi.sh/v1/douyin/post/comments` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.douyin.postComments({ url: "https://www.douyin.com/video/7711656915507399971" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.douyin.post_comments(url="https://www.douyin.com/video/7711656915507399971") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/douyin/post/comments \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://www.douyin.com/video/7711656915507399971" ``` **Response** ```json { "data": [ { "id": "7711706345209463593", "postId": "7711656915507399971", "parentId": null, "text": "他根本不想给那么多钱,银行十万美金他坐在旁边紧张了", "createdAt": "2026-11-24T11:59:13.000Z", "author": { "id": "96764987372", "username": "783877977", "displayName": "北极海", "avatarUrl": "https://p3-pc.douyinpic.com/aweme/100x100/aweme-avatar/tos-cn-i-0813c001_ocaJE9C1AgAIFDeyAiHAfASAaAhBbi5AQNuA0A.jpeg?from=2064092626", "verified": false, "url": "https://www.douyin.com/user/MS4wLjABAAAAZ-q_k_y6PBwxm3ypPTWxG-affH4949r2TUolmeXn-KI" }, "likes": 26424, "replies": 382, "ext": { "ipLabel": "四川", "replyTo": null, "authorLiked": false, "images": [] } }, { "id": "7711757311761662771", "postId": "7711656915507399971", "parentId": null, "text": "老妈“你做什么赢的?” “呃。。。我杀了几个警察,抢了一架飞机。。。”", "createdAt": "2026-11-24T15:22:18.000Z", "author": { "id": "78140758852", "username": "glen8888", "displayName": "给我个面子", "avatarUrl": "https://p3-pc.douyinpic.com/aweme/100x100/aweme-avatar/tos-cn-avt-0015_506da8360a97fbf10e8908cc3e77901d.jpeg?from=2064092626", "verified": false, "url": "https://www.douyin.com/user/MS4wLjABAAAAFbcN3nemx7wkKFTOIgjqkKvOdS0Zns99Sug5WJHif7w" }, "likes": 6952, "replies": 44, "ext": { "ipLabel": "浙江", "replyTo": null, "authorLiked": false, "images": [] } } ], "pagination": { "nextCursor": "20", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/douyin/post/comments": { "get": { "tags": [ "Douyin" ], "summary": "A post's comments, 20 a page.", "description": "Each with its author, likes, reply count, where it was written from and whether the\npost's author liked it. 1 credit a comment returned.", "operationId": "douyinPostComments", "parameters": [ { "name": "url", "in": "query", "description": "The post's link or a share link.", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "Its id, instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_DouyinComment" }, "example": { "data": [ { "id": "7711706345209463593", "postId": "7711656915507399971", "parentId": null, "text": "他根本不想给那么多钱,银行十万美金他坐在旁边紧张了", "createdAt": "2026-11-24T11:59:13.000Z", "author": { "id": "96764987372", "username": "783877977", "displayName": "北极海", "avatarUrl": "https://p3-pc.douyinpic.com/aweme/100x100/aweme-avatar/tos-cn-i-0813c001_ocaJE9C1AgAIFDeyAiHAfASAaAhBbi5AQNuA0A.jpeg?from=2064092626", "verified": false, "url": "https://www.douyin.com/user/MS4wLjABAAAAZ-q_k_y6PBwxm3ypPTWxG-affH4949r2TUolmeXn-KI" }, "likes": 26424, "replies": 382, "ext": { "ipLabel": "四川", "replyTo": null, "authorLiked": false, "images": [] } }, { "id": "7711757311761662771", "postId": "7711656915507399971", "parentId": null, "text": "老妈“你做什么赢的?” “呃。。。我杀了几个警察,抢了一架飞机。。。”", "createdAt": "2026-11-24T15:22:18.000Z", "author": { "id": "78140758852", "username": "glen8888", "displayName": "给我个面子", "avatarUrl": "https://p3-pc.douyinpic.com/aweme/100x100/aweme-avatar/tos-cn-avt-0015_506da8360a97fbf10e8908cc3e77901d.jpeg?from=2064092626", "verified": false, "url": "https://www.douyin.com/user/MS4wLjABAAAAFbcN3nemx7wkKFTOIgjqkKvOdS0Zns99Sug5WJHif7w" }, "likes": 6952, "replies": 44, "ext": { "ipLabel": "浙江", "replyTo": null, "authorLiked": false, "images": [] } } ], "pagination": { "nextCursor": "20", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.douyin.postComments({ url: \"https://www.douyin.com/video/7711656915507399971\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.douyin.post_comments(url=\"https://www.douyin.com/video/7711656915507399971\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/douyin/post/comments \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://www.douyin.com/video/7711656915507399971\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_DouyinComment": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/DouyinComment" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "DouyinComment": { "allOf": [ { "type": "object", "description": "A comment or a reply.", "required": [ "id", "postId", "text", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "authorLiked", "images" ], "properties": { "authorLiked": { "type": "boolean", "description": "Liked by the post's author." }, "images": { "type": "array", "items": { "type": "string" }, "description": "The pictures in it." }, "ipLabel": { "type": [ "string", "null" ], "description": "The province or country it was written from (`四川`)." }, "replyTo": { "type": [ "string", "null" ], "description": "The reply it answers, under the same comment." } } }, { "type": "object", "description": "What only this platform has." } ] }, "id": { "type": "string" }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "parentId": { "type": [ "string", "null" ], "description": "The comment this replies to; absent on a top-level comment." }, "postId": { "type": "string" }, "replies": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "text": { "type": "string" } } }, { "type": "object", "description": "A comment or a reply." } ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Post Related (/docs/api-reference/douyin/post-related) Posts like a post, 10. `GET https://api.socialapi.sh/v1/douyin/post/related` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.douyin.postRelated({ url: "https://www.douyin.com/video/7711656915507399971" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.douyin.post_related(url="https://www.douyin.com/video/7711656915507399971") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/douyin/post/related \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://www.douyin.com/video/7711656915507399971" ``` **Response** ```json { "data": [ { "id": "7692037468770751985", "url": "https://www.douyin.com/video/7692037468770751985", "text": "vamos!#Horcus #nephh", "createdAt": "2026-10-02T11:53:55.000Z", "author": { "id": "545778251345223", "username": "lsq20090409", "displayName": "树莓味", "avatarUrl": "https://p3-pc.douyinpic.com/aweme/100x100/aweme-avatar/tos-cn-avt-0015_87a9c15a6aa6c3839a88ed7ac092a5f9.jpeg?from=327834062", "verified": false, "url": "https://www.douyin.com/user/MS4wLjABAAAAw2bEsjqJ5CWe2VEtNh_uqVb_NCf_60v2cQsF10GDxNM" }, "stats": { "views": null, "likes": 25017, "comments": 87, "shares": 4812, "saves": 559, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://p3-pc-sign.douyinpic.com/image-cut-tos-priv/0915a5806f27dbe5a18d9d1c6f8a0f94~tplv-dy-resize-origshort-autoq-75:330.jpeg?lk3s=138a59ce&x-expires=2111158800&x-signature=ckm%2Ba3dufCQJuZTCHlc1L8yxMUg%3D&from=327834062&s=PackSourceEnum_WEBPC_RELATED_AWEME&se=false&sc=cover&biz_tag=pcweb_cover&l=202611280116437CBC79D857F7DA5F95CC", "width": 3114, "height": 2160, "durationSeconds": 9.8 } ], "hashtags": [ "horcus", "nephh" ], "mentions": [], "ext": { "kind": "video", "title": null, "durationSeconds": 9.8, "recommends": 1172, "pinned": false, "series": null, "sound": { "id": "7684220008419216171", "title": "@Billionhappy创作的原声", "author": "Billionhappy" }, "categories": [ "随拍", "人物随拍", "多人随拍" ] } }, { "id": "7710254573662784804", "url": "https://www.douyin.com/video/7710254573662784804", "text": "日赚500万刀!GTA6无限刷钱2.0简化版,不读档少跑图,效率翻倍! #GTA6#GTA#PS5", "createdAt": "2026-11-20T14:05:46.000Z", "author": { "id": "4301742558951459", "username": "zeldaxiaoma", "displayName": "塞尔达小马", "avatarUrl": "https://p3-pc.douyinpic.com/aweme/100x100/aweme-avatar/tos-cn-avt-0015_db02b2db1e51fd7439bf57669ba18e08.jpeg?from=327834062", "verified": false, "url": "https://www.douyin.com/user/MS4wLjABAAAA8Sz9EnBpazNKHRiyTrHCFwsaJUHtPPCODnn_eF0KEMmcKxCKzr2VNxLcOKq0OZHO" }, "stats": { "views": null, "likes": 17752, "comments": 714, "shares": 3581, "saves": 13703, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://p3-pc-sign.douyinpic.com/image-cut-tos/0abc9c6951598c6340007b7973879089~tplv-dy-resize-origshort-autoq-75:330.jpeg?lk3s=138a59ce&x-expires=2111158800&x-signature=6idxpd6nP0Q1e7rP5jtkxhKKJoA%3D&from=327834062&s=PackSourceEnum_WEBPC_RELATED_AWEME&se=false&sc=cover&biz_tag=pcweb_cover&l=202611280116437CBC79D857F7DA5F95CC", "width": 3840, "height": 2160, "durationSeconds": 242.134 } ], "hashtags": [ "GTA6", "GTA", "PS5" ], "mentions": [], "ext": { "kind": "video", "title": null, "durationSeconds": 242.134, "recommends": 173, "pinned": false, "series": { "id": "7710257537177618467", "name": "GTA6", "episode": 2 }, "sound": { "id": "7710254621746301723", "title": "@塞尔达小马创作的原声", "author": "塞尔达小马" }, "categories": [ "游戏", "角色扮演" ] } } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/douyin/post/related": { "get": { "tags": [ "Douyin" ], "summary": "Posts like a post, 10.", "description": "What Douyin recommends beside it, each with its counts. 1 credit.", "operationId": "douyinPostRelated", "parameters": [ { "name": "url", "in": "query", "description": "The post's link (`https://www.douyin.com/video/7711656915507399971`) or a share\nlink (`https://v.douyin.com/…`).", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "Its id, instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_DouyinPost" }, "example": { "data": [ { "id": "7692037468770751985", "url": "https://www.douyin.com/video/7692037468770751985", "text": "vamos!#Horcus #nephh", "createdAt": "2026-10-02T11:53:55.000Z", "author": { "id": "545778251345223", "username": "lsq20090409", "displayName": "树莓味", "avatarUrl": "https://p3-pc.douyinpic.com/aweme/100x100/aweme-avatar/tos-cn-avt-0015_87a9c15a6aa6c3839a88ed7ac092a5f9.jpeg?from=327834062", "verified": false, "url": "https://www.douyin.com/user/MS4wLjABAAAAw2bEsjqJ5CWe2VEtNh_uqVb_NCf_60v2cQsF10GDxNM" }, "stats": { "views": null, "likes": 25017, "comments": 87, "shares": 4812, "saves": 559, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://p3-pc-sign.douyinpic.com/image-cut-tos-priv/0915a5806f27dbe5a18d9d1c6f8a0f94~tplv-dy-resize-origshort-autoq-75:330.jpeg?lk3s=138a59ce&x-expires=2111158800&x-signature=ckm%2Ba3dufCQJuZTCHlc1L8yxMUg%3D&from=327834062&s=PackSourceEnum_WEBPC_RELATED_AWEME&se=false&sc=cover&biz_tag=pcweb_cover&l=202611280116437CBC79D857F7DA5F95CC", "width": 3114, "height": 2160, "durationSeconds": 9.8 } ], "hashtags": [ "horcus", "nephh" ], "mentions": [], "ext": { "kind": "video", "title": null, "durationSeconds": 9.8, "recommends": 1172, "pinned": false, "series": null, "sound": { "id": "7684220008419216171", "title": "@Billionhappy创作的原声", "author": "Billionhappy" }, "categories": [ "随拍", "人物随拍", "多人随拍" ] } }, { "id": "7710254573662784804", "url": "https://www.douyin.com/video/7710254573662784804", "text": "日赚500万刀!GTA6无限刷钱2.0简化版,不读档少跑图,效率翻倍! #GTA6#GTA#PS5", "createdAt": "2026-11-20T14:05:46.000Z", "author": { "id": "4301742558951459", "username": "zeldaxiaoma", "displayName": "塞尔达小马", "avatarUrl": "https://p3-pc.douyinpic.com/aweme/100x100/aweme-avatar/tos-cn-avt-0015_db02b2db1e51fd7439bf57669ba18e08.jpeg?from=327834062", "verified": false, "url": "https://www.douyin.com/user/MS4wLjABAAAA8Sz9EnBpazNKHRiyTrHCFwsaJUHtPPCODnn_eF0KEMmcKxCKzr2VNxLcOKq0OZHO" }, "stats": { "views": null, "likes": 17752, "comments": 714, "shares": 3581, "saves": 13703, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://p3-pc-sign.douyinpic.com/image-cut-tos/0abc9c6951598c6340007b7973879089~tplv-dy-resize-origshort-autoq-75:330.jpeg?lk3s=138a59ce&x-expires=2111158800&x-signature=6idxpd6nP0Q1e7rP5jtkxhKKJoA%3D&from=327834062&s=PackSourceEnum_WEBPC_RELATED_AWEME&se=false&sc=cover&biz_tag=pcweb_cover&l=202611280116437CBC79D857F7DA5F95CC", "width": 3840, "height": 2160, "durationSeconds": 242.134 } ], "hashtags": [ "GTA6", "GTA", "PS5" ], "mentions": [], "ext": { "kind": "video", "title": null, "durationSeconds": 242.134, "recommends": 173, "pinned": false, "series": { "id": "7710257537177618467", "name": "GTA6", "episode": 2 }, "sound": { "id": "7710254621746301723", "title": "@塞尔达小马创作的原声", "author": "塞尔达小马" }, "categories": [ "游戏", "角色扮演" ] } } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.douyin.postRelated({ url: \"https://www.douyin.com/video/7711656915507399971\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.douyin.post_related(url=\"https://www.douyin.com/video/7711656915507399971\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/douyin/post/related \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://www.douyin.com/video/7711656915507399971\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_DouyinPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/DouyinPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "DouyinPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "kind", "pinned", "categories" ], "properties": { "categories": { "type": "array", "items": { "type": "string" }, "description": "Douyin's categories for it, broadest first (`游戏`, `角色扮演`)." }, "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "kind": { "$ref": "#/components/schemas/DouyinPostKind" }, "pinned": { "type": "boolean", "description": "Pinned to the top of its account." }, "recommends": { "type": [ "integer", "null" ], "format": "int64", "description": "Times recommended to others (推荐).", "minimum": 0 }, "series": { "oneOf": [ { "$ref": "#/components/schemas/DouyinSeriesRef" }, { "type": "null" } ] }, "sound": { "oneOf": [ { "$ref": "#/components/schemas/DouyinSoundRef" }, { "type": "null" } ] }, "title": { "type": [ "string", "null" ], "description": "Its title, where it has one apart from its caption." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A Douyin video or photo set." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "DouyinSoundRef": { "type": "object", "description": "The sound a post uses.", "required": [ "id" ], "properties": { "author": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "title": { "type": [ "string", "null" ] } } }, "DouyinSeriesRef": { "type": "object", "description": "A series (合集) a post is in.", "required": [ "id" ], "properties": { "episode": { "type": [ "integer", "null" ], "format": "int64", "description": "Its place in the series.", "minimum": 0 }, "id": { "type": "string" }, "name": { "type": [ "string", "null" ] } } }, "DouyinPostKind": { "type": "string", "description": "What a post is.", "enum": [ "video", "images" ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Post (/docs/api-reference/douyin/post) One post with its likes, comments, shares and saves. `GET https://api.socialapi.sh/v1/douyin/post` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.douyin.post({ url: "https://www.douyin.com/video/7711656915507399971" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.douyin.post(url="https://www.douyin.com/video/7711656915507399971").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/douyin/post \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://www.douyin.com/video/7711656915507399971" ``` **Response** ```json { "data": { "id": "7711656915507399971", "url": "https://www.douyin.com/video/7711656915507399971", "text": "你在GTA6拿多少钱,我在现实就给你多少! 如果在GTA6里获得的钱都能成为现实中的钱,会发生什么?这次我们就来挑战一下,结局太刺激了!!#把生活过成GTA #超能演2026 #抖音精选app", "createdAt": "2026-11-24T10:05:30.000Z", "author": { "id": "2346788843174825", "username": "MrBeast_", "displayName": "野兽先生MrBeast", "avatarUrl": "https://p3-pc.douyinpic.com/aweme/100x100/aweme-avatar/tos-cn-avt-0015_b29d2aa6fae189e4b4242b03c4893dc4.jpeg?from=327834062", "verified": false, "url": "https://www.douyin.com/user/MS4wLjABAAAA5387Fmmln-gOAeC9xGyzE6khw7Az0K4knE1QGyGdjlZ2RoGkhnRAXLadkJTCF4IW" }, "stats": { "views": null, "likes": 529987, "comments": 5903, "shares": 246182, "saves": 37553, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://p3-pc-sign.douyinpic.com/image-cut-tos-priv/7c5971446af1437adcfc1c8f2e73b8d7~tplv-dy-resize-origshort-autoq-75:330.jpeg?lk3s=138a59ce&x-expires=2111158800&x-signature=FO6feYj4O5dOCUmYVKuMaV3BkW0%3D&from=327834062&s=PackSourceEnum_AWEME_DETAIL&se=false&sc=cover&biz_tag=pcweb_cover&l=202611280116428F8F5D95FC37A964C0B2", "width": 1920, "height": 1080, "durationSeconds": 1254.69 } ], "hashtags": [ "把生活过成GTA", "超能演2026", "抖音精选app" ], "mentions": [], "ext": { "kind": "video", "title": "你在GTA6拿多少钱,我在现实就给你多少!", "durationSeconds": 1254.69, "recommends": 21427, "pinned": false, "series": null, "sound": { "id": "7711657555281382185", "title": "@野兽先生MrBeast创作的原声", "author": "野兽先生MrBeast" }, "categories": [ "游戏", "角色扮演" ] } } } ``` **OpenAPI** ```json { "paths": { "/v1/douyin/post": { "get": { "tags": [ "Douyin" ], "summary": "One post with its likes, comments, shares and saves.", "description": "A video's caption, cover, size and length, or a photo set's pictures; its author,\nhashtags, sound, series and Douyin's categories. 2 credits.", "operationId": "douyinPost", "parameters": [ { "name": "url", "in": "query", "description": "The post's link (`https://www.douyin.com/video/7711656915507399971`) or a share\nlink (`https://v.douyin.com/…`).", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "Its id, instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_DouyinPost" }, "example": { "data": { "id": "7711656915507399971", "url": "https://www.douyin.com/video/7711656915507399971", "text": "你在GTA6拿多少钱,我在现实就给你多少! 如果在GTA6里获得的钱都能成为现实中的钱,会发生什么?这次我们就来挑战一下,结局太刺激了!!#把生活过成GTA #超能演2026 #抖音精选app", "createdAt": "2026-11-24T10:05:30.000Z", "author": { "id": "2346788843174825", "username": "MrBeast_", "displayName": "野兽先生MrBeast", "avatarUrl": "https://p3-pc.douyinpic.com/aweme/100x100/aweme-avatar/tos-cn-avt-0015_b29d2aa6fae189e4b4242b03c4893dc4.jpeg?from=327834062", "verified": false, "url": "https://www.douyin.com/user/MS4wLjABAAAA5387Fmmln-gOAeC9xGyzE6khw7Az0K4knE1QGyGdjlZ2RoGkhnRAXLadkJTCF4IW" }, "stats": { "views": null, "likes": 529987, "comments": 5903, "shares": 246182, "saves": 37553, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://p3-pc-sign.douyinpic.com/image-cut-tos-priv/7c5971446af1437adcfc1c8f2e73b8d7~tplv-dy-resize-origshort-autoq-75:330.jpeg?lk3s=138a59ce&x-expires=2111158800&x-signature=FO6feYj4O5dOCUmYVKuMaV3BkW0%3D&from=327834062&s=PackSourceEnum_AWEME_DETAIL&se=false&sc=cover&biz_tag=pcweb_cover&l=202611280116428F8F5D95FC37A964C0B2", "width": 1920, "height": 1080, "durationSeconds": 1254.69 } ], "hashtags": [ "把生活过成GTA", "超能演2026", "抖音精选app" ], "mentions": [], "ext": { "kind": "video", "title": "你在GTA6拿多少钱,我在现实就给你多少!", "durationSeconds": 1254.69, "recommends": 21427, "pinned": false, "series": null, "sound": { "id": "7711657555281382185", "title": "@野兽先生MrBeast创作的原声", "author": "野兽先生MrBeast" }, "categories": [ "游戏", "角色扮演" ] } } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.douyin.post({ url: \"https://www.douyin.com/video/7711656915507399971\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.douyin.post(url=\"https://www.douyin.com/video/7711656915507399971\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/douyin/post \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://www.douyin.com/video/7711656915507399971\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_DouyinPost": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/DouyinPost" } } }, "DouyinPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "kind", "pinned", "categories" ], "properties": { "categories": { "type": "array", "items": { "type": "string" }, "description": "Douyin's categories for it, broadest first (`游戏`, `角色扮演`)." }, "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "kind": { "$ref": "#/components/schemas/DouyinPostKind" }, "pinned": { "type": "boolean", "description": "Pinned to the top of its account." }, "recommends": { "type": [ "integer", "null" ], "format": "int64", "description": "Times recommended to others (推荐).", "minimum": 0 }, "series": { "oneOf": [ { "$ref": "#/components/schemas/DouyinSeriesRef" }, { "type": "null" } ] }, "sound": { "oneOf": [ { "$ref": "#/components/schemas/DouyinSoundRef" }, { "type": "null" } ] }, "title": { "type": [ "string", "null" ], "description": "Its title, where it has one apart from its caption." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A Douyin video or photo set." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "DouyinSoundRef": { "type": "object", "description": "The sound a post uses.", "required": [ "id" ], "properties": { "author": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "title": { "type": [ "string", "null" ] } } }, "DouyinSeriesRef": { "type": "object", "description": "A series (合集) a post is in.", "required": [ "id" ], "properties": { "episode": { "type": [ "integer", "null" ], "format": "int64", "description": "Its place in the series.", "minimum": 0 }, "id": { "type": "string" }, "name": { "type": [ "string", "null" ] } } }, "DouyinPostKind": { "type": "string", "description": "What a post is.", "enum": [ "video", "images" ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Profile Playlists (/docs/api-reference/douyin/profile-playlists) An account's series (合集). `GET https://api.socialapi.sh/v1/douyin/profile/playlists` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.douyin.profilePlaylists({ secUid: "MS4wLjABAAAAoDPbeBJwY9IpoMFWKaDAPR7WXPset_2zjILeb65yPeg" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.douyin.profile_playlists(sec_uid="MS4wLjABAAAAoDPbeBJwY9IpoMFWKaDAPR7WXPset_2zjILeb65yPeg") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/douyin/profile/playlists \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "secUid=MS4wLjABAAAAoDPbeBJwY9IpoMFWKaDAPR7WXPset_2zjILeb65yPeg" ``` **Response** ```json { "data": [ { "id": "7667116913554556968", "name": "《开心锤锤世界》", "url": "https://www.douyin.com/collection/7667116913554556968", "coverUrl": "https://p3-sign.douyinpic.com/obj/tos-cn-i-dy/0c9f4c3593fc4ffaaf4ea6d833b1fe72?lk3s=f3356eed&x-expires=1795820400&x-signature=iq5T0qQbzlGFFVBfdgAC6THaZoM%3D&from=4080365293&s=PackSourceEnum_MIX_PUBLISH&se=false&sc=mix_cover&biz_tag=aweme_mix&l=2026112801164074F2BCB4A9F9E2FE0439", "posts": 37, "ext": { "description": "在《开心锤锤世界》,生活着乐观善良的少年锤锤和他性格各异的家人朋友们,他们在日常琐事中脑洞大开,以充满趣味的方式应对生活琐事或难题,碰撞出欢乐的火花。在用幽默为你带来欢乐的同时,传递满满正能量", "views": 32750720, "saves": 3977, "createdAt": "2026-07-27T08:09:25.000Z", "updatedAt": "2026-11-19T06:48:02.000Z", "authorSecUid": "MS4wLjABAAAAoDPbeBJwY9IpoMFWKaDAPR7WXPset_2zjILeb65yPeg" } }, { "id": "6890827591121373192", "name": "《开心锤锤》", "url": "https://www.douyin.com/collection/6890827591121373192", "coverUrl": "https://p3-sign.douyinpic.com/obj/tos-cn-i-dy/6bb25397f96d423383e0346141db1c05?lk3s=138a59ce&x-expires=1795820400&x-signature=KbpzXlXtSRlnm2R7dthh1PNOvkY%3D&from=327834062&s=PackSourceEnum_PUBLISH&se=false&sc=mix_cover&biz_tag=aweme_mix&l=202611280116400BCBB39D50243CE393D8", "posts": 1070, "ext": { "description": "开心锤锤,专注原创搞笑短视频!", "views": null, "saves": 0, "createdAt": "2020-11-03T09:30:23.000Z", "updatedAt": "2026-11-27T13:40:08.000Z", "authorSecUid": null } } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/douyin/profile/playlists": { "get": { "tags": [ "Douyin" ], "summary": "An account's series (合集).", "description": "Each with its name, cover, episodes, plays and saves; their posts come from\n`/v1/douyin/playlist/posts`. 1 credit.", "operationId": "douyinProfilePlaylists", "parameters": [ { "name": "secUid", "in": "query", "description": "The account's `sec_uid` (`MS4wLjABAAAA…`), as its page's link ends.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "Its page (`https://www.douyin.com/user/MS4w…`) or a share link\n(`https://v.douyin.com/…`), instead of `secUid`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_DouyinPlaylist" }, "example": { "data": [ { "id": "7667116913554556968", "name": "《开心锤锤世界》", "url": "https://www.douyin.com/collection/7667116913554556968", "coverUrl": "https://p3-sign.douyinpic.com/obj/tos-cn-i-dy/0c9f4c3593fc4ffaaf4ea6d833b1fe72?lk3s=f3356eed&x-expires=1795820400&x-signature=iq5T0qQbzlGFFVBfdgAC6THaZoM%3D&from=4080365293&s=PackSourceEnum_MIX_PUBLISH&se=false&sc=mix_cover&biz_tag=aweme_mix&l=2026112801164074F2BCB4A9F9E2FE0439", "posts": 37, "ext": { "description": "在《开心锤锤世界》,生活着乐观善良的少年锤锤和他性格各异的家人朋友们,他们在日常琐事中脑洞大开,以充满趣味的方式应对生活琐事或难题,碰撞出欢乐的火花。在用幽默为你带来欢乐的同时,传递满满正能量", "views": 32750720, "saves": 3977, "createdAt": "2026-07-27T08:09:25.000Z", "updatedAt": "2026-11-19T06:48:02.000Z", "authorSecUid": "MS4wLjABAAAAoDPbeBJwY9IpoMFWKaDAPR7WXPset_2zjILeb65yPeg" } }, { "id": "6890827591121373192", "name": "《开心锤锤》", "url": "https://www.douyin.com/collection/6890827591121373192", "coverUrl": "https://p3-sign.douyinpic.com/obj/tos-cn-i-dy/6bb25397f96d423383e0346141db1c05?lk3s=138a59ce&x-expires=1795820400&x-signature=KbpzXlXtSRlnm2R7dthh1PNOvkY%3D&from=327834062&s=PackSourceEnum_PUBLISH&se=false&sc=mix_cover&biz_tag=aweme_mix&l=202611280116400BCBB39D50243CE393D8", "posts": 1070, "ext": { "description": "开心锤锤,专注原创搞笑短视频!", "views": null, "saves": 0, "createdAt": "2020-11-03T09:30:23.000Z", "updatedAt": "2026-11-27T13:40:08.000Z", "authorSecUid": null } } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.douyin.profilePlaylists({ secUid: \"MS4wLjABAAAAoDPbeBJwY9IpoMFWKaDAPR7WXPset_2zjILeb65yPeg\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.douyin.profile_playlists(sec_uid=\"MS4wLjABAAAAoDPbeBJwY9IpoMFWKaDAPR7WXPset_2zjILeb65yPeg\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/douyin/profile/playlists \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"secUid=MS4wLjABAAAAoDPbeBJwY9IpoMFWKaDAPR7WXPset_2zjILeb65yPeg\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_DouyinPlaylist": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/DouyinPlaylist" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "DouyinPlaylist": { "allOf": [ { "type": "object", "description": "A playlist, mix or collection of posts.", "required": [ "id", "name", "ext" ], "properties": { "coverUrl": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "properties": { "authorSecUid": { "type": [ "string", "null" ], "description": "The account it belongs to." }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "description": { "type": [ "string", "null" ] }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Times it was saved.", "minimum": 0 }, "updatedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "views": { "type": [ "integer", "null" ], "format": "int64", "description": "Plays of the whole series.", "minimum": 0 } } }, { "type": "object", "description": "What only this platform has." } ] }, "id": { "type": "string" }, "name": { "type": "string" }, "posts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "url": { "type": [ "string", "null" ] } } }, { "type": "object", "description": "A series (合集)." } ] }, "Timestamp": { "type": "string", "format": "date-time" } } } } ``` # Profile Posts (/docs/api-reference/douyin/profile-posts) An account's latest posts, about 10. `GET https://api.socialapi.sh/v1/douyin/profile/posts` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.douyin.profilePosts({ secUid: "MS4wLjABAAAA8U_l6rBzmy7bcy6xOJel4v0RzoR_wfAubGPeJimN__4" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.douyin.profile_posts(sec_uid="MS4wLjABAAAA8U_l6rBzmy7bcy6xOJel4v0RzoR_wfAubGPeJimN__4") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/douyin/profile/posts \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "secUid=MS4wLjABAAAA8U_l6rBzmy7bcy6xOJel4v0RzoR_wfAubGPeJimN__4" ``` **Response** ```json { "data": [ { "id": "7710625585499802906", "url": "https://www.douyin.com/video/7710625585499802906", "text": "11月19日,亚太经合组织第三十三次领导人非正式会议开始前,与会经济体领导人、代表戴上红蓝围巾,留下一张集体合影。细数近年来的APEC“全家福”,这张集体合影里人员齐、规格高。这张近十年来最全的APEC“全家福”,为何定格在深圳?人民日报“经纬线”带你了解。#媒体原创", "createdAt": "2026-11-21T14:05:27.000Z", "author": { "id": "104255897823", "username": "104255897823", "displayName": "人民日报", "avatarUrl": "https://p3-pc.douyinpic.com/aweme/100x100/aweme-avatar/tos-cn-avt-0015_21b4383e542b8991bcd33d33eeda7d8d.jpeg?from=327834062", "verified": true, "url": "https://www.douyin.com/user/MS4wLjABAAAA8U_l6rBzmy7bcy6xOJel4v0RzoR_wfAubGPeJimN__4" }, "stats": { "views": null, "likes": 30337, "comments": 89, "shares": 1786, "saves": 2515, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://p3-pc-sign.douyinpic.com/tos-cn-i-dy/fe21f2dece0e4c9098b9a25cf4470578~tplv-dy-cropcenter:323:430.jpeg?lk3s=138a59ce&x-expires=2111158800&x-signature=3Xi70AOB01VP4UEwydDPDDPHUZo%3D&from=327834062&s=PackSourceEnum_PUBLISH&se=true&sh=323_430&sc=cover&biz_tag=pcweb_cover&l=20261128011639E5B3838D434E6D72C4E7", "width": 1920, "height": 1080, "durationSeconds": 187.391 } ], "hashtags": [ "媒体原创" ], "mentions": [], "ext": { "kind": "video", "title": null, "durationSeconds": 187.391, "recommends": 1264, "pinned": false, "series": null, "sound": { "id": "7710625692676819766", "title": "@人民日报创作的原声", "author": "人民日报" }, "categories": [ "时政社会", "时政新闻", "外交" ] } }, { "id": "7710606416897150235", "url": "https://www.douyin.com/video/7710606416897150235", "text": "多国领导人明确表态:坚定恪守一个中国原则", "createdAt": "2026-11-21T12:51:04.000Z", "author": { "id": "104255897823", "username": "104255897823", "displayName": "人民日报", "avatarUrl": "https://p3-pc.douyinpic.com/aweme/100x100/aweme-avatar/tos-cn-avt-0015_21b4383e542b8991bcd33d33eeda7d8d.jpeg?from=327834062", "verified": true, "url": "https://www.douyin.com/user/MS4wLjABAAAA8U_l6rBzmy7bcy6xOJel4v0RzoR_wfAubGPeJimN__4" }, "stats": { "views": null, "likes": 375878, "comments": 87, "shares": 43064, "saves": 14944, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://p3-pc-sign.douyinpic.com/tos-cn-p-0015/oUEiEknlI01ACRgBLBEBfACejxAiC3MgBGl1Ij~tplv-dy-cropcenter:323:430.jpeg?lk3s=138a59ce&x-expires=2111158800&x-signature=8Z7VxCLmj9eHA2xqFG7m30g%2BLYc%3D&from=327834062&s=PackSourceEnum_PUBLISH&se=true&sh=323_430&sc=cover&biz_tag=pcweb_cover&l=20261128011639E5B3838D434E6D72C4E7", "width": 1080, "height": 1920, "durationSeconds": 74.091 } ], "hashtags": [], "mentions": [], "ext": { "kind": "video", "title": null, "durationSeconds": 74.091, "recommends": 25395, "pinned": false, "series": null, "sound": { "id": "7710606418172267327", "title": "@人民日报创作的原声", "author": "人民日报" }, "categories": [ "时政社会", "时政新闻", "外交" ] } } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/douyin/profile/posts": { "get": { "tags": [ "Douyin" ], "summary": "An account's latest posts, about 10.", "description": "Its newest posts and the ones it pinned, with likes, comments, shares and saves: the\none page Douyin shows a visitor. 2 credits a post returned.", "operationId": "douyinProfilePosts", "parameters": [ { "name": "secUid", "in": "query", "description": "The account's `sec_uid` (`MS4wLjABAAAA…`), as its page's link ends.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "Its page (`https://www.douyin.com/user/MS4w…`) or a share link\n(`https://v.douyin.com/…`), instead of `secUid`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_DouyinPost" }, "example": { "data": [ { "id": "7710625585499802906", "url": "https://www.douyin.com/video/7710625585499802906", "text": "11月19日,亚太经合组织第三十三次领导人非正式会议开始前,与会经济体领导人、代表戴上红蓝围巾,留下一张集体合影。细数近年来的APEC“全家福”,这张集体合影里人员齐、规格高。这张近十年来最全的APEC“全家福”,为何定格在深圳?人民日报“经纬线”带你了解。#媒体原创", "createdAt": "2026-11-21T14:05:27.000Z", "author": { "id": "104255897823", "username": "104255897823", "displayName": "人民日报", "avatarUrl": "https://p3-pc.douyinpic.com/aweme/100x100/aweme-avatar/tos-cn-avt-0015_21b4383e542b8991bcd33d33eeda7d8d.jpeg?from=327834062", "verified": true, "url": "https://www.douyin.com/user/MS4wLjABAAAA8U_l6rBzmy7bcy6xOJel4v0RzoR_wfAubGPeJimN__4" }, "stats": { "views": null, "likes": 30337, "comments": 89, "shares": 1786, "saves": 2515, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://p3-pc-sign.douyinpic.com/tos-cn-i-dy/fe21f2dece0e4c9098b9a25cf4470578~tplv-dy-cropcenter:323:430.jpeg?lk3s=138a59ce&x-expires=2111158800&x-signature=3Xi70AOB01VP4UEwydDPDDPHUZo%3D&from=327834062&s=PackSourceEnum_PUBLISH&se=true&sh=323_430&sc=cover&biz_tag=pcweb_cover&l=20261128011639E5B3838D434E6D72C4E7", "width": 1920, "height": 1080, "durationSeconds": 187.391 } ], "hashtags": [ "媒体原创" ], "mentions": [], "ext": { "kind": "video", "title": null, "durationSeconds": 187.391, "recommends": 1264, "pinned": false, "series": null, "sound": { "id": "7710625692676819766", "title": "@人民日报创作的原声", "author": "人民日报" }, "categories": [ "时政社会", "时政新闻", "外交" ] } }, { "id": "7710606416897150235", "url": "https://www.douyin.com/video/7710606416897150235", "text": "多国领导人明确表态:坚定恪守一个中国原则", "createdAt": "2026-11-21T12:51:04.000Z", "author": { "id": "104255897823", "username": "104255897823", "displayName": "人民日报", "avatarUrl": "https://p3-pc.douyinpic.com/aweme/100x100/aweme-avatar/tos-cn-avt-0015_21b4383e542b8991bcd33d33eeda7d8d.jpeg?from=327834062", "verified": true, "url": "https://www.douyin.com/user/MS4wLjABAAAA8U_l6rBzmy7bcy6xOJel4v0RzoR_wfAubGPeJimN__4" }, "stats": { "views": null, "likes": 375878, "comments": 87, "shares": 43064, "saves": 14944, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://p3-pc-sign.douyinpic.com/tos-cn-p-0015/oUEiEknlI01ACRgBLBEBfACejxAiC3MgBGl1Ij~tplv-dy-cropcenter:323:430.jpeg?lk3s=138a59ce&x-expires=2111158800&x-signature=8Z7VxCLmj9eHA2xqFG7m30g%2BLYc%3D&from=327834062&s=PackSourceEnum_PUBLISH&se=true&sh=323_430&sc=cover&biz_tag=pcweb_cover&l=20261128011639E5B3838D434E6D72C4E7", "width": 1080, "height": 1920, "durationSeconds": 74.091 } ], "hashtags": [], "mentions": [], "ext": { "kind": "video", "title": null, "durationSeconds": 74.091, "recommends": 25395, "pinned": false, "series": null, "sound": { "id": "7710606418172267327", "title": "@人民日报创作的原声", "author": "人民日报" }, "categories": [ "时政社会", "时政新闻", "外交" ] } } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.douyin.profilePosts({ secUid: \"MS4wLjABAAAA8U_l6rBzmy7bcy6xOJel4v0RzoR_wfAubGPeJimN__4\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.douyin.profile_posts(sec_uid=\"MS4wLjABAAAA8U_l6rBzmy7bcy6xOJel4v0RzoR_wfAubGPeJimN__4\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/douyin/profile/posts \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"secUid=MS4wLjABAAAA8U_l6rBzmy7bcy6xOJel4v0RzoR_wfAubGPeJimN__4\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_DouyinPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/DouyinPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "DouyinPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "kind", "pinned", "categories" ], "properties": { "categories": { "type": "array", "items": { "type": "string" }, "description": "Douyin's categories for it, broadest first (`游戏`, `角色扮演`)." }, "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "kind": { "$ref": "#/components/schemas/DouyinPostKind" }, "pinned": { "type": "boolean", "description": "Pinned to the top of its account." }, "recommends": { "type": [ "integer", "null" ], "format": "int64", "description": "Times recommended to others (推荐).", "minimum": 0 }, "series": { "oneOf": [ { "$ref": "#/components/schemas/DouyinSeriesRef" }, { "type": "null" } ] }, "sound": { "oneOf": [ { "$ref": "#/components/schemas/DouyinSoundRef" }, { "type": "null" } ] }, "title": { "type": [ "string", "null" ], "description": "Its title, where it has one apart from its caption." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A Douyin video or photo set." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "DouyinSoundRef": { "type": "object", "description": "The sound a post uses.", "required": [ "id" ], "properties": { "author": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "title": { "type": [ "string", "null" ] } } }, "DouyinSeriesRef": { "type": "object", "description": "A series (合集) a post is in.", "required": [ "id" ], "properties": { "episode": { "type": [ "integer", "null" ], "format": "int64", "description": "Its place in the series.", "minimum": 0 }, "id": { "type": "string" }, "name": { "type": [ "string", "null" ] } } }, "DouyinPostKind": { "type": "string", "description": "What a post is.", "enum": [ "video", "images" ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Profile (/docs/api-reference/douyin/profile) An account with its followers, likes and post count. `GET https://api.socialapi.sh/v1/douyin/profile` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.douyin.profile({ secUid: "MS4wLjABAAAA8U_l6rBzmy7bcy6xOJel4v0RzoR_wfAubGPeJimN__4" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.douyin.profile(sec_uid="MS4wLjABAAAA8U_l6rBzmy7bcy6xOJel4v0RzoR_wfAubGPeJimN__4").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/douyin/profile \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "secUid=MS4wLjABAAAA8U_l6rBzmy7bcy6xOJel4v0RzoR_wfAubGPeJimN__4" ``` **Response** ```json { "data": { "id": "104255897823", "username": "rmrbxmt", "displayName": "人民日报", "bio": "参与、沟通、记录时代。", "avatarUrl": "https://p3-pc.douyinpic.com/aweme/1080x1080/aweme-avatar/tos-cn-avt-0015_21b4383e542b8991bcd33d33eeda7d8d.jpeg?from=2956013662", "url": "https://www.douyin.com/user/MS4wLjABAAAA8U_l6rBzmy7bcy6xOJel4v0RzoR_wfAubGPeJimN__4", "verified": true, "private": false, "followers": 203912912, "following": 35, "likes": 19445869999, "posts": 12986, "externalUrl": null, "createdAt": null, "ext": { "secUid": "MS4wLjABAAAA8U_l6rBzmy7bcy6xOJel4v0RzoR_wfAubGPeJimN__4", "shortId": null, "verification": "人民日报官方账号", "ipLocation": null, "live": false, "series": 0, "coverUrl": "https://p3-pc-sign.douyinpic.com/obj/douyin-user-image-file/a0fed342d45f11ee57830326fa8bb1b1?lk3s=93de098e&x-expires=1795971600&x-signature=BQcW6nFUv7nzrCmTA6wyIHE29%2BM%3D&from=2480802190" } } } ``` **OpenAPI** ```json { "paths": { "/v1/douyin/profile": { "get": { "tags": [ "Douyin" ], "summary": "An account with its followers, likes and post count.", "description": "Name, bio, picture, exact followers, following, likes received and posts, Douyin's\nverification, where Douyin shows it posting from, and whether it is live. 2 credits.", "operationId": "douyinProfile", "parameters": [ { "name": "secUid", "in": "query", "description": "The account's `sec_uid` (`MS4wLjABAAAA…`), as its page's link ends.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "Its page (`https://www.douyin.com/user/MS4w…`) or a share link\n(`https://v.douyin.com/…`), instead of `secUid`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_DouyinProfile" }, "example": { "data": { "id": "104255897823", "username": "rmrbxmt", "displayName": "人民日报", "bio": "参与、沟通、记录时代。", "avatarUrl": "https://p3-pc.douyinpic.com/aweme/1080x1080/aweme-avatar/tos-cn-avt-0015_21b4383e542b8991bcd33d33eeda7d8d.jpeg?from=2956013662", "url": "https://www.douyin.com/user/MS4wLjABAAAA8U_l6rBzmy7bcy6xOJel4v0RzoR_wfAubGPeJimN__4", "verified": true, "private": false, "followers": 203912912, "following": 35, "likes": 19445869999, "posts": 12986, "externalUrl": null, "createdAt": null, "ext": { "secUid": "MS4wLjABAAAA8U_l6rBzmy7bcy6xOJel4v0RzoR_wfAubGPeJimN__4", "shortId": null, "verification": "人民日报官方账号", "ipLocation": null, "live": false, "series": 0, "coverUrl": "https://p3-pc-sign.douyinpic.com/obj/douyin-user-image-file/a0fed342d45f11ee57830326fa8bb1b1?lk3s=93de098e&x-expires=1795971600&x-signature=BQcW6nFUv7nzrCmTA6wyIHE29%2BM%3D&from=2480802190" } } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.douyin.profile({ secUid: \"MS4wLjABAAAA8U_l6rBzmy7bcy6xOJel4v0RzoR_wfAubGPeJimN__4\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.douyin.profile(sec_uid=\"MS4wLjABAAAA8U_l6rBzmy7bcy6xOJel4v0RzoR_wfAubGPeJimN__4\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/douyin/profile \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"secUid=MS4wLjABAAAA8U_l6rBzmy7bcy6xOJel4v0RzoR_wfAubGPeJimN__4\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_DouyinProfile": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/DouyinProfile" } } }, "DouyinProfile": { "allOf": [ { "type": "object", "description": "An account.", "required": [ "id", "username", "url", "verified", "private", "ext" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "bio": { "type": [ "string", "null" ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "displayName": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "secUid", "live" ], "properties": { "coverUrl": { "type": [ "string", "null" ] }, "ipLocation": { "type": [ "string", "null" ], "description": "The province or country Douyin shows it posting from (`IP属地`)." }, "live": { "type": "boolean", "description": "On air now; `/v1/douyin/live` reads its room by the number in its link." }, "secUid": { "type": "string", "description": "The id Douyin's links and lists name the account by." }, "series": { "type": [ "integer", "null" ], "format": "int64", "description": "Its series (合集).", "minimum": 0 }, "shortId": { "type": [ "string", "null" ], "description": "Its short number (抖音号 when it set none of its own)." }, "verification": { "type": [ "string", "null" ], "description": "What Douyin's checkmark says (`人民日报官方账号`)." } } }, { "type": "object", "description": "What only this platform has." } ] }, "externalUrl": { "type": [ "string", "null" ], "description": "The link in the bio." }, "followers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "following": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "id": { "type": "string", "description": "The platform's id for the account." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "description": "Likes the account's posts received in total.", "minimum": 0 }, "posts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "private": { "type": "boolean" }, "url": { "type": "string", "description": "The profile's page." }, "username": { "type": "string", "description": "The handle, without `@`." }, "verified": { "type": "boolean" } } }, { "type": "object", "description": "A Douyin account." } ] }, "Timestamp": { "type": "string", "format": "date-time" } } } } ``` # Search Suggestions (/docs/api-reference/douyin/search-suggestions) What Douyin's search box suggests for a query. `GET https://api.socialapi.sh/v1/douyin/search/suggestions` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.douyin.searchSuggestions({ query: "猫" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.douyin.search_suggestions(query="猫") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/douyin/search/suggestions \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "query=猫" ``` **Response** ```json { "data": [ { "text": "猫" }, { "text": "猫宁" } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/douyin/search/suggestions": { "get": { "tags": [ "Douyin" ], "summary": "What Douyin's search box suggests for a query.", "description": "The completions it offers, in its order. 1 credit.", "operationId": "douyinSearchSuggestions", "parameters": [ { "name": "query", "in": "query", "description": "The first letters of a search.", "required": true, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_Suggestion" }, "example": { "data": [ { "text": "猫" }, { "text": "猫宁" } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.douyin.searchSuggestions({ query: \"猫\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.douyin.search_suggestions(query=\"猫\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/douyin/search/suggestions \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"query=猫\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_Suggestion": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Suggestion" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "Suggestion": { "type": "object", "description": "A search suggestion.", "required": [ "text" ], "properties": { "text": { "type": "string" } } } } } } ``` # Sound Posts (/docs/api-reference/douyin/sound-posts) Posts using a sound. `GET https://api.socialapi.sh/v1/douyin/sound/posts` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.douyin.soundPosts({ id: "7711657555281382185" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.douyin.sound_posts(id="7711657555281382185") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/douyin/sound/posts \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "id=7711657555281382185" ``` **Response** ```json { "data": [ { "id": "7711656915507399971", "url": "https://www.douyin.com/video/7711656915507399971", "text": "你在GTA6拿多少钱,我在现实就给你多少! 如果在GTA6里获得的钱都能成为现实中的钱,会发生什么?这次我们就来挑战一下,结局太刺激了!!#把生活过成GTA #超能演2026 #抖音精选app", "createdAt": "2026-11-24T10:05:30.000Z", "author": { "id": "2346788843174825", "username": "2346788843174825", "displayName": "野兽先生MrBeast", "avatarUrl": "https://p3-pc.douyinpic.com/aweme/100x100/aweme-avatar/tos-cn-avt-0015_b29d2aa6fae189e4b4242b03c4893dc4.jpeg?from=327834062", "verified": false, "url": "https://www.douyin.com/user/MS4wLjABAAAA5387Fmmln-gOAeC9xGyzE6khw7Az0K4knE1QGyGdjlZ2RoGkhnRAXLadkJTCF4IW" }, "stats": { "views": null, "likes": 530001, "comments": 5903, "shares": 246184, "saves": 37554, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://p3-pc-sign.douyinpic.com/image-cut-tos-priv/7c5971446af1437adcfc1c8f2e73b8d7~tplv-dy-resize-origshort-autoq-75:330.jpeg?lk3s=138a59ce&x-expires=2111158800&x-signature=FO6feYj4O5dOCUmYVKuMaV3BkW0%3D&from=327834062&s=PackSourceEnum_MUSIC_AWEME&se=false&sc=cover&biz_tag=pcweb_cover&l=202611280116464F2E0E2D7B945CACB0F4", "width": 1920, "height": 1080, "durationSeconds": 1254.69 } ], "hashtags": [ "把生活过成GTA", "超能演2026", "抖音精选app" ], "mentions": [], "ext": { "kind": "video", "title": "你在GTA6拿多少钱,我在现实就给你多少!", "durationSeconds": 1254.69, "recommends": 21427, "pinned": false, "series": null, "sound": { "id": "7711657555281382185", "title": "@野兽先生MrBeast创作的原声", "author": "野兽先生MrBeast" }, "categories": [ "游戏", "角色扮演" ] } } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/douyin/sound/posts": { "get": { "tags": [ "Douyin" ], "summary": "Posts using a sound.", "description": "About 13 a page, each with its counts. 1 credit a page.", "operationId": "douyinSoundPosts", "parameters": [ { "name": "url", "in": "query", "description": "Its link, or a share link.", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "Its id, instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_DouyinPost" }, "example": { "data": [ { "id": "7711656915507399971", "url": "https://www.douyin.com/video/7711656915507399971", "text": "你在GTA6拿多少钱,我在现实就给你多少! 如果在GTA6里获得的钱都能成为现实中的钱,会发生什么?这次我们就来挑战一下,结局太刺激了!!#把生活过成GTA #超能演2026 #抖音精选app", "createdAt": "2026-11-24T10:05:30.000Z", "author": { "id": "2346788843174825", "username": "2346788843174825", "displayName": "野兽先生MrBeast", "avatarUrl": "https://p3-pc.douyinpic.com/aweme/100x100/aweme-avatar/tos-cn-avt-0015_b29d2aa6fae189e4b4242b03c4893dc4.jpeg?from=327834062", "verified": false, "url": "https://www.douyin.com/user/MS4wLjABAAAA5387Fmmln-gOAeC9xGyzE6khw7Az0K4knE1QGyGdjlZ2RoGkhnRAXLadkJTCF4IW" }, "stats": { "views": null, "likes": 530001, "comments": 5903, "shares": 246184, "saves": 37554, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://p3-pc-sign.douyinpic.com/image-cut-tos-priv/7c5971446af1437adcfc1c8f2e73b8d7~tplv-dy-resize-origshort-autoq-75:330.jpeg?lk3s=138a59ce&x-expires=2111158800&x-signature=FO6feYj4O5dOCUmYVKuMaV3BkW0%3D&from=327834062&s=PackSourceEnum_MUSIC_AWEME&se=false&sc=cover&biz_tag=pcweb_cover&l=202611280116464F2E0E2D7B945CACB0F4", "width": 1920, "height": 1080, "durationSeconds": 1254.69 } ], "hashtags": [ "把生活过成GTA", "超能演2026", "抖音精选app" ], "mentions": [], "ext": { "kind": "video", "title": "你在GTA6拿多少钱,我在现实就给你多少!", "durationSeconds": 1254.69, "recommends": 21427, "pinned": false, "series": null, "sound": { "id": "7711657555281382185", "title": "@野兽先生MrBeast创作的原声", "author": "野兽先生MrBeast" }, "categories": [ "游戏", "角色扮演" ] } } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.douyin.soundPosts({ id: \"7711657555281382185\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.douyin.sound_posts(id=\"7711657555281382185\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/douyin/sound/posts \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"id=7711657555281382185\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_DouyinPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/DouyinPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "DouyinPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "kind", "pinned", "categories" ], "properties": { "categories": { "type": "array", "items": { "type": "string" }, "description": "Douyin's categories for it, broadest first (`游戏`, `角色扮演`)." }, "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "kind": { "$ref": "#/components/schemas/DouyinPostKind" }, "pinned": { "type": "boolean", "description": "Pinned to the top of its account." }, "recommends": { "type": [ "integer", "null" ], "format": "int64", "description": "Times recommended to others (推荐).", "minimum": 0 }, "series": { "oneOf": [ { "$ref": "#/components/schemas/DouyinSeriesRef" }, { "type": "null" } ] }, "sound": { "oneOf": [ { "$ref": "#/components/schemas/DouyinSoundRef" }, { "type": "null" } ] }, "title": { "type": [ "string", "null" ], "description": "Its title, where it has one apart from its caption." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A Douyin video or photo set." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "DouyinSoundRef": { "type": "object", "description": "The sound a post uses.", "required": [ "id" ], "properties": { "author": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "title": { "type": [ "string", "null" ] } } }, "DouyinSeriesRef": { "type": "object", "description": "A series (合集) a post is in.", "required": [ "id" ], "properties": { "episode": { "type": [ "integer", "null" ], "format": "int64", "description": "Its place in the series.", "minimum": 0 }, "id": { "type": "string" }, "name": { "type": [ "string", "null" ] } } }, "DouyinPostKind": { "type": "string", "description": "What a post is.", "enum": [ "video", "images" ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Sound (/docs/api-reference/douyin/sound) A sound with the number of posts using it. `GET https://api.socialapi.sh/v1/douyin/sound` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.douyin.sound({ id: "7711657555281382185" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.douyin.sound(id="7711657555281382185").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/douyin/sound \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "id=7711657555281382185" ``` **Response** ```json { "data": { "id": "7711657555281382185", "title": "@野兽先生MrBeast创作的原声", "artist": "野兽先生MrBeast", "url": "https://www.douyin.com/music/7711657555281382185", "coverUrl": "https://p3-pc.douyinpic.com/aweme/1080x1080/aweme-avatar/tos-cn-avt-0015_b29d2aa6fae189e4b4242b03c4893dc4.jpeg?from=889713528", "playUrl": "https://sf11-cdn-tos.douyinstatic.com/obj/ies-music/7711657580631706431.mp3", "durationSeconds": 1254, "original": true, "posts": 162, "ext": { "ownerSecUid": "MS4wLjABAAAA5387Fmmln-gOAeC9xGyzE6khw7Az0K4knE1QGyGdjlZ2RoGkhnRAXLadkJTCF4IW", "ownerName": "野兽先生MrBeast", "album": null } } } ``` **OpenAPI** ```json { "paths": { "/v1/douyin/sound": { "get": { "tags": [ "Douyin" ], "summary": "A sound with the number of posts using it.", "description": "Its title, author, cover, length, a link to play it, and whether it is an account's\nown recording. 1 credit.", "operationId": "douyinSound", "parameters": [ { "name": "url", "in": "query", "description": "Its link, or a share link.", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "Its id, instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_DouyinSound" }, "example": { "data": { "id": "7711657555281382185", "title": "@野兽先生MrBeast创作的原声", "artist": "野兽先生MrBeast", "url": "https://www.douyin.com/music/7711657555281382185", "coverUrl": "https://p3-pc.douyinpic.com/aweme/1080x1080/aweme-avatar/tos-cn-avt-0015_b29d2aa6fae189e4b4242b03c4893dc4.jpeg?from=889713528", "playUrl": "https://sf11-cdn-tos.douyinstatic.com/obj/ies-music/7711657580631706431.mp3", "durationSeconds": 1254, "original": true, "posts": 162, "ext": { "ownerSecUid": "MS4wLjABAAAA5387Fmmln-gOAeC9xGyzE6khw7Az0K4knE1QGyGdjlZ2RoGkhnRAXLadkJTCF4IW", "ownerName": "野兽先生MrBeast", "album": null } } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.douyin.sound({ id: \"7711657555281382185\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.douyin.sound(id=\"7711657555281382185\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/douyin/sound \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"id=7711657555281382185\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_DouyinSound": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/DouyinSound" } } }, "DouyinSound": { "allOf": [ { "type": "object", "description": "A sound or song posts use.", "required": [ "id", "title", "url", "original", "ext" ], "properties": { "artist": { "type": [ "string", "null" ], "description": "The artist, or the account the original sound is from." }, "coverUrl": { "type": [ "string", "null" ] }, "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "ext": { "allOf": [ { "type": "object", "properties": { "album": { "type": [ "string", "null" ] }, "ownerName": { "type": [ "string", "null" ] }, "ownerSecUid": { "type": [ "string", "null" ], "description": "The account it belongs to, for an account's own sound." } } }, { "type": "object", "description": "What only this platform has." } ] }, "id": { "type": "string" }, "original": { "type": "boolean", "description": "Whether it is an account's own recording rather than a released song." }, "playUrl": { "type": [ "string", "null" ] }, "posts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "title": { "type": "string" }, "url": { "type": "string" } } }, { "type": "object", "description": "A sound." } ] } } } } ``` # Trending Posts (/docs/api-reference/douyin/trending-posts) Recommended posts, 10, or a category's. `GET https://api.socialapi.sh/v1/douyin/trending/posts` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.douyin.trendingPosts({ category: "games" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.douyin.trending_posts(category="games") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/douyin/trending/posts \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "category=games" ``` **Response** ```json { "data": [ { "id": "7697577972965920027", "url": "https://www.douyin.com/video/7697577972965920027", "text": "一口气看完暴雨末日生存 一秒还正常的世界,一场无休止的暴雨骤然降临。洪水不断蔓延,生存空间越来越小。物资匮乏,危机四伏。这是暴雨末日,而我,要在这里艰难求生#我的世界#mc#末日#暴雨末日#一口气看完系列", "createdAt": "2026-10-17T10:14:01.000Z", "author": { "id": "1491387481857523", "username": "45618260104", "displayName": "我的世界-祖子", "avatarUrl": "https://p3-pc.douyinpic.com/aweme/100x100/aweme-avatar/tos-cn-avt-0015_bca3c0d9d9ee796fc6ac0def6dfa2cd4.jpeg?from=327834062&se=false&biz_tag=feed_avatar&l=202611280116473FF50F05D6AC01168710", "verified": false, "url": "https://www.douyin.com/user/MS4wLjABAAAAYR1tQ7yNnko_XsstQxQ5JpYDmU27JJSGd4RZf873U-J1Y2YgghvCKAEMckX6exOG" }, "stats": { "views": null, "likes": 67173, "comments": 331, "shares": 8922, "saves": 19765, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://p3-pc-sign.douyinpic.com/image-cut-tos/1131c4706060df21ad53b28ce5ad8f0c~tplv-dy-resize-origshort-autoq-75:330.jpeg?lk3s=138a59ce&x-expires=2111158800&x-signature=Idwgwg8mvFrw%2BifmtN8rahMS4Hs%3D&from=327834062&s=PackSourceEnum_FEED&se=false&sc=cover&biz_tag=pcweb_cover&l=202611280116473FF50F05D6AC01168710", "width": 1920, "height": 1080, "durationSeconds": 4679.921 } ], "hashtags": [ "我的世界", "mc", "末日" ], "mentions": [], "ext": { "kind": "video", "title": "一口气看完暴雨末日生存", "durationSeconds": 4679.921, "recommends": 1059, "pinned": false, "series": null, "sound": { "id": "7697580513577421587", "title": "@我的世界-祖子创作的原声", "author": "我的世界-祖子" }, "categories": [ "游戏", "模拟养成" ] } }, { "id": "7706513388629496549", "url": "https://www.douyin.com/video/7706513388629496549", "text": "如何在三点图正确使用非常规哨位?莲花古城禁灭全局思路解析他来了!@Orin失眠电竞 #无畏契约 #valorant #无畏契约教学 #瓦学弟", "createdAt": "2026-11-10T12:46:59.000Z", "author": { "id": "1190143787806569", "username": "Sevenone1s", "displayName": "7in(无畏契约)", "avatarUrl": "https://p3-pc.douyinpic.com/aweme/100x100/aweme-avatar/tos-cn-avt-0015_6dd03dfc9883ce207336b13d8bdcda56.jpeg?from=327834062&se=false&biz_tag=feed_avatar&l=202611280116473FF50F05D6AC01168710", "verified": false, "url": "https://www.douyin.com/user/MS4wLjABAAAA9lqvOpyp9W2hfhyy8fMASp386jhAs0hTjrzDbnHFl6QbCP3bMLZfaQmc-af3Nmt8" }, "stats": { "views": null, "likes": 66774, "comments": 240, "shares": 1688, "saves": 1102, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://p3-pc-sign.douyinpic.com/image-cut-tos/4875a85cb53f780ab7c41975c42334a9~tplv-dy-resize-origshort-autoq-75:330.jpeg?lk3s=138a59ce&x-expires=2111158800&x-signature=0NZVtYug%2B6dvkyoGlJsa7g5ySTk%3D&from=327834062&s=PackSourceEnum_FEED&se=false&sc=cover&biz_tag=pcweb_cover&l=202611280116473FF50F05D6AC01168710", "width": 1280, "height": 720, "durationSeconds": 336.367 } ], "hashtags": [ "无畏契约", "valorant", "无畏契约教学" ], "mentions": [], "ext": { "kind": "video", "title": null, "durationSeconds": 336.367, "recommends": 691, "pinned": false, "series": null, "sound": { "id": "7706513397868727040", "title": "@7in(无畏契约)创作的原声", "author": "7in(无畏契约)" }, "categories": [ "游戏", "竞技游戏" ] } } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/douyin/trending/posts": { "get": { "tags": [ "Douyin" ], "summary": "Recommended posts, 10, or a category's.", "description": "What Douyin's home page or one of its categories recommends now: a new batch each\ncall. 1 credit.", "operationId": "douyinTrendingPosts", "parameters": [ { "name": "category", "in": "query", "description": "`food`, `games`, `anime`, `sports`, `music`, `knowledge`, `film`, `cars` or `pets`;\nthe home page's feed without it.", "required": false, "schema": { "type": "string", "description": "A category of the recommended feed.", "enum": [ "food", "games", "anime", "sports", "music", "knowledge", "film", "cars", "pets" ] } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_DouyinPost" }, "example": { "data": [ { "id": "7697577972965920027", "url": "https://www.douyin.com/video/7697577972965920027", "text": "一口气看完暴雨末日生存 一秒还正常的世界,一场无休止的暴雨骤然降临。洪水不断蔓延,生存空间越来越小。物资匮乏,危机四伏。这是暴雨末日,而我,要在这里艰难求生#我的世界#mc#末日#暴雨末日#一口气看完系列", "createdAt": "2026-10-17T10:14:01.000Z", "author": { "id": "1491387481857523", "username": "45618260104", "displayName": "我的世界-祖子", "avatarUrl": "https://p3-pc.douyinpic.com/aweme/100x100/aweme-avatar/tos-cn-avt-0015_bca3c0d9d9ee796fc6ac0def6dfa2cd4.jpeg?from=327834062&se=false&biz_tag=feed_avatar&l=202611280116473FF50F05D6AC01168710", "verified": false, "url": "https://www.douyin.com/user/MS4wLjABAAAAYR1tQ7yNnko_XsstQxQ5JpYDmU27JJSGd4RZf873U-J1Y2YgghvCKAEMckX6exOG" }, "stats": { "views": null, "likes": 67173, "comments": 331, "shares": 8922, "saves": 19765, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://p3-pc-sign.douyinpic.com/image-cut-tos/1131c4706060df21ad53b28ce5ad8f0c~tplv-dy-resize-origshort-autoq-75:330.jpeg?lk3s=138a59ce&x-expires=2111158800&x-signature=Idwgwg8mvFrw%2BifmtN8rahMS4Hs%3D&from=327834062&s=PackSourceEnum_FEED&se=false&sc=cover&biz_tag=pcweb_cover&l=202611280116473FF50F05D6AC01168710", "width": 1920, "height": 1080, "durationSeconds": 4679.921 } ], "hashtags": [ "我的世界", "mc", "末日" ], "mentions": [], "ext": { "kind": "video", "title": "一口气看完暴雨末日生存", "durationSeconds": 4679.921, "recommends": 1059, "pinned": false, "series": null, "sound": { "id": "7697580513577421587", "title": "@我的世界-祖子创作的原声", "author": "我的世界-祖子" }, "categories": [ "游戏", "模拟养成" ] } }, { "id": "7706513388629496549", "url": "https://www.douyin.com/video/7706513388629496549", "text": "如何在三点图正确使用非常规哨位?莲花古城禁灭全局思路解析他来了!@Orin失眠电竞 #无畏契约 #valorant #无畏契约教学 #瓦学弟", "createdAt": "2026-11-10T12:46:59.000Z", "author": { "id": "1190143787806569", "username": "Sevenone1s", "displayName": "7in(无畏契约)", "avatarUrl": "https://p3-pc.douyinpic.com/aweme/100x100/aweme-avatar/tos-cn-avt-0015_6dd03dfc9883ce207336b13d8bdcda56.jpeg?from=327834062&se=false&biz_tag=feed_avatar&l=202611280116473FF50F05D6AC01168710", "verified": false, "url": "https://www.douyin.com/user/MS4wLjABAAAA9lqvOpyp9W2hfhyy8fMASp386jhAs0hTjrzDbnHFl6QbCP3bMLZfaQmc-af3Nmt8" }, "stats": { "views": null, "likes": 66774, "comments": 240, "shares": 1688, "saves": 1102, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://p3-pc-sign.douyinpic.com/image-cut-tos/4875a85cb53f780ab7c41975c42334a9~tplv-dy-resize-origshort-autoq-75:330.jpeg?lk3s=138a59ce&x-expires=2111158800&x-signature=0NZVtYug%2B6dvkyoGlJsa7g5ySTk%3D&from=327834062&s=PackSourceEnum_FEED&se=false&sc=cover&biz_tag=pcweb_cover&l=202611280116473FF50F05D6AC01168710", "width": 1280, "height": 720, "durationSeconds": 336.367 } ], "hashtags": [ "无畏契约", "valorant", "无畏契约教学" ], "mentions": [], "ext": { "kind": "video", "title": null, "durationSeconds": 336.367, "recommends": 691, "pinned": false, "series": null, "sound": { "id": "7706513397868727040", "title": "@7in(无畏契约)创作的原声", "author": "7in(无畏契约)" }, "categories": [ "游戏", "竞技游戏" ] } } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.douyin.trendingPosts({ category: \"games\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.douyin.trending_posts(category=\"games\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/douyin/trending/posts \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"category=games\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_DouyinPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/DouyinPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "DouyinPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "kind", "pinned", "categories" ], "properties": { "categories": { "type": "array", "items": { "type": "string" }, "description": "Douyin's categories for it, broadest first (`游戏`, `角色扮演`)." }, "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "kind": { "$ref": "#/components/schemas/DouyinPostKind" }, "pinned": { "type": "boolean", "description": "Pinned to the top of its account." }, "recommends": { "type": [ "integer", "null" ], "format": "int64", "description": "Times recommended to others (推荐).", "minimum": 0 }, "series": { "oneOf": [ { "$ref": "#/components/schemas/DouyinSeriesRef" }, { "type": "null" } ] }, "sound": { "oneOf": [ { "$ref": "#/components/schemas/DouyinSoundRef" }, { "type": "null" } ] }, "title": { "type": [ "string", "null" ], "description": "Its title, where it has one apart from its caption." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A Douyin video or photo set." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "DouyinSoundRef": { "type": "object", "description": "The sound a post uses.", "required": [ "id" ], "properties": { "author": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "title": { "type": [ "string", "null" ] } } }, "DouyinSeriesRef": { "type": "object", "description": "A series (合集) a post is in.", "required": [ "id" ], "properties": { "episode": { "type": [ "integer", "null" ], "format": "int64", "description": "Its place in the series.", "minimum": 0 }, "id": { "type": "string" }, "name": { "type": [ "string", "null" ] } } }, "DouyinPostKind": { "type": "string", "description": "What a post is.", "enum": [ "video", "images" ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Trending (/docs/api-reference/douyin/trending) Douyin's hot search list, about 50. `GET https://api.socialapi.sh/v1/douyin/trending` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.douyin.trending(); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.douyin.trending() ``` **cURL** ```bash curl https://api.socialapi.sh/v1/douyin/trending \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" ``` **Response** ```json { "data": [ { "rank": null, "word": "习近平深圳时间的时代回响", "heat": null, "badge": null, "startedAt": null, "videos": null, "url": "https://www.douyin.com/hot/2768420", "coverUrl": null }, { "rank": 1, "word": "驻日使馆提醒中国公民防范地震", "heat": 11261400, "badge": 3, "startedAt": "2026-11-27T04:38:36.000Z", "videos": 2, "url": "https://www.douyin.com/hot/2767310", "coverUrl": "https://p9-sign.douyinpic.com/tos-cn-p-0015/ocmA4Cybr0AuWllJBeFEgODJACA9VxZIIkfACQ~noop.jpeg?lk3s=bfd515bb&x-expires=1795820400&x-signature=Hpb0%2BVdA%2BSbMI%2Fl51ucOZiTUSoI%3D&from=3218412987" } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/douyin/trending": { "get": { "tags": [ "Douyin" ], "summary": "Douyin's hot search list, about 50.", "description": "A board of 抖音热榜 (the main one, entertainment, society or hashtags), each search\nwith its rank, heat, video count and page. 10 credits.", "operationId": "douyinTrending", "parameters": [ { "name": "board", "in": "query", "description": "`hot` (the default), `entertainment`, `society` or `challenge` (hashtags).", "required": false, "schema": { "type": "string", "description": "A hot search board.", "enum": [ "hot", "entertainment", "society", "challenge" ] } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_DouyinTrend" }, "example": { "data": [ { "rank": null, "word": "习近平深圳时间的时代回响", "heat": null, "badge": null, "startedAt": null, "videos": null, "url": "https://www.douyin.com/hot/2768420", "coverUrl": null }, { "rank": 1, "word": "驻日使馆提醒中国公民防范地震", "heat": 11261400, "badge": 3, "startedAt": "2026-11-27T04:38:36.000Z", "videos": 2, "url": "https://www.douyin.com/hot/2767310", "coverUrl": "https://p9-sign.douyinpic.com/tos-cn-p-0015/ocmA4Cybr0AuWllJBeFEgODJACA9VxZIIkfACQ~noop.jpeg?lk3s=bfd515bb&x-expires=1795820400&x-signature=Hpb0%2BVdA%2BSbMI%2Fl51ucOZiTUSoI%3D&from=3218412987" } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.douyin.trending();" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.douyin.trending()" }, { "lang": "bash", "label": "cURL", "source": "curl https://api.socialapi.sh/v1/douyin/trending \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_DouyinTrend": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/DouyinTrend" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "DouyinTrend": { "type": "object", "description": "A search Douyin's hot list ranks (抖音热榜).", "required": [ "word" ], "properties": { "badge": { "type": [ "integer", "null" ], "format": "int64", "description": "Douyin's badge, by its code as the list sends it (3 is 热, hot); absent for none.", "minimum": 0 }, "coverUrl": { "type": [ "string", "null" ] }, "heat": { "type": [ "integer", "null" ], "format": "int64", "description": "Douyin's heat score.", "minimum": 0 }, "rank": { "type": [ "integer", "null" ], "format": "int64", "description": "Its place on the board; absent for the one pinned on top.", "minimum": 0 }, "startedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "When it began." }, { "type": "null" } ] }, "url": { "type": [ "string", "null" ], "description": "Its page." }, "videos": { "type": [ "integer", "null" ], "format": "int64", "description": "Videos about it.", "minimum": 0 }, "word": { "type": "string" } } }, "Timestamp": { "type": "string", "format": "date-time" } } } } ``` # Event (/docs/api-reference/facebook/event) One event, with its time, place and host. `GET https://api.socialapi.sh/v1/facebook/event` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.facebook.event({ id: "1172420738455703" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.facebook.event(id="1172420738455703").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/facebook/event \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "id=1172420738455703" ``` **Response** ```json { "data": { "id": "1172420738455703", "url": "https://www.facebook.com/events/1172420738455703/", "name": "Black Friday Starts Early at JCPenney Bronx", "description": "BLACK FRIDAY STARTS EARLY AT JCPENNEY! \n\nThe holiday excitement starts bright and early! Join us Friday, November 27, at 4:00 AM at JCPenney Bronx for a special Black Friday experience celebrating the customers who show up first.\n\nWe're bringing extra holiday cheer to the early morning with exclusive experiences, festive entertainment, and special surprises for our JCPenney Rewards members ONLY!…", "startsAt": "2026-11-27T09:00:00.000Z", "when": "Friday 27 November 2026 at 04:00 EST", "place": "JCPenney (The Bronx, NY)", "address": "100 Baychester Ave, The Bronx, NY, US 10475", "online": false, "past": false, "coverUrl": "https://scontent-lhr6-2.xx.fbcdn.net/v/t39.99422-6/911450546_1128424796718723_4108387113018032758_n.png?stp=dst-jpg_tt6&cstp=mx1920x1002&ctp=s960x960&_nc_cat=110&_nc_map=urlgen_bucketless&ccb=1-7&_nc_sid=75d36f&_nc_ohc=hoWTfgcXN4YQ7kNvwG7NR6r&_nc_oc=Adofe9enhUAto3p2aRrIhsOHAaZuuNNdmVlCCJ6eHIPHdgpE8QrKQS-hJDGUJaL2t5Q&_nc_zt=14&_nc_ht=scontent-lhr6-2.xx&_nc_gid=tHD6IQc9biRhnhsNe1uitg&_nc_ss=79389&oh=00_AQTfK1ZQiE0pJEIkcrfOKeGLMHAcH_zC5KlirSQYRDx7wQ&oe=6B0CB9CA", "attendance": null, "host": { "id": "100044467298394", "name": "JCPenney" }, "ticketUrl": null } } ``` **OpenAPI** ```json { "paths": { "/v1/facebook/event": { "get": { "tags": [ "Facebook" ], "summary": "One event, with its time, place and host.", "description": "Name, description, when, where, its host, how many are going and its tickets' link.\n1 credit.", "operationId": "facebookEvent", "parameters": [ { "name": "url", "in": "query", "description": "The event's link (`https://www.facebook.com/events//`).", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The event's id, instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_FacebookEvent" }, "example": { "data": { "id": "1172420738455703", "url": "https://www.facebook.com/events/1172420738455703/", "name": "Black Friday Starts Early at JCPenney Bronx", "description": "BLACK FRIDAY STARTS EARLY AT JCPENNEY! \n\nThe holiday excitement starts bright and early! Join us Friday, November 27, at 4:00 AM at JCPenney Bronx for a special Black Friday experience celebrating the customers who show up first.\n\nWe're bringing extra holiday cheer to the early morning with exclusive experiences, festive entertainment, and special surprises for our JCPenney Rewards members ONLY!…", "startsAt": "2026-11-27T09:00:00.000Z", "when": "Friday 27 November 2026 at 04:00 EST", "place": "JCPenney (The Bronx, NY)", "address": "100 Baychester Ave, The Bronx, NY, US 10475", "online": false, "past": false, "coverUrl": "https://scontent-lhr6-2.xx.fbcdn.net/v/t39.99422-6/911450546_1128424796718723_4108387113018032758_n.png?stp=dst-jpg_tt6&cstp=mx1920x1002&ctp=s960x960&_nc_cat=110&_nc_map=urlgen_bucketless&ccb=1-7&_nc_sid=75d36f&_nc_ohc=hoWTfgcXN4YQ7kNvwG7NR6r&_nc_oc=Adofe9enhUAto3p2aRrIhsOHAaZuuNNdmVlCCJ6eHIPHdgpE8QrKQS-hJDGUJaL2t5Q&_nc_zt=14&_nc_ht=scontent-lhr6-2.xx&_nc_gid=tHD6IQc9biRhnhsNe1uitg&_nc_ss=79389&oh=00_AQTfK1ZQiE0pJEIkcrfOKeGLMHAcH_zC5KlirSQYRDx7wQ&oe=6B0CB9CA", "attendance": null, "host": { "id": "100044467298394", "name": "JCPenney" }, "ticketUrl": null } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.facebook.event({ id: \"1172420738455703\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.facebook.event(id=\"1172420738455703\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/facebook/event \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"id=1172420738455703\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_FacebookEvent": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/FacebookEvent" } } }, "FacebookEvent": { "allOf": [ { "type": "object", "description": "An event.", "required": [ "id", "url", "name", "online", "past" ], "properties": { "address": { "type": [ "string", "null" ] }, "attendance": { "type": [ "string", "null" ], "description": "\"196 interested · 17 going\", as shown." }, "coverUrl": { "type": [ "string", "null" ] }, "description": { "type": [ "string", "null" ] }, "host": { "oneOf": [ { "$ref": "#/components/schemas/FacebookSeller" }, { "type": "null" } ] }, "id": { "type": "string" }, "name": { "type": "string" }, "online": { "type": "boolean" }, "past": { "type": "boolean" }, "place": { "type": [ "string", "null" ], "description": "Where: a venue's name, or \"Online event\"." }, "startsAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ticketUrl": { "type": [ "string", "null" ] }, "url": { "type": "string" }, "when": { "type": [ "string", "null" ], "description": "When, as Facebook writes it (\"Fri, Nov 27 at 4:00 AM EST\")." } } }, { "type": "object", "description": "A Facebook event." } ] }, "Timestamp": { "type": "string", "format": "date-time" }, "FacebookSeller": { "type": "object", "required": [ "id", "name" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" } } } } } } ``` # Events Search (/docs/api-reference/facebook/events-search) Events matching a query. `GET https://api.socialapi.sh/v1/facebook/events/search` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.facebook.eventsSearch({ query: "concert" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.facebook.events_search(query="concert") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/facebook/events/search \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "query=concert" ``` **Response** ```json { "data": [ { "id": "1108343211562169", "url": "https://www.facebook.com/events/1108343211562169/", "name": "grupa TRANZĪTS @ RIGA", "description": null, "startsAt": null, "when": null, "place": null, "address": null, "online": false, "past": false, "coverUrl": "https://scontent-lhr6-1.xx.fbcdn.net/v/t39.30808-6/838716757_122206266734794145_6130119481239039872_n.jpg?stp=c300.0.400.400a_cp0_dst-jpg_tt6&cstp=mx400x400&ctp=s64x64&_nc_cat=110&_nc_map=urlgen_bucketless&ccb=1-7&_nc_sid=80b81f&_nc_ohc=k96ntogVTUUQ7kNvwGlbVHL&_nc_oc=AdonyO5yZ1CV3SkuS21ynfO9acyu22MjimscdxJ2mSJqCgL3_1BRVab70hpWPo4jjVM&_nc_zt=23&_nc_ht=scontent-lhr6-1.xx&_nc_gid=AWFLm7o0xOr6MJTezHqzuQ&_nc_ss=79389&oh=00_AQQ6Zp2RwMd05v5OZMpFdSR4ApuY4NCvoK-9rSy5DRUJ2w&oe=6B0CCDAA", "attendance": null, "host": null, "ticketUrl": null }, { "id": "1155356459409853", "url": "https://www.facebook.com/events/1155356459409853/", "name": "Doja Cat at Philadelphia, PA", "description": null, "startsAt": null, "when": null, "place": null, "address": null, "online": false, "past": false, "coverUrl": "https://scontent-lhr6-1.xx.fbcdn.net/v/t39.30808-6/571231229_122164661300396331_8794661485324704249_n.jpg?stp=c200.0.800.800a_cp0_dst-jpg_tt6&cstp=mx800x800&ctp=s64x64&_nc_cat=105&_nc_map=urlgen_bucketless&ccb=1-7&_nc_sid=80b81f&_nc_ohc=PgHcdQQH-iIQ7kNvwF_N4z3&_nc_oc=AdoQxIbiPN6xjXp7yuaqgzpomDFK-cJHRJn-4tqcOEm9R2LNBJGLJ3kqVi3tMQXiWXU&_nc_zt=23&_nc_ht=scontent-lhr6-1.xx&_nc_gid=AWFLm7o0xOr6MJTezHqzuQ&_nc_ss=79389&oh=00_AQR1rvpdaTdOrmRcdO1SRVK98mLHMyEMgGIyLGahe50aTw&oe=6B0CB73C", "attendance": null, "host": null, "ticketUrl": null } ], "pagination": { "nextCursor": "eyJjIjoie1wicGFnZV9udW1iZXJcIjowLFwiZmxvd19jdXJzb3JzX3NlcmlhbGl6ZWRcIjp7XCJJTlRFUk5BTF9ERUJVR19NT0RVTEVcIjpcInt9XCIsXCJTRUFSQ0hfQ09OVFJPTFNfSU5URVJDRVBUXCI6XCJ7fVwiLFwiSU5URUdSSVRZXCI6XCJ7XFxcImhhc19tb3JlX3Jlc3VsdHNcXFwiOmZhbHNlLFxcXCJwcm9jZXNzZWRfdW5pY29ybl9pZHNcXFwiOltdLFxcXCJpc19lbmRfb2Zfc2VycFxcXCI6ZmFsc2V9XCIsXCJTUEVMTEVSXCI6XCJ7fVwiLFwiRVZFTlRTX1RBQlwiOlwie1xcXCJoYXNfbW9yZV9yZXN1bHRzXFxcIjp0…", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/facebook/events/search": { "get": { "tags": [ "Facebook" ], "summary": "Events matching a query.", "description": "Two short pages, all Facebook shows a visitor. 1 credit a page.", "operationId": "facebookEventsSearch", "parameters": [ { "name": "query", "in": "query", "description": "What to search for.", "required": true, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_FacebookEvent" }, "example": { "data": [ { "id": "1108343211562169", "url": "https://www.facebook.com/events/1108343211562169/", "name": "grupa TRANZĪTS @ RIGA", "description": null, "startsAt": null, "when": null, "place": null, "address": null, "online": false, "past": false, "coverUrl": "https://scontent-lhr6-1.xx.fbcdn.net/v/t39.30808-6/838716757_122206266734794145_6130119481239039872_n.jpg?stp=c300.0.400.400a_cp0_dst-jpg_tt6&cstp=mx400x400&ctp=s64x64&_nc_cat=110&_nc_map=urlgen_bucketless&ccb=1-7&_nc_sid=80b81f&_nc_ohc=k96ntogVTUUQ7kNvwGlbVHL&_nc_oc=AdonyO5yZ1CV3SkuS21ynfO9acyu22MjimscdxJ2mSJqCgL3_1BRVab70hpWPo4jjVM&_nc_zt=23&_nc_ht=scontent-lhr6-1.xx&_nc_gid=AWFLm7o0xOr6MJTezHqzuQ&_nc_ss=79389&oh=00_AQQ6Zp2RwMd05v5OZMpFdSR4ApuY4NCvoK-9rSy5DRUJ2w&oe=6B0CCDAA", "attendance": null, "host": null, "ticketUrl": null }, { "id": "1155356459409853", "url": "https://www.facebook.com/events/1155356459409853/", "name": "Doja Cat at Philadelphia, PA", "description": null, "startsAt": null, "when": null, "place": null, "address": null, "online": false, "past": false, "coverUrl": "https://scontent-lhr6-1.xx.fbcdn.net/v/t39.30808-6/571231229_122164661300396331_8794661485324704249_n.jpg?stp=c200.0.800.800a_cp0_dst-jpg_tt6&cstp=mx800x800&ctp=s64x64&_nc_cat=105&_nc_map=urlgen_bucketless&ccb=1-7&_nc_sid=80b81f&_nc_ohc=PgHcdQQH-iIQ7kNvwF_N4z3&_nc_oc=AdoQxIbiPN6xjXp7yuaqgzpomDFK-cJHRJn-4tqcOEm9R2LNBJGLJ3kqVi3tMQXiWXU&_nc_zt=23&_nc_ht=scontent-lhr6-1.xx&_nc_gid=AWFLm7o0xOr6MJTezHqzuQ&_nc_ss=79389&oh=00_AQR1rvpdaTdOrmRcdO1SRVK98mLHMyEMgGIyLGahe50aTw&oe=6B0CB73C", "attendance": null, "host": null, "ticketUrl": null } ], "pagination": { "nextCursor": "eyJjIjoie1wicGFnZV9udW1iZXJcIjowLFwiZmxvd19jdXJzb3JzX3NlcmlhbGl6ZWRcIjp7XCJJTlRFUk5BTF9ERUJVR19NT0RVTEVcIjpcInt9XCIsXCJTRUFSQ0hfQ09OVFJPTFNfSU5URVJDRVBUXCI6XCJ7fVwiLFwiSU5URUdSSVRZXCI6XCJ7XFxcImhhc19tb3JlX3Jlc3VsdHNcXFwiOmZhbHNlLFxcXCJwcm9jZXNzZWRfdW5pY29ybl9pZHNcXFwiOltdLFxcXCJpc19lbmRfb2Zfc2VycFxcXCI6ZmFsc2V9XCIsXCJTUEVMTEVSXCI6XCJ7fVwiLFwiRVZFTlRTX1RBQlwiOlwie1xcXCJoYXNfbW9yZV9yZXN1bHRzXFxcIjp0…", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.facebook.eventsSearch({ query: \"concert\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.facebook.events_search(query=\"concert\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/facebook/events/search \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"query=concert\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_FacebookEvent": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/FacebookEvent" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "FacebookEvent": { "allOf": [ { "type": "object", "description": "An event.", "required": [ "id", "url", "name", "online", "past" ], "properties": { "address": { "type": [ "string", "null" ] }, "attendance": { "type": [ "string", "null" ], "description": "\"196 interested · 17 going\", as shown." }, "coverUrl": { "type": [ "string", "null" ] }, "description": { "type": [ "string", "null" ] }, "host": { "oneOf": [ { "$ref": "#/components/schemas/FacebookSeller" }, { "type": "null" } ] }, "id": { "type": "string" }, "name": { "type": "string" }, "online": { "type": "boolean" }, "past": { "type": "boolean" }, "place": { "type": [ "string", "null" ], "description": "Where: a venue's name, or \"Online event\"." }, "startsAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ticketUrl": { "type": [ "string", "null" ] }, "url": { "type": "string" }, "when": { "type": [ "string", "null" ], "description": "When, as Facebook writes it (\"Fri, Nov 27 at 4:00 AM EST\")." } } }, { "type": "object", "description": "A Facebook event." } ] }, "Timestamp": { "type": "string", "format": "date-time" }, "FacebookSeller": { "type": "object", "required": [ "id", "name" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" } } } } } } ``` # Events (/docs/api-reference/facebook/events) A city's upcoming events, 12 a page. `GET https://api.socialapi.sh/v1/facebook/events` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.facebook.events({ cityId: "108424279189115" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.facebook.events(city_id="108424279189115") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/facebook/events \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "cityId=108424279189115" ``` **Response** ```json { "data": [ { "id": "1172420738455703", "url": "https://www.facebook.com/events/1172420738455703/", "name": "Black Friday Starts Early at JCPenney Bronx", "description": null, "startsAt": "2026-11-27T09:00:00.000Z", "when": "Fri, Nov 27 at 4:00 AM EST", "place": "JCPenney", "address": null, "online": false, "past": false, "coverUrl": "https://scontent-ham3-1.xx.fbcdn.net/v/t39.99422-6/911450546_1128424796718723_4108387113018032758_n.png?stp=c0.28.1920.917a_dst-jpg_tt6&cstp=mx1920x917&ctp=s320x320&_nc_cat=110&_nc_map=urlgen_bucketless&ccb=1-7&_nc_sid=75d36f&_nc_ohc=hoWTfgcXN4YQ7kNvwFsRgsy&_nc_oc=AdqsW-PGZExjm14k8vu3a0ib_lfZEVlYCDgRF_aQ85gQYXb3_1iqv3s9tlHvNEnrsWs&_nc_zt=14&_nc_ht=scontent-ham3-1.xx&_nc_gid=PpwSHzNGTjJ4GsOp-mBtgg&_nc_ss=79389&oh=00_AQSCiry0RuV8jzNxHNRAESNzbPDfYktzGPhncNJpDxcWbw&oe=6B0CB9CA", "attendance": "291 interested · 18 going", "host": null, "ticketUrl": null }, { "id": "2528884147546706", "url": "https://www.facebook.com/events/2528884147546706/", "name": "Anthony Rodia: Insanely Funny Tour", "description": null, "startsAt": "2026-11-29T01:00:00.000Z", "when": "Sat, Nov 28 at 8:00 PM EST", "place": "St. George Theatre", "address": null, "online": false, "past": false, "coverUrl": "https://scontent-ham3-1.xx.fbcdn.net/v/t39.30808-6/658385880_1410569981111555_2192905350716454565_n.avif?stp=c0.58.2048.977a_dst-jpg_tt6&cstp=mx2048x977&ctp=s320x320&_nc_cat=108&_nc_map=urlgen_bucketless&ccb=1-7&_nc_sid=75d36f&_nc_ohc=86HL6bVLd-8Q7kNvwHrGrf6&_nc_oc=AdrKWvGxgWyajKDlMvKvwdg-aPk6u9xsgSSYBPwzPPKCXGxOrHGtpK59M_HKmDPgaPE&_nc_zt=23&_nc_ht=scontent-ham3-1.xx&_nc_gid=PpwSHzNGTjJ4GsOp-mBtgg&_nc_ss=79389&oh=00_AQTRBOKOLM6r2Cz9TwHc-ZAHF-iBQPFRalKhN9L6vVy9IQ&oe=6B0CB381", "attendance": "3.2K interested · 349 going", "host": null, "ticketUrl": null } ], "pagination": { "nextCursor": "eyJzdGFydF90aW1lIjoxNzk1NjE3MTU4LCJlbmRfdGltZSI6MTgwMzM5MzE1OCwiYnJvd3NlX2N1cnNvciI6IkFicEhfY2MtRHhoQ3pjQXJhVlZzSHp1RzhHSDhyMVpVU3NVTTctbjZSdnphVnFHYjF3WmFGWjNoQTg4RnlwMEtHd2pQaVNxMlNScGxGOUF4bktjSlh1WFNXMVJ2WGM1SGN5TEZ0TnQyQkY5N2NNNUFDblZ4Q1lDak1yZVJQb1VZWkFYeUlhakJ5TjRhbm5sU010Y2I5Q0g0NzRkZGltOEtDT3pFeWxpTF81aTFlZmtxalA5VjBCbDFNQW94ajloMF9qSklSTTNzdUxnR3dFdWFONFEtUzkyUGstVXRoRU80NVgxZW1sTUNqVV9V…", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/facebook/events": { "get": { "tags": [ "Facebook" ], "summary": "A city's upcoming events, 12 a page.", "description": "1 credit a page.", "operationId": "facebookEvents", "parameters": [ { "name": "url", "in": "query", "description": "A city's events page (`https://www.facebook.com/events/explore/us-new-york/108424279189115/`).", "required": false, "schema": { "type": "string" } }, { "name": "cityId", "in": "query", "description": "The city's id (the number at the end of that link), instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_FacebookEvent" }, "example": { "data": [ { "id": "1172420738455703", "url": "https://www.facebook.com/events/1172420738455703/", "name": "Black Friday Starts Early at JCPenney Bronx", "description": null, "startsAt": "2026-11-27T09:00:00.000Z", "when": "Fri, Nov 27 at 4:00 AM EST", "place": "JCPenney", "address": null, "online": false, "past": false, "coverUrl": "https://scontent-ham3-1.xx.fbcdn.net/v/t39.99422-6/911450546_1128424796718723_4108387113018032758_n.png?stp=c0.28.1920.917a_dst-jpg_tt6&cstp=mx1920x917&ctp=s320x320&_nc_cat=110&_nc_map=urlgen_bucketless&ccb=1-7&_nc_sid=75d36f&_nc_ohc=hoWTfgcXN4YQ7kNvwFsRgsy&_nc_oc=AdqsW-PGZExjm14k8vu3a0ib_lfZEVlYCDgRF_aQ85gQYXb3_1iqv3s9tlHvNEnrsWs&_nc_zt=14&_nc_ht=scontent-ham3-1.xx&_nc_gid=PpwSHzNGTjJ4GsOp-mBtgg&_nc_ss=79389&oh=00_AQSCiry0RuV8jzNxHNRAESNzbPDfYktzGPhncNJpDxcWbw&oe=6B0CB9CA", "attendance": "291 interested · 18 going", "host": null, "ticketUrl": null }, { "id": "2528884147546706", "url": "https://www.facebook.com/events/2528884147546706/", "name": "Anthony Rodia: Insanely Funny Tour", "description": null, "startsAt": "2026-11-29T01:00:00.000Z", "when": "Sat, Nov 28 at 8:00 PM EST", "place": "St. George Theatre", "address": null, "online": false, "past": false, "coverUrl": "https://scontent-ham3-1.xx.fbcdn.net/v/t39.30808-6/658385880_1410569981111555_2192905350716454565_n.avif?stp=c0.58.2048.977a_dst-jpg_tt6&cstp=mx2048x977&ctp=s320x320&_nc_cat=108&_nc_map=urlgen_bucketless&ccb=1-7&_nc_sid=75d36f&_nc_ohc=86HL6bVLd-8Q7kNvwHrGrf6&_nc_oc=AdrKWvGxgWyajKDlMvKvwdg-aPk6u9xsgSSYBPwzPPKCXGxOrHGtpK59M_HKmDPgaPE&_nc_zt=23&_nc_ht=scontent-ham3-1.xx&_nc_gid=PpwSHzNGTjJ4GsOp-mBtgg&_nc_ss=79389&oh=00_AQTRBOKOLM6r2Cz9TwHc-ZAHF-iBQPFRalKhN9L6vVy9IQ&oe=6B0CB381", "attendance": "3.2K interested · 349 going", "host": null, "ticketUrl": null } ], "pagination": { "nextCursor": "eyJzdGFydF90aW1lIjoxNzk1NjE3MTU4LCJlbmRfdGltZSI6MTgwMzM5MzE1OCwiYnJvd3NlX2N1cnNvciI6IkFicEhfY2MtRHhoQ3pjQXJhVlZzSHp1RzhHSDhyMVpVU3NVTTctbjZSdnphVnFHYjF3WmFGWjNoQTg4RnlwMEtHd2pQaVNxMlNScGxGOUF4bktjSlh1WFNXMVJ2WGM1SGN5TEZ0TnQyQkY5N2NNNUFDblZ4Q1lDak1yZVJQb1VZWkFYeUlhakJ5TjRhbm5sU010Y2I5Q0g0NzRkZGltOEtDT3pFeWxpTF81aTFlZmtxalA5VjBCbDFNQW94ajloMF9qSklSTTNzdUxnR3dFdWFONFEtUzkyUGstVXRoRU80NVgxZW1sTUNqVV9V…", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.facebook.events({ cityId: \"108424279189115\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.facebook.events(city_id=\"108424279189115\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/facebook/events \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"cityId=108424279189115\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_FacebookEvent": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/FacebookEvent" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "FacebookEvent": { "allOf": [ { "type": "object", "description": "An event.", "required": [ "id", "url", "name", "online", "past" ], "properties": { "address": { "type": [ "string", "null" ] }, "attendance": { "type": [ "string", "null" ], "description": "\"196 interested · 17 going\", as shown." }, "coverUrl": { "type": [ "string", "null" ] }, "description": { "type": [ "string", "null" ] }, "host": { "oneOf": [ { "$ref": "#/components/schemas/FacebookSeller" }, { "type": "null" } ] }, "id": { "type": "string" }, "name": { "type": "string" }, "online": { "type": "boolean" }, "past": { "type": "boolean" }, "place": { "type": [ "string", "null" ], "description": "Where: a venue's name, or \"Online event\"." }, "startsAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ticketUrl": { "type": [ "string", "null" ] }, "url": { "type": "string" }, "when": { "type": [ "string", "null" ], "description": "When, as Facebook writes it (\"Fri, Nov 27 at 4:00 AM EST\")." } } }, { "type": "object", "description": "A Facebook event." } ] }, "Timestamp": { "type": "string", "format": "date-time" }, "FacebookSeller": { "type": "object", "required": [ "id", "name" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" } } } } } } ``` # Facebook API (/docs/api-reference/facebook) Every Facebook endpoint, by group. Each is a `GET` under `/v1/facebook`. ## Quick Reference [#quick-reference] | Property | Value | | --- | --- | | Base path | `/v1/facebook` | | Endpoints | 13 | | Credits | See Below | | Guide | [Facebook](/docs/facebook) | ## Accounts [#accounts] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/facebook/profile`](/docs/api-reference/facebook/profile) | A Page or a public person, with its follower count. | 1 | | [`GET /v1/facebook/profile/photos`](/docs/api-reference/facebook/profile-photos) | A Page's or person's photos, 8 a page. | 1 | | [`GET /v1/facebook/profile/posts`](/docs/api-reference/facebook/profile-posts) | A Page's or person's posts, newest first, 3 a page. | 1 | | [`GET /v1/facebook/profile/videos`](/docs/api-reference/facebook/profile-videos) | A Page's videos with their plays, about 6 a page. | 1 | ## Posts [#posts] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/facebook/post`](/docs/api-reference/facebook/post) | One post, reel or video with its counts and media. | 1 | | [`GET /v1/facebook/post/comments`](/docs/api-reference/facebook/post-comments) | A post's comments, most relevant first, 10 a page. | 1 | | [`GET /v1/facebook/post/comment/replies`](/docs/api-reference/facebook/post-comment-replies) | The replies to one comment, about 10 a page. | 1 | | [`GET /v1/facebook/post/transcript`](/docs/api-reference/facebook/post-transcript) | A video's captions as text with their times. | 10 | ## Marketplace [#marketplace] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/facebook/marketplace/item`](/docs/api-reference/facebook/marketplace-item) | One Marketplace listing. | 1 | | [`GET /v1/facebook/marketplace/search`](/docs/api-reference/facebook/marketplace-search) | Marketplace listings for a query near a point. | 1 | ## Events [#events] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/facebook/event`](/docs/api-reference/facebook/event) | One event, with its time, place and host. | 1 | | [`GET /v1/facebook/events`](/docs/api-reference/facebook/events) | A city's upcoming events, 12 a page. | 1 | | [`GET /v1/facebook/events/search`](/docs/api-reference/facebook/events-search) | Events matching a query. | 1 | ## Example Request [#example-request] Every Facebook endpoint is called this way: its path, and what to read as query parameters. **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.facebook.profile({ handle: "NASA" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.facebook.profile(handle="NASA").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/facebook/profile \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=NASA" ``` **Response** ```json { "data": { "id": "100044561550831", "username": "NASA", "displayName": "NASA - National Aeronautics and Space Administration", "bio": null, "avatarUrl": "https://scontent-ham3-1.xx.fbcdn.net/v/t39.30808-1/243095782_416661036495945_3843362260429099279_n.png?stp=dst-png&cstp=mx800x800&ctp=s200x200&_nc_cat=1&ccb=1-7&_nc_sid=2d3e12&_nc_ohc=9L3SyA6O4hMQ7kNvwFFAvxF&_nc_oc=AdpybpYhMw8jWVtu_JxDWUdMtLI5Czq9TSbYuo76Tt_Ox7pjEOtGt-zaWMbXtwrefdE&_nc_zt=24&_nc_ht=scontent-ham3-1.xx&_nc_gid=T5i9pWIous68P_Bvr73CIQ&_nc_ss=79389&oh=00_AQSM-2Yh4eXf9cZZwPB8BzXgNMEWSvNW3yHgzBkVrWdheQ&oe=6B0CCF95", "url": "https://www.facebook.com/NASA", "verified": true, "private": false, "followers": 28000000, "following": 53, "likes": null, "posts": null, "externalUrl": "https://www.nasa.gov/nasa-app/", "createdAt": null, "ext": { "pageId": "54971236771", "category": "Government organization", "followersLabel": "28M followers", "followingLabel": "53 following", "coverUrl": "https://scontent-ham3-1.xx.fbcdn.net/v/t39.99422-6/809146614_4484013928506139_3181913787670602881_n.png?stp=dst-jpg_tt6&cstp=mx2047x1487&ctp=s960x960&_nc_cat=110&_nc_map=urlgen_bucketless&ccb=1-7&_nc_sid=cc71e4&_nc_ohc=GVR710ihTyEQ7kNvwHoC3xD&_nc_oc=AdrCE6VeeQD4Y3D241kJ12-Iay1yW4-xHohgIU2E_l-MxAObvtEm-CmlFH7rAhOwXXU&_nc_zt=14&_nc_ht=scontent-ham3-1.xx&_nc_gid=T5i9pWIous68P_Bvr73CIQ&_nc_ss=79389&oh=00_AQR060AGMvQOt9YGGAfnInfe0lHPcITapSQoOhUfSrNIYA&oe=6B0CD367", "intro": [ { "kind": "category", "text": "Page · Government organization", "url": null }, { "kind": "confirmed_owner_label", "text": "NATIONAL AERONAUTICS AND SPACE ADMINISTRATION is responsible for this Page", "url": null }, { "kind": "email", "text": "public-inquiries@hq.nasa.gov", "url": null } ] } } } ``` ## Errors [#errors] A call that fails costs nothing. See [Errors](/docs/errors) for every code. # Marketplace Item (/docs/api-reference/facebook/marketplace-item) One Marketplace listing. `GET https://api.socialapi.sh/v1/facebook/marketplace/item` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.facebook.marketplaceItem({ id: "1611102457370634" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.facebook.marketplace_item(id="1611102457370634").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/facebook/marketplace/item \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "id=1611102457370634" ``` **Response** ```json { "data": { "id": "1611102457370634", "url": "https://www.facebook.com/marketplace/item/1611102457370634/", "title": "Schwinn Women's Cruiser Bike", "description": "Light blue Schwinn cruiser bike has a step-through steel frame with matching fenders. This bicycle is equipped with a white and blue padded seat, white-walled tires, and a kickstand. It has a single-speed drivetrain and coaster brakes.", "price": "$70", "amount": "70.00", "currency": "USD", "location": "New York, NY", "latitude": 40.712585449219, "longitude": -74.009399414062, "category": "Bicycles", "condition": "Used - Good", "imageUrl": null, "seller": { "id": "pfbid0pUjfdUMfWCvFZY4Uvop4UwKiZDA1zd7GQkrLuTZnxHcHuucb8rT5DJnjMdQh9oZtl", "name": "William Clayton" }, "sold": false, "createdAt": "2026-11-24T19:48:28.000Z" } } ``` **OpenAPI** ```json { "paths": { "/v1/facebook/marketplace/item": { "get": { "tags": [ "Facebook" ], "summary": "One Marketplace listing.", "description": "Title, description, price, condition, place and seller. 1 credit.", "operationId": "facebookMarketplaceItem", "parameters": [ { "name": "url", "in": "query", "description": "The listing's link (`https://www.facebook.com/marketplace/item//`).", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The listing's id, instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_FacebookListing" }, "example": { "data": { "id": "1611102457370634", "url": "https://www.facebook.com/marketplace/item/1611102457370634/", "title": "Schwinn Women's Cruiser Bike", "description": "Light blue Schwinn cruiser bike has a step-through steel frame with matching fenders. This bicycle is equipped with a white and blue padded seat, white-walled tires, and a kickstand. It has a single-speed drivetrain and coaster brakes.", "price": "$70", "amount": "70.00", "currency": "USD", "location": "New York, NY", "latitude": 40.712585449219, "longitude": -74.009399414062, "category": "Bicycles", "condition": "Used - Good", "imageUrl": null, "seller": { "id": "pfbid0pUjfdUMfWCvFZY4Uvop4UwKiZDA1zd7GQkrLuTZnxHcHuucb8rT5DJnjMdQh9oZtl", "name": "William Clayton" }, "sold": false, "createdAt": "2026-11-24T19:48:28.000Z" } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.facebook.marketplaceItem({ id: \"1611102457370634\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.facebook.marketplace_item(id=\"1611102457370634\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/facebook/marketplace/item \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"id=1611102457370634\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_FacebookListing": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/FacebookListing" } } }, "FacebookListing": { "allOf": [ { "type": "object", "description": "A Marketplace listing.", "required": [ "id", "url", "title", "sold" ], "properties": { "amount": { "type": [ "string", "null" ], "description": "The price as a decimal (\"150.00\"), and its currency where given." }, "category": { "type": [ "string", "null" ] }, "condition": { "type": [ "string", "null" ], "description": "\"Used - like new\", where the seller says." }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "currency": { "type": [ "string", "null" ] }, "description": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "imageUrl": { "type": [ "string", "null" ] }, "latitude": { "type": [ "number", "null" ], "format": "double" }, "location": { "type": [ "string", "null" ], "description": "Where it is, as shown (\"Jackson Heights, NY\")." }, "longitude": { "type": [ "number", "null" ], "format": "double" }, "price": { "type": [ "string", "null" ], "description": "The price as shown (\"$150\")." }, "seller": { "oneOf": [ { "$ref": "#/components/schemas/FacebookSeller" }, { "type": "null" } ] }, "sold": { "type": "boolean" }, "title": { "type": "string" }, "url": { "type": "string" } } }, { "type": "object", "description": "A Facebook Marketplace listing." } ] }, "FacebookSeller": { "type": "object", "required": [ "id", "name" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" } } }, "Timestamp": { "type": "string", "format": "date-time" } } } } ``` # Marketplace Search (/docs/api-reference/facebook/marketplace-search) Marketplace listings for a query near a point. `GET https://api.socialapi.sh/v1/facebook/marketplace/search` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.facebook.marketplaceSearch({ query: "bike", latitude: 40.7142, longitude: -74.0064, radiusKm: 40 }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.facebook.marketplace_search(query="bike", latitude=40.7142, longitude=-74.0064, radius_km=40) ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/facebook/marketplace/search \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "query=bike" \ --data-urlencode "latitude=40.7142" \ --data-urlencode "longitude=-74.0064" \ --data-urlencode "radiusKm=40" ``` **Response** ```json { "data": [ { "id": "1611102457370634", "url": "https://www.facebook.com/marketplace/item/1611102457370634/", "title": "Schwinn Women's Cruiser Bike", "description": null, "price": "$70", "amount": "70.00", "currency": null, "location": "New York, NY", "latitude": null, "longitude": null, "category": null, "condition": null, "imageUrl": "https://scontent-lhr11-1.xx.fbcdn.net/v/t39.84726-6/925373746_1470919605245753_5049828182584983856_n.jpg?stp=c158.0.260.260a_dst-jpg_p261x260_tt6&_nc_cat=110&_nc_map=urlgen_bucketless&ccb=1-7&_nc_sid=92e707&_nc_ohc=0i7glkGfmHwQ7kNvwEDV19z&_nc_oc=AdovpwlgiQm6h59UVjorYEB36YdPh8RyyxdhESTiPV4PqldKk36hl6OG19HPrhS9a3g&_nc_zt=14&_nc_ht=scontent-lhr11-1.xx&_nc_gid=al_LwO4tIYMiUhMJhYweVg&_nc_ss=79389&oh=00_AQTm-Vr6sDNmpjS0rLAF9B30V3VJOMuTJ8YuC3ivAoNeTg&oe=6B0CBD68", "seller": { "id": "pfbid0pUjfdUMfWCvFZY4Uvop4UwKiZDA1zd7GQkrLuTZnxHcHuucb8rT5DJnjMdQh9oZtl", "name": "William Clayton" }, "sold": false, "createdAt": "2026-11-24T19:48:28.000Z" }, { "id": "1430762362147166", "url": "https://www.facebook.com/marketplace/item/1430762362147166/", "title": "Fixed bike", "description": null, "price": "$80", "amount": "80.00", "currency": null, "location": "Far Rockaway, NY", "latitude": null, "longitude": null, "category": null, "condition": null, "imageUrl": "https://scontent-lhr11-1.xx.fbcdn.net/v/t39.84726-6/926503282_1795355981733089_2862857702909896092_n.jpg?stp=c43.0.260.260a_dst-jpg_p261x260_tt6&_nc_cat=104&_nc_map=urlgen_bucketless&ccb=1-7&_nc_sid=92e707&_nc_ohc=O3vh6Qy-pQYQ7kNvwGBuL3H&_nc_oc=AdrlmkWfX-T2wEg4Xgwd-nOesCSTcxwfljBNVnOM6RNsw3JP3AbNSFNj1lNvdXBFZis&_nc_zt=14&_nc_ht=scontent-lhr11-1.xx&_nc_gid=al_LwO4tIYMiUhMJhYweVg&_nc_ss=79389&oh=00_AQQM_XJRdye5EgVYr61pmiVGxR3LNPR36OF-OPncEDyJdw&oe=6B0CB196", "seller": { "id": "pfbid02ouXzMQNv1VEdfjhsTx3QdTNinuKQ52GzudWuAD8Heto4U91wcBT2sdyv3Ry44NCpl", "name": "Malcolm Hill" }, "sold": false, "createdAt": "2026-11-24T20:13:52.000Z" } ], "pagination": { "nextCursor": "{\"pg\":0,\"b2c\":{\"br\":\"\",\"it\":0,\"hmsr\":false,\"tbi\":0},\"c2c\":{\"br\":\"AboQsQeljhINTKOiQhHCXnx4YlThqYVDogbtGyhai0jeM6kqj4oWHm--E0Iq34oiLoNLm7uyiFQvQ3X2PknB5nQ0gbbWIiMPwswgCByHMoV2riIQ6aq3biDbl26TUL14NScrgemm2ZLZuPGDWbMFz6tQX5YxFQmJGB6GjhEKGi32ss9XIRMLZXyjCpbEngm7yIoDlYHuz3nWvKUSqS1gwAHMGtyEfsiUmjzuYw7TK0RTFb54Mk2RWmJejRlhf8cCD1yK3tzFHH61eDdgLEJg3OYC460MIdsQxrjQkaEh3aD-CdDxwi7DAViWr5oETq420-6nNL6ubzc1s3o…", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/facebook/marketplace/search": { "get": { "tags": [ "Facebook" ], "summary": "Marketplace listings for a query near a point.", "description": "Title, price, place and seller of each, about 14, the first page Facebook shows a\nvisitor. 1 credit.", "operationId": "facebookMarketplaceSearch", "parameters": [ { "name": "query", "in": "query", "description": "What to look for.", "required": true, "schema": { "type": "string" } }, { "name": "latitude", "in": "query", "description": "Where: latitude and longitude of the point to search around.", "required": true, "schema": { "type": "number", "format": "double" } }, { "name": "longitude", "in": "query", "required": true, "schema": { "type": "number", "format": "double" } }, { "name": "radiusKm", "in": "query", "description": "How far around it, in kilometres (default 40, at most 500).", "required": false, "schema": { "type": "integer", "format": "int32", "minimum": 0 } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_FacebookListing" }, "example": { "data": [ { "id": "1611102457370634", "url": "https://www.facebook.com/marketplace/item/1611102457370634/", "title": "Schwinn Women's Cruiser Bike", "description": null, "price": "$70", "amount": "70.00", "currency": null, "location": "New York, NY", "latitude": null, "longitude": null, "category": null, "condition": null, "imageUrl": "https://scontent-lhr11-1.xx.fbcdn.net/v/t39.84726-6/925373746_1470919605245753_5049828182584983856_n.jpg?stp=c158.0.260.260a_dst-jpg_p261x260_tt6&_nc_cat=110&_nc_map=urlgen_bucketless&ccb=1-7&_nc_sid=92e707&_nc_ohc=0i7glkGfmHwQ7kNvwEDV19z&_nc_oc=AdovpwlgiQm6h59UVjorYEB36YdPh8RyyxdhESTiPV4PqldKk36hl6OG19HPrhS9a3g&_nc_zt=14&_nc_ht=scontent-lhr11-1.xx&_nc_gid=al_LwO4tIYMiUhMJhYweVg&_nc_ss=79389&oh=00_AQTm-Vr6sDNmpjS0rLAF9B30V3VJOMuTJ8YuC3ivAoNeTg&oe=6B0CBD68", "seller": { "id": "pfbid0pUjfdUMfWCvFZY4Uvop4UwKiZDA1zd7GQkrLuTZnxHcHuucb8rT5DJnjMdQh9oZtl", "name": "William Clayton" }, "sold": false, "createdAt": "2026-11-24T19:48:28.000Z" }, { "id": "1430762362147166", "url": "https://www.facebook.com/marketplace/item/1430762362147166/", "title": "Fixed bike", "description": null, "price": "$80", "amount": "80.00", "currency": null, "location": "Far Rockaway, NY", "latitude": null, "longitude": null, "category": null, "condition": null, "imageUrl": "https://scontent-lhr11-1.xx.fbcdn.net/v/t39.84726-6/926503282_1795355981733089_2862857702909896092_n.jpg?stp=c43.0.260.260a_dst-jpg_p261x260_tt6&_nc_cat=104&_nc_map=urlgen_bucketless&ccb=1-7&_nc_sid=92e707&_nc_ohc=O3vh6Qy-pQYQ7kNvwGBuL3H&_nc_oc=AdrlmkWfX-T2wEg4Xgwd-nOesCSTcxwfljBNVnOM6RNsw3JP3AbNSFNj1lNvdXBFZis&_nc_zt=14&_nc_ht=scontent-lhr11-1.xx&_nc_gid=al_LwO4tIYMiUhMJhYweVg&_nc_ss=79389&oh=00_AQQM_XJRdye5EgVYr61pmiVGxR3LNPR36OF-OPncEDyJdw&oe=6B0CB196", "seller": { "id": "pfbid02ouXzMQNv1VEdfjhsTx3QdTNinuKQ52GzudWuAD8Heto4U91wcBT2sdyv3Ry44NCpl", "name": "Malcolm Hill" }, "sold": false, "createdAt": "2026-11-24T20:13:52.000Z" } ], "pagination": { "nextCursor": "{\"pg\":0,\"b2c\":{\"br\":\"\",\"it\":0,\"hmsr\":false,\"tbi\":0},\"c2c\":{\"br\":\"AboQsQeljhINTKOiQhHCXnx4YlThqYVDogbtGyhai0jeM6kqj4oWHm--E0Iq34oiLoNLm7uyiFQvQ3X2PknB5nQ0gbbWIiMPwswgCByHMoV2riIQ6aq3biDbl26TUL14NScrgemm2ZLZuPGDWbMFz6tQX5YxFQmJGB6GjhEKGi32ss9XIRMLZXyjCpbEngm7yIoDlYHuz3nWvKUSqS1gwAHMGtyEfsiUmjzuYw7TK0RTFb54Mk2RWmJejRlhf8cCD1yK3tzFHH61eDdgLEJg3OYC460MIdsQxrjQkaEh3aD-CdDxwi7DAViWr5oETq420-6nNL6ubzc1s3o…", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.facebook.marketplaceSearch({ query: \"bike\", latitude: 40.7142, longitude: -74.0064, radiusKm: 40 });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.facebook.marketplace_search(query=\"bike\", latitude=40.7142, longitude=-74.0064, radius_km=40)" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/facebook/marketplace/search \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"query=bike\" \\\n --data-urlencode \"latitude=40.7142\" \\\n --data-urlencode \"longitude=-74.0064\" \\\n --data-urlencode \"radiusKm=40\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_FacebookListing": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/FacebookListing" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "FacebookListing": { "allOf": [ { "type": "object", "description": "A Marketplace listing.", "required": [ "id", "url", "title", "sold" ], "properties": { "amount": { "type": [ "string", "null" ], "description": "The price as a decimal (\"150.00\"), and its currency where given." }, "category": { "type": [ "string", "null" ] }, "condition": { "type": [ "string", "null" ], "description": "\"Used - like new\", where the seller says." }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "currency": { "type": [ "string", "null" ] }, "description": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "imageUrl": { "type": [ "string", "null" ] }, "latitude": { "type": [ "number", "null" ], "format": "double" }, "location": { "type": [ "string", "null" ], "description": "Where it is, as shown (\"Jackson Heights, NY\")." }, "longitude": { "type": [ "number", "null" ], "format": "double" }, "price": { "type": [ "string", "null" ], "description": "The price as shown (\"$150\")." }, "seller": { "oneOf": [ { "$ref": "#/components/schemas/FacebookSeller" }, { "type": "null" } ] }, "sold": { "type": "boolean" }, "title": { "type": "string" }, "url": { "type": "string" } } }, { "type": "object", "description": "A Facebook Marketplace listing." } ] }, "FacebookSeller": { "type": "object", "required": [ "id", "name" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" } } }, "Timestamp": { "type": "string", "format": "date-time" } } } } ``` # Post Comment Replies (/docs/api-reference/facebook/post-comment-replies) The replies to one comment, about 10 a page. `GET https://api.socialapi.sh/v1/facebook/post/comment/replies` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.facebook.postCommentReplies({ token: "ZmVlZGJhY2s6cGZiaWQwM2NuY2cycnBlcHRDV2Zzb0R0aWFZUG1GelRlOFZmTm5wd0tLQUxtRGROYnJSdW9WZll2ZGgyVXdETmpyY2dTa1BUV3paRlI2aEFqVzlhU1BNQ245V21TakVqZVJDRXNoTUJDbA==:MjoxNzk1NjE3MTQ3OgF_sLfYh85ZEc0p62jkke1KI7pM5Dr1_Dde1H6jrxsoBO9vqOwclH-5wop8Wqly-OMJmZPn_5YvONJFF7kUs8pW5mTCzhQKhVvveNbvdTm2fghiJ-pG3tg_7JFvkLHTKGzW_iKWMWZ0Ri9eeb29T1KoxcRaKQaqcorwz9nlcV-X8QLIY6C-6wvXG5zQLn-qh3KublxAqQPy7qcihcNh3vYgGHi82Fl39iGTE2csL3qGvzfh8OgbY1PwSZuDXf3PQLuRQPkkp4UuQ1e79ImpBD_xYLFCqpEl_4ORqQUQBMv4V3K7bz1UV-f_ffjEOO-wfq-ClQq35WuVadSD_8c1qoYXj99sSSusTPcqgWX-13Np4StxTH-7h1J_Ff2xjT2pGwOLe-LYkglm7lt7WcFLVwzI3oPjH9oJ27y44cQpaI-RAkrIi1E98j9cKnox4S8hGmA4FSVzNUAcszOGCG9LkHZusO-QTx4PrT6l-D6ou3dVdHGhmyIJmXbaswmOVOLJWhwjRv9Ym1cUV7VXS4DgkEcHVCX11sa10pVujX0Q340Tvr6sRrM36MziFQCDWCV2WtaOCf2Wh1mfIAQOyz3FTKVe3tPD4e2MlsYRTacOlQujCatKwwZbX8vt" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.facebook.post_comment_replies(token="ZmVlZGJhY2s6cGZiaWQwM2NuY2cycnBlcHRDV2Zzb0R0aWFZUG1GelRlOFZmTm5wd0tLQUxtRGROYnJSdW9WZll2ZGgyVXdETmpyY2dTa1BUV3paRlI2aEFqVzlhU1BNQ245V21TakVqZVJDRXNoTUJDbA==:MjoxNzk1NjE3MTQ3OgF_sLfYh85ZEc0p62jkke1KI7pM5Dr1_Dde1H6jrxsoBO9vqOwclH-5wop8Wqly-OMJmZPn_5YvONJFF7kUs8pW5mTCzhQKhVvveNbvdTm2fghiJ-pG3tg_7JFvkLHTKGzW_iKWMWZ0Ri9eeb29T1KoxcRaKQaqcorwz9nlcV-X8QLIY6C-6wvXG5zQLn-qh3KublxAqQPy7qcihcNh3vYgGHi82Fl39iGTE2csL3qGvzfh8OgbY1PwSZuDXf3PQLuRQPkkp4UuQ1e79ImpBD_xYLFCqpEl_4ORqQUQBMv4V3K7bz1UV-f_ffjEOO-wfq-ClQq35WuVadSD_8c1qoYXj99sSSusTPcqgWX-13Np4StxTH-7h1J_Ff2xjT2pGwOLe-LYkglm7lt7WcFLVwzI3oPjH9oJ27y44cQpaI-RAkrIi1E98j9cKnox4S8hGmA4FSVzNUAcszOGCG9LkHZusO-QTx4PrT6l-D6ou3dVdHGhmyIJmXbaswmOVOLJWhwjRv9Ym1cUV7VXS4DgkEcHVCX11sa10pVujX0Q340Tvr6sRrM36MziFQCDWCV2WtaOCf2Wh1mfIAQOyz3FTKVe3tPD4e2MlsYRTacOlQujCatKwwZbX8vt") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/facebook/post/comment/replies \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "token=ZmVlZGJhY2s6cGZiaWQwM2NuY2cycnBlcHRDV2Zzb0R0aWFZUG1GelRlOFZmTm5wd0tLQUxtRGROYnJSdW9WZll2ZGgyVXdETmpyY2dTa1BUV3paRlI2aEFqVzlhU1BNQ245V21TakVqZVJDRXNoTUJDbA==:MjoxNzk1NjE3MTQ3OgF_sLfYh85ZEc0p62jkke1KI7pM5Dr1_Dde1H6jrxsoBO9vqOwclH-5wop8Wqly-OMJmZPn_5YvONJFF7kUs8pW5mTCzhQKhVvveNbvdTm2fghiJ-pG3tg_7JFvkLHTKGzW_iKWMWZ0Ri9eeb29T1KoxcRaKQaqcorwz9nlcV-X8QLIY6C-6wvXG5zQLn-qh3KublxAqQPy7qcihcNh3vYgGHi82Fl39iGTE2csL3qGvzfh8OgbY1PwSZuDXf3PQLuRQPkkp4UuQ1e79ImpBD_xYLFCqpEl_4ORqQUQBMv4V3K7bz1UV-f_ffjEOO-wfq-ClQq35WuVadSD_8c1qoYXj99sSSusTPcqgWX-13Np4StxTH-7h1J_Ff2xjT2pGwOLe-LYkglm7lt7WcFLVwzI3oPjH9oJ27y44cQpaI-RAkrIi1E98j9cKnox4S8hGmA4FSVzNUAcszOGCG9LkHZusO-QTx4PrT6l-D6ou3dVdHGhmyIJmXbaswmOVOLJWhwjRv9Ym1cUV7VXS4DgkEcHVCX11sa10pVujX0Q340Tvr6sRrM36MziFQCDWCV2WtaOCf2Wh1mfIAQOyz3FTKVe3tPD4e2MlsYRTacOlQujCatKwwZbX8vt" ``` **Response** ```json { "data": [ { "id": "1074508998557491", "postId": "1393461115481927", "parentId": null, "text": "Tommie Green not the stock prices of Nike? LOL.", "createdAt": "2026-09-10T16:57:08.000Z", "author": { "id": "pfbid0twZfSZSRuFLAi84ZogC6FYWpvNokG8RE8hrKjBexKRSjaoV3iJj6chZUFspYibcZl", "username": "people", "displayName": "Yourbreath Needsasnickers", "avatarUrl": "https://scontent-ham3-1.xx.fbcdn.net/v/t39.30808-1/743146092_122221075646436161_3935444085493419230_n.jpg?stp=c66.0.148.148a_cp0_dst-jpg_tt6&cstp=mx148x148&ctp=s32x32&_nc_cat=107&_nc_map=urlgen_bucketless&ccb=1-7&_nc_sid=e99d92&_nc_ohc=VPcJUqcEGLIQ7kNvwF6yYXr&_nc_oc=Adp0sRtqVGBdhLqDprS1KDyGyTUa6HPLbeby9_HnikJJ2KpAlHfFyUIlXc6k_w6YKT4&_nc_zt=24&_nc_ht=scontent-ham3-1.xx&_nc_gid=npPOR5gBse6szs_iQpgOAg&_nc_ss=79389&oh=00_AQQZyRitbAwaxarGqKi8k-Uv5P9C7AS5y-2DvxkI0WHy3A&oe=6B0CBC40", "verified": false, "url": "https://www.facebook.com/people/Yourbreath-Needsasnickers/pfbid0twZfSZSRuFLAi84ZogC6FYWpvNokG8RE8hrKjBexKRSjaoV3iJj6chZUFspYibcZl/" }, "likes": 0, "replies": 0, "ext": { "repliesToken": null, "reactions": [] } } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/facebook/post/comment/replies": { "get": { "tags": [ "Facebook" ], "summary": "The replies to one comment, about 10 a page.", "description": "The comment is named by its `ext.repliesToken`. 1 credit a page.", "operationId": "facebookPostCommentReplies", "parameters": [ { "name": "token", "in": "query", "description": "The comment's `ext.repliesToken` (present when it has replies).", "required": true, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_FacebookComment" }, "example": { "data": [ { "id": "1074508998557491", "postId": "1393461115481927", "parentId": null, "text": "Tommie Green not the stock prices of Nike? LOL.", "createdAt": "2026-09-10T16:57:08.000Z", "author": { "id": "pfbid0twZfSZSRuFLAi84ZogC6FYWpvNokG8RE8hrKjBexKRSjaoV3iJj6chZUFspYibcZl", "username": "people", "displayName": "Yourbreath Needsasnickers", "avatarUrl": "https://scontent-ham3-1.xx.fbcdn.net/v/t39.30808-1/743146092_122221075646436161_3935444085493419230_n.jpg?stp=c66.0.148.148a_cp0_dst-jpg_tt6&cstp=mx148x148&ctp=s32x32&_nc_cat=107&_nc_map=urlgen_bucketless&ccb=1-7&_nc_sid=e99d92&_nc_ohc=VPcJUqcEGLIQ7kNvwF6yYXr&_nc_oc=Adp0sRtqVGBdhLqDprS1KDyGyTUa6HPLbeby9_HnikJJ2KpAlHfFyUIlXc6k_w6YKT4&_nc_zt=24&_nc_ht=scontent-ham3-1.xx&_nc_gid=npPOR5gBse6szs_iQpgOAg&_nc_ss=79389&oh=00_AQQZyRitbAwaxarGqKi8k-Uv5P9C7AS5y-2DvxkI0WHy3A&oe=6B0CBC40", "verified": false, "url": "https://www.facebook.com/people/Yourbreath-Needsasnickers/pfbid0twZfSZSRuFLAi84ZogC6FYWpvNokG8RE8hrKjBexKRSjaoV3iJj6chZUFspYibcZl/" }, "likes": 0, "replies": 0, "ext": { "repliesToken": null, "reactions": [] } } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.facebook.postCommentReplies({ token: \"ZmVlZGJhY2s6cGZiaWQwM2NuY2cycnBlcHRDV2Zzb0R0aWFZUG1GelRlOFZmTm5wd0tLQUxtRGROYnJSdW9WZll2ZGgyVXdETmpyY2dTa1BUV3paRlI2aEFqVzlhU1BNQ245V21TakVqZVJDRXNoTUJDbA==:MjoxNzk1NjE3MTQ3OgF_sLfYh85ZEc0p62jkke1KI7pM5Dr1_Dde1H6jrxsoBO9vqOwclH-5wop8Wqly-OMJmZPn_5YvONJFF7kUs8pW5mTCzhQKhVvveNbvdTm2fghiJ-pG3tg_7JFvkLHTKGzW_iKWMWZ0Ri9eeb29T1KoxcRaKQaqcorwz9nlcV-X8QLIY6C-6wvXG5zQLn-qh3KublxAqQPy7qcihcNh3vYgGHi82Fl39iGTE2csL3qGvzfh8OgbY1PwSZuDXf3PQLuRQPkkp4UuQ1e79ImpBD_xYLFCqpEl_4ORqQUQBMv4V3K7bz1UV-f_ffjEOO-wfq-ClQq35WuVadSD_8c1qoYXj99sSSusTPcqgWX-13Np4StxTH-7h1J_Ff2xjT2pGwOLe-LYkglm7lt7WcFLVwzI3oPjH9oJ27y44cQpaI-RAkrIi1E98j9cKnox4S8hGmA4FSVzNUAcszOGCG9LkHZusO-QTx4PrT6l-D6ou3dVdHGhmyIJmXbaswmOVOLJWhwjRv9Ym1cUV7VXS4DgkEcHVCX11sa10pVujX0Q340Tvr6sRrM36MziFQCDWCV2WtaOCf2Wh1mfIAQOyz3FTKVe3tPD4e2MlsYRTacOlQujCatKwwZbX8vt\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.facebook.post_comment_replies(token=\"ZmVlZGJhY2s6cGZiaWQwM2NuY2cycnBlcHRDV2Zzb0R0aWFZUG1GelRlOFZmTm5wd0tLQUxtRGROYnJSdW9WZll2ZGgyVXdETmpyY2dTa1BUV3paRlI2aEFqVzlhU1BNQ245V21TakVqZVJDRXNoTUJDbA==:MjoxNzk1NjE3MTQ3OgF_sLfYh85ZEc0p62jkke1KI7pM5Dr1_Dde1H6jrxsoBO9vqOwclH-5wop8Wqly-OMJmZPn_5YvONJFF7kUs8pW5mTCzhQKhVvveNbvdTm2fghiJ-pG3tg_7JFvkLHTKGzW_iKWMWZ0Ri9eeb29T1KoxcRaKQaqcorwz9nlcV-X8QLIY6C-6wvXG5zQLn-qh3KublxAqQPy7qcihcNh3vYgGHi82Fl39iGTE2csL3qGvzfh8OgbY1PwSZuDXf3PQLuRQPkkp4UuQ1e79ImpBD_xYLFCqpEl_4ORqQUQBMv4V3K7bz1UV-f_ffjEOO-wfq-ClQq35WuVadSD_8c1qoYXj99sSSusTPcqgWX-13Np4StxTH-7h1J_Ff2xjT2pGwOLe-LYkglm7lt7WcFLVwzI3oPjH9oJ27y44cQpaI-RAkrIi1E98j9cKnox4S8hGmA4FSVzNUAcszOGCG9LkHZusO-QTx4PrT6l-D6ou3dVdHGhmyIJmXbaswmOVOLJWhwjRv9Ym1cUV7VXS4DgkEcHVCX11sa10pVujX0Q340Tvr6sRrM36MziFQCDWCV2WtaOCf2Wh1mfIAQOyz3FTKVe3tPD4e2MlsYRTacOlQujCatKwwZbX8vt\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/facebook/post/comment/replies \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"token=ZmVlZGJhY2s6cGZiaWQwM2NuY2cycnBlcHRDV2Zzb0R0aWFZUG1GelRlOFZmTm5wd0tLQUxtRGROYnJSdW9WZll2ZGgyVXdETmpyY2dTa1BUV3paRlI2aEFqVzlhU1BNQ245V21TakVqZVJDRXNoTUJDbA==:MjoxNzk1NjE3MTQ3OgF_sLfYh85ZEc0p62jkke1KI7pM5Dr1_Dde1H6jrxsoBO9vqOwclH-5wop8Wqly-OMJmZPn_5YvONJFF7kUs8pW5mTCzhQKhVvveNbvdTm2fghiJ-pG3tg_7JFvkLHTKGzW_iKWMWZ0Ri9eeb29T1KoxcRaKQaqcorwz9nlcV-X8QLIY6C-6wvXG5zQLn-qh3KublxAqQPy7qcihcNh3vYgGHi82Fl39iGTE2csL3qGvzfh8OgbY1PwSZuDXf3PQLuRQPkkp4UuQ1e79ImpBD_xYLFCqpEl_4ORqQUQBMv4V3K7bz1UV-f_ffjEOO-wfq-ClQq35WuVadSD_8c1qoYXj99sSSusTPcqgWX-13Np4StxTH-7h1J_Ff2xjT2pGwOLe-LYkglm7lt7WcFLVwzI3oPjH9oJ27y44cQpaI-RAkrIi1E98j9cKnox4S8hGmA4FSVzNUAcszOGCG9LkHZusO-QTx4PrT6l-D6ou3dVdHGhmyIJmXbaswmOVOLJWhwjRv9Ym1cUV7VXS4DgkEcHVCX11sa10pVujX0Q340Tvr6sRrM36MziFQCDWCV2WtaOCf2Wh1mfIAQOyz3FTKVe3tPD4e2MlsYRTacOlQujCatKwwZbX8vt\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_FacebookComment": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/FacebookComment" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "FacebookComment": { "allOf": [ { "type": "object", "description": "A comment or a reply.", "required": [ "id", "postId", "text", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "reactions" ], "properties": { "reactions": { "type": "array", "items": { "$ref": "#/components/schemas/FacebookReaction" }, "description": "Reactions by kind (`likes` is them all)." }, "repliesToken": { "type": [ "string", "null" ], "description": "Pass it as `token` to `/v1/facebook/post/comment/replies` for its replies; absent\nwhen it has none." } } }, { "type": "object", "description": "What only this platform has." } ] }, "id": { "type": "string" }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "parentId": { "type": [ "string", "null" ], "description": "The comment this replies to; absent on a top-level comment." }, "postId": { "type": "string" }, "replies": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "text": { "type": "string" } } }, { "type": "object", "description": "A Facebook comment or reply." } ] }, "FacebookReaction": { "type": "object", "description": "One kind of reaction and how many gave it.", "required": [ "kind", "count" ], "properties": { "count": { "type": "integer", "format": "int64", "minimum": 0 }, "kind": { "type": "string", "description": "`Like`, `Love`, `Care`, `Haha`, `Wow`, `Sad`, `Angry`." } } }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Post Comments (/docs/api-reference/facebook/post-comments) A post's comments, most relevant first, 10 a page. `GET https://api.socialapi.sh/v1/facebook/post/comments` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.facebook.postComments({ url: "https://www.facebook.com/reel/2166091230582141/" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.facebook.post_comments(url="https://www.facebook.com/reel/2166091230582141/") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/facebook/post/comments \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://www.facebook.com/reel/2166091230582141/" ``` **Response** ```json { "data": [ { "id": "2082653245809386", "postId": "pfbid033KSQ51ManYG45zmjEdDniiZrrsUR8HAswY9MNHF1AcC6iymnXkuYgUMK5RfTyjdel", "parentId": null, "text": "The small breath she took beforehand got my anxiety up", "createdAt": "2025-11-08T02:07:24.000Z", "author": { "id": "1090190898", "username": "TommieGreen", "displayName": "Tommie Green", "avatarUrl": "https://scontent-ham3-1.xx.fbcdn.net/v/t39.30808-1/600230482_10237851409919657_1111065343747799075_n.jpg?stp=cp6_dst-jpg_tt6&cstp=mx912x912&ctp=s32x32&_nc_cat=109&_nc_map=urlgen_bucketless&ccb=1-7&_nc_sid=1d2534&_nc_ohc=50Kxd_y-OGoQ7kNvwFrdeva&_nc_oc=AdopEfW3NiDn6dZkROfsxOv5lAY85VQCCIffELHW29kIzLDx2BzI-eCIfnm2FzNPn9E&_nc_zt=24&_nc_ht=scontent-ham3-1.xx&_nc_gid=bkewnTp2Ih6nyycNMxwTFg&_nc_ss=79389&oh=00_AQSklKTTICIDaRghzJ4CysDCvV9ikroXAfRpeN0i2r564g&oe=6B0CD050", "verified": false, "url": "https://www.facebook.com/TommieGreen" }, "likes": 56, "replies": 1, "ext": { "repliesToken": "ZmVlZGJhY2s6cGZiaWQwM2NuY2cycnBlcHRDV2Zzb0R0aWFZUG1GelRlOFZmTm5wd0tLQUxtRGROYnJSdW9WZll2ZGgyVXdETmpyY2dTa1BUV3paRlI2aEFqVzlhU1BNQ245V21TakVqZVJDRXNoTUJDbA==:MjoxNzk1NjE3MTQ3OgF_sLfYh85ZEc0p62jkke1KI7pM5Dr1_Dde1H6jrxsoBO9vqOwclH-5wop8Wqly-OMJmZPn_5YvONJFF7kUs8pW5mTCzhQKhVvveNbvdTm2fghiJ-pG3tg_7JFvkLHTKGzW_iKWMWZ0Ri9eeb29T1KoxcRaKQaqcorwz9nlcV-X8QLIY6C-6wvXG5zQLn-qh3KublxAqQPy7qcihcNh3vYgGHi82Fl39iG…", "reactions": [ { "kind": "Like", "count": 47 }, { "kind": "Love", "count": 7 }, { "kind": "Haha", "count": 1 } ] } }, { "id": "928055526461620", "postId": "pfbid033KSQ51ManYG45zmjEdDniiZrrsUR8HAswY9MNHF1AcC6iymnXkuYgUMK5RfTyjdel", "parentId": null, "text": "Ok. I tried a pair of ons. I really like them. But- I still got another pair of Nike's. After a TON of trying on the Ons - yes I found a pair but my Nike's still feel better for me structurally than others including Brooks brand. (Which I also like ). Still gotta have a pair of my tried and true Nike's 😍", "createdAt": "2026-02-03T02:22:11.000Z", "author": { "id": "pfbid02px9VF7tw6MCuYsFoZjpvShkWv85ANRKT57GN6VLv83e7izdQbGKNTJCRxxstUir4l", "username": "pfbid02px9VF7tw6MCuYsFoZjpvShkWv85ANRKT57GN6VLv83e7izdQbGKNTJCRxxstUir4l", "displayName": "Summer Bruhn", "avatarUrl": "https://scontent-ham3-1.xx.fbcdn.net/v/t39.30808-1/865728182_29954361804165257_1674048826125095569_n.jpg?stp=cp0_dst-jpg_tt6&cstp=mx960x960&ctp=s32x32&_nc_cat=109&_nc_map=urlgen_bucketless&ccb=1-7&_nc_sid=e99d92&_nc_ohc=ZRNYT09jRhMQ7kNvwGBQwVA&_nc_oc=AdpwqfZ_vVtAvY8SlRxvFV3RRVfSxlTEwKeRlXCKdVCMXf1q8OInihaPdW59lv_fnvs&_nc_zt=24&_nc_ht=scontent-ham3-1.xx&_nc_gid=bkewnTp2Ih6nyycNMxwTFg&_nc_ss=79389&oh=00_AQQlu-eAPpGjTki0266C6nmvrV2lAxcy7iC2I3GstAIhLQ&oe=6B0CB074", "verified": false, "url": "https://www.facebook.com/profile.php?id=pfbid02px9VF7tw6MCuYsFoZjpvShkWv85ANRKT57GN6VLv83e7izdQbGKNTJCRxxstUir4l" }, "likes": 13, "replies": 1, "ext": { "repliesToken": "ZmVlZGJhY2s6cGZiaWQwNDdQZkFCVkY5a0c5TGlYZ01Dc1Q2cWFGYjNqYjNNVVRxdjd3aHE3Wjh3WUJiWmpCN04yaUJwWkpONXVvc0xOU0ExZjd0UUVneGtSQ0dLcDVMc05CVDh6YUd0dVkzd29oU2w=:MjoxNzk1NjE3MTQ3OgF_aNiIwICrcDsjXsVcOXV_ojpwV9WI0K44WptiClG9woyjW1C2uOPYWBfxAnmIW1ORyr3kXZgovo9Asi2oEnTNclDBrpi3qqi07YFd8KPZqhAPSNfYdYG7uYf2ZWdLNbW7lKvOetwwzuq98LrR3Yi-UXFVRhTKq7ovQjdgyDR_-2EYLTycmd2AJ-tI2EwQDtPPkGQ8qdWgAKahpPqf0lREPj81njmEpaVnFhP…", "reactions": [ { "kind": "Like", "count": 10 }, { "kind": "Love", "count": 3 } ] } } ], "pagination": { "nextCursor": "MToxNzk1NjE3MTQ3OgF_d7gtK0xgEahLiLI48Cq2LT0RdGZUqU9q_9XklI5gigOHLTHvWNLg2sdhkvUT7IRkkgCTjdI60eokKKTB7UWfX6YIv-5dlqZtIe5-r_PUKakclDr8TY4EFWs1E6_0GvvhjtZE2kaO5Hy3s1hVUwaw2gGn_g-subp0fezglvx3k4Hl0vKNLVF4gK5YPTHBbmPaglOklpJySuFswXbRPi1kQJmi5enJJa_ibiMvpKw9YX8mG8fjnTm0IiMjInsKRLbMA6v1GR4mmPoJakhV6tA6a6HpJIcV8hPFsgnBgOFocyJfLca7EALEoTFQb9xMGP6S6a5lf79zwXeL1C7AvSLDFvdu1whtRwaf5vWRFXpgA3P_dZo5Eb_pUrbgRlp_…", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/facebook/post/comments": { "get": { "tags": [ "Facebook" ], "summary": "A post's comments, most relevant first, 10 a page.", "description": "With their reactions and reply counts. A comment with replies carries\n`ext.repliesToken` for `/v1/facebook/post/comment/replies`. 1 credit a page.", "operationId": "facebookPostComments", "parameters": [ { "name": "url", "in": "query", "description": "The post's link.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_FacebookComment" }, "example": { "data": [ { "id": "2082653245809386", "postId": "pfbid033KSQ51ManYG45zmjEdDniiZrrsUR8HAswY9MNHF1AcC6iymnXkuYgUMK5RfTyjdel", "parentId": null, "text": "The small breath she took beforehand got my anxiety up", "createdAt": "2025-11-08T02:07:24.000Z", "author": { "id": "1090190898", "username": "TommieGreen", "displayName": "Tommie Green", "avatarUrl": "https://scontent-ham3-1.xx.fbcdn.net/v/t39.30808-1/600230482_10237851409919657_1111065343747799075_n.jpg?stp=cp6_dst-jpg_tt6&cstp=mx912x912&ctp=s32x32&_nc_cat=109&_nc_map=urlgen_bucketless&ccb=1-7&_nc_sid=1d2534&_nc_ohc=50Kxd_y-OGoQ7kNvwFrdeva&_nc_oc=AdopEfW3NiDn6dZkROfsxOv5lAY85VQCCIffELHW29kIzLDx2BzI-eCIfnm2FzNPn9E&_nc_zt=24&_nc_ht=scontent-ham3-1.xx&_nc_gid=bkewnTp2Ih6nyycNMxwTFg&_nc_ss=79389&oh=00_AQSklKTTICIDaRghzJ4CysDCvV9ikroXAfRpeN0i2r564g&oe=6B0CD050", "verified": false, "url": "https://www.facebook.com/TommieGreen" }, "likes": 56, "replies": 1, "ext": { "repliesToken": "ZmVlZGJhY2s6cGZiaWQwM2NuY2cycnBlcHRDV2Zzb0R0aWFZUG1GelRlOFZmTm5wd0tLQUxtRGROYnJSdW9WZll2ZGgyVXdETmpyY2dTa1BUV3paRlI2aEFqVzlhU1BNQ245V21TakVqZVJDRXNoTUJDbA==:MjoxNzk1NjE3MTQ3OgF_sLfYh85ZEc0p62jkke1KI7pM5Dr1_Dde1H6jrxsoBO9vqOwclH-5wop8Wqly-OMJmZPn_5YvONJFF7kUs8pW5mTCzhQKhVvveNbvdTm2fghiJ-pG3tg_7JFvkLHTKGzW_iKWMWZ0Ri9eeb29T1KoxcRaKQaqcorwz9nlcV-X8QLIY6C-6wvXG5zQLn-qh3KublxAqQPy7qcihcNh3vYgGHi82Fl39iG…", "reactions": [ { "kind": "Like", "count": 47 }, { "kind": "Love", "count": 7 }, { "kind": "Haha", "count": 1 } ] } }, { "id": "928055526461620", "postId": "pfbid033KSQ51ManYG45zmjEdDniiZrrsUR8HAswY9MNHF1AcC6iymnXkuYgUMK5RfTyjdel", "parentId": null, "text": "Ok. I tried a pair of ons. I really like them. But- I still got another pair of Nike's. After a TON of trying on the Ons - yes I found a pair but my Nike's still feel better for me structurally than others including Brooks brand. (Which I also like ). Still gotta have a pair of my tried and true Nike's 😍", "createdAt": "2026-02-03T02:22:11.000Z", "author": { "id": "pfbid02px9VF7tw6MCuYsFoZjpvShkWv85ANRKT57GN6VLv83e7izdQbGKNTJCRxxstUir4l", "username": "pfbid02px9VF7tw6MCuYsFoZjpvShkWv85ANRKT57GN6VLv83e7izdQbGKNTJCRxxstUir4l", "displayName": "Summer Bruhn", "avatarUrl": "https://scontent-ham3-1.xx.fbcdn.net/v/t39.30808-1/865728182_29954361804165257_1674048826125095569_n.jpg?stp=cp0_dst-jpg_tt6&cstp=mx960x960&ctp=s32x32&_nc_cat=109&_nc_map=urlgen_bucketless&ccb=1-7&_nc_sid=e99d92&_nc_ohc=ZRNYT09jRhMQ7kNvwGBQwVA&_nc_oc=AdpwqfZ_vVtAvY8SlRxvFV3RRVfSxlTEwKeRlXCKdVCMXf1q8OInihaPdW59lv_fnvs&_nc_zt=24&_nc_ht=scontent-ham3-1.xx&_nc_gid=bkewnTp2Ih6nyycNMxwTFg&_nc_ss=79389&oh=00_AQQlu-eAPpGjTki0266C6nmvrV2lAxcy7iC2I3GstAIhLQ&oe=6B0CB074", "verified": false, "url": "https://www.facebook.com/profile.php?id=pfbid02px9VF7tw6MCuYsFoZjpvShkWv85ANRKT57GN6VLv83e7izdQbGKNTJCRxxstUir4l" }, "likes": 13, "replies": 1, "ext": { "repliesToken": "ZmVlZGJhY2s6cGZiaWQwNDdQZkFCVkY5a0c5TGlYZ01Dc1Q2cWFGYjNqYjNNVVRxdjd3aHE3Wjh3WUJiWmpCN04yaUJwWkpONXVvc0xOU0ExZjd0UUVneGtSQ0dLcDVMc05CVDh6YUd0dVkzd29oU2w=:MjoxNzk1NjE3MTQ3OgF_aNiIwICrcDsjXsVcOXV_ojpwV9WI0K44WptiClG9woyjW1C2uOPYWBfxAnmIW1ORyr3kXZgovo9Asi2oEnTNclDBrpi3qqi07YFd8KPZqhAPSNfYdYG7uYf2ZWdLNbW7lKvOetwwzuq98LrR3Yi-UXFVRhTKq7ovQjdgyDR_-2EYLTycmd2AJ-tI2EwQDtPPkGQ8qdWgAKahpPqf0lREPj81njmEpaVnFhP…", "reactions": [ { "kind": "Like", "count": 10 }, { "kind": "Love", "count": 3 } ] } } ], "pagination": { "nextCursor": "MToxNzk1NjE3MTQ3OgF_d7gtK0xgEahLiLI48Cq2LT0RdGZUqU9q_9XklI5gigOHLTHvWNLg2sdhkvUT7IRkkgCTjdI60eokKKTB7UWfX6YIv-5dlqZtIe5-r_PUKakclDr8TY4EFWs1E6_0GvvhjtZE2kaO5Hy3s1hVUwaw2gGn_g-subp0fezglvx3k4Hl0vKNLVF4gK5YPTHBbmPaglOklpJySuFswXbRPi1kQJmi5enJJa_ibiMvpKw9YX8mG8fjnTm0IiMjInsKRLbMA6v1GR4mmPoJakhV6tA6a6HpJIcV8hPFsgnBgOFocyJfLca7EALEoTFQb9xMGP6S6a5lf79zwXeL1C7AvSLDFvdu1whtRwaf5vWRFXpgA3P_dZo5Eb_pUrbgRlp_…", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.facebook.postComments({ url: \"https://www.facebook.com/reel/2166091230582141/\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.facebook.post_comments(url=\"https://www.facebook.com/reel/2166091230582141/\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/facebook/post/comments \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://www.facebook.com/reel/2166091230582141/\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_FacebookComment": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/FacebookComment" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "FacebookComment": { "allOf": [ { "type": "object", "description": "A comment or a reply.", "required": [ "id", "postId", "text", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "reactions" ], "properties": { "reactions": { "type": "array", "items": { "$ref": "#/components/schemas/FacebookReaction" }, "description": "Reactions by kind (`likes` is them all)." }, "repliesToken": { "type": [ "string", "null" ], "description": "Pass it as `token` to `/v1/facebook/post/comment/replies` for its replies; absent\nwhen it has none." } } }, { "type": "object", "description": "What only this platform has." } ] }, "id": { "type": "string" }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "parentId": { "type": [ "string", "null" ], "description": "The comment this replies to; absent on a top-level comment." }, "postId": { "type": "string" }, "replies": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "text": { "type": "string" } } }, { "type": "object", "description": "A Facebook comment or reply." } ] }, "FacebookReaction": { "type": "object", "description": "One kind of reaction and how many gave it.", "required": [ "kind", "count" ], "properties": { "count": { "type": "integer", "format": "int64", "minimum": 0 }, "kind": { "type": "string", "description": "`Like`, `Love`, `Care`, `Haha`, `Wow`, `Sad`, `Angry`." } } }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Post Transcript (/docs/api-reference/facebook/post-transcript) A video's captions as text with their times. `GET https://api.socialapi.sh/v1/facebook/post/transcript` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.facebook.postTranscript({ url: "https://www.facebook.com/NASA/videos/happy-thanksgiving-from-the-international-space-station-nasa-astronauts-anil-men/2688015701636592/" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.facebook.post_transcript(url="https://www.facebook.com/NASA/videos/happy-thanksgiving-from-the-international-space-station-nasa-astronauts-anil-men/2688015701636592/").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/facebook/post/transcript \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://www.facebook.com/NASA/videos/happy-thanksgiving-from-the-international-space-station-nasa-astronauts-anil-men/2688015701636592/" ``` **Response** ```json { "data": { "postId": "2688015701636592", "locale": "en_US", "language": "English", "translated": false, "text": "And a harvest is just as important\nnow as it was in the first Thanksgiving.\nWe need plants to survive as we set up our moon base,\nand as we go to Mars, we're going to have to grow our own nutrition.\nSo that's what we're doing this Thanksgiving.\nI plan on using this with a tortilla\nand some pasta and some hot sauce to make my Thanksgiving meal,\nand I'm grateful for you and for my family\nat home.\nYe…", "cues": [ { "startSeconds": 9.642, "endSeconds": 12.679, "text": "And a harvest is just as important" }, { "startSeconds": 12.729, "endSeconds": 15.965, "text": "now as it was in the first Thanksgiving." }, { "startSeconds": 16.533, "endSeconds": 20.236, "text": "We need plants to survive as we set up our moon base," } ] } } ``` **OpenAPI** ```json { "paths": { "/v1/facebook/post/transcript": { "get": { "tags": [ "Facebook" ], "summary": "A video's captions as text with their times.", "description": "Facebook's own track, in the video's language where it lists one, else a translation\n(`translated` says so). `404` when the video has none. 10 credits.", "operationId": "facebookPostTranscript", "parameters": [ { "name": "url", "in": "query", "description": "The video's or reel's link.", "required": false, "schema": { "type": "string" } }, { "name": "language", "in": "query", "description": "A language to prefer, such as `en` or `tr`; the video's own otherwise.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_FacebookTranscript" }, "example": { "data": { "postId": "2688015701636592", "locale": "en_US", "language": "English", "translated": false, "text": "And a harvest is just as important\nnow as it was in the first Thanksgiving.\nWe need plants to survive as we set up our moon base,\nand as we go to Mars, we're going to have to grow our own nutrition.\nSo that's what we're doing this Thanksgiving.\nI plan on using this with a tortilla\nand some pasta and some hot sauce to make my Thanksgiving meal,\nand I'm grateful for you and for my family\nat home.\nYe…", "cues": [ { "startSeconds": 9.642, "endSeconds": 12.679, "text": "And a harvest is just as important" }, { "startSeconds": 12.729, "endSeconds": 15.965, "text": "now as it was in the first Thanksgiving." }, { "startSeconds": 16.533, "endSeconds": 20.236, "text": "We need plants to survive as we set up our moon base," } ] } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.facebook.postTranscript({ url: \"https://www.facebook.com/NASA/videos/happy-thanksgiving-from-the-international-space-station-nasa-astronauts-anil-men/2688015701636592/\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.facebook.post_transcript(url=\"https://www.facebook.com/NASA/videos/happy-thanksgiving-from-the-international-space-station-nasa-astronauts-anil-men/2688015701636592/\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/facebook/post/transcript \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://www.facebook.com/NASA/videos/happy-thanksgiving-from-the-international-space-station-nasa-astronauts-anil-men/2688015701636592/\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_FacebookTranscript": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/FacebookTranscript" } } }, "FacebookTranscript": { "allOf": [ { "type": "object", "description": "A video's captions as text.", "required": [ "postId", "locale", "translated", "text", "cues" ], "properties": { "cues": { "type": "array", "items": { "$ref": "#/components/schemas/FacebookCue" } }, "language": { "type": [ "string", "null" ] }, "locale": { "type": "string" }, "postId": { "type": "string" }, "text": { "type": "string", "description": "The captions as plain text, one cue per line." }, "translated": { "type": "boolean", "description": "A machine translation, where the video's own track is not listed." } } }, { "type": "object", "description": "A Facebook video's captions as text." } ] }, "FacebookCue": { "type": "object", "required": [ "startSeconds", "endSeconds", "text" ], "properties": { "endSeconds": { "type": "number", "format": "double" }, "startSeconds": { "type": "number", "format": "double" }, "text": { "type": "string" } } } } } } ``` # Post (/docs/api-reference/facebook/post) One post, reel or video with its counts and media. `GET https://api.socialapi.sh/v1/facebook/post` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.facebook.post({ url: "https://www.facebook.com/NASA/posts/pfbid02sZQLRpCntK2pPvttuB2JQn1d1HRLMgxGgM6qSeAKoxKg4stR91djJcHy4AKipjk1l" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.facebook.post(url="https://www.facebook.com/NASA/posts/pfbid02sZQLRpCntK2pPvttuB2JQn1d1HRLMgxGgM6qSeAKoxKg4stR91djJcHy4AKipjk1l").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/facebook/post \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://www.facebook.com/NASA/posts/pfbid02sZQLRpCntK2pPvttuB2JQn1d1HRLMgxGgM6qSeAKoxKg4stR91djJcHy4AKipjk1l" ``` **Response** ```json { "data": { "id": "pfbid02sZQLRpCntK2pPvttuB2JQn1d1HRLMgxGgM6qSeAKoxKg4stR91djJcHy4AKipjk1l", "url": "https://www.facebook.com/NASA/posts/pfbid02sZQLRpCntK2pPvttuB2JQn1d1HRLMgxGgM6qSeAKoxKg4stR91djJcHy4AKipjk1l", "text": "A home away from home 🌕\n \nWe're building a Moon Base, where astronauts will live, work, and explore the lunar surface.\n \nLearn how humanity's first lunar outpost will be built and how it'll prepare us for future missions: https://go.nasa.gov/4jamgox", "createdAt": "2026-11-24T16:50:00.000Z", "author": { "id": "100044561550831", "username": "NASA", "displayName": "NASA - National Aeronautics and Space Administration", "avatarUrl": null, "verified": false, "url": "https://www.facebook.com/NASA" }, "stats": { "views": null, "likes": 1763, "comments": 89, "shares": 154, "saves": null, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "kind": "post", "postId": "1697460178416018", "reactions": [ { "kind": "Like", "count": 1317 }, { "kind": "Love", "count": 407 }, { "kind": "Care", "count": 20 } ], "plays": null, "captions": [], "altText": "The heavily cratered Moon as seen by the Artemis II crew as they traveled around the Moon. The boundary between lunar day and night, or the terminator, is visible at the top of the image. This area is the South Pole-Aitken basin, the largest and oldest basin on the Moon." } } } ``` **OpenAPI** ```json { "paths": { "/v1/facebook/post": { "get": { "tags": [ "Facebook" ], "summary": "One post, reel or video with its counts and media.", "description": "Text, author, time, reactions by kind, comment and share counts, its media and the\ncaption tracks it has. 1 credit.", "operationId": "facebookPost", "parameters": [ { "name": "url", "in": "query", "description": "The post's link (`https://www.facebook.com/nike/posts/pfbid…`, a reel's, a video's).", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_FacebookPost" }, "example": { "data": { "id": "pfbid02sZQLRpCntK2pPvttuB2JQn1d1HRLMgxGgM6qSeAKoxKg4stR91djJcHy4AKipjk1l", "url": "https://www.facebook.com/NASA/posts/pfbid02sZQLRpCntK2pPvttuB2JQn1d1HRLMgxGgM6qSeAKoxKg4stR91djJcHy4AKipjk1l", "text": "A home away from home 🌕\n \nWe're building a Moon Base, where astronauts will live, work, and explore the lunar surface.\n \nLearn how humanity's first lunar outpost will be built and how it'll prepare us for future missions: https://go.nasa.gov/4jamgox", "createdAt": "2026-11-24T16:50:00.000Z", "author": { "id": "100044561550831", "username": "NASA", "displayName": "NASA - National Aeronautics and Space Administration", "avatarUrl": null, "verified": false, "url": "https://www.facebook.com/NASA" }, "stats": { "views": null, "likes": 1763, "comments": 89, "shares": 154, "saves": null, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "kind": "post", "postId": "1697460178416018", "reactions": [ { "kind": "Like", "count": 1317 }, { "kind": "Love", "count": 407 }, { "kind": "Care", "count": 20 } ], "plays": null, "captions": [], "altText": "The heavily cratered Moon as seen by the Artemis II crew as they traveled around the Moon. The boundary between lunar day and night, or the terminator, is visible at the top of the image. This area is the South Pole-Aitken basin, the largest and oldest basin on the Moon." } } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.facebook.post({ url: \"https://www.facebook.com/NASA/posts/pfbid02sZQLRpCntK2pPvttuB2JQn1d1HRLMgxGgM6qSeAKoxKg4stR91djJcHy4AKipjk1l\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.facebook.post(url=\"https://www.facebook.com/NASA/posts/pfbid02sZQLRpCntK2pPvttuB2JQn1d1HRLMgxGgM6qSeAKoxKg4stR91djJcHy4AKipjk1l\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/facebook/post \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://www.facebook.com/NASA/posts/pfbid02sZQLRpCntK2pPvttuB2JQn1d1HRLMgxGgM6qSeAKoxKg4stR91djJcHy4AKipjk1l\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_FacebookPost": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/FacebookPost" } } }, "FacebookPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "kind", "reactions", "captions" ], "properties": { "altText": { "type": [ "string", "null" ], "description": "Facebook's description of a photo, for screen readers." }, "captions": { "type": "array", "items": { "$ref": "#/components/schemas/FacebookCaptionTrack" }, "description": "The video's caption tracks; read one with `/v1/facebook/post/transcript`." }, "kind": { "$ref": "#/components/schemas/FacebookPostKind" }, "plays": { "type": [ "integer", "null" ], "format": "int64", "description": "Plays of a video, where Facebook counts them beside its views.", "minimum": 0 }, "postId": { "type": [ "string", "null" ], "description": "The numeric id Facebook also gives the post, where it does." }, "reactions": { "type": "array", "items": { "$ref": "#/components/schemas/FacebookReaction" }, "description": "Reactions by kind (`stats.likes` is them all)." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A Facebook post: a story, a photo, a video or a reel." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "FacebookReaction": { "type": "object", "description": "One kind of reaction and how many gave it.", "required": [ "kind", "count" ], "properties": { "count": { "type": "integer", "format": "int64", "minimum": 0 }, "kind": { "type": "string", "description": "`Like`, `Love`, `Care`, `Haha`, `Wow`, `Sad`, `Angry`." } } }, "FacebookPostKind": { "type": "string", "description": "What a post is.", "enum": [ "post", "photo", "video", "reel" ] }, "FacebookCaptionTrack": { "type": "object", "description": "A caption track of a video.", "required": [ "locale", "translated" ], "properties": { "language": { "type": [ "string", "null" ], "description": "The language's name, as Facebook gives it." }, "locale": { "type": "string", "description": "`en_US`, `es_LA`…" }, "translated": { "type": "boolean", "description": "A machine translation of the video's own track, not the track itself." } } }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Profile Photos (/docs/api-reference/facebook/profile-photos) A Page's or person's photos, 8 a page. `GET https://api.socialapi.sh/v1/facebook/profile/photos` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.facebook.profilePhotos({ handle: "NASA" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.facebook.profile_photos(handle="NASA") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/facebook/profile/photos \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=NASA" ``` **Response** ```json { "data": [ { "id": "1697460148416021", "url": "https://www.facebook.com/photo/?fbid=1697460148416021", "text": null, "createdAt": null, "author": null, "stats": { "views": null, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://scontent-lhr6-1.xx.fbcdn.net/v/t39.30808-6/924514337_1697460158416020_6227482654830500974_n.jpg?stp=dst-jpg_tt6&cstp=mx1280x853&ctp=s1280x853&_nc_cat=108&_nc_map=urlgen_bucketless&ccb=1-7&_nc_sid=127cfc&_nc_ohc=qdkt-qCSuNUQ7kNvwEqLQNJ&_nc_oc=AdrRB-PkbuLWjrVYAETsi1XD4g_Ez09LKgLsmuCqS_exvA-k0JZbU1uS68sOORh3n0o&_nc_zt=23&_nc_ht=scontent-lhr6-1.xx&_nc_gid=NOlGtxq4DF3CgfeJBd_hbA&_nc_ss=79389&oh=00_AQRaOhIBY-JaM57hibEItWswbMPGL09y_z32A1Rrzvz-zg&oe=6B0CB0DE", "thumbnailUrl": null, "width": 1280, "height": 853, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "kind": "photo", "postId": null, "reactions": [], "plays": null, "captions": [], "altText": "The heavily cratered Moon as seen by the Artemis II crew as they traveled around the Moon. The boundary between lunar day and night, or the terminator, is visible at the top of the image. This area is the South Pole-Aitken basin, the largest and oldest basin on the Moon." } }, { "id": "1690599555768747", "url": "https://www.facebook.com/photo/?fbid=1690599555768747", "text": null, "createdAt": null, "author": null, "stats": { "views": null, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://scontent-lhr11-1.xx.fbcdn.net/v/t39.30808-6/916765074_1690599559102080_8008653452099091270_n.jpg?stp=dst-jpg_tt6&cstp=mx2048x2048&ctp=s2048x2048&_nc_cat=105&_nc_map=urlgen_bucketless&ccb=1-7&_nc_sid=127cfc&_nc_ohc=y06oZdeErRAQ7kNvwF9PXcL&_nc_oc=Adp_p5R_F4Pxt9T_Iq5dEe-D6Mq_xC8EdJ9amgcWpoxKJQKYh0V8uPAWSshUQvY2dCI&_nc_zt=23&_nc_ht=scontent-lhr11-1.xx&_nc_gid=NOlGtxq4DF3CgfeJBd_hbA&_nc_ss=79389&oh=00_AQRsUTY-vitx1PsQtXKRepSNnGBHG3tSvR-PsNfd0UKuiA&oe=6B0CB122", "thumbnailUrl": null, "width": 2048, "height": 2048, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "kind": "photo", "postId": null, "reactions": [], "plays": null, "captions": [], "altText": "A supernova remnant looks like colorful paints swirling together set against the darkness of space. At the heart of the image is a light purple cloud and a spiraling, bright yellow tangle. A vibrant red gas cloud surrounds the center; it has trails of red that drift upward and to the right. A faint, dark blue cloud begins at upper left and exits the bottom of the frame. The image combines data fro…" } } ], "pagination": { "nextCursor": "YXBwX2NvbGxlY3Rpb246cGZiaWQwN1plYkZxVWJmdGg1RzZha3BFZ2FoaUJ5cmNYRHJma0VXbTFaRjIyYjdmVEd5ZXVvUUpqWk5vbkJrY2kzTDRGTmFXclk3QWREQ2dEdnJZVEZ0aXJYandEeWllRTJs:AQHT6DAHWvtS92YmQbBTtCjvshATrZpXHJcsxfdKh32lYUImQFGeU58XUIMyfmpbzb_6zFx4f5MyeiZsEVUf8EfR-Q", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/facebook/profile/photos": { "get": { "tags": [ "Facebook" ], "summary": "A Page's or person's photos, 8 a page.", "description": "1 credit a page.", "operationId": "facebookProfilePhotos", "parameters": [ { "name": "handle", "in": "query", "description": "The page's or person's name in its link, or its numeric id.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "Its link, instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_FacebookPost" }, "example": { "data": [ { "id": "1697460148416021", "url": "https://www.facebook.com/photo/?fbid=1697460148416021", "text": null, "createdAt": null, "author": null, "stats": { "views": null, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://scontent-lhr6-1.xx.fbcdn.net/v/t39.30808-6/924514337_1697460158416020_6227482654830500974_n.jpg?stp=dst-jpg_tt6&cstp=mx1280x853&ctp=s1280x853&_nc_cat=108&_nc_map=urlgen_bucketless&ccb=1-7&_nc_sid=127cfc&_nc_ohc=qdkt-qCSuNUQ7kNvwEqLQNJ&_nc_oc=AdrRB-PkbuLWjrVYAETsi1XD4g_Ez09LKgLsmuCqS_exvA-k0JZbU1uS68sOORh3n0o&_nc_zt=23&_nc_ht=scontent-lhr6-1.xx&_nc_gid=NOlGtxq4DF3CgfeJBd_hbA&_nc_ss=79389&oh=00_AQRaOhIBY-JaM57hibEItWswbMPGL09y_z32A1Rrzvz-zg&oe=6B0CB0DE", "thumbnailUrl": null, "width": 1280, "height": 853, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "kind": "photo", "postId": null, "reactions": [], "plays": null, "captions": [], "altText": "The heavily cratered Moon as seen by the Artemis II crew as they traveled around the Moon. The boundary between lunar day and night, or the terminator, is visible at the top of the image. This area is the South Pole-Aitken basin, the largest and oldest basin on the Moon." } }, { "id": "1690599555768747", "url": "https://www.facebook.com/photo/?fbid=1690599555768747", "text": null, "createdAt": null, "author": null, "stats": { "views": null, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://scontent-lhr11-1.xx.fbcdn.net/v/t39.30808-6/916765074_1690599559102080_8008653452099091270_n.jpg?stp=dst-jpg_tt6&cstp=mx2048x2048&ctp=s2048x2048&_nc_cat=105&_nc_map=urlgen_bucketless&ccb=1-7&_nc_sid=127cfc&_nc_ohc=y06oZdeErRAQ7kNvwF9PXcL&_nc_oc=Adp_p5R_F4Pxt9T_Iq5dEe-D6Mq_xC8EdJ9amgcWpoxKJQKYh0V8uPAWSshUQvY2dCI&_nc_zt=23&_nc_ht=scontent-lhr11-1.xx&_nc_gid=NOlGtxq4DF3CgfeJBd_hbA&_nc_ss=79389&oh=00_AQRsUTY-vitx1PsQtXKRepSNnGBHG3tSvR-PsNfd0UKuiA&oe=6B0CB122", "thumbnailUrl": null, "width": 2048, "height": 2048, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "kind": "photo", "postId": null, "reactions": [], "plays": null, "captions": [], "altText": "A supernova remnant looks like colorful paints swirling together set against the darkness of space. At the heart of the image is a light purple cloud and a spiraling, bright yellow tangle. A vibrant red gas cloud surrounds the center; it has trails of red that drift upward and to the right. A faint, dark blue cloud begins at upper left and exits the bottom of the frame. The image combines data fro…" } } ], "pagination": { "nextCursor": "YXBwX2NvbGxlY3Rpb246cGZiaWQwN1plYkZxVWJmdGg1RzZha3BFZ2FoaUJ5cmNYRHJma0VXbTFaRjIyYjdmVEd5ZXVvUUpqWk5vbkJrY2kzTDRGTmFXclk3QWREQ2dEdnJZVEZ0aXJYandEeWllRTJs:AQHT6DAHWvtS92YmQbBTtCjvshATrZpXHJcsxfdKh32lYUImQFGeU58XUIMyfmpbzb_6zFx4f5MyeiZsEVUf8EfR-Q", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.facebook.profilePhotos({ handle: \"NASA\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.facebook.profile_photos(handle=\"NASA\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/facebook/profile/photos \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=NASA\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_FacebookPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/FacebookPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "FacebookPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "kind", "reactions", "captions" ], "properties": { "altText": { "type": [ "string", "null" ], "description": "Facebook's description of a photo, for screen readers." }, "captions": { "type": "array", "items": { "$ref": "#/components/schemas/FacebookCaptionTrack" }, "description": "The video's caption tracks; read one with `/v1/facebook/post/transcript`." }, "kind": { "$ref": "#/components/schemas/FacebookPostKind" }, "plays": { "type": [ "integer", "null" ], "format": "int64", "description": "Plays of a video, where Facebook counts them beside its views.", "minimum": 0 }, "postId": { "type": [ "string", "null" ], "description": "The numeric id Facebook also gives the post, where it does." }, "reactions": { "type": "array", "items": { "$ref": "#/components/schemas/FacebookReaction" }, "description": "Reactions by kind (`stats.likes` is them all)." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A Facebook post: a story, a photo, a video or a reel." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "FacebookReaction": { "type": "object", "description": "One kind of reaction and how many gave it.", "required": [ "kind", "count" ], "properties": { "count": { "type": "integer", "format": "int64", "minimum": 0 }, "kind": { "type": "string", "description": "`Like`, `Love`, `Care`, `Haha`, `Wow`, `Sad`, `Angry`." } } }, "FacebookPostKind": { "type": "string", "description": "What a post is.", "enum": [ "post", "photo", "video", "reel" ] }, "FacebookCaptionTrack": { "type": "object", "description": "A caption track of a video.", "required": [ "locale", "translated" ], "properties": { "language": { "type": [ "string", "null" ], "description": "The language's name, as Facebook gives it." }, "locale": { "type": "string", "description": "`en_US`, `es_LA`…" }, "translated": { "type": "boolean", "description": "A machine translation of the video's own track, not the track itself." } } }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Profile Posts (/docs/api-reference/facebook/profile-posts) A Page's or person's posts, newest first, 3 a page. `GET https://api.socialapi.sh/v1/facebook/profile/posts` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.facebook.profilePosts({ handle: "NASA" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.facebook.profile_posts(handle="NASA") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/facebook/profile/posts \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=NASA" ``` **Response** ```json { "data": [ { "id": "pfbid02sZQLRpCntK2pPvttuB2JQn1d1HRLMgxGgM6qSeAKoxKg4stR91djJcHy4AKipjk1l", "url": "https://www.facebook.com/NASA/posts/pfbid02sZQLRpCntK2pPvttuB2JQn1d1HRLMgxGgM6qSeAKoxKg4stR91djJcHy4AKipjk1l", "text": "A home away from home 🌕\n \nWe're building a Moon Base, where astronauts will live, work, and explore the lunar surface.\n \nLearn how humanity's first lunar outpost will be built and how it'll prepare us for future missions: https://go.nasa.gov/4jamgox", "createdAt": "2026-11-24T16:50:00.000Z", "author": { "id": "100044561550831", "username": "NASA", "displayName": "NASA - National Aeronautics and Space Administration", "avatarUrl": null, "verified": false, "url": "https://www.facebook.com/NASA" }, "stats": { "views": null, "likes": 1763, "comments": 89, "shares": 154, "saves": null, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "kind": "post", "postId": "1697460178416018", "reactions": [ { "kind": "Like", "count": 1317 }, { "kind": "Love", "count": 407 }, { "kind": "Care", "count": 20 } ], "plays": null, "captions": [], "altText": "The heavily cratered Moon as seen by the Artemis II crew as they traveled around the Moon. The boundary between lunar day and night, or the terminator, is visible at the top of the image. This area is the South Pole-Aitken basin, the largest and oldest basin on the Moon." } } ], "pagination": { "nextCursor": "Cg8Ob3JnYW5pY19jdXJzb3IJAAACREFRSFRjeTZQbHJyUllzRVJuZ3ZnYVFDVUFTUjFZU3hhZ1FnLXhPRkNjZG93TUFSOEhVeDVtYVo1SGZBbXBTTEpBMzVIMENZeWtOVHh5M2dvU3ZUdzZET0Rpd2F2b29LTzQtVnZ1WVNsclRlUVZPZThyZVFuSjNKbmtJUkpsMGtMWUlLOTdNYXE3RFRKVEJkdFVpODdZUjV5dWtFaWZwdzNhYV9IbXN2ai00RUV6SnNPWGIzSmVXRmZxWVd5Nm82dmRGcFg5eVNkbGRnUF9Ec1BSYkN4Q05OS3dKU1hvSHlVX3RhYmpxQ1ptUzlXNF9lemRxT2ViM1Y2MV81NG83b2E1LWNWM01zNFJsT3ZvdUVPR3lMYzcw…", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/facebook/profile/posts": { "get": { "tags": [ "Facebook" ], "summary": "A Page's or person's posts, newest first, 3 a page.", "description": "With reactions by kind, comments, shares and a video's views, 3 a page as Facebook\npages them. 1 credit a page.", "operationId": "facebookProfilePosts", "parameters": [ { "name": "handle", "in": "query", "description": "The page's or person's name in its link, or its numeric id.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "Its link, instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_FacebookPost" }, "example": { "data": [ { "id": "pfbid02sZQLRpCntK2pPvttuB2JQn1d1HRLMgxGgM6qSeAKoxKg4stR91djJcHy4AKipjk1l", "url": "https://www.facebook.com/NASA/posts/pfbid02sZQLRpCntK2pPvttuB2JQn1d1HRLMgxGgM6qSeAKoxKg4stR91djJcHy4AKipjk1l", "text": "A home away from home 🌕\n \nWe're building a Moon Base, where astronauts will live, work, and explore the lunar surface.\n \nLearn how humanity's first lunar outpost will be built and how it'll prepare us for future missions: https://go.nasa.gov/4jamgox", "createdAt": "2026-11-24T16:50:00.000Z", "author": { "id": "100044561550831", "username": "NASA", "displayName": "NASA - National Aeronautics and Space Administration", "avatarUrl": null, "verified": false, "url": "https://www.facebook.com/NASA" }, "stats": { "views": null, "likes": 1763, "comments": 89, "shares": 154, "saves": null, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "kind": "post", "postId": "1697460178416018", "reactions": [ { "kind": "Like", "count": 1317 }, { "kind": "Love", "count": 407 }, { "kind": "Care", "count": 20 } ], "plays": null, "captions": [], "altText": "The heavily cratered Moon as seen by the Artemis II crew as they traveled around the Moon. The boundary between lunar day and night, or the terminator, is visible at the top of the image. This area is the South Pole-Aitken basin, the largest and oldest basin on the Moon." } } ], "pagination": { "nextCursor": "Cg8Ob3JnYW5pY19jdXJzb3IJAAACREFRSFRjeTZQbHJyUllzRVJuZ3ZnYVFDVUFTUjFZU3hhZ1FnLXhPRkNjZG93TUFSOEhVeDVtYVo1SGZBbXBTTEpBMzVIMENZeWtOVHh5M2dvU3ZUdzZET0Rpd2F2b29LTzQtVnZ1WVNsclRlUVZPZThyZVFuSjNKbmtJUkpsMGtMWUlLOTdNYXE3RFRKVEJkdFVpODdZUjV5dWtFaWZwdzNhYV9IbXN2ai00RUV6SnNPWGIzSmVXRmZxWVd5Nm82dmRGcFg5eVNkbGRnUF9Ec1BSYkN4Q05OS3dKU1hvSHlVX3RhYmpxQ1ptUzlXNF9lemRxT2ViM1Y2MV81NG83b2E1LWNWM01zNFJsT3ZvdUVPR3lMYzcw…", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.facebook.profilePosts({ handle: \"NASA\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.facebook.profile_posts(handle=\"NASA\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/facebook/profile/posts \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=NASA\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_FacebookPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/FacebookPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "FacebookPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "kind", "reactions", "captions" ], "properties": { "altText": { "type": [ "string", "null" ], "description": "Facebook's description of a photo, for screen readers." }, "captions": { "type": "array", "items": { "$ref": "#/components/schemas/FacebookCaptionTrack" }, "description": "The video's caption tracks; read one with `/v1/facebook/post/transcript`." }, "kind": { "$ref": "#/components/schemas/FacebookPostKind" }, "plays": { "type": [ "integer", "null" ], "format": "int64", "description": "Plays of a video, where Facebook counts them beside its views.", "minimum": 0 }, "postId": { "type": [ "string", "null" ], "description": "The numeric id Facebook also gives the post, where it does." }, "reactions": { "type": "array", "items": { "$ref": "#/components/schemas/FacebookReaction" }, "description": "Reactions by kind (`stats.likes` is them all)." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A Facebook post: a story, a photo, a video or a reel." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "FacebookReaction": { "type": "object", "description": "One kind of reaction and how many gave it.", "required": [ "kind", "count" ], "properties": { "count": { "type": "integer", "format": "int64", "minimum": 0 }, "kind": { "type": "string", "description": "`Like`, `Love`, `Care`, `Haha`, `Wow`, `Sad`, `Angry`." } } }, "FacebookPostKind": { "type": "string", "description": "What a post is.", "enum": [ "post", "photo", "video", "reel" ] }, "FacebookCaptionTrack": { "type": "object", "description": "A caption track of a video.", "required": [ "locale", "translated" ], "properties": { "language": { "type": [ "string", "null" ], "description": "The language's name, as Facebook gives it." }, "locale": { "type": "string", "description": "`en_US`, `es_LA`…" }, "translated": { "type": "boolean", "description": "A machine translation of the video's own track, not the track itself." } } }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Profile Videos (/docs/api-reference/facebook/profile-videos) A Page's videos with their plays, about 6 a page. `GET https://api.socialapi.sh/v1/facebook/profile/videos` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.facebook.profileVideos({ handle: "NASA" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.facebook.profile_videos(handle="NASA") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/facebook/profile/videos \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=NASA" ``` **Response** ```json { "data": [ { "id": "2688015701636592", "url": "https://www.facebook.com/NASA/videos/happy-thanksgiving-from-the-international-space-station-nasa-astronauts-anil-men/2688015701636592/", "text": "Happy Thanksgiving from the International Space Station!\n \nNASA astronauts Anil Menon, Luke Delaney, Jessica Watkins and CSA (Canadian Space Agency) astronaut Josh Kutryk share well wishes, reflections, and their meal plans for Thanksgiving on the space station.", "createdAt": "2026-11-23T19:00:34.000Z", "author": null, "stats": { "views": 179590, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://scontent-lhr6-1.xx.fbcdn.net/v/t15.5256-10/896002033_1114689958045076_1910198720974934684_n.jpg?stp=dst-jpg_tt6&cstp=mx1280x720&ctp=p206x206&_nc_cat=111&_nc_map=urlgen_bucketless&ccb=1-7&_nc_sid=d2b52d&_nc_ohc=s-uJ7Zve7lAQ7kNvwEyj1SD&_nc_oc=Adpp0tWOXgHQXLtv5LlHbhr6lQt_wQRSdFJkYFhGehpffGuHHe30jiqmPt6y8K6zJSQ&_nc_zt=23&_nc_ht=scontent-lhr6-1.xx&_nc_gid=qVDPmjtnKnBanjZJMFVvQA&_nc_ss=79389&oh=00_AQTfHeo24pHjdgm8C5pQ8y1HMPi-vLzgOCkcvGMy4ofIYQ&oe=6B0CA9A2", "width": null, "height": null, "durationSeconds": 165.973 } ], "hashtags": [], "mentions": [], "ext": { "kind": "video", "postId": null, "reactions": [], "plays": null, "captions": [], "altText": null } }, { "id": "2470894823717065", "url": "https://www.facebook.com/NASA/videos/the-europa-concept-trailer/2470894823717065/", "text": "The Europa Concept: Trailer", "createdAt": "2026-11-23T16:28:32.000Z", "author": null, "stats": { "views": 364460, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://scontent-lhr6-1.xx.fbcdn.net/v/t15.5256-10/906046274_1176776975193542_4962297076653796944_n.jpg?stp=dst-jpg_tt6&cstp=mx720x405&ctp=p206x206&_nc_cat=104&_nc_map=urlgen_bucketless&ccb=1-7&_nc_sid=d2b52d&_nc_ohc=zQQPlrxW-_sQ7kNvwGk4c49&_nc_oc=AdojsdaLaHx4UtpJTzohOrLTEeqOQu6-TRXa2MofYkfIaeEi5fQWBxY4FhTEfTQ7qo0&_nc_zt=23&_nc_ht=scontent-lhr6-1.xx&_nc_gid=qVDPmjtnKnBanjZJMFVvQA&_nc_ss=79389&oh=00_AQS11IlAWYDcWu4jx3SeoFYHqIrJKA_-nkX7F3ZPHATocw&oe=6B0CD2CC", "width": null, "height": null, "durationSeconds": 87.403 } ], "hashtags": [], "mentions": [], "ext": { "kind": "video", "postId": null, "reactions": [], "plays": null, "captions": [], "altText": null } } ], "pagination": { "nextCursor": "AQHTrLaTRJsLe6ylVDXQS9sK8NfNE95ZaH4MkydAfVk6HOthDSKq8NoU9E3rAcCgA0St_Du8ZBI_TvWNq8BZGS3iig", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/facebook/profile/videos": { "get": { "tags": [ "Facebook" ], "summary": "A Page's videos with their plays, about 6 a page.", "description": "With their reactions. Only a Page has a videos tab. 1 credit a page.", "operationId": "facebookProfileVideos", "parameters": [ { "name": "handle", "in": "query", "description": "The page's or person's name in its link, or its numeric id.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "Its link, instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_FacebookPost" }, "example": { "data": [ { "id": "2688015701636592", "url": "https://www.facebook.com/NASA/videos/happy-thanksgiving-from-the-international-space-station-nasa-astronauts-anil-men/2688015701636592/", "text": "Happy Thanksgiving from the International Space Station!\n \nNASA astronauts Anil Menon, Luke Delaney, Jessica Watkins and CSA (Canadian Space Agency) astronaut Josh Kutryk share well wishes, reflections, and their meal plans for Thanksgiving on the space station.", "createdAt": "2026-11-23T19:00:34.000Z", "author": null, "stats": { "views": 179590, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://scontent-lhr6-1.xx.fbcdn.net/v/t15.5256-10/896002033_1114689958045076_1910198720974934684_n.jpg?stp=dst-jpg_tt6&cstp=mx1280x720&ctp=p206x206&_nc_cat=111&_nc_map=urlgen_bucketless&ccb=1-7&_nc_sid=d2b52d&_nc_ohc=s-uJ7Zve7lAQ7kNvwEyj1SD&_nc_oc=Adpp0tWOXgHQXLtv5LlHbhr6lQt_wQRSdFJkYFhGehpffGuHHe30jiqmPt6y8K6zJSQ&_nc_zt=23&_nc_ht=scontent-lhr6-1.xx&_nc_gid=qVDPmjtnKnBanjZJMFVvQA&_nc_ss=79389&oh=00_AQTfHeo24pHjdgm8C5pQ8y1HMPi-vLzgOCkcvGMy4ofIYQ&oe=6B0CA9A2", "width": null, "height": null, "durationSeconds": 165.973 } ], "hashtags": [], "mentions": [], "ext": { "kind": "video", "postId": null, "reactions": [], "plays": null, "captions": [], "altText": null } }, { "id": "2470894823717065", "url": "https://www.facebook.com/NASA/videos/the-europa-concept-trailer/2470894823717065/", "text": "The Europa Concept: Trailer", "createdAt": "2026-11-23T16:28:32.000Z", "author": null, "stats": { "views": 364460, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://scontent-lhr6-1.xx.fbcdn.net/v/t15.5256-10/906046274_1176776975193542_4962297076653796944_n.jpg?stp=dst-jpg_tt6&cstp=mx720x405&ctp=p206x206&_nc_cat=104&_nc_map=urlgen_bucketless&ccb=1-7&_nc_sid=d2b52d&_nc_ohc=zQQPlrxW-_sQ7kNvwGk4c49&_nc_oc=AdojsdaLaHx4UtpJTzohOrLTEeqOQu6-TRXa2MofYkfIaeEi5fQWBxY4FhTEfTQ7qo0&_nc_zt=23&_nc_ht=scontent-lhr6-1.xx&_nc_gid=qVDPmjtnKnBanjZJMFVvQA&_nc_ss=79389&oh=00_AQS11IlAWYDcWu4jx3SeoFYHqIrJKA_-nkX7F3ZPHATocw&oe=6B0CD2CC", "width": null, "height": null, "durationSeconds": 87.403 } ], "hashtags": [], "mentions": [], "ext": { "kind": "video", "postId": null, "reactions": [], "plays": null, "captions": [], "altText": null } } ], "pagination": { "nextCursor": "AQHTrLaTRJsLe6ylVDXQS9sK8NfNE95ZaH4MkydAfVk6HOthDSKq8NoU9E3rAcCgA0St_Du8ZBI_TvWNq8BZGS3iig", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.facebook.profileVideos({ handle: \"NASA\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.facebook.profile_videos(handle=\"NASA\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/facebook/profile/videos \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=NASA\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_FacebookPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/FacebookPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "FacebookPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "kind", "reactions", "captions" ], "properties": { "altText": { "type": [ "string", "null" ], "description": "Facebook's description of a photo, for screen readers." }, "captions": { "type": "array", "items": { "$ref": "#/components/schemas/FacebookCaptionTrack" }, "description": "The video's caption tracks; read one with `/v1/facebook/post/transcript`." }, "kind": { "$ref": "#/components/schemas/FacebookPostKind" }, "plays": { "type": [ "integer", "null" ], "format": "int64", "description": "Plays of a video, where Facebook counts them beside its views.", "minimum": 0 }, "postId": { "type": [ "string", "null" ], "description": "The numeric id Facebook also gives the post, where it does." }, "reactions": { "type": "array", "items": { "$ref": "#/components/schemas/FacebookReaction" }, "description": "Reactions by kind (`stats.likes` is them all)." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A Facebook post: a story, a photo, a video or a reel." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "FacebookReaction": { "type": "object", "description": "One kind of reaction and how many gave it.", "required": [ "kind", "count" ], "properties": { "count": { "type": "integer", "format": "int64", "minimum": 0 }, "kind": { "type": "string", "description": "`Like`, `Love`, `Care`, `Haha`, `Wow`, `Sad`, `Angry`." } } }, "FacebookPostKind": { "type": "string", "description": "What a post is.", "enum": [ "post", "photo", "video", "reel" ] }, "FacebookCaptionTrack": { "type": "object", "description": "A caption track of a video.", "required": [ "locale", "translated" ], "properties": { "language": { "type": [ "string", "null" ], "description": "The language's name, as Facebook gives it." }, "locale": { "type": "string", "description": "`en_US`, `es_LA`…" }, "translated": { "type": "boolean", "description": "A machine translation of the video's own track, not the track itself." } } }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Profile (/docs/api-reference/facebook/profile) A Page or a public person, with its follower count. `GET https://api.socialapi.sh/v1/facebook/profile` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.facebook.profile({ handle: "NASA" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.facebook.profile(handle="NASA").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/facebook/profile \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=NASA" ``` **Response** ```json { "data": { "id": "100044561550831", "username": "NASA", "displayName": "NASA - National Aeronautics and Space Administration", "bio": null, "avatarUrl": "https://scontent-ham3-1.xx.fbcdn.net/v/t39.30808-1/243095782_416661036495945_3843362260429099279_n.png?stp=dst-png&cstp=mx800x800&ctp=s200x200&_nc_cat=1&ccb=1-7&_nc_sid=2d3e12&_nc_ohc=9L3SyA6O4hMQ7kNvwFFAvxF&_nc_oc=AdpybpYhMw8jWVtu_JxDWUdMtLI5Czq9TSbYuo76Tt_Ox7pjEOtGt-zaWMbXtwrefdE&_nc_zt=24&_nc_ht=scontent-ham3-1.xx&_nc_gid=T5i9pWIous68P_Bvr73CIQ&_nc_ss=79389&oh=00_AQSM-2Yh4eXf9cZZwPB8BzXgNMEWSvNW3yHgzBkVrWdheQ&oe=6B0CCF95", "url": "https://www.facebook.com/NASA", "verified": true, "private": false, "followers": 28000000, "following": 53, "likes": null, "posts": null, "externalUrl": "https://www.nasa.gov/nasa-app/", "createdAt": null, "ext": { "pageId": "54971236771", "category": "Government organization", "followersLabel": "28M followers", "followingLabel": "53 following", "coverUrl": "https://scontent-ham3-1.xx.fbcdn.net/v/t39.99422-6/809146614_4484013928506139_3181913787670602881_n.png?stp=dst-jpg_tt6&cstp=mx2047x1487&ctp=s960x960&_nc_cat=110&_nc_map=urlgen_bucketless&ccb=1-7&_nc_sid=cc71e4&_nc_ohc=GVR710ihTyEQ7kNvwHoC3xD&_nc_oc=AdrCE6VeeQD4Y3D241kJ12-Iay1yW4-xHohgIU2E_l-MxAObvtEm-CmlFH7rAhOwXXU&_nc_zt=14&_nc_ht=scontent-ham3-1.xx&_nc_gid=T5i9pWIous68P_Bvr73CIQ&_nc_ss=79389&oh=00_AQR060AGMvQOt9YGGAfnInfe0lHPcITapSQoOhUfSrNIYA&oe=6B0CD367", "intro": [ { "kind": "category", "text": "Page · Government organization", "url": null }, { "kind": "confirmed_owner_label", "text": "NATIONAL AERONAUTICS AND SPACE ADMINISTRATION is responsible for this Page", "url": null }, { "kind": "email", "text": "public-inquiries@hq.nasa.gov", "url": null } ] } } } ``` **OpenAPI** ```json { "paths": { "/v1/facebook/profile": { "get": { "tags": [ "Facebook" ], "summary": "A Page or a public person, with its follower count.", "description": "Name, category, bio, verified, followers as Facebook rounds them (\"39M\"), cover and\nthe intro's lines (address, phone, links). 1 credit.", "operationId": "facebookProfile", "parameters": [ { "name": "handle", "in": "query", "description": "The page's or person's name in its link (`nike`), or its numeric id.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "Its link (`https://www.facebook.com/nike`), instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_FacebookProfile" }, "example": { "data": { "id": "100044561550831", "username": "NASA", "displayName": "NASA - National Aeronautics and Space Administration", "bio": null, "avatarUrl": "https://scontent-ham3-1.xx.fbcdn.net/v/t39.30808-1/243095782_416661036495945_3843362260429099279_n.png?stp=dst-png&cstp=mx800x800&ctp=s200x200&_nc_cat=1&ccb=1-7&_nc_sid=2d3e12&_nc_ohc=9L3SyA6O4hMQ7kNvwFFAvxF&_nc_oc=AdpybpYhMw8jWVtu_JxDWUdMtLI5Czq9TSbYuo76Tt_Ox7pjEOtGt-zaWMbXtwrefdE&_nc_zt=24&_nc_ht=scontent-ham3-1.xx&_nc_gid=T5i9pWIous68P_Bvr73CIQ&_nc_ss=79389&oh=00_AQSM-2Yh4eXf9cZZwPB8BzXgNMEWSvNW3yHgzBkVrWdheQ&oe=6B0CCF95", "url": "https://www.facebook.com/NASA", "verified": true, "private": false, "followers": 28000000, "following": 53, "likes": null, "posts": null, "externalUrl": "https://www.nasa.gov/nasa-app/", "createdAt": null, "ext": { "pageId": "54971236771", "category": "Government organization", "followersLabel": "28M followers", "followingLabel": "53 following", "coverUrl": "https://scontent-ham3-1.xx.fbcdn.net/v/t39.99422-6/809146614_4484013928506139_3181913787670602881_n.png?stp=dst-jpg_tt6&cstp=mx2047x1487&ctp=s960x960&_nc_cat=110&_nc_map=urlgen_bucketless&ccb=1-7&_nc_sid=cc71e4&_nc_ohc=GVR710ihTyEQ7kNvwHoC3xD&_nc_oc=AdrCE6VeeQD4Y3D241kJ12-Iay1yW4-xHohgIU2E_l-MxAObvtEm-CmlFH7rAhOwXXU&_nc_zt=14&_nc_ht=scontent-ham3-1.xx&_nc_gid=T5i9pWIous68P_Bvr73CIQ&_nc_ss=79389&oh=00_AQR060AGMvQOt9YGGAfnInfe0lHPcITapSQoOhUfSrNIYA&oe=6B0CD367", "intro": [ { "kind": "category", "text": "Page · Government organization", "url": null }, { "kind": "confirmed_owner_label", "text": "NATIONAL AERONAUTICS AND SPACE ADMINISTRATION is responsible for this Page", "url": null }, { "kind": "email", "text": "public-inquiries@hq.nasa.gov", "url": null } ] } } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.facebook.profile({ handle: \"NASA\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.facebook.profile(handle=\"NASA\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/facebook/profile \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=NASA\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_FacebookProfile": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/FacebookProfile" } } }, "FacebookProfile": { "allOf": [ { "type": "object", "description": "An account.", "required": [ "id", "username", "url", "verified", "private", "ext" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "bio": { "type": [ "string", "null" ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "displayName": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "intro" ], "properties": { "category": { "type": [ "string", "null" ], "description": "The Page's category (\"Sportswear Store\"), from its intro." }, "coverUrl": { "type": [ "string", "null" ] }, "followersLabel": { "type": [ "string", "null" ], "description": "The follower count as Facebook shows it (\"39M followers\"); `followers` is this,\nread as a number, so it is rounded." }, "followingLabel": { "type": [ "string", "null" ] }, "intro": { "type": "array", "items": { "$ref": "#/components/schemas/FacebookIntroItem" }, "description": "The intro's lines, in order: what each is and what it says." }, "pageId": { "type": [ "string", "null" ], "description": "The Page behind the profile, when it is a Page (`/v1/facebook/profile/videos` reads\nits videos by this id)." } } }, { "type": "object", "description": "What only this platform has." } ] }, "externalUrl": { "type": [ "string", "null" ], "description": "The link in the bio." }, "followers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "following": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "id": { "type": "string", "description": "The platform's id for the account." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "description": "Likes the account's posts received in total.", "minimum": 0 }, "posts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "private": { "type": "boolean" }, "url": { "type": "string", "description": "The profile's page." }, "username": { "type": "string", "description": "The handle, without `@`." }, "verified": { "type": "boolean" } } }, { "type": "object", "description": "A Facebook Page or public profile." } ] }, "FacebookIntroItem": { "type": "object", "description": "One line of a profile's intro.", "required": [ "kind", "text" ], "properties": { "kind": { "type": "string", "description": "`category`, `phone`, `website`, `address`, `email`, `rating`, `price_range`…, or\n`other`: Facebook's own kind, lowercased." }, "text": { "type": "string" }, "url": { "type": [ "string", "null" ] } } }, "Timestamp": { "type": "string", "format": "date-time" } } } } ``` # API Overview (/docs/api-reference) Every endpoint with its parameters, its answer and a real request, in TypeScript, Python and cURL. ## Base URL [#base-url] ``` https://api.socialapi.sh ``` Every endpoint is a `GET` under `/v1`, with the platform first: `/v1/tiktok/profile`. ## Authentication [#authentication] Send your API key as a bearer token. See [Authentication](/docs/authentication#create-an-api-key). ```bash curl https://api.socialapi.sh/v1/credits \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" ``` ## Responses [#responses] | Answer | Shape | | --- | --- | | One item | `{ "data": … }` | | A list | `{ "data": [...], "pagination": … }` | | An error | `{ "error", "code", "param" }` | Each answer carries its cost and request id in headers. See [Responses](/docs/responses#headers). ## Errors and Rate Limits [#errors-and-rate-limits] - A call that fails costs nothing. See [Errors](/docs/errors). - A workspace sends up to 600 requests a minute. See [Rate Limits](/docs/rate-limits#handle-429-responses). ## Endpoints [#endpoints] ### Platforms [#platforms] - [TikTok](/docs/api-reference/tiktok): 22 endpoints for profiles, posts and transcripts. - [Instagram](/docs/api-reference/instagram): 15 endpoints for profiles, reels and places. - [Threads](/docs/api-reference/threads): 10 endpoints for profiles, threads and search. - [Facebook](/docs/api-reference/facebook): 13 endpoints for Pages, posts and Marketplace. - [YouTube](/docs/api-reference/youtube): 26 endpoints for channels, videos and transcripts. - [Reddit](/docs/api-reference/reddit): 17 endpoints for users, communities and comments. - [Pinterest](/docs/api-reference/pinterest): 19 endpoints for pins, boards and trends. - [Twitch](/docs/api-reference/twitch): 20 endpoints for channels, clips and live status. - [Bluesky](/docs/api-reference/bluesky): 30 endpoints for accounts, posts and feeds. - [X (Twitter)](/docs/api-reference/x): 13 endpoints for accounts, posts and Spaces. - [Telegram](/docs/api-reference/telegram): 6 endpoints for channels, posts and comments. - [Kick](/docs/api-reference/kick): 16 endpoints for channels, clips and chat replays. - [Douyin](/docs/api-reference/douyin): 15 endpoints for accounts, posts and the hot list. - [LinkedIn](/docs/api-reference/linkedin): 17 endpoints for profiles, companies, jobs and ads. ### Workspace [#workspace] - [Account](/docs/api-reference/account): 1 endpoint for your workspace's credits. ## OpenAPI [#openapi] The whole API as one OpenAPI document, for code generators and API clients: [`/openapi.json`](https://api.socialapi.sh/openapi.json). # Highlight (/docs/api-reference/instagram/highlight) A story highlight's stories, with their media. `GET https://api.socialapi.sh/v1/instagram/highlight` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.instagram.highlight({ id: "18032893448824228" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.instagram.highlight(id="18032893448824228") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/instagram/highlight \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "id=18032893448824228" ``` **Response** ```json { "data": [ { "id": "3736808959122626508", "url": "https://www.instagram.com/stories/highlights/18032893448824228/", "text": null, "createdAt": "2025-10-05T16:39:13.000Z", "author": { "id": "25025320", "username": "instagram", "displayName": "Instagram", "avatarUrl": "https://scontent-los4-1.cdninstagram.com/v/t51.82787-19/550891366_18667771684001321_1383210656577177067_n.jpg?efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby4xMDgwLmMxIn0&_nc_ht=scontent-los4-1.cdninstagram.com&_nc_cat=1&_nc_oc=Q6cZ2gEoVl_dlNHf3S5eV6-WGoCTlDr2YGFMf4Go6rqIM3sEcN1jF7pj4kPa2rS4EylexJw&_nc_ohc=7pn-g-d5TcIQ7kNvwGb7W9t&_nc_gid=6VY4tKwJe3XviGuYd3QbrQ&edm=APs17CUBAAAA&ccb=7-5&_nc_ct=RQAsPBUCFQIAAAA&oh=00_AQQXABS9j6Lwju2mqLXeXOuV_LB8P2K_4pGbekoGZOxMtQ&oe=6B0BE627&_nc_sid=10d13b", "verified": true, "url": "https://www.instagram.com/instagram/" }, "stats": { "views": null, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://scontent-los4-1.cdninstagram.com/o1/v/t2/f2/m367/AQNvChtEGuyGJDWMI5pqDlLPdzcSrcX4FzLcdoBHz9VtGpDWlRxvciKcvJFrs7836Esw3e96BVCcsAgF4g6KL1CcYOkxXAWhmen1NHo.mp4?_nc_cat=108&_nc_sid=5e9851&_nc_ht=scontent-los4-1.cdninstagram.com&_nc_ohc=2ZAF2rm6pH0Q7kNvwE67J9y&efg=eyJ2ZW5jb2RlX3RhZyI6Inhwdl9wcm9ncmVzc2l2ZS5JTlNUQUdSQU0uU1RPUlkuQzMuNzIwLmRhc2hfYmFzZWxpbmVfMV92MSIsInhwdl9hc3NldF9pZCI6NTExMzQ3MzM0MjIxMTMyNSwiYXNzZXRfYWdlX2RheXMiOjQxNSwidmlfdXNlY2FzZV9pZCI6MTA4MjYsImR1cmF0aW9uX3MiOjE3LCJ1cmxnZW5fc291cmNlIjoid3d3In0%3D&ccb=17-1&vs=be47a6ee9e873631&_nc_vs=HBksFQIYQGlnX2VwaGVtZXJhbC9BQjRFMUI3NDhBMDRGNkMwQTI4Nzk0QkI5Q0NBRjNBRF92aWRlb19kYXNoaW5pdC5tcDQVAALIARIAFQIYRmlnX3hwdl9yZWVsc19wZXJtYW5lbnRfc3JfcHJvZC84NDMzNzA2NDEzNTQ4NDVfMTYxODQyMTYyNTkzNzM2NzAzMy5tcDQVAgLIARIAKAAYABsDiAd1c2Vfb2lsATEScHJvZ3Jlc3NpdmVfcmVjaXBlATESY29weV9zYW1wbGVfZ3JvdXBzATEVAAAm-pOMoqmrlRIVAigCQzMsF0AxlT987ZFoGBJkYXNoX2Jhc2VsaW5lXzFfdjERAHXoB2WUqQEA&_nc_gid=6VY4tKwJe3XviGuYd3QbrQ&_nc_ss=79789&_nc_map=urlgen_bucketless&_nc_zt=28&_nc_enc=Us3WB647a59zZv7pNpDS8PyrJhSRSSd-64MSBGkjwUCWU9BoSCskPVsNf8zT52ajmpmHA0-TR05VYEdXzrnNNAl-a01Ot99SxYWyTFvzN7V22ejX6Q3DcsAMq1M&oh=00_AQQf7DGIJ51lGKsNk_ZGCojkZkUREUH1eccLRcnbnKd3uA&oe=6B0BFB79", "thumbnailUrl": "https://scontent-los4-1.cdninstagram.com/v/t51.71878-15/559536480_1138904164365630_5737062639314255781_n.jpg?stp=dst-jpg_e15_tt6&_nc_cat=100&_nc_map=urlgen_bucketless&ig_cache_key=MzczNjgwODk1OTEyMjYyNjUwOA%3D%3D.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IlNUT1JZLnhwaWRzLjY0MC5zZHIudmlkZW9fZGVmYXVsdF9jb3Zlcl9mcmFtZS5DMyJ9&_nc_ohc=pViKzY7e8_UQ7kNvwHvrJk6&_nc_oc=AdqWz58vJLLMz206wD7DN7QtM0yMDRyZy6fvyo1zq4JnC4g69jXNnahlH5iGk8jQx_o&_nc_zt=23&_nc_ht=scontent-los4-1.cdninstagram.com&_nc_gid=6VY4tKwJe3XviGuYd3QbrQ&_nc_ss=79789&_nc_ct=RQosPBUIFQQlBAAAAA&oh=00_AQTaGihN286YL8O7mhL21pVzayr__UALvH07OS787z6LVA&oe=6B0BC6B8", "width": 720, "height": 1280, "durationSeconds": 17.583 } ], "hashtags": [], "mentions": [], "ext": { "code": "DPbz_MqAFfM", "kind": "story", "location": null, "sound": null, "tagged": [], "paidPartnership": false, "countsHidden": false, "altText": null } }, { "id": "3760016588086991500", "url": "https://www.instagram.com/stories/highlights/18032893448824228/", "text": null, "createdAt": "2025-11-06T17:08:18.000Z", "author": { "id": "25025320", "username": "instagram", "displayName": "Instagram", "avatarUrl": "https://scontent-los4-1.cdninstagram.com/v/t51.82787-19/550891366_18667771684001321_1383210656577177067_n.jpg?efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby4xMDgwLmMxIn0&_nc_ht=scontent-los4-1.cdninstagram.com&_nc_cat=1&_nc_oc=Q6cZ2gEoVl_dlNHf3S5eV6-WGoCTlDr2YGFMf4Go6rqIM3sEcN1jF7pj4kPa2rS4EylexJw&_nc_ohc=7pn-g-d5TcIQ7kNvwGb7W9t&_nc_gid=6VY4tKwJe3XviGuYd3QbrQ&edm=APs17CUBAAAA&ccb=7-5&_nc_ct=RQAsPBUCFQIAAAA&oh=00_AQQXABS9j6Lwju2mqLXeXOuV_LB8P2K_4pGbekoGZOxMtQ&oe=6B0BE627&_nc_sid=10d13b", "verified": true, "url": "https://www.instagram.com/instagram/" }, "stats": { "views": null, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://scontent-los4-1.cdninstagram.com/o1/v/t2/f2/m367/AQPje7igESu09ugNk1pgNbzV0UltT3oAj-OTzPoZHQormreY4wVOWMSaO7lqX-CVnmLPou6Tasl9SVP69SnJ_nDX8sTokZXhjd1EYgE.mp4?_nc_cat=108&_nc_sid=5e9851&_nc_ht=scontent-los4-1.cdninstagram.com&_nc_ohc=o-MLYfqm1CAQ7kNvwGxayWo&efg=eyJ2ZW5jb2RlX3RhZyI6Inhwdl9wcm9ncmVzc2l2ZS5JTlNUQUdSQU0uU1RPUlkuQzMuNzIwLmRhc2hfYmFzZWxpbmVfMV92MSIsInhwdl9hc3NldF9pZCI6ODIxMDc4Njk3NTU0MDEyLCJhc3NldF9hZ2VfZGF5cyI6MzgzLCJ2aV91c2VjYXNlX2lkIjoxMDgyNiwiZHVyYXRpb25fcyI6MzEsInVybGdlbl9zb3VyY2UiOiJ3d3cifQ%3D%3D&ccb=17-1&vs=315e2cce166a820e&_nc_vs=HBksFQIYQGlnX2VwaGVtZXJhbC9GQjRGNkZFQUZCOThDMDk4RjRGOUQ1RDk4MTFEMUJBMF92aWRlb19kYXNoaW5pdC5tcDQVAALIARIAFQIYRmlnX3hwdl9yZWVsc19wZXJtYW5lbnRfc3JfcHJvZC84MTg3MTUzNDQyMzI5NDJfNTMyMDg2NjU4ODU1OTIwODIxMC5tcDQVAgLIARIAKAAYABsDiAd1c2Vfb2lsATEScHJvZ3Jlc3NpdmVfcmVjaXBlATESY29weV9zYW1wbGVfZ3JvdXBzATEVAAAmuMHNgYmx9QIVAigCQzMsF0A_RBiTdLxqGBJkYXNoX2Jhc2VsaW5lXzFfdjERAHXoB2WUqQEA&_nc_gid=6VY4tKwJe3XviGuYd3QbrQ&_nc_ss=79789&_nc_map=urlgen_bucketless&_nc_zt=28&_nc_enc=Urcd-MWBGIisZl8oa4xq746WdGXTqR9CoLLeBCtjBvmFV_P7jKpsBc7fMyY0Vv3lCbIEfnXvOhOTurz1ZQXVr8863tbW8HO_CVyojF8QaQPWnWV2UZSCZ_IAHNI&oh=00_AQRqU-l8Nb-GX5r9vt8oOvYRFeaEXOIezPulJIZnfTZW3w&oe=6B0BFC3D", "thumbnailUrl": "https://scontent-los4-1.cdninstagram.com/v/t51.71878-15/572229845_830209269714205_6796771206169134849_n.jpg?stp=dst-jpg_e15_tt6&_nc_cat=109&_nc_map=urlgen_bucketless&ig_cache_key=Mzc2MDAxNjU4ODA4Njk5MTUwMA%3D%3D.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IlNUT1JZLnhwaWRzLjY0MC5zZHIudmlkZW9fZGVmYXVsdF9jb3Zlcl9mcmFtZS5DMyJ9&_nc_ohc=6gK28-yUhHQQ7kNvwE92w8m&_nc_oc=AdoawuD7qm27aa_FE58ei6VEMCO5hHyr58NwUW2UjkNITip-C1cc_oggy3sObdoxQ8w&_nc_zt=23&_nc_ht=scontent-los4-1.cdninstagram.com&_nc_gid=6VY4tKwJe3XviGuYd3QbrQ&_nc_ss=79789&_nc_ct=RQosPBUIFQQlBAAAAA&oh=00_AQTXTIm0YPyvlg9UI7k7aExm71i_3H7xRwcJ3_Xg8K8NKg&oe=6B0BEFBF", "width": 720, "height": 1280, "durationSeconds": 31.266 } ], "hashtags": [], "mentions": [], "ext": { "code": "DQuQypagFqM", "kind": "story", "location": null, "sound": null, "tagged": [], "paidPartnership": false, "countsHidden": false, "altText": null } } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/instagram/highlight": { "get": { "tags": [ "Instagram" ], "summary": "A story highlight's stories, with their media.", "description": "Each with its media and time. 1 credit.", "operationId": "instagramHighlight", "parameters": [ { "name": "url", "in": "query", "description": "The highlight's link (`https://www.instagram.com/stories/highlights//`, or the\napp's share link).", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The highlight's id (from `/v1/instagram/profile/highlights`), instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_InstagramPost" }, "example": { "data": [ { "id": "3736808959122626508", "url": "https://www.instagram.com/stories/highlights/18032893448824228/", "text": null, "createdAt": "2025-10-05T16:39:13.000Z", "author": { "id": "25025320", "username": "instagram", "displayName": "Instagram", "avatarUrl": "https://scontent-los4-1.cdninstagram.com/v/t51.82787-19/550891366_18667771684001321_1383210656577177067_n.jpg?efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby4xMDgwLmMxIn0&_nc_ht=scontent-los4-1.cdninstagram.com&_nc_cat=1&_nc_oc=Q6cZ2gEoVl_dlNHf3S5eV6-WGoCTlDr2YGFMf4Go6rqIM3sEcN1jF7pj4kPa2rS4EylexJw&_nc_ohc=7pn-g-d5TcIQ7kNvwGb7W9t&_nc_gid=6VY4tKwJe3XviGuYd3QbrQ&edm=APs17CUBAAAA&ccb=7-5&_nc_ct=RQAsPBUCFQIAAAA&oh=00_AQQXABS9j6Lwju2mqLXeXOuV_LB8P2K_4pGbekoGZOxMtQ&oe=6B0BE627&_nc_sid=10d13b", "verified": true, "url": "https://www.instagram.com/instagram/" }, "stats": { "views": null, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://scontent-los4-1.cdninstagram.com/o1/v/t2/f2/m367/AQNvChtEGuyGJDWMI5pqDlLPdzcSrcX4FzLcdoBHz9VtGpDWlRxvciKcvJFrs7836Esw3e96BVCcsAgF4g6KL1CcYOkxXAWhmen1NHo.mp4?_nc_cat=108&_nc_sid=5e9851&_nc_ht=scontent-los4-1.cdninstagram.com&_nc_ohc=2ZAF2rm6pH0Q7kNvwE67J9y&efg=eyJ2ZW5jb2RlX3RhZyI6Inhwdl9wcm9ncmVzc2l2ZS5JTlNUQUdSQU0uU1RPUlkuQzMuNzIwLmRhc2hfYmFzZWxpbmVfMV92MSIsInhwdl9hc3NldF9pZCI6NTExMzQ3MzM0MjIxMTMyNSwiYXNzZXRfYWdlX2RheXMiOjQxNSwidmlfdXNlY2FzZV9pZCI6MTA4MjYsImR1cmF0aW9uX3MiOjE3LCJ1cmxnZW5fc291cmNlIjoid3d3In0%3D&ccb=17-1&vs=be47a6ee9e873631&_nc_vs=HBksFQIYQGlnX2VwaGVtZXJhbC9BQjRFMUI3NDhBMDRGNkMwQTI4Nzk0QkI5Q0NBRjNBRF92aWRlb19kYXNoaW5pdC5tcDQVAALIARIAFQIYRmlnX3hwdl9yZWVsc19wZXJtYW5lbnRfc3JfcHJvZC84NDMzNzA2NDEzNTQ4NDVfMTYxODQyMTYyNTkzNzM2NzAzMy5tcDQVAgLIARIAKAAYABsDiAd1c2Vfb2lsATEScHJvZ3Jlc3NpdmVfcmVjaXBlATESY29weV9zYW1wbGVfZ3JvdXBzATEVAAAm-pOMoqmrlRIVAigCQzMsF0AxlT987ZFoGBJkYXNoX2Jhc2VsaW5lXzFfdjERAHXoB2WUqQEA&_nc_gid=6VY4tKwJe3XviGuYd3QbrQ&_nc_ss=79789&_nc_map=urlgen_bucketless&_nc_zt=28&_nc_enc=Us3WB647a59zZv7pNpDS8PyrJhSRSSd-64MSBGkjwUCWU9BoSCskPVsNf8zT52ajmpmHA0-TR05VYEdXzrnNNAl-a01Ot99SxYWyTFvzN7V22ejX6Q3DcsAMq1M&oh=00_AQQf7DGIJ51lGKsNk_ZGCojkZkUREUH1eccLRcnbnKd3uA&oe=6B0BFB79", "thumbnailUrl": "https://scontent-los4-1.cdninstagram.com/v/t51.71878-15/559536480_1138904164365630_5737062639314255781_n.jpg?stp=dst-jpg_e15_tt6&_nc_cat=100&_nc_map=urlgen_bucketless&ig_cache_key=MzczNjgwODk1OTEyMjYyNjUwOA%3D%3D.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IlNUT1JZLnhwaWRzLjY0MC5zZHIudmlkZW9fZGVmYXVsdF9jb3Zlcl9mcmFtZS5DMyJ9&_nc_ohc=pViKzY7e8_UQ7kNvwHvrJk6&_nc_oc=AdqWz58vJLLMz206wD7DN7QtM0yMDRyZy6fvyo1zq4JnC4g69jXNnahlH5iGk8jQx_o&_nc_zt=23&_nc_ht=scontent-los4-1.cdninstagram.com&_nc_gid=6VY4tKwJe3XviGuYd3QbrQ&_nc_ss=79789&_nc_ct=RQosPBUIFQQlBAAAAA&oh=00_AQTaGihN286YL8O7mhL21pVzayr__UALvH07OS787z6LVA&oe=6B0BC6B8", "width": 720, "height": 1280, "durationSeconds": 17.583 } ], "hashtags": [], "mentions": [], "ext": { "code": "DPbz_MqAFfM", "kind": "story", "location": null, "sound": null, "tagged": [], "paidPartnership": false, "countsHidden": false, "altText": null } }, { "id": "3760016588086991500", "url": "https://www.instagram.com/stories/highlights/18032893448824228/", "text": null, "createdAt": "2025-11-06T17:08:18.000Z", "author": { "id": "25025320", "username": "instagram", "displayName": "Instagram", "avatarUrl": "https://scontent-los4-1.cdninstagram.com/v/t51.82787-19/550891366_18667771684001321_1383210656577177067_n.jpg?efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby4xMDgwLmMxIn0&_nc_ht=scontent-los4-1.cdninstagram.com&_nc_cat=1&_nc_oc=Q6cZ2gEoVl_dlNHf3S5eV6-WGoCTlDr2YGFMf4Go6rqIM3sEcN1jF7pj4kPa2rS4EylexJw&_nc_ohc=7pn-g-d5TcIQ7kNvwGb7W9t&_nc_gid=6VY4tKwJe3XviGuYd3QbrQ&edm=APs17CUBAAAA&ccb=7-5&_nc_ct=RQAsPBUCFQIAAAA&oh=00_AQQXABS9j6Lwju2mqLXeXOuV_LB8P2K_4pGbekoGZOxMtQ&oe=6B0BE627&_nc_sid=10d13b", "verified": true, "url": "https://www.instagram.com/instagram/" }, "stats": { "views": null, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://scontent-los4-1.cdninstagram.com/o1/v/t2/f2/m367/AQPje7igESu09ugNk1pgNbzV0UltT3oAj-OTzPoZHQormreY4wVOWMSaO7lqX-CVnmLPou6Tasl9SVP69SnJ_nDX8sTokZXhjd1EYgE.mp4?_nc_cat=108&_nc_sid=5e9851&_nc_ht=scontent-los4-1.cdninstagram.com&_nc_ohc=o-MLYfqm1CAQ7kNvwGxayWo&efg=eyJ2ZW5jb2RlX3RhZyI6Inhwdl9wcm9ncmVzc2l2ZS5JTlNUQUdSQU0uU1RPUlkuQzMuNzIwLmRhc2hfYmFzZWxpbmVfMV92MSIsInhwdl9hc3NldF9pZCI6ODIxMDc4Njk3NTU0MDEyLCJhc3NldF9hZ2VfZGF5cyI6MzgzLCJ2aV91c2VjYXNlX2lkIjoxMDgyNiwiZHVyYXRpb25fcyI6MzEsInVybGdlbl9zb3VyY2UiOiJ3d3cifQ%3D%3D&ccb=17-1&vs=315e2cce166a820e&_nc_vs=HBksFQIYQGlnX2VwaGVtZXJhbC9GQjRGNkZFQUZCOThDMDk4RjRGOUQ1RDk4MTFEMUJBMF92aWRlb19kYXNoaW5pdC5tcDQVAALIARIAFQIYRmlnX3hwdl9yZWVsc19wZXJtYW5lbnRfc3JfcHJvZC84MTg3MTUzNDQyMzI5NDJfNTMyMDg2NjU4ODU1OTIwODIxMC5tcDQVAgLIARIAKAAYABsDiAd1c2Vfb2lsATEScHJvZ3Jlc3NpdmVfcmVjaXBlATESY29weV9zYW1wbGVfZ3JvdXBzATEVAAAmuMHNgYmx9QIVAigCQzMsF0A_RBiTdLxqGBJkYXNoX2Jhc2VsaW5lXzFfdjERAHXoB2WUqQEA&_nc_gid=6VY4tKwJe3XviGuYd3QbrQ&_nc_ss=79789&_nc_map=urlgen_bucketless&_nc_zt=28&_nc_enc=Urcd-MWBGIisZl8oa4xq746WdGXTqR9CoLLeBCtjBvmFV_P7jKpsBc7fMyY0Vv3lCbIEfnXvOhOTurz1ZQXVr8863tbW8HO_CVyojF8QaQPWnWV2UZSCZ_IAHNI&oh=00_AQRqU-l8Nb-GX5r9vt8oOvYRFeaEXOIezPulJIZnfTZW3w&oe=6B0BFC3D", "thumbnailUrl": "https://scontent-los4-1.cdninstagram.com/v/t51.71878-15/572229845_830209269714205_6796771206169134849_n.jpg?stp=dst-jpg_e15_tt6&_nc_cat=109&_nc_map=urlgen_bucketless&ig_cache_key=Mzc2MDAxNjU4ODA4Njk5MTUwMA%3D%3D.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IlNUT1JZLnhwaWRzLjY0MC5zZHIudmlkZW9fZGVmYXVsdF9jb3Zlcl9mcmFtZS5DMyJ9&_nc_ohc=6gK28-yUhHQQ7kNvwE92w8m&_nc_oc=AdoawuD7qm27aa_FE58ei6VEMCO5hHyr58NwUW2UjkNITip-C1cc_oggy3sObdoxQ8w&_nc_zt=23&_nc_ht=scontent-los4-1.cdninstagram.com&_nc_gid=6VY4tKwJe3XviGuYd3QbrQ&_nc_ss=79789&_nc_ct=RQosPBUIFQQlBAAAAA&oh=00_AQTXTIm0YPyvlg9UI7k7aExm71i_3H7xRwcJ3_Xg8K8NKg&oe=6B0BEFBF", "width": 720, "height": 1280, "durationSeconds": 31.266 } ], "hashtags": [], "mentions": [], "ext": { "code": "DQuQypagFqM", "kind": "story", "location": null, "sound": null, "tagged": [], "paidPartnership": false, "countsHidden": false, "altText": null } } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.instagram.highlight({ id: \"18032893448824228\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.instagram.highlight(id=\"18032893448824228\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/instagram/highlight \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"id=18032893448824228\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_InstagramPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/InstagramPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "InstagramPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "code", "kind", "tagged", "paidPartnership", "countsHidden" ], "properties": { "altText": { "type": [ "string", "null" ], "description": "Instagram's description of the image, for screen readers." }, "code": { "type": "string", "description": "The code in its link (`instagram.com/p/`)." }, "countsHidden": { "type": "boolean", "description": "Whether its author hides its like and view counts." }, "kind": { "$ref": "#/components/schemas/InstagramPostKind" }, "location": { "oneOf": [ { "$ref": "#/components/schemas/InstagramPlaceRef", "description": "The place it was tagged at." }, { "type": "null" } ] }, "paidPartnership": { "type": "boolean", "description": "A paid partnership." }, "sound": { "oneOf": [ { "$ref": "#/components/schemas/InstagramSoundRef", "description": "The sound a reel uses." }, { "type": "null" } ] }, "tagged": { "type": "array", "items": { "type": "string" }, "description": "Accounts tagged in it, by username." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "An Instagram post: a photo, a video, a carousel, a reel, or a story in a highlight." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "InstagramSoundRef": { "type": "object", "description": "The sound a reel uses: a released song (by its audio cluster) or an account's\noriginal audio (by its asset). Read either with `/v1/instagram/sound`.", "required": [ "id", "title", "original" ], "properties": { "artist": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "original": { "type": "boolean" }, "title": { "type": "string" } } }, "InstagramPlaceRef": { "type": "object", "description": "A place a post is tagged at.", "required": [ "id", "name" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" } } }, "InstagramPostKind": { "type": "string", "description": "What a post is.", "enum": [ "photo", "video", "carousel", "reel", "story" ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Instagram API (/docs/api-reference/instagram) Every Instagram endpoint, by group. Each is a `GET` under `/v1/instagram`. ## Quick Reference [#quick-reference] | Property | Value | | --- | --- | | Base path | `/v1/instagram` | | Endpoints | 15 | | Credits | See Below | | Guide | [Instagram](/docs/instagram) | ## Accounts [#accounts] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/instagram/profile`](/docs/api-reference/instagram/profile) | A profile with its follower and following counts. | 1 | | [`GET /v1/instagram/profile/highlights`](/docs/api-reference/instagram/profile-highlights) | An account's story highlights, with their covers. | 1 | | [`GET /v1/instagram/profile/posts`](/docs/api-reference/instagram/profile-posts) | An account's posts, newest first, 12 a page. | 1 | | [`GET /v1/instagram/profile/reels`](/docs/api-reference/instagram/profile-reels) | An account's reels with their plays, 12 a page. | 1 | | [`GET /v1/instagram/profile/similar`](/docs/api-reference/instagram/profile-similar) | Accounts like this one, as Instagram suggests them. | 5 | | [`GET /v1/instagram/highlight`](/docs/api-reference/instagram/highlight) | A story highlight's stories, with their media. | 1 | ## Posts [#posts] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/instagram/post`](/docs/api-reference/instagram/post) | One post or reel with its counts, media and tags. | 1 | | [`GET /v1/instagram/post/comments`](/docs/api-reference/instagram/post-comments) | A post's comments with their likes, about 22 a page. | 5 | ## Discovery [#discovery] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/instagram/location`](/docs/api-reference/instagram/location) | A place, with how many posts are tagged at it. | 1 | | [`GET /v1/instagram/location/posts`](/docs/api-reference/instagram/location-posts) | A place's top posts with their likes and comments. | 5 | | [`GET /v1/instagram/search`](/docs/api-reference/instagram/search) | Popular posts for a word or hashtag, 12 a page. | 1 | | [`GET /v1/instagram/sound`](/docs/api-reference/instagram/sound) | A sound, and how many reels use it. | 1 | | [`GET /v1/instagram/sound/posts`](/docs/api-reference/instagram/sound-posts) | The reels that use a sound, 12 a page. | 1 | | [`GET /v1/instagram/trending`](/docs/api-reference/instagram/trending) | The reels feed Instagram gives a visitor, 8 a page. | 5 | | [`GET /v1/instagram/trending/topics`](/docs/api-reference/instagram/trending-topics) | The explore page's trending keywords and accounts. | 1 | ## Example Request [#example-request] Every Instagram endpoint is called this way: its path, and what to read as query parameters. **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.instagram.profile({ handle: "natgeo" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.instagram.profile(handle="natgeo").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/instagram/profile \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=natgeo" ``` **Response** ```json { "data": { "id": "787132", "username": "natgeo", "displayName": "National Geographic", "bio": "Step into wonder and find your inner explorer with National Geographic 🌎", "avatarUrl": "https://scontent-bos5-1.cdninstagram.com/v/t51.82787-19/683576066_18653628823019133_9051036240972105113_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_cat=1&ig_cache_key=GAKLvih9nsRnYEVCAJlFVLiBvZt9bmNDAQAB1501500j-ccb7-5&ccb=7-5&_nc_sid=669407&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLnd3dy40MDAuQzMifQ%3D%3D&_nc_ohc=Fzq-SLmj7IoQ7kNvwGv6Q-m&_nc_oc=Adqba9tyEQDxQEp3-B2IZh6tpjHxc5VaFSfndZ5toAR85RUYhlNWPGd0hJZIDC29xxg&_nc_zt=24&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_gid=DKToTpAPnxQ3-31AVDAh2w&_nc_ss=79b8c&_nc_ct=RQosPBUCFQIAAAA&oh=00_AQQjsSzc6M516mz06KVhu_tGEUutW9TNo7UVxSYTkJDp-g&oe=6B0CB22B", "url": "https://www.instagram.com/natgeo/", "verified": true, "private": false, "followers": 267265090, "following": 195, "likes": null, "posts": null, "externalUrl": "http://visitstore.bio/natgeo", "createdAt": null, "ext": { "bioLinks": [ { "url": "http://visitstore.bio/natgeo", "title": null }, { "url": "https://ngmdomsubs.nationalgeographic.com/servlet/OrdersGateway?cds_mag_code=NGM&cds_page_id=283562&cds_response_key=I5FX10002", "title": "Subscribe Here!" } ], "category": null, "latestStoryAt": "2026-11-24T23:09:17.000Z", "hasReels": true, "threadsUsername": "natgeo", "memorialized": false, "moreHighlights": false } } } ``` ## Errors [#errors] A call that fails costs nothing. See [Errors](/docs/errors) for every code. # Location Posts (/docs/api-reference/instagram/location-posts) A place's top posts with their likes and comments. `GET https://api.socialapi.sh/v1/instagram/location/posts` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.instagram.locationPosts({ id: "212988663" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.instagram.location_posts(id="212988663") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/instagram/location/posts \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "id=212988663" ``` **Response** ```json { "data": [ { "id": "4038243391452079175", "url": "https://www.instagram.com/p/DgKuPgQEeRH/", "text": "❤️🎗️ Join Exponents as We Commemorate World AIDS Day 2026!\n\nOn Tuesday, December 1, Exponents invites you to join us for a special World AIDS Day celebration as we come together to raise awareness, promote HIV prevention, and continue the fight for health equity.\n\nThis year’s theme, “Putting Ourselves to the Test: Achieving Equity to End HIV,” highlights the importance of knowing your status, exp…", "createdAt": "2026-11-25T14:15:47.000Z", "author": { "id": "1251788759", "username": "exponentsnyc", "displayName": "EXPONENTS", "avatarUrl": "https://scontent-bos5-1.cdninstagram.com/v/t51.2885-19/411852303_1020995128978815_1361726704639715382_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_cat=110&_nc_map=urlgen_bucketless&ig_cache_key=GA9ejBh-7frzlqADADaoNh850_USbkULAAAB1501500j-ccb7-5&ccb=7-5&_nc_sid=669407&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLnd3dy4xMDQ5LkMzIn0%3D&_nc_ohc=qufdZ4aB00MQ7kNvwH7mknc&_nc_oc=AdosG6tOjnpYCJfKxkceOGrVEgI-gDzl3qDRgbAD0pZgkfWjta66oBbwpMJ5O4dK30M&_nc_zt=24&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_ss=79389&_nc_ct=RQosPBUCFQIAAAA&oh=00_AQT9I2QYXT1PZofqeIpIHyMLUcrStG8Nd-G1aX_0FW27Nw&oe=6B0CB3F9", "verified": false, "url": "https://www.instagram.com/exponentsnyc/" }, "stats": { "views": null, "likes": 1, "comments": 1, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://scontent-bos5-1.cdninstagram.com/v/t51.82787-15/930522673_18659287447012760_446505640977196300_n.jpg?stp=dst-jpg_e35_tt6&_nc_cat=109&_nc_map=urlgen_bucketless&ig_cache_key=NDAzODI0Mjk4MjA1Nzg4Mjc5Mg%3D%3D.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNBUk9VU0VMX0lURU0ueHBpZHMuMTE0NS5zZHIucmVndWxhcl9waG90by5DMyJ9&_nc_ohc=HOcMzXGGcyYQ7kNvwHVxvVO&_nc_oc=AdqjwAY5qCKDJjiWSUOElYNBpdcT9oAW11nh-evMchsfcCO29cU-NO_WyxZKvmAWR4w&_nc_zt=23&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_gid=i3FaT8s6Jb_eD9HW10GOYA&_nc_ss=79389&_nc_ct=RQosPBUIFQIlBAAAAA&oh=00_AQTnm9VolmEJgaEy_-MdgkechSHnSXJP3qs2j_tQ9WTgfg&oe=6B0CCD1F", "thumbnailUrl": null, "width": 1145, "height": 1374, "durationSeconds": null }, { "kind": "image", "url": "https://scontent-bos5-1.cdninstagram.com/v/t51.82787-15/930676580_18659287456012760_973199995404583033_n.jpg?stp=dst-jpg_e35_tt6&_nc_cat=111&_nc_map=urlgen_bucketless&ig_cache_key=NDAzODI0Mjk5NTEzNTgxNzQ3OA%3D%3D.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNBUk9VU0VMX0lURU0ueHBpZHMuMTE0NS5zZHIucmVndWxhcl9waG90by5DMyJ9&_nc_ohc=gfRsu0hMJwwQ7kNvwGwnZBz&_nc_oc=AdrM3cpQu2_UwJNdV8cJz5edMXdOckarx0MX_gxjBFx63Oxn1AmD9Kdk1AMSV6s3TnM&_nc_zt=23&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_gid=i3FaT8s6Jb_eD9HW10GOYA&_nc_ss=79389&_nc_ct=RQosPBUIFQIlBAAAAA&oh=00_AQQ0qMx24DsEFIn3puNS590Gmu8yLXstLf3g-Z6Ib8D3vw&oe=6B0CC426", "thumbnailUrl": null, "width": 1145, "height": 1374, "durationSeconds": null } ], "hashtags": [ "WorldAIDSDay", "WorldAIDSDay2026", "Exponents" ], "mentions": [], "ext": { "code": "DgKuPgQEeRH", "kind": "carousel", "location": { "id": "108424279189115", "name": "New York, New York" }, "sound": null, "tagged": [], "paidPartnership": false, "countsHidden": false, "altText": null } }, { "id": "4038250886866523745", "url": "https://www.instagram.com/p/DgKv8k5ldZh/", "text": "still processing seeing this live\n\nstevie wonder the artist of life\n\n76 years young and sung each song in the perfect key, played every instrument. A literal musical genius \n\npop up\n\nTHE Greg Phillinganes \n\n1976.\n\nan honor", "createdAt": "2026-11-25T14:30:40.000Z", "author": { "id": "4789206590", "username": "dj.nabiii", "displayName": "nabiii", "avatarUrl": "https://scontent-bos5-1.cdninstagram.com/v/t51.82787-19/663199506_18395126098158591_5422138049503359763_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_cat=106&_nc_map=urlgen_bucketless&ig_cache_key=GBKfhyf-460MRVpBABPzxgvUTT9LbmNDAQAB1501500j-ccb7-5&ccb=7-5&_nc_sid=669407&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLnd3dy4zMjUuQzMifQ%3D%3D&_nc_ohc=kNt6XKBUhVAQ7kNvwGhWe5m&_nc_oc=AdrW1rNhUNICBg6A4dn7BQ80rH7DZ8oVM5ei0Ce_IJH_XoCoaD5wRdhCrYVZ49Wmiew&_nc_zt=24&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_gid=i3FaT8s6Jb_eD9HW10GOYA&_nc_ss=79389&_nc_ct=RQosPBUCFQIAAAA&oh=00_AQQjppQmWwwi3koE0VgthD9k66edDWAwI_cl-YX3dzrwGQ&oe=6B0CC4B3", "verified": false, "url": "https://www.instagram.com/dj.nabiii/" }, "stats": { "views": null, "likes": null, "comments": 0, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://scontent-bos5-1.cdninstagram.com/v/t51.82787-15/902948987_18429353614158591_6390000339494817142_n.jpg?stp=dst-jpg_e35_tt6&_nc_cat=107&_nc_map=urlgen_bucketless&ig_cache_key=NDAzODI0OTY5NDg5NDU3NDA0NQ%3D%3D.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNBUk9VU0VMX0lURU0ueHBpZHMuOTAxLnNkci5yZWd1bGFyX3Bob3RvLkMzIn0%3D&_nc_ohc=8SP_WT7uTJEQ7kNvwFZ-5bY&_nc_oc=AdrJNn6PwrybR42SSMpweEVLDq-FhbeLDHa5UM-L5VUezsLfgNpBh73IyfofM1qpQZ8&_nc_zt=23&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_gid=i3FaT8s6Jb_eD9HW10GOYA&_nc_ss=79389&_nc_ct=RQosPBUIFQIlBAAAAA&oh=00_AQS9mK2JrhQzV35OL_rA6k-gQuriWiAw59a-cUvEgdTx7Q&oe=6B0CD084", "thumbnailUrl": null, "width": 901, "height": 901, "durationSeconds": null }, { "kind": "image", "url": "https://scontent-bos5-1.cdninstagram.com/v/t51.82787-15/902949181_18429353641158591_7136494947088087158_n.jpg?stp=dst-jpegr_e35_tt6&_nc_cat=108&_nc_map=urlgen_bucketless&ig_cache_key=NDAzODI0OTcwMTc5ODQxNjg1NA%3D%3D.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNBUk9VU0VMX0lURU0ueHBpZHMuMzAyNC5oZHIucmVndWxhcl9waG90by5DMyJ9&_nc_ohc=bapdP4XwulgQ7kNvwEaGsyP&_nc_oc=AdrZSUg6nBeLMbShCvYBxm_LVOp7jdlbaEzrvzD6a9mmCQUug9cVz7DnkNLVMlNAKDs&_nc_zt=23&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_gid=i3FaT8s6Jb_eD9HW10GOYA&_nc_ss=79389&_nc_ct=RQosPBUIFQIlAgAAAA&oh=00_AQS1-5ZURqwyUSPB4SJ9DH_-VfEuBJtY_rNkDpLwyQkNBQ&oe=6B0CC4C8", "thumbnailUrl": null, "width": 3024, "height": 3024, "durationSeconds": null }, { "kind": "video", "url": "https://scontent-bos5-1.cdninstagram.com/o1/v/t16/f2/m84/AQPWq5dRDyDe_YcAtOaNmA6liOel-LBpWD-tzzQoa7gB6SJp3FW0ZN6duQxZ-74oBZEirLijmvb8_Q4JfPHEKHn2JQJb9345dkE3MiM.mp4?_nc_cat=103&_nc_sid=5e9851&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_ohc=LF_McnAHyzoQ7kNvwHvhtNj&efg=eyJ2ZW5jb2RlX3RhZyI6Inhwdl9wcm9ncmVzc2l2ZS5JTlNUQUdSQU0uQ0FST1VTRUxfSVRFTS5DMy43MjAuZGFzaF9iYXNlbGluZV8xX3YxIiwieHB2X2Fzc2V0X2lkIjoxODQyOTM1Mzc0MDE1ODU5MSwiYXNzZXRfYWdlX2RheXMiOjAsInZpX3VzZWNhc2VfaWQiOjEwMTQ2LCJkdXJhdGlvbl9zIjo4LCJ1cmxnZW5fc291cmNlIjoid3d3In0%3D&ccb=17-1&vs=78cabcc24f4327f6&_nc_vs=HBkcFQIYTGlnX2JhY2tmaWxsX3RpbWVsaW5lX3ZvZC82QkU3MUNBOTNEQUU0NTM3OUYxRUZFQUI5QzREREMwNl92aWRlb19kYXNoaW5pdC5tcDQVAALIARIAKAAYABsDiAd1c2Vfb2lsATEScHJvZ3Jlc3NpdmVfcmVjaXBlATESY29weV9zYW1wbGVfZ3JvdXBzATEVAAAm_pn6scnZvEEVAigCQzMsF0AgBaHKwIMSGBJkYXNoX2Jhc2VsaW5lXzFfdjERAHXuB2XEngEA&_nc_gid=i3FaT8s6Jb_eD9HW10GOYA&_nc_ss=79b8c&_nc_map=urlgen_bucketless&_nc_zt=28&oh=00_AQRC1h1QBxspM4FETaL-m6duUpl72PzrjEg0vh0e2alevg&oe=6B08BBC9", "thumbnailUrl": "https://scontent-bos5-1.cdninstagram.com/v/t51.82787-15/927126314_18429353779158591_3710223770243931868_n.jpg?stp=dst-jpg_e15_tt6&_nc_cat=104&_nc_map=urlgen_bucketless&ig_cache_key=NDAzODI0OTcwODg0NTg3NDQxNA%3D%3D.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNBUk9VU0VMX0lURU0ueHBpZHMuNzIwLnNkci52aWRlb19maXJzdF9mcmFtZV90aHVtYm5haWwuQzMifQ%3D%3D&_nc_ohc=KRdJeEf5MUEQ7kNvwFxCZkU&_nc_oc=Adq5070NH8lkZ0wOKqY4BA_VxtvJsbKfhdC-BGHNFsCj7wR100JrMfKwZnn9YO77iQE&_nc_zt=23&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_gid=i3FaT8s6Jb_eD9HW10GOYA&_nc_ss=79b8c&_nc_ct=RQosPBUIFQolBAAAAA&oh=00_AQSXfwgwNFnmFPlMPyC3NzHk6LVvUyLU3z7cHyhpuBN0bQ&oe=6B0CB35F", "width": 720, "height": 720, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "code": "DgKv8k5ldZh", "kind": "carousel", "location": { "id": "2082352", "name": "Madison Square Garden" }, "sound": null, "tagged": [ "greg_phillinganes_live" ], "paidPartnership": false, "countsHidden": true, "altText": null } } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/instagram/location/posts": { "get": { "tags": [ "Instagram" ], "summary": "A place's top posts with their likes and comments.", "description": "With their times. The 18 Instagram shows a visitor, no more. 5 credits.", "operationId": "instagramLocationPosts", "parameters": [ { "name": "url", "in": "query", "description": "The place's link (`https://www.instagram.com/explore/locations///`).", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The place's id (a post's `ext.location.id`), instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_InstagramPost" }, "example": { "data": [ { "id": "4038243391452079175", "url": "https://www.instagram.com/p/DgKuPgQEeRH/", "text": "❤️🎗️ Join Exponents as We Commemorate World AIDS Day 2026!\n\nOn Tuesday, December 1, Exponents invites you to join us for a special World AIDS Day celebration as we come together to raise awareness, promote HIV prevention, and continue the fight for health equity.\n\nThis year’s theme, “Putting Ourselves to the Test: Achieving Equity to End HIV,” highlights the importance of knowing your status, exp…", "createdAt": "2026-11-25T14:15:47.000Z", "author": { "id": "1251788759", "username": "exponentsnyc", "displayName": "EXPONENTS", "avatarUrl": "https://scontent-bos5-1.cdninstagram.com/v/t51.2885-19/411852303_1020995128978815_1361726704639715382_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_cat=110&_nc_map=urlgen_bucketless&ig_cache_key=GA9ejBh-7frzlqADADaoNh850_USbkULAAAB1501500j-ccb7-5&ccb=7-5&_nc_sid=669407&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLnd3dy4xMDQ5LkMzIn0%3D&_nc_ohc=qufdZ4aB00MQ7kNvwH7mknc&_nc_oc=AdosG6tOjnpYCJfKxkceOGrVEgI-gDzl3qDRgbAD0pZgkfWjta66oBbwpMJ5O4dK30M&_nc_zt=24&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_ss=79389&_nc_ct=RQosPBUCFQIAAAA&oh=00_AQT9I2QYXT1PZofqeIpIHyMLUcrStG8Nd-G1aX_0FW27Nw&oe=6B0CB3F9", "verified": false, "url": "https://www.instagram.com/exponentsnyc/" }, "stats": { "views": null, "likes": 1, "comments": 1, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://scontent-bos5-1.cdninstagram.com/v/t51.82787-15/930522673_18659287447012760_446505640977196300_n.jpg?stp=dst-jpg_e35_tt6&_nc_cat=109&_nc_map=urlgen_bucketless&ig_cache_key=NDAzODI0Mjk4MjA1Nzg4Mjc5Mg%3D%3D.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNBUk9VU0VMX0lURU0ueHBpZHMuMTE0NS5zZHIucmVndWxhcl9waG90by5DMyJ9&_nc_ohc=HOcMzXGGcyYQ7kNvwHVxvVO&_nc_oc=AdqjwAY5qCKDJjiWSUOElYNBpdcT9oAW11nh-evMchsfcCO29cU-NO_WyxZKvmAWR4w&_nc_zt=23&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_gid=i3FaT8s6Jb_eD9HW10GOYA&_nc_ss=79389&_nc_ct=RQosPBUIFQIlBAAAAA&oh=00_AQTnm9VolmEJgaEy_-MdgkechSHnSXJP3qs2j_tQ9WTgfg&oe=6B0CCD1F", "thumbnailUrl": null, "width": 1145, "height": 1374, "durationSeconds": null }, { "kind": "image", "url": "https://scontent-bos5-1.cdninstagram.com/v/t51.82787-15/930676580_18659287456012760_973199995404583033_n.jpg?stp=dst-jpg_e35_tt6&_nc_cat=111&_nc_map=urlgen_bucketless&ig_cache_key=NDAzODI0Mjk5NTEzNTgxNzQ3OA%3D%3D.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNBUk9VU0VMX0lURU0ueHBpZHMuMTE0NS5zZHIucmVndWxhcl9waG90by5DMyJ9&_nc_ohc=gfRsu0hMJwwQ7kNvwGwnZBz&_nc_oc=AdrM3cpQu2_UwJNdV8cJz5edMXdOckarx0MX_gxjBFx63Oxn1AmD9Kdk1AMSV6s3TnM&_nc_zt=23&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_gid=i3FaT8s6Jb_eD9HW10GOYA&_nc_ss=79389&_nc_ct=RQosPBUIFQIlBAAAAA&oh=00_AQQ0qMx24DsEFIn3puNS590Gmu8yLXstLf3g-Z6Ib8D3vw&oe=6B0CC426", "thumbnailUrl": null, "width": 1145, "height": 1374, "durationSeconds": null } ], "hashtags": [ "WorldAIDSDay", "WorldAIDSDay2026", "Exponents" ], "mentions": [], "ext": { "code": "DgKuPgQEeRH", "kind": "carousel", "location": { "id": "108424279189115", "name": "New York, New York" }, "sound": null, "tagged": [], "paidPartnership": false, "countsHidden": false, "altText": null } }, { "id": "4038250886866523745", "url": "https://www.instagram.com/p/DgKv8k5ldZh/", "text": "still processing seeing this live\n\nstevie wonder the artist of life\n\n76 years young and sung each song in the perfect key, played every instrument. A literal musical genius \n\npop up\n\nTHE Greg Phillinganes \n\n1976.\n\nan honor", "createdAt": "2026-11-25T14:30:40.000Z", "author": { "id": "4789206590", "username": "dj.nabiii", "displayName": "nabiii", "avatarUrl": "https://scontent-bos5-1.cdninstagram.com/v/t51.82787-19/663199506_18395126098158591_5422138049503359763_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_cat=106&_nc_map=urlgen_bucketless&ig_cache_key=GBKfhyf-460MRVpBABPzxgvUTT9LbmNDAQAB1501500j-ccb7-5&ccb=7-5&_nc_sid=669407&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLnd3dy4zMjUuQzMifQ%3D%3D&_nc_ohc=kNt6XKBUhVAQ7kNvwGhWe5m&_nc_oc=AdrW1rNhUNICBg6A4dn7BQ80rH7DZ8oVM5ei0Ce_IJH_XoCoaD5wRdhCrYVZ49Wmiew&_nc_zt=24&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_gid=i3FaT8s6Jb_eD9HW10GOYA&_nc_ss=79389&_nc_ct=RQosPBUCFQIAAAA&oh=00_AQQjppQmWwwi3koE0VgthD9k66edDWAwI_cl-YX3dzrwGQ&oe=6B0CC4B3", "verified": false, "url": "https://www.instagram.com/dj.nabiii/" }, "stats": { "views": null, "likes": null, "comments": 0, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://scontent-bos5-1.cdninstagram.com/v/t51.82787-15/902948987_18429353614158591_6390000339494817142_n.jpg?stp=dst-jpg_e35_tt6&_nc_cat=107&_nc_map=urlgen_bucketless&ig_cache_key=NDAzODI0OTY5NDg5NDU3NDA0NQ%3D%3D.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNBUk9VU0VMX0lURU0ueHBpZHMuOTAxLnNkci5yZWd1bGFyX3Bob3RvLkMzIn0%3D&_nc_ohc=8SP_WT7uTJEQ7kNvwFZ-5bY&_nc_oc=AdrJNn6PwrybR42SSMpweEVLDq-FhbeLDHa5UM-L5VUezsLfgNpBh73IyfofM1qpQZ8&_nc_zt=23&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_gid=i3FaT8s6Jb_eD9HW10GOYA&_nc_ss=79389&_nc_ct=RQosPBUIFQIlBAAAAA&oh=00_AQS9mK2JrhQzV35OL_rA6k-gQuriWiAw59a-cUvEgdTx7Q&oe=6B0CD084", "thumbnailUrl": null, "width": 901, "height": 901, "durationSeconds": null }, { "kind": "image", "url": "https://scontent-bos5-1.cdninstagram.com/v/t51.82787-15/902949181_18429353641158591_7136494947088087158_n.jpg?stp=dst-jpegr_e35_tt6&_nc_cat=108&_nc_map=urlgen_bucketless&ig_cache_key=NDAzODI0OTcwMTc5ODQxNjg1NA%3D%3D.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNBUk9VU0VMX0lURU0ueHBpZHMuMzAyNC5oZHIucmVndWxhcl9waG90by5DMyJ9&_nc_ohc=bapdP4XwulgQ7kNvwEaGsyP&_nc_oc=AdrZSUg6nBeLMbShCvYBxm_LVOp7jdlbaEzrvzD6a9mmCQUug9cVz7DnkNLVMlNAKDs&_nc_zt=23&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_gid=i3FaT8s6Jb_eD9HW10GOYA&_nc_ss=79389&_nc_ct=RQosPBUIFQIlAgAAAA&oh=00_AQS1-5ZURqwyUSPB4SJ9DH_-VfEuBJtY_rNkDpLwyQkNBQ&oe=6B0CC4C8", "thumbnailUrl": null, "width": 3024, "height": 3024, "durationSeconds": null }, { "kind": "video", "url": "https://scontent-bos5-1.cdninstagram.com/o1/v/t16/f2/m84/AQPWq5dRDyDe_YcAtOaNmA6liOel-LBpWD-tzzQoa7gB6SJp3FW0ZN6duQxZ-74oBZEirLijmvb8_Q4JfPHEKHn2JQJb9345dkE3MiM.mp4?_nc_cat=103&_nc_sid=5e9851&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_ohc=LF_McnAHyzoQ7kNvwHvhtNj&efg=eyJ2ZW5jb2RlX3RhZyI6Inhwdl9wcm9ncmVzc2l2ZS5JTlNUQUdSQU0uQ0FST1VTRUxfSVRFTS5DMy43MjAuZGFzaF9iYXNlbGluZV8xX3YxIiwieHB2X2Fzc2V0X2lkIjoxODQyOTM1Mzc0MDE1ODU5MSwiYXNzZXRfYWdlX2RheXMiOjAsInZpX3VzZWNhc2VfaWQiOjEwMTQ2LCJkdXJhdGlvbl9zIjo4LCJ1cmxnZW5fc291cmNlIjoid3d3In0%3D&ccb=17-1&vs=78cabcc24f4327f6&_nc_vs=HBkcFQIYTGlnX2JhY2tmaWxsX3RpbWVsaW5lX3ZvZC82QkU3MUNBOTNEQUU0NTM3OUYxRUZFQUI5QzREREMwNl92aWRlb19kYXNoaW5pdC5tcDQVAALIARIAKAAYABsDiAd1c2Vfb2lsATEScHJvZ3Jlc3NpdmVfcmVjaXBlATESY29weV9zYW1wbGVfZ3JvdXBzATEVAAAm_pn6scnZvEEVAigCQzMsF0AgBaHKwIMSGBJkYXNoX2Jhc2VsaW5lXzFfdjERAHXuB2XEngEA&_nc_gid=i3FaT8s6Jb_eD9HW10GOYA&_nc_ss=79b8c&_nc_map=urlgen_bucketless&_nc_zt=28&oh=00_AQRC1h1QBxspM4FETaL-m6duUpl72PzrjEg0vh0e2alevg&oe=6B08BBC9", "thumbnailUrl": "https://scontent-bos5-1.cdninstagram.com/v/t51.82787-15/927126314_18429353779158591_3710223770243931868_n.jpg?stp=dst-jpg_e15_tt6&_nc_cat=104&_nc_map=urlgen_bucketless&ig_cache_key=NDAzODI0OTcwODg0NTg3NDQxNA%3D%3D.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNBUk9VU0VMX0lURU0ueHBpZHMuNzIwLnNkci52aWRlb19maXJzdF9mcmFtZV90aHVtYm5haWwuQzMifQ%3D%3D&_nc_ohc=KRdJeEf5MUEQ7kNvwFxCZkU&_nc_oc=Adq5070NH8lkZ0wOKqY4BA_VxtvJsbKfhdC-BGHNFsCj7wR100JrMfKwZnn9YO77iQE&_nc_zt=23&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_gid=i3FaT8s6Jb_eD9HW10GOYA&_nc_ss=79b8c&_nc_ct=RQosPBUIFQolBAAAAA&oh=00_AQSXfwgwNFnmFPlMPyC3NzHk6LVvUyLU3z7cHyhpuBN0bQ&oe=6B0CB35F", "width": 720, "height": 720, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "code": "DgKv8k5ldZh", "kind": "carousel", "location": { "id": "2082352", "name": "Madison Square Garden" }, "sound": null, "tagged": [ "greg_phillinganes_live" ], "paidPartnership": false, "countsHidden": true, "altText": null } } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.instagram.locationPosts({ id: \"212988663\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.instagram.location_posts(id=\"212988663\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/instagram/location/posts \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"id=212988663\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_InstagramPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/InstagramPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "InstagramPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "code", "kind", "tagged", "paidPartnership", "countsHidden" ], "properties": { "altText": { "type": [ "string", "null" ], "description": "Instagram's description of the image, for screen readers." }, "code": { "type": "string", "description": "The code in its link (`instagram.com/p/`)." }, "countsHidden": { "type": "boolean", "description": "Whether its author hides its like and view counts." }, "kind": { "$ref": "#/components/schemas/InstagramPostKind" }, "location": { "oneOf": [ { "$ref": "#/components/schemas/InstagramPlaceRef", "description": "The place it was tagged at." }, { "type": "null" } ] }, "paidPartnership": { "type": "boolean", "description": "A paid partnership." }, "sound": { "oneOf": [ { "$ref": "#/components/schemas/InstagramSoundRef", "description": "The sound a reel uses." }, { "type": "null" } ] }, "tagged": { "type": "array", "items": { "type": "string" }, "description": "Accounts tagged in it, by username." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "An Instagram post: a photo, a video, a carousel, a reel, or a story in a highlight." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "InstagramSoundRef": { "type": "object", "description": "The sound a reel uses: a released song (by its audio cluster) or an account's\noriginal audio (by its asset). Read either with `/v1/instagram/sound`.", "required": [ "id", "title", "original" ], "properties": { "artist": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "original": { "type": "boolean" }, "title": { "type": "string" } } }, "InstagramPlaceRef": { "type": "object", "description": "A place a post is tagged at.", "required": [ "id", "name" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" } } }, "InstagramPostKind": { "type": "string", "description": "What a post is.", "enum": [ "photo", "video", "carousel", "reel", "story" ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Location (/docs/api-reference/instagram/location) A place, with how many posts are tagged at it. `GET https://api.socialapi.sh/v1/instagram/location` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.instagram.location({ id: "212988663" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.instagram.location(id="212988663").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/instagram/location \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "id=212988663" ``` **Response** ```json { "data": { "id": "212988663", "name": "New York, New York", "url": "https://www.instagram.com/explore/locations/212988663/new-york-new-york", "category": "City", "address": null, "city": null, "zip": null, "phone": null, "website": null, "latitude": 40.7142, "longitude": -74.0064, "posts": 84371541, "priceRange": 3 } } ``` **OpenAPI** ```json { "paths": { "/v1/instagram/location": { "get": { "tags": [ "Instagram" ], "summary": "A place, with how many posts are tagged at it.", "description": "Name, category, address, phone and coordinates, and how many posts are tagged at it.\n1 credit.", "operationId": "instagramLocation", "parameters": [ { "name": "url", "in": "query", "description": "The place's link (`https://www.instagram.com/explore/locations///`).", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The place's id (a post's `ext.location.id`), instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_InstagramPlace" }, "example": { "data": { "id": "212988663", "name": "New York, New York", "url": "https://www.instagram.com/explore/locations/212988663/new-york-new-york", "category": "City", "address": null, "city": null, "zip": null, "phone": null, "website": null, "latitude": 40.7142, "longitude": -74.0064, "posts": 84371541, "priceRange": 3 } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.instagram.location({ id: \"212988663\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.instagram.location(id=\"212988663\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/instagram/location \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"id=212988663\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_InstagramPlace": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/InstagramPlace" } } }, "InstagramPlace": { "allOf": [ { "type": "object", "description": "A place: a venue, a city, an address, with its posts count.", "required": [ "id", "name", "url" ], "properties": { "address": { "type": [ "string", "null" ] }, "category": { "type": [ "string", "null" ] }, "city": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "latitude": { "type": [ "number", "null" ], "format": "double" }, "longitude": { "type": [ "number", "null" ], "format": "double" }, "name": { "type": "string" }, "phone": { "type": [ "string", "null" ] }, "posts": { "type": [ "integer", "null" ], "format": "int64", "description": "Posts tagged at it.", "minimum": 0 }, "priceRange": { "type": [ "integer", "null" ], "format": "int64", "description": "1 to 4, where Instagram rates it.", "minimum": 0 }, "url": { "type": "string" }, "website": { "type": [ "string", "null" ] }, "zip": { "type": [ "string", "null" ] } } }, { "type": "object", "description": "An Instagram place." } ] } } } } ``` # Post Comments (/docs/api-reference/instagram/post-comments) A post's comments with their likes, about 22 a page. `GET https://api.socialapi.sh/v1/instagram/post/comments` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.instagram.postComments({ url: "https://www.instagram.com/p/Df147tCiAyB/" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.instagram.post_comments(url="https://www.instagram.com/p/Df147tCiAyB/") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/instagram/post/comments \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://www.instagram.com/p/Df147tCiAyB/" ``` **Response** ```json { "data": [ { "id": "18037614338911355", "postId": "4032379434794749057", "parentId": null, "text": "Last is fake", "createdAt": "2026-11-25T05:56:31.000Z", "author": { "id": "71555241893", "username": "obicnjak", "displayName": null, "avatarUrl": "https://scontent-bos5-1.cdninstagram.com/v/t51.82787-19/881132460_17944070352385894_2663051968055980428_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_cat=105&_nc_map=urlgen_bucketless&ig_cache_key=GKwDhTRmty1zCcA-AIyxYc6nD-UkbmNDAQAB1501500j-ccb7-5&ccb=7-5&_nc_sid=669407&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLnd3dy4xMDgwLkMzIn0%3D&_nc_ohc=PtoOTAN_xhcQ7kNvwEzS0CM&_nc_oc=AdqReWsYcpNYpNz626ZbboxRChznFP7vOdtoi_KfATKGBZ_9LyFdk5akAursVoAUQiU&_nc_zt=24&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_gid=9EQQH7JGj-ZSEEegUjH1tA&_nc_ss=79b8c&_nc_ct=RQosPBUCFQIAAAA&oh=00_AQRZtaHtz9JrJXUO4TeqhbfqwKbHCofVjqVxfvayLKEyuA&oe=6B0CD3B4", "verified": false, "url": "https://www.instagram.com/obicnjak/" }, "likes": 0, "replies": null, "ext": { "covered": false } }, { "id": "18151791271601993", "postId": "4032379434794749057", "parentId": null, "text": "great shot", "createdAt": "2026-11-25T01:14:36.000Z", "author": { "id": "15884616547", "username": "tomomi85352", "displayName": null, "avatarUrl": "https://scontent-bos5-1.cdninstagram.com/v/t51.82787-19/927548956_18155067538528548_6222448229785698867_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_cat=104&_nc_map=urlgen_bucketless&ig_cache_key=GBxGSTck2YEP8H9AADOConGyk1pWbmNDAQAB1501500j-ccb7-5&ccb=7-5&_nc_sid=669407&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLnd3dy41MTIuQzMifQ%3D%3D&_nc_ohc=noy2pinQ6HkQ7kNvwEKJZ7R&_nc_oc=AdpCifkzH8Fq8ILi77DO380kGCYsPVqUc1edyvouDdHSebbRjhpnk-kMVVZGGFTyOFU&_nc_zt=24&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_gid=9EQQH7JGj-ZSEEegUjH1tA&_nc_ss=79b8c&_nc_ct=RQosPBUCFQIAAAA&oh=00_AQRVv_eHw26IypHTxKpksQwj6lhN49uIxqtc5TpoGGHHaw&oe=6B0CBC5A", "verified": false, "url": "https://www.instagram.com/tomomi85352/" }, "likes": 0, "replies": null, "ext": { "covered": false } } ], "pagination": { "nextCursor": "{\"is_server_cursor_inverse\":true,\"server_cursor\":\"AQHTCsl8o8CuPSC7hHswJMHuNHcJm0EGZEDX1sdPjG0v8BJR_h5LjaM9aWZ-_BCZiMKismuC6pJCftMX-2tPUQvOQA\"}", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/instagram/post/comments": { "get": { "tags": [ "Instagram" ], "summary": "A post's comments with their likes, about 22 a page.", "description": "Replies, and how many a comment has, are not shown to a visitor. 5 credits a page.", "operationId": "instagramPostComments", "parameters": [ { "name": "url", "in": "query", "description": "The post's link.", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The post's media id, instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_InstagramComment" }, "example": { "data": [ { "id": "18037614338911355", "postId": "4032379434794749057", "parentId": null, "text": "Last is fake", "createdAt": "2026-11-25T05:56:31.000Z", "author": { "id": "71555241893", "username": "obicnjak", "displayName": null, "avatarUrl": "https://scontent-bos5-1.cdninstagram.com/v/t51.82787-19/881132460_17944070352385894_2663051968055980428_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_cat=105&_nc_map=urlgen_bucketless&ig_cache_key=GKwDhTRmty1zCcA-AIyxYc6nD-UkbmNDAQAB1501500j-ccb7-5&ccb=7-5&_nc_sid=669407&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLnd3dy4xMDgwLkMzIn0%3D&_nc_ohc=PtoOTAN_xhcQ7kNvwEzS0CM&_nc_oc=AdqReWsYcpNYpNz626ZbboxRChznFP7vOdtoi_KfATKGBZ_9LyFdk5akAursVoAUQiU&_nc_zt=24&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_gid=9EQQH7JGj-ZSEEegUjH1tA&_nc_ss=79b8c&_nc_ct=RQosPBUCFQIAAAA&oh=00_AQRZtaHtz9JrJXUO4TeqhbfqwKbHCofVjqVxfvayLKEyuA&oe=6B0CD3B4", "verified": false, "url": "https://www.instagram.com/obicnjak/" }, "likes": 0, "replies": null, "ext": { "covered": false } }, { "id": "18151791271601993", "postId": "4032379434794749057", "parentId": null, "text": "great shot", "createdAt": "2026-11-25T01:14:36.000Z", "author": { "id": "15884616547", "username": "tomomi85352", "displayName": null, "avatarUrl": "https://scontent-bos5-1.cdninstagram.com/v/t51.82787-19/927548956_18155067538528548_6222448229785698867_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_cat=104&_nc_map=urlgen_bucketless&ig_cache_key=GBxGSTck2YEP8H9AADOConGyk1pWbmNDAQAB1501500j-ccb7-5&ccb=7-5&_nc_sid=669407&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLnd3dy41MTIuQzMifQ%3D%3D&_nc_ohc=noy2pinQ6HkQ7kNvwEKJZ7R&_nc_oc=AdpCifkzH8Fq8ILi77DO380kGCYsPVqUc1edyvouDdHSebbRjhpnk-kMVVZGGFTyOFU&_nc_zt=24&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_gid=9EQQH7JGj-ZSEEegUjH1tA&_nc_ss=79b8c&_nc_ct=RQosPBUCFQIAAAA&oh=00_AQRVv_eHw26IypHTxKpksQwj6lhN49uIxqtc5TpoGGHHaw&oe=6B0CBC5A", "verified": false, "url": "https://www.instagram.com/tomomi85352/" }, "likes": 0, "replies": null, "ext": { "covered": false } } ], "pagination": { "nextCursor": "{\"is_server_cursor_inverse\":true,\"server_cursor\":\"AQHTCsl8o8CuPSC7hHswJMHuNHcJm0EGZEDX1sdPjG0v8BJR_h5LjaM9aWZ-_BCZiMKismuC6pJCftMX-2tPUQvOQA\"}", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.instagram.postComments({ url: \"https://www.instagram.com/p/Df147tCiAyB/\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.instagram.post_comments(url=\"https://www.instagram.com/p/Df147tCiAyB/\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/instagram/post/comments \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://www.instagram.com/p/Df147tCiAyB/\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_InstagramComment": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/InstagramComment" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "InstagramComment": { "allOf": [ { "type": "object", "description": "A comment or a reply.", "required": [ "id", "postId", "text", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "covered" ], "properties": { "covered": { "type": "boolean", "description": "Shown behind a sensitive-content cover until opened." } } }, { "type": "object", "description": "What only this platform has." } ] }, "id": { "type": "string" }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "parentId": { "type": [ "string", "null" ], "description": "The comment this replies to; absent on a top-level comment." }, "postId": { "type": "string" }, "replies": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "text": { "type": "string" } } }, { "type": "object", "description": "An Instagram comment." } ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Post (/docs/api-reference/instagram/post) One post or reel with its counts, media and tags. `GET https://api.socialapi.sh/v1/instagram/post` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.instagram.post({ url: "https://www.instagram.com/p/Df147tCiAyB/" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.instagram.post(url="https://www.instagram.com/p/Df147tCiAyB/").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/instagram/post \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://www.instagram.com/p/Df147tCiAyB/" ``` **Response** ```json { "data": { "id": "4032379434794749057", "url": "https://www.instagram.com/p/Df147tCiAyB/", "text": "National Geographic photographers ventured to places far and wide to capture the year’s most fascinating images. Out of millions of photos, just 25 were selected as our Pictures of the Year. \n\nWe thought these photos of a juvenile Greenland shark, possibly born around the time of the American Civil War, a climber dangling from a horizontal ledge in Spain during August’s solar eclipse, and an astro…", "createdAt": "2026-11-17T12:05:09.000Z", "author": { "id": "787132", "username": "natgeo", "displayName": "National Geographic", "avatarUrl": "https://scontent-muc2-1.cdninstagram.com/v/t51.82787-19/683576066_18653628823019133_9051036240972105113_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_cat=1&ig_cache_key=GAKLvih9nsRnYEVCAJlFVLiBvZt9bmNDAQAB1501500j-ccb7-5&ccb=7-5&_nc_sid=669407&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLnd3dy40MDAuQzMifQ%3D%3D&_nc_ohc=Fzq-SLmj7IoQ7kNvwEomVU3&_nc_oc=AdoSSLSDWlxgB4nS6ADyJql3YCqH2Tddy3-4UcMuTratGcW73ljT5DGiYUUCFdQ_Di8&_nc_zt=24&_nc_ht=scontent-muc2-1.cdninstagram.com&_nc_gid=9y7W7SWNsnsOUo3MiAJpbA&_nc_ss=79b8c&_nc_ct=RQosPBUCFQIAAAA&oh=00_AQTybcC1BBeWZvRK8DV_8Z8OfF2sR2xxZWN68hDiyIhhMQ&oe=6B0CB22B", "verified": true, "url": "https://www.instagram.com/natgeo/" }, "stats": { "views": null, "likes": 23825, "comments": 104, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://scontent-muc2-1.cdninstagram.com/v/t51.82787-15/912032737_18720223195019133_3854183847552490578_n.jpg?stp=dst-jpg_e35_tt6&_nc_cat=109&_nc_map=urlgen_bucketless&ig_cache_key=NDAzMjM3MDM5NDQxODY4Mjg1OA%3D%3D.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNBUk9VU0VMX0lURU0ueHBpZHMuMTA4MC5zZHIucmVndWxhcl9waG90by5DMyJ9&_nc_ohc=bFP-yCIxZ7sQ7kNvwEUcYun&_nc_oc=AdpOZc2LMJ9e8ZtQkhjo0HgXFkrlqmbKUMs5bFacIFlb3diItSOB_ZlTs4DeRU0WX8U&_nc_zt=23&_nc_ht=scontent-muc2-1.cdninstagram.com&_nc_gid=9y7W7SWNsnsOUo3MiAJpbA&_nc_ss=79b8c&_nc_ct=RQosPBUIFQIlBAAAAA&oh=00_AQRjkuAR0QBIZxOs61jk95_5NmXGtHNxkOCA-AVsjp1WTQ&oe=6B0CC5B4", "thumbnailUrl": null, "width": 1080, "height": 1350, "durationSeconds": null }, { "kind": "image", "url": "https://scontent-muc2-1.cdninstagram.com/v/t51.82787-15/914384603_18720223210019133_7491756309452445712_n.jpg?stp=dst-jpg_e35_tt6&_nc_cat=110&_nc_map=urlgen_bucketless&ig_cache_key=NDAzMjM3MDM5OTYxOTY5MjgwOA%3D%3D.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNBUk9VU0VMX0lURU0ueHBpZHMuMjA0Ni5zZHIucmVndWxhcl9waG90by5DMyJ9&_nc_ohc=4wWdcPuuez0Q7kNvwEkzIn6&_nc_oc=AdoVL2kYtZsOk76In6v1t8UFnx4MIxSZ5aqCkGO3wnUSF-DGrKjV4RP5QDqrN-tIKFE&_nc_zt=23&_nc_ht=scontent-muc2-1.cdninstagram.com&_nc_gid=9y7W7SWNsnsOUo3MiAJpbA&_nc_ss=79b8c&_nc_ct=RQosPBUIFQIlBAAAAA&oh=00_AQQXbqNPERXcyBdr47pObvqR7CbRKvD-xhlFrJKmfRltjQ&oe=6B0CBCCF", "thumbnailUrl": null, "width": 2046, "height": 1856, "durationSeconds": null }, { "kind": "image", "url": "https://scontent-muc2-1.cdninstagram.com/v/t51.82787-15/910707883_18720223213019133_8801173042309599373_n.jpg?stp=dst-jpg_e35_tt6&_nc_cat=104&_nc_map=urlgen_bucketless&ig_cache_key=NDAzMjM3MDQwMTQ5ODgyMTAxOQ%3D%3D.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNBUk9VU0VMX0lURU0ueHBpZHMuMjg4Ny5zZHIucmVndWxhcl9waG90by5DMyJ9&_nc_ohc=9c9rBGW3-XAQ7kNvwFpoYnK&_nc_oc=AdobA-ns7bltQpgOia95XRoDAbq9wMTOY81I_rka7fdg2XmCTJDZBQHJK6yWB8TPAn8&_nc_zt=23&_nc_ht=scontent-muc2-1.cdninstagram.com&_nc_gid=9y7W7SWNsnsOUo3MiAJpbA&_nc_ss=79b8c&_nc_ct=RQosPBUIFQIlBAAAAA&oh=00_AQSkpWlz1k5Qgu91gH7OYnc4FyFxsvQx8Q46_oveolX4cw&oe=6B0CC4E7", "thumbnailUrl": null, "width": 2887, "height": 2099, "durationSeconds": null } ], "hashtags": [], "mentions": [ "kiliiiyuyan", "chrisburkard", "paoloverzone" ], "ext": { "code": "Df147tCiAyB", "kind": "carousel", "location": null, "sound": null, "tagged": [], "paidPartnership": false, "countsHidden": false, "altText": "Photo by National Geographic on November 17, 2026. May be an image of text." } } } ``` **OpenAPI** ```json { "paths": { "/v1/instagram/post": { "get": { "tags": [ "Instagram" ], "summary": "One post or reel with its counts, media and tags.", "description": "Caption, time, author, like and comment counts, its media, the place it was tagged at,\nthe accounts tagged in it and the sound a reel uses. 1 credit.", "operationId": "instagramPost", "parameters": [ { "name": "url", "in": "query", "description": "The post's link (`https://www.instagram.com/p/DgCpvD5A-3U/`, or a reel's).", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The post's media id, instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_InstagramPost" }, "example": { "data": { "id": "4032379434794749057", "url": "https://www.instagram.com/p/Df147tCiAyB/", "text": "National Geographic photographers ventured to places far and wide to capture the year’s most fascinating images. Out of millions of photos, just 25 were selected as our Pictures of the Year. \n\nWe thought these photos of a juvenile Greenland shark, possibly born around the time of the American Civil War, a climber dangling from a horizontal ledge in Spain during August’s solar eclipse, and an astro…", "createdAt": "2026-11-17T12:05:09.000Z", "author": { "id": "787132", "username": "natgeo", "displayName": "National Geographic", "avatarUrl": "https://scontent-muc2-1.cdninstagram.com/v/t51.82787-19/683576066_18653628823019133_9051036240972105113_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_cat=1&ig_cache_key=GAKLvih9nsRnYEVCAJlFVLiBvZt9bmNDAQAB1501500j-ccb7-5&ccb=7-5&_nc_sid=669407&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLnd3dy40MDAuQzMifQ%3D%3D&_nc_ohc=Fzq-SLmj7IoQ7kNvwEomVU3&_nc_oc=AdoSSLSDWlxgB4nS6ADyJql3YCqH2Tddy3-4UcMuTratGcW73ljT5DGiYUUCFdQ_Di8&_nc_zt=24&_nc_ht=scontent-muc2-1.cdninstagram.com&_nc_gid=9y7W7SWNsnsOUo3MiAJpbA&_nc_ss=79b8c&_nc_ct=RQosPBUCFQIAAAA&oh=00_AQTybcC1BBeWZvRK8DV_8Z8OfF2sR2xxZWN68hDiyIhhMQ&oe=6B0CB22B", "verified": true, "url": "https://www.instagram.com/natgeo/" }, "stats": { "views": null, "likes": 23825, "comments": 104, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://scontent-muc2-1.cdninstagram.com/v/t51.82787-15/912032737_18720223195019133_3854183847552490578_n.jpg?stp=dst-jpg_e35_tt6&_nc_cat=109&_nc_map=urlgen_bucketless&ig_cache_key=NDAzMjM3MDM5NDQxODY4Mjg1OA%3D%3D.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNBUk9VU0VMX0lURU0ueHBpZHMuMTA4MC5zZHIucmVndWxhcl9waG90by5DMyJ9&_nc_ohc=bFP-yCIxZ7sQ7kNvwEUcYun&_nc_oc=AdpOZc2LMJ9e8ZtQkhjo0HgXFkrlqmbKUMs5bFacIFlb3diItSOB_ZlTs4DeRU0WX8U&_nc_zt=23&_nc_ht=scontent-muc2-1.cdninstagram.com&_nc_gid=9y7W7SWNsnsOUo3MiAJpbA&_nc_ss=79b8c&_nc_ct=RQosPBUIFQIlBAAAAA&oh=00_AQRjkuAR0QBIZxOs61jk95_5NmXGtHNxkOCA-AVsjp1WTQ&oe=6B0CC5B4", "thumbnailUrl": null, "width": 1080, "height": 1350, "durationSeconds": null }, { "kind": "image", "url": "https://scontent-muc2-1.cdninstagram.com/v/t51.82787-15/914384603_18720223210019133_7491756309452445712_n.jpg?stp=dst-jpg_e35_tt6&_nc_cat=110&_nc_map=urlgen_bucketless&ig_cache_key=NDAzMjM3MDM5OTYxOTY5MjgwOA%3D%3D.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNBUk9VU0VMX0lURU0ueHBpZHMuMjA0Ni5zZHIucmVndWxhcl9waG90by5DMyJ9&_nc_ohc=4wWdcPuuez0Q7kNvwEkzIn6&_nc_oc=AdoVL2kYtZsOk76In6v1t8UFnx4MIxSZ5aqCkGO3wnUSF-DGrKjV4RP5QDqrN-tIKFE&_nc_zt=23&_nc_ht=scontent-muc2-1.cdninstagram.com&_nc_gid=9y7W7SWNsnsOUo3MiAJpbA&_nc_ss=79b8c&_nc_ct=RQosPBUIFQIlBAAAAA&oh=00_AQQXbqNPERXcyBdr47pObvqR7CbRKvD-xhlFrJKmfRltjQ&oe=6B0CBCCF", "thumbnailUrl": null, "width": 2046, "height": 1856, "durationSeconds": null }, { "kind": "image", "url": "https://scontent-muc2-1.cdninstagram.com/v/t51.82787-15/910707883_18720223213019133_8801173042309599373_n.jpg?stp=dst-jpg_e35_tt6&_nc_cat=104&_nc_map=urlgen_bucketless&ig_cache_key=NDAzMjM3MDQwMTQ5ODgyMTAxOQ%3D%3D.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNBUk9VU0VMX0lURU0ueHBpZHMuMjg4Ny5zZHIucmVndWxhcl9waG90by5DMyJ9&_nc_ohc=9c9rBGW3-XAQ7kNvwFpoYnK&_nc_oc=AdobA-ns7bltQpgOia95XRoDAbq9wMTOY81I_rka7fdg2XmCTJDZBQHJK6yWB8TPAn8&_nc_zt=23&_nc_ht=scontent-muc2-1.cdninstagram.com&_nc_gid=9y7W7SWNsnsOUo3MiAJpbA&_nc_ss=79b8c&_nc_ct=RQosPBUIFQIlBAAAAA&oh=00_AQSkpWlz1k5Qgu91gH7OYnc4FyFxsvQx8Q46_oveolX4cw&oe=6B0CC4E7", "thumbnailUrl": null, "width": 2887, "height": 2099, "durationSeconds": null } ], "hashtags": [], "mentions": [ "kiliiiyuyan", "chrisburkard", "paoloverzone" ], "ext": { "code": "Df147tCiAyB", "kind": "carousel", "location": null, "sound": null, "tagged": [], "paidPartnership": false, "countsHidden": false, "altText": "Photo by National Geographic on November 17, 2026. May be an image of text." } } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.instagram.post({ url: \"https://www.instagram.com/p/Df147tCiAyB/\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.instagram.post(url=\"https://www.instagram.com/p/Df147tCiAyB/\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/instagram/post \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://www.instagram.com/p/Df147tCiAyB/\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_InstagramPost": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/InstagramPost" } } }, "InstagramPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "code", "kind", "tagged", "paidPartnership", "countsHidden" ], "properties": { "altText": { "type": [ "string", "null" ], "description": "Instagram's description of the image, for screen readers." }, "code": { "type": "string", "description": "The code in its link (`instagram.com/p/`)." }, "countsHidden": { "type": "boolean", "description": "Whether its author hides its like and view counts." }, "kind": { "$ref": "#/components/schemas/InstagramPostKind" }, "location": { "oneOf": [ { "$ref": "#/components/schemas/InstagramPlaceRef", "description": "The place it was tagged at." }, { "type": "null" } ] }, "paidPartnership": { "type": "boolean", "description": "A paid partnership." }, "sound": { "oneOf": [ { "$ref": "#/components/schemas/InstagramSoundRef", "description": "The sound a reel uses." }, { "type": "null" } ] }, "tagged": { "type": "array", "items": { "type": "string" }, "description": "Accounts tagged in it, by username." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "An Instagram post: a photo, a video, a carousel, a reel, or a story in a highlight." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "InstagramSoundRef": { "type": "object", "description": "The sound a reel uses: a released song (by its audio cluster) or an account's\noriginal audio (by its asset). Read either with `/v1/instagram/sound`.", "required": [ "id", "title", "original" ], "properties": { "artist": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "original": { "type": "boolean" }, "title": { "type": "string" } } }, "InstagramPlaceRef": { "type": "object", "description": "A place a post is tagged at.", "required": [ "id", "name" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" } } }, "InstagramPostKind": { "type": "string", "description": "What a post is.", "enum": [ "photo", "video", "carousel", "reel", "story" ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Profile Highlights (/docs/api-reference/instagram/profile-highlights) An account's story highlights, with their covers. `GET https://api.socialapi.sh/v1/instagram/profile/highlights` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.instagram.profileHighlights({ handle: "instagram" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.instagram.profile_highlights(handle="instagram") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/instagram/profile/highlights \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=instagram" ``` **Response** ```json { "data": [ { "id": "18032893448824228", "name": "🎾🏀⚽️", "url": "https://www.instagram.com/stories/highlights/18032893448824228/", "coverUrl": "https://scontent-bos5-1.cdninstagram.com/v/t51.82787-15/575724433_18680673526001321_5945490939444494882_n.jpg?stp=c0.5x0.5f_dst-jpg_e35_p150x150_tt6_u&_nc_cat=1&ccb=7-5&_nc_sid=18de74&efg=eyJlZmdfdGFnIjoiU1RPUlkuYmVzdF9pbWFnZV91cmxnZW4uQzMifQ%3D%3D&_nc_ohc=LsNbXBDLf4oQ7kNvwGAyD1E&_nc_oc=Adq_d2Iujxdb23LULbBkZA4WTZorZt9XaulIqgzLTjeaA0fiaFJVsbQ8Y4N00wCfROc&_nc_zt=23&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_gid=uZuj2ODEKP8eQ-MsxW-cSw&_nc_ss=79b8c&_nc_ct=RQosPBUKFQIAAAA&oh=00_AQSvb0u7hD-OWdtAvKksT5CxDVAyfIUTd9kpYCDBarLrAw&oe=6B0CC749", "posts": null, "ext": { "ownerUsername": "instagram" } }, { "id": "18612622252018257", "name": "🎤🎶🎸", "url": "https://www.instagram.com/stories/highlights/18612622252018257/", "coverUrl": "https://scontent-bos5-1.cdninstagram.com/v/t51.71878-15/755867844_1751720619182762_5430881549273743299_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_cat=1&ccb=7-5&_nc_sid=acbce5&_nc_ohc=cHWqWiak_ZEQ7kNvwHC2Ndo&_nc_oc=AdpZOLUNTlL8GSc-pqY-9QnjW1TfNLcfpkT0inyFC2LUP0sPbLDDFEYwN6VQKM5-S6g&_nc_zt=23&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_gid=uZuj2ODEKP8eQ-MsxW-cSw&_nc_ss=79b8c&oh=00_AQRRr9AzSvn-7Akulg1uBBQcqfSbVWiF8PPIrqiFYSCrYQ&oe=6B0CB8AF", "posts": null, "ext": { "ownerUsername": "instagram" } } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/instagram/profile/highlights": { "get": { "tags": [ "Instagram" ], "summary": "An account's story highlights, with their covers.", "description": "Their titles and covers. The first 10, all Instagram shows a visitor; the profile's\n`ext.moreHighlights` says when there are more. 1 credit.", "operationId": "instagramProfileHighlights", "parameters": [ { "name": "handle", "in": "query", "description": "The username, with or without `@`.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "The profile's link, instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_InstagramHighlight" }, "example": { "data": [ { "id": "18032893448824228", "name": "🎾🏀⚽️", "url": "https://www.instagram.com/stories/highlights/18032893448824228/", "coverUrl": "https://scontent-bos5-1.cdninstagram.com/v/t51.82787-15/575724433_18680673526001321_5945490939444494882_n.jpg?stp=c0.5x0.5f_dst-jpg_e35_p150x150_tt6_u&_nc_cat=1&ccb=7-5&_nc_sid=18de74&efg=eyJlZmdfdGFnIjoiU1RPUlkuYmVzdF9pbWFnZV91cmxnZW4uQzMifQ%3D%3D&_nc_ohc=LsNbXBDLf4oQ7kNvwGAyD1E&_nc_oc=Adq_d2Iujxdb23LULbBkZA4WTZorZt9XaulIqgzLTjeaA0fiaFJVsbQ8Y4N00wCfROc&_nc_zt=23&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_gid=uZuj2ODEKP8eQ-MsxW-cSw&_nc_ss=79b8c&_nc_ct=RQosPBUKFQIAAAA&oh=00_AQSvb0u7hD-OWdtAvKksT5CxDVAyfIUTd9kpYCDBarLrAw&oe=6B0CC749", "posts": null, "ext": { "ownerUsername": "instagram" } }, { "id": "18612622252018257", "name": "🎤🎶🎸", "url": "https://www.instagram.com/stories/highlights/18612622252018257/", "coverUrl": "https://scontent-bos5-1.cdninstagram.com/v/t51.71878-15/755867844_1751720619182762_5430881549273743299_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_cat=1&ccb=7-5&_nc_sid=acbce5&_nc_ohc=cHWqWiak_ZEQ7kNvwHC2Ndo&_nc_oc=AdpZOLUNTlL8GSc-pqY-9QnjW1TfNLcfpkT0inyFC2LUP0sPbLDDFEYwN6VQKM5-S6g&_nc_zt=23&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_gid=uZuj2ODEKP8eQ-MsxW-cSw&_nc_ss=79b8c&oh=00_AQRRr9AzSvn-7Akulg1uBBQcqfSbVWiF8PPIrqiFYSCrYQ&oe=6B0CB8AF", "posts": null, "ext": { "ownerUsername": "instagram" } } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.instagram.profileHighlights({ handle: \"instagram\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.instagram.profile_highlights(handle=\"instagram\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/instagram/profile/highlights \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=instagram\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_InstagramHighlight": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/InstagramHighlight" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "InstagramHighlight": { "allOf": [ { "type": "object", "description": "A playlist, mix or collection of posts.", "required": [ "id", "name", "ext" ], "properties": { "coverUrl": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "description": "A story highlight, as a playlist of stories.", "properties": { "ownerUsername": { "type": [ "string", "null" ] } } }, { "type": "object", "description": "What only this platform has." } ] }, "id": { "type": "string" }, "name": { "type": "string" }, "posts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "url": { "type": [ "string", "null" ] } } }, { "type": "object", "description": "An Instagram story highlight." } ] } } } } ``` # Profile Posts (/docs/api-reference/instagram/profile-posts) An account's posts, newest first, 12 a page. `GET https://api.socialapi.sh/v1/instagram/profile/posts` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.instagram.profilePosts({ handle: "natgeo" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.instagram.profile_posts(handle="natgeo") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/instagram/profile/posts \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=natgeo" ``` **Response** ```json { "data": [ { "id": "4032379434794749057", "url": "https://www.instagram.com/p/Df147tCiAyB/", "text": "National Geographic photographers ventured to places far and wide to capture the year’s most fascinating images. Out of millions of photos, just 25 were selected as our Pictures of the Year. \n\nWe thought these photos of a juvenile Greenland shark, possibly born around the time of the American Civil War, a climber dangling from a horizontal ledge in Spain during August’s solar eclipse, and an astro…", "createdAt": "2026-11-17T12:05:09.000Z", "author": { "id": "787132", "username": "natgeo", "displayName": "National Geographic", "avatarUrl": "https://scontent-bos5-1.cdninstagram.com/v/t51.82787-19/683576066_18653628823019133_9051036240972105113_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_cat=1&ig_cache_key=GAKLvih9nsRnYEVCAJlFVLiBvZt9bmNDAQAB1501500j-ccb7-5&ccb=7-5&_nc_sid=669407&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLnd3dy40MDAuQzMifQ%3D%3D&_nc_ohc=Fzq-SLmj7IoQ7kNvwGv6Q-m&_nc_oc=Adqba9tyEQDxQEp3-B2IZh6tpjHxc5VaFSfndZ5toAR85RUYhlNWPGd0hJZIDC29xxg&_nc_zt=24&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_gid=yf7k_nIiwDL9XPzokHlt0A&_nc_ss=79389&_nc_ct=RQosPBUCFQIAAAA&oh=00_AQQ3jmnQ6k3Bh2Bs-0j0YuV1YZEVDlbHybVLcWpLWGsbrQ&oe=6B0CB22B", "verified": true, "url": "https://www.instagram.com/natgeo/" }, "stats": { "views": null, "likes": 23825, "comments": 104, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://scontent-bos5-1.cdninstagram.com/v/t51.82787-15/912032737_18720223195019133_3854183847552490578_n.jpg?stp=dst-jpg_e35_tt6&_nc_cat=109&_nc_map=urlgen_bucketless&ig_cache_key=NDAzMjM3MDM5NDQxODY4Mjg1OA%3D%3D.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNBUk9VU0VMX0lURU0ueHBpZHMuMTA4MC5zZHIucmVndWxhcl9waG90by5DMyJ9&_nc_ohc=bFP-yCIxZ7sQ7kNvwGPGN3J&_nc_oc=AdqdBai40ocxfLOTAmD_IwTe61MQPAh7OL02VDt8sfbk6GGHc8JqJWvBe2juFIGS94U&_nc_zt=23&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_gid=yf7k_nIiwDL9XPzokHlt0A&_nc_ss=79389&_nc_ct=RQosPBUIFQIlBAAAAA&oh=00_AQTbC4LavXqbIJ2NCa4iP6y-stcYqSf5cGZLeD2HD0xSDA&oe=6B0CC5B4", "thumbnailUrl": null, "width": 1080, "height": 1350, "durationSeconds": null }, { "kind": "image", "url": "https://scontent-bos5-1.cdninstagram.com/v/t51.82787-15/914384603_18720223210019133_7491756309452445712_n.jpg?stp=dst-jpg_e35_tt6&_nc_cat=110&_nc_map=urlgen_bucketless&ig_cache_key=NDAzMjM3MDM5OTYxOTY5MjgwOA%3D%3D.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNBUk9VU0VMX0lURU0ueHBpZHMuMjA0Ni5zZHIucmVndWxhcl9waG90by5DMyJ9&_nc_ohc=4wWdcPuuez0Q7kNvwGwWTzs&_nc_oc=Adok6NtZlL1ENV2D_8Ib3GiC0Drd7_0mkNctWFq5TXGBVTCT0tiLo0uGK_K127YfZRs&_nc_zt=23&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_gid=yf7k_nIiwDL9XPzokHlt0A&_nc_ss=79389&_nc_ct=RQosPBUIFQIlBAAAAA&oh=00_AQQizjU77StFXFSnuBJbgG93ZtP2cGdxAVbQLpQ-qrQB2A&oe=6B0CBCCF", "thumbnailUrl": null, "width": 2046, "height": 1856, "durationSeconds": null }, { "kind": "image", "url": "https://scontent-bos5-1.cdninstagram.com/v/t51.82787-15/910707883_18720223213019133_8801173042309599373_n.jpg?stp=dst-jpg_e35_tt6&_nc_cat=104&_nc_map=urlgen_bucketless&ig_cache_key=NDAzMjM3MDQwMTQ5ODgyMTAxOQ%3D%3D.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNBUk9VU0VMX0lURU0ueHBpZHMuMjg4Ny5zZHIucmVndWxhcl9waG90by5DMyJ9&_nc_ohc=9c9rBGW3-XAQ7kNvwFFOWaQ&_nc_oc=Adq6R3UaigS-Gbx0y39f_lrBixdjXnbDB9QHq-EQmI24Gcbgoe23XKeMJhMsxvWVtwM&_nc_zt=23&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_gid=yf7k_nIiwDL9XPzokHlt0A&_nc_ss=79389&_nc_ct=RQosPBUIFQIlBAAAAA&oh=00_AQTEgW7OnVddkNlOJsBsN3nquuGy8efmsdbIIe-_4bK_Lw&oe=6B0CC4E7", "thumbnailUrl": null, "width": 2887, "height": 2099, "durationSeconds": null } ], "hashtags": [], "mentions": [ "kiliiiyuyan", "chrisburkard", "paoloverzone" ], "ext": { "code": "Df147tCiAyB", "kind": "carousel", "location": null, "sound": null, "tagged": [], "paidPartnership": true, "countsHidden": false, "altText": null } }, { "id": "4017311023166285121", "url": "https://www.instagram.com/reel/DfAWxdIFmVB/", "text": "Even a moment’s rest on Everest can come with a reminder of just how unpredictable the mountain can be.\n\nFrom Oscar®-winning filmmakers @chaivasarhelyi and @jimmychin, EVEREST: THE OTHER SIDE, only in theaters and IMAX worldwide on October 30.", "createdAt": "2026-10-27T18:00:03.000Z", "author": { "id": "787132", "username": "natgeo", "displayName": "National Geographic", "avatarUrl": "https://scontent-bos5-1.cdninstagram.com/v/t51.82787-19/683576066_18653628823019133_9051036240972105113_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_cat=1&ig_cache_key=GAKLvih9nsRnYEVCAJlFVLiBvZt9bmNDAQAB1501500j-ccb7-5&ccb=7-5&_nc_sid=669407&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLnd3dy40MDAuQzMifQ%3D%3D&_nc_ohc=Fzq-SLmj7IoQ7kNvwGv6Q-m&_nc_oc=Adqba9tyEQDxQEp3-B2IZh6tpjHxc5VaFSfndZ5toAR85RUYhlNWPGd0hJZIDC29xxg&_nc_zt=24&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_gid=yf7k_nIiwDL9XPzokHlt0A&_nc_ss=79389&_nc_ct=RQosPBUCFQIAAAA&oh=00_AQQ3jmnQ6k3Bh2Bs-0j0YuV1YZEVDlbHybVLcWpLWGsbrQ&oe=6B0CB22B", "verified": true, "url": "https://www.instagram.com/natgeo/" }, "stats": { "views": null, "likes": 47536, "comments": 293, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://scontent-bos5-1.cdninstagram.com/o1/v/t2/f2/m86/AQO5UaEBuVN5hhSeE2Pjf5XGrwc3N5zJL5pllE6Qdcz-COp0ydRLeOMPAQuK_o4oLpDCoBmjjBwoPGnp7t-I4rSTp6U95gsrdOx9g9c.mp4?_nc_cat=106&_nc_sid=5e9851&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_ohc=woNj_vhBuQAQ7kNvwEvsjh9&efg=eyJ2ZW5jb2RlX3RhZyI6Inhwdl9wcm9ncmVzc2l2ZS5JTlNUQUdSQU0uQ0xJUFMuQzMuNzIwLmRhc2hfYmFzZWxpbmVfMV92MSIsInhwdl9hc3NldF9pZCI6MjcyOTY0MTE3NDEwNTAwNCwiYXNzZXRfYWdlX2RheXMiOjI4LCJ2aV91c2VjYXNlX2lkIjoxMDA5OSwiZHVyYXRpb25fcyI6NjgsInVybGdlbl9zb3VyY2UiOiJ3d3cifQ%3D%3D&ccb=17-1&vs=bb07d2bb0a4c7132&_nc_vs=HBksFQIYUmlnX3hwdl9yZWVsc19wZXJtYW5lbnRfc3JfcHJvZC83OEZDNzc3NTM1MkM0OEZCQjhENTlFQjRFOEI3QjNFMV92aWRlb19kYXNoaW5pdC5tcDQVAALIARIAFQIYUWlnX3hwdl9wbGFjZW1lbnRfcGVybWFuZW50X3YyLzc5NjAzOUYzNDY3MTQ4QTRCOEI2ODI2NDY2QTMzRDczX2F1ZGlvX2Rhc2hpbml0Lm1wNBUCAsgBEgAoABgAGwOIB3VzZV9vaWwBMRJwcm9ncmVzc2l2ZV9yZWNpcGUBMRJjb3B5X3NhbXBsZV9ncm91cHMBMRUAACbY7t_Ig6bZCRUCKAJDMywXQFEUWhysCDEYEmRhc2hfYmFzZWxpbmVfMV92MREAdf4HZeadAQA&_nc_gid=yf7k_nIiwDL9XPzokHlt0A&_nc_ss=79b8c&_nc_map=urlgen_bucketless&_nc_zt=28&_nc_enc=Up2zEG-1MsuDDHqpQv1xFuw28qalB0MUKu_GqRynSYMVNwEFXTWuyvgMqzu7MWYZ4UZ-d92JE7TmRpyGDTxtERV1PfUH8srCDIRjKgBTL5_Faqw4TSdFZmwwCsc&oh=00_AQR-cBqkHlrWMlyEWgFYpY9jfZwQycEXLu96OJThkOpOiw&oe=6B08D02B", "thumbnailUrl": "https://scontent-bos5-1.cdninstagram.com/v/t51.82787-15/865525088_18712762651019133_8954025122327073428_n.jpg?stp=dst-jpg_e15_tt6&_nc_cat=109&_nc_map=urlgen_bucketless&ig_cache_key=NDAxNzMxMTAyMzE2NjI4NTEyMTE4NzEyNzYyNjQ4MDE5MTMz.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNMSVBTLnhwaWRzLjEwODAuc2RyLnZpZGVvX2RlZmF1bHRfY292ZXJfZnJhbWUuQzMifQ%3D%3D&_nc_ohc=9oUelw1R1DgQ7kNvwHRrqHt&_nc_oc=Ado54QC7WrjKdSLg5-o31vo_JFvtkLCRIhJYZXkXdoieuR2-FxF10LsdnmNeyglpbWk&_nc_zt=23&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_gid=yf7k_nIiwDL9XPzokHlt0A&_nc_ss=79b8c&_nc_ct=RQosPBUIFQQlBAAAAA&oh=00_AQS0UH2sd5h7wRkvEN5AsOZNlLWvx_4DgxxUiZ9AFyFemA&oe=6B0CABF8", "width": 720, "height": 1280, "durationSeconds": null } ], "hashtags": [], "mentions": [ "chaivasarhelyi", "jimmychin" ], "ext": { "code": "DfAWxdIFmVB", "kind": "reel", "location": null, "sound": null, "tagged": [ "jimmychin", "chaivasarhelyi", "disneystudios" ], "paidPartnership": false, "countsHidden": false, "altText": null } } ], "pagination": { "nextCursor": "AQHTVg67_XXI0Z4XM0uOjFO0oHUF4VPZr8UCmmPQZ6KeI2wyU7-amcg5BIlZ7q3iYXX0QJBvitLX3adUDrcZa_125w", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/instagram/profile/posts": { "get": { "tags": [ "Instagram" ], "summary": "An account's posts, newest first, 12 a page.", "description": "With their likes, comments, captions and times. 1 credit a page.", "operationId": "instagramProfilePosts", "parameters": [ { "name": "handle", "in": "query", "description": "The username, with or without `@`.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "The profile's link, instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_InstagramPost" }, "example": { "data": [ { "id": "4032379434794749057", "url": "https://www.instagram.com/p/Df147tCiAyB/", "text": "National Geographic photographers ventured to places far and wide to capture the year’s most fascinating images. Out of millions of photos, just 25 were selected as our Pictures of the Year. \n\nWe thought these photos of a juvenile Greenland shark, possibly born around the time of the American Civil War, a climber dangling from a horizontal ledge in Spain during August’s solar eclipse, and an astro…", "createdAt": "2026-11-17T12:05:09.000Z", "author": { "id": "787132", "username": "natgeo", "displayName": "National Geographic", "avatarUrl": "https://scontent-bos5-1.cdninstagram.com/v/t51.82787-19/683576066_18653628823019133_9051036240972105113_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_cat=1&ig_cache_key=GAKLvih9nsRnYEVCAJlFVLiBvZt9bmNDAQAB1501500j-ccb7-5&ccb=7-5&_nc_sid=669407&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLnd3dy40MDAuQzMifQ%3D%3D&_nc_ohc=Fzq-SLmj7IoQ7kNvwGv6Q-m&_nc_oc=Adqba9tyEQDxQEp3-B2IZh6tpjHxc5VaFSfndZ5toAR85RUYhlNWPGd0hJZIDC29xxg&_nc_zt=24&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_gid=yf7k_nIiwDL9XPzokHlt0A&_nc_ss=79389&_nc_ct=RQosPBUCFQIAAAA&oh=00_AQQ3jmnQ6k3Bh2Bs-0j0YuV1YZEVDlbHybVLcWpLWGsbrQ&oe=6B0CB22B", "verified": true, "url": "https://www.instagram.com/natgeo/" }, "stats": { "views": null, "likes": 23825, "comments": 104, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://scontent-bos5-1.cdninstagram.com/v/t51.82787-15/912032737_18720223195019133_3854183847552490578_n.jpg?stp=dst-jpg_e35_tt6&_nc_cat=109&_nc_map=urlgen_bucketless&ig_cache_key=NDAzMjM3MDM5NDQxODY4Mjg1OA%3D%3D.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNBUk9VU0VMX0lURU0ueHBpZHMuMTA4MC5zZHIucmVndWxhcl9waG90by5DMyJ9&_nc_ohc=bFP-yCIxZ7sQ7kNvwGPGN3J&_nc_oc=AdqdBai40ocxfLOTAmD_IwTe61MQPAh7OL02VDt8sfbk6GGHc8JqJWvBe2juFIGS94U&_nc_zt=23&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_gid=yf7k_nIiwDL9XPzokHlt0A&_nc_ss=79389&_nc_ct=RQosPBUIFQIlBAAAAA&oh=00_AQTbC4LavXqbIJ2NCa4iP6y-stcYqSf5cGZLeD2HD0xSDA&oe=6B0CC5B4", "thumbnailUrl": null, "width": 1080, "height": 1350, "durationSeconds": null }, { "kind": "image", "url": "https://scontent-bos5-1.cdninstagram.com/v/t51.82787-15/914384603_18720223210019133_7491756309452445712_n.jpg?stp=dst-jpg_e35_tt6&_nc_cat=110&_nc_map=urlgen_bucketless&ig_cache_key=NDAzMjM3MDM5OTYxOTY5MjgwOA%3D%3D.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNBUk9VU0VMX0lURU0ueHBpZHMuMjA0Ni5zZHIucmVndWxhcl9waG90by5DMyJ9&_nc_ohc=4wWdcPuuez0Q7kNvwGwWTzs&_nc_oc=Adok6NtZlL1ENV2D_8Ib3GiC0Drd7_0mkNctWFq5TXGBVTCT0tiLo0uGK_K127YfZRs&_nc_zt=23&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_gid=yf7k_nIiwDL9XPzokHlt0A&_nc_ss=79389&_nc_ct=RQosPBUIFQIlBAAAAA&oh=00_AQQizjU77StFXFSnuBJbgG93ZtP2cGdxAVbQLpQ-qrQB2A&oe=6B0CBCCF", "thumbnailUrl": null, "width": 2046, "height": 1856, "durationSeconds": null }, { "kind": "image", "url": "https://scontent-bos5-1.cdninstagram.com/v/t51.82787-15/910707883_18720223213019133_8801173042309599373_n.jpg?stp=dst-jpg_e35_tt6&_nc_cat=104&_nc_map=urlgen_bucketless&ig_cache_key=NDAzMjM3MDQwMTQ5ODgyMTAxOQ%3D%3D.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNBUk9VU0VMX0lURU0ueHBpZHMuMjg4Ny5zZHIucmVndWxhcl9waG90by5DMyJ9&_nc_ohc=9c9rBGW3-XAQ7kNvwFFOWaQ&_nc_oc=Adq6R3UaigS-Gbx0y39f_lrBixdjXnbDB9QHq-EQmI24Gcbgoe23XKeMJhMsxvWVtwM&_nc_zt=23&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_gid=yf7k_nIiwDL9XPzokHlt0A&_nc_ss=79389&_nc_ct=RQosPBUIFQIlBAAAAA&oh=00_AQTEgW7OnVddkNlOJsBsN3nquuGy8efmsdbIIe-_4bK_Lw&oe=6B0CC4E7", "thumbnailUrl": null, "width": 2887, "height": 2099, "durationSeconds": null } ], "hashtags": [], "mentions": [ "kiliiiyuyan", "chrisburkard", "paoloverzone" ], "ext": { "code": "Df147tCiAyB", "kind": "carousel", "location": null, "sound": null, "tagged": [], "paidPartnership": true, "countsHidden": false, "altText": null } }, { "id": "4017311023166285121", "url": "https://www.instagram.com/reel/DfAWxdIFmVB/", "text": "Even a moment’s rest on Everest can come with a reminder of just how unpredictable the mountain can be.\n\nFrom Oscar®-winning filmmakers @chaivasarhelyi and @jimmychin, EVEREST: THE OTHER SIDE, only in theaters and IMAX worldwide on October 30.", "createdAt": "2026-10-27T18:00:03.000Z", "author": { "id": "787132", "username": "natgeo", "displayName": "National Geographic", "avatarUrl": "https://scontent-bos5-1.cdninstagram.com/v/t51.82787-19/683576066_18653628823019133_9051036240972105113_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_cat=1&ig_cache_key=GAKLvih9nsRnYEVCAJlFVLiBvZt9bmNDAQAB1501500j-ccb7-5&ccb=7-5&_nc_sid=669407&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLnd3dy40MDAuQzMifQ%3D%3D&_nc_ohc=Fzq-SLmj7IoQ7kNvwGv6Q-m&_nc_oc=Adqba9tyEQDxQEp3-B2IZh6tpjHxc5VaFSfndZ5toAR85RUYhlNWPGd0hJZIDC29xxg&_nc_zt=24&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_gid=yf7k_nIiwDL9XPzokHlt0A&_nc_ss=79389&_nc_ct=RQosPBUCFQIAAAA&oh=00_AQQ3jmnQ6k3Bh2Bs-0j0YuV1YZEVDlbHybVLcWpLWGsbrQ&oe=6B0CB22B", "verified": true, "url": "https://www.instagram.com/natgeo/" }, "stats": { "views": null, "likes": 47536, "comments": 293, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://scontent-bos5-1.cdninstagram.com/o1/v/t2/f2/m86/AQO5UaEBuVN5hhSeE2Pjf5XGrwc3N5zJL5pllE6Qdcz-COp0ydRLeOMPAQuK_o4oLpDCoBmjjBwoPGnp7t-I4rSTp6U95gsrdOx9g9c.mp4?_nc_cat=106&_nc_sid=5e9851&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_ohc=woNj_vhBuQAQ7kNvwEvsjh9&efg=eyJ2ZW5jb2RlX3RhZyI6Inhwdl9wcm9ncmVzc2l2ZS5JTlNUQUdSQU0uQ0xJUFMuQzMuNzIwLmRhc2hfYmFzZWxpbmVfMV92MSIsInhwdl9hc3NldF9pZCI6MjcyOTY0MTE3NDEwNTAwNCwiYXNzZXRfYWdlX2RheXMiOjI4LCJ2aV91c2VjYXNlX2lkIjoxMDA5OSwiZHVyYXRpb25fcyI6NjgsInVybGdlbl9zb3VyY2UiOiJ3d3cifQ%3D%3D&ccb=17-1&vs=bb07d2bb0a4c7132&_nc_vs=HBksFQIYUmlnX3hwdl9yZWVsc19wZXJtYW5lbnRfc3JfcHJvZC83OEZDNzc3NTM1MkM0OEZCQjhENTlFQjRFOEI3QjNFMV92aWRlb19kYXNoaW5pdC5tcDQVAALIARIAFQIYUWlnX3hwdl9wbGFjZW1lbnRfcGVybWFuZW50X3YyLzc5NjAzOUYzNDY3MTQ4QTRCOEI2ODI2NDY2QTMzRDczX2F1ZGlvX2Rhc2hpbml0Lm1wNBUCAsgBEgAoABgAGwOIB3VzZV9vaWwBMRJwcm9ncmVzc2l2ZV9yZWNpcGUBMRJjb3B5X3NhbXBsZV9ncm91cHMBMRUAACbY7t_Ig6bZCRUCKAJDMywXQFEUWhysCDEYEmRhc2hfYmFzZWxpbmVfMV92MREAdf4HZeadAQA&_nc_gid=yf7k_nIiwDL9XPzokHlt0A&_nc_ss=79b8c&_nc_map=urlgen_bucketless&_nc_zt=28&_nc_enc=Up2zEG-1MsuDDHqpQv1xFuw28qalB0MUKu_GqRynSYMVNwEFXTWuyvgMqzu7MWYZ4UZ-d92JE7TmRpyGDTxtERV1PfUH8srCDIRjKgBTL5_Faqw4TSdFZmwwCsc&oh=00_AQR-cBqkHlrWMlyEWgFYpY9jfZwQycEXLu96OJThkOpOiw&oe=6B08D02B", "thumbnailUrl": "https://scontent-bos5-1.cdninstagram.com/v/t51.82787-15/865525088_18712762651019133_8954025122327073428_n.jpg?stp=dst-jpg_e15_tt6&_nc_cat=109&_nc_map=urlgen_bucketless&ig_cache_key=NDAxNzMxMTAyMzE2NjI4NTEyMTE4NzEyNzYyNjQ4MDE5MTMz.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNMSVBTLnhwaWRzLjEwODAuc2RyLnZpZGVvX2RlZmF1bHRfY292ZXJfZnJhbWUuQzMifQ%3D%3D&_nc_ohc=9oUelw1R1DgQ7kNvwHRrqHt&_nc_oc=Ado54QC7WrjKdSLg5-o31vo_JFvtkLCRIhJYZXkXdoieuR2-FxF10LsdnmNeyglpbWk&_nc_zt=23&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_gid=yf7k_nIiwDL9XPzokHlt0A&_nc_ss=79b8c&_nc_ct=RQosPBUIFQQlBAAAAA&oh=00_AQS0UH2sd5h7wRkvEN5AsOZNlLWvx_4DgxxUiZ9AFyFemA&oe=6B0CABF8", "width": 720, "height": 1280, "durationSeconds": null } ], "hashtags": [], "mentions": [ "chaivasarhelyi", "jimmychin" ], "ext": { "code": "DfAWxdIFmVB", "kind": "reel", "location": null, "sound": null, "tagged": [ "jimmychin", "chaivasarhelyi", "disneystudios" ], "paidPartnership": false, "countsHidden": false, "altText": null } } ], "pagination": { "nextCursor": "AQHTVg67_XXI0Z4XM0uOjFO0oHUF4VPZr8UCmmPQZ6KeI2wyU7-amcg5BIlZ7q3iYXX0QJBvitLX3adUDrcZa_125w", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.instagram.profilePosts({ handle: \"natgeo\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.instagram.profile_posts(handle=\"natgeo\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/instagram/profile/posts \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=natgeo\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_InstagramPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/InstagramPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "InstagramPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "code", "kind", "tagged", "paidPartnership", "countsHidden" ], "properties": { "altText": { "type": [ "string", "null" ], "description": "Instagram's description of the image, for screen readers." }, "code": { "type": "string", "description": "The code in its link (`instagram.com/p/`)." }, "countsHidden": { "type": "boolean", "description": "Whether its author hides its like and view counts." }, "kind": { "$ref": "#/components/schemas/InstagramPostKind" }, "location": { "oneOf": [ { "$ref": "#/components/schemas/InstagramPlaceRef", "description": "The place it was tagged at." }, { "type": "null" } ] }, "paidPartnership": { "type": "boolean", "description": "A paid partnership." }, "sound": { "oneOf": [ { "$ref": "#/components/schemas/InstagramSoundRef", "description": "The sound a reel uses." }, { "type": "null" } ] }, "tagged": { "type": "array", "items": { "type": "string" }, "description": "Accounts tagged in it, by username." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "An Instagram post: a photo, a video, a carousel, a reel, or a story in a highlight." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "InstagramSoundRef": { "type": "object", "description": "The sound a reel uses: a released song (by its audio cluster) or an account's\noriginal audio (by its asset). Read either with `/v1/instagram/sound`.", "required": [ "id", "title", "original" ], "properties": { "artist": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "original": { "type": "boolean" }, "title": { "type": "string" } } }, "InstagramPlaceRef": { "type": "object", "description": "A place a post is tagged at.", "required": [ "id", "name" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" } } }, "InstagramPostKind": { "type": "string", "description": "What a post is.", "enum": [ "photo", "video", "carousel", "reel", "story" ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Profile Reels (/docs/api-reference/instagram/profile-reels) An account's reels with their plays, 12 a page. `GET https://api.socialapi.sh/v1/instagram/profile/reels` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.instagram.profileReels({ handle: "natgeo" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.instagram.profile_reels(handle="natgeo") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/instagram/profile/reels \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=natgeo" ``` **Response** ```json { "data": [ { "id": "4037787067701342133", "url": "https://www.instagram.com/reel/DgJGfHpAS-1/", "text": null, "createdAt": null, "author": { "id": "787132", "username": "natgeo", "displayName": null, "avatarUrl": null, "verified": false, "url": "https://www.instagram.com/natgeo/" }, "stats": { "views": 795351, "likes": 39042, "comments": 140, "shares": null, "saves": null, "engagementRate": 0.0493 }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://scontent-muc2-1.cdninstagram.com/v/t51.82787-15/921525947_18722563309019133_591112174822918768_n.jpg?stp=dst-jpg_e35_s640x640_tt6&_nc_cat=104&_nc_map=urlgen_bucketless&ccb=7-5&_nc_sid=18de74&efg=eyJlZmdfdGFnIjoiQ0xJUFMuYmVzdF9pbWFnZV91cmxnZW4uQzMifQ%3D%3D&_nc_ohc=8erJMuyaCRsQ7kNvwEZw2mQ&_nc_oc=AdreMdgEDrv8otarFZaxrMIEmjCckXeTDhNo_0p9Li3T9EjCXEEFjkNQ1oojnqxa9mE&_nc_zt=23&_nc_ht=scontent-muc2-1.cdninstagram.com&_nc_gid=NHyoBlgmA6GHzlXT7QFO1w&_nc_ss=79b8c&_nc_ct=RQosPBUKFQQAAAA&oh=00_AQRPROySx5Il9o7yuT-0jIGHN-DSk5IzIa68GXkEJ6Yq2Q&oe=6B0CAD83", "width": null, "height": null, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "code": "DgJGfHpAS-1", "kind": "reel", "location": null, "sound": null, "tagged": [], "paidPartnership": false, "countsHidden": false, "altText": null } }, { "id": "4037061490883314525", "url": "https://www.instagram.com/reel/DgGhglkgkNd/", "text": null, "createdAt": null, "author": { "id": "787132", "username": "natgeo", "displayName": null, "avatarUrl": null, "verified": false, "url": "https://www.instagram.com/natgeo/" }, "stats": { "views": 1298680, "likes": 18354, "comments": 68, "shares": null, "saves": null, "engagementRate": 0.0142 }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://scontent-muc2-1.cdninstagram.com/v/t51.82787-15/930624953_18722449651019133_85184317330909988_n.jpg?stp=dst-jpg_e35_s640x640_tt6&_nc_cat=101&_nc_map=urlgen_bucketless&ccb=7-5&_nc_sid=18de74&efg=eyJlZmdfdGFnIjoiQ0xJUFMuYmVzdF9pbWFnZV91cmxnZW4uQzMifQ%3D%3D&_nc_ohc=jRYk4Xlx2NQQ7kNvwF2oGVq&_nc_oc=AdpYTYYWtl87sj1m2JMR7nF25zND_tD2nd5_YwsdvqBK_LMBpNSiVkFd7WWDY4dkSs4&_nc_zt=23&_nc_ht=scontent-muc2-1.cdninstagram.com&_nc_gid=NHyoBlgmA6GHzlXT7QFO1w&_nc_ss=79b8c&_nc_ct=RQosPBUKFQwAAAA&oh=00_AQQx348na3teZJrRcqjLtxhmMLvCMTP5QKGzfK12s2fe2g&oe=6B0CAD7E", "width": null, "height": null, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "code": "DgGhglkgkNd", "kind": "reel", "location": null, "sound": null, "tagged": [], "paidPartnership": false, "countsHidden": false, "altText": null } } ], "pagination": { "nextCursor": "AQHT2jv6NIUKqXX-rzrlTt7eHraqasm1vmkjaHjOai3drogOgL-cdq5R19w9JZfyokw9ZwCGkeCspfcU5wHnJjt5qQ", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/instagram/profile/reels": { "get": { "tags": [ "Instagram" ], "summary": "An account's reels with their plays, 12 a page.", "description": "With their plays, likes, comments and cover. Captions, times and the video's link are\nnot in this list; read a reel with `/v1/instagram/post`. 1 credit a page.", "operationId": "instagramProfileReels", "parameters": [ { "name": "handle", "in": "query", "description": "The username, with or without `@`.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "The profile's link, instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_InstagramPost" }, "example": { "data": [ { "id": "4037787067701342133", "url": "https://www.instagram.com/reel/DgJGfHpAS-1/", "text": null, "createdAt": null, "author": { "id": "787132", "username": "natgeo", "displayName": null, "avatarUrl": null, "verified": false, "url": "https://www.instagram.com/natgeo/" }, "stats": { "views": 795351, "likes": 39042, "comments": 140, "shares": null, "saves": null, "engagementRate": 0.0493 }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://scontent-muc2-1.cdninstagram.com/v/t51.82787-15/921525947_18722563309019133_591112174822918768_n.jpg?stp=dst-jpg_e35_s640x640_tt6&_nc_cat=104&_nc_map=urlgen_bucketless&ccb=7-5&_nc_sid=18de74&efg=eyJlZmdfdGFnIjoiQ0xJUFMuYmVzdF9pbWFnZV91cmxnZW4uQzMifQ%3D%3D&_nc_ohc=8erJMuyaCRsQ7kNvwEZw2mQ&_nc_oc=AdreMdgEDrv8otarFZaxrMIEmjCckXeTDhNo_0p9Li3T9EjCXEEFjkNQ1oojnqxa9mE&_nc_zt=23&_nc_ht=scontent-muc2-1.cdninstagram.com&_nc_gid=NHyoBlgmA6GHzlXT7QFO1w&_nc_ss=79b8c&_nc_ct=RQosPBUKFQQAAAA&oh=00_AQRPROySx5Il9o7yuT-0jIGHN-DSk5IzIa68GXkEJ6Yq2Q&oe=6B0CAD83", "width": null, "height": null, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "code": "DgJGfHpAS-1", "kind": "reel", "location": null, "sound": null, "tagged": [], "paidPartnership": false, "countsHidden": false, "altText": null } }, { "id": "4037061490883314525", "url": "https://www.instagram.com/reel/DgGhglkgkNd/", "text": null, "createdAt": null, "author": { "id": "787132", "username": "natgeo", "displayName": null, "avatarUrl": null, "verified": false, "url": "https://www.instagram.com/natgeo/" }, "stats": { "views": 1298680, "likes": 18354, "comments": 68, "shares": null, "saves": null, "engagementRate": 0.0142 }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://scontent-muc2-1.cdninstagram.com/v/t51.82787-15/930624953_18722449651019133_85184317330909988_n.jpg?stp=dst-jpg_e35_s640x640_tt6&_nc_cat=101&_nc_map=urlgen_bucketless&ccb=7-5&_nc_sid=18de74&efg=eyJlZmdfdGFnIjoiQ0xJUFMuYmVzdF9pbWFnZV91cmxnZW4uQzMifQ%3D%3D&_nc_ohc=jRYk4Xlx2NQQ7kNvwF2oGVq&_nc_oc=AdpYTYYWtl87sj1m2JMR7nF25zND_tD2nd5_YwsdvqBK_LMBpNSiVkFd7WWDY4dkSs4&_nc_zt=23&_nc_ht=scontent-muc2-1.cdninstagram.com&_nc_gid=NHyoBlgmA6GHzlXT7QFO1w&_nc_ss=79b8c&_nc_ct=RQosPBUKFQwAAAA&oh=00_AQQx348na3teZJrRcqjLtxhmMLvCMTP5QKGzfK12s2fe2g&oe=6B0CAD7E", "width": null, "height": null, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "code": "DgGhglkgkNd", "kind": "reel", "location": null, "sound": null, "tagged": [], "paidPartnership": false, "countsHidden": false, "altText": null } } ], "pagination": { "nextCursor": "AQHT2jv6NIUKqXX-rzrlTt7eHraqasm1vmkjaHjOai3drogOgL-cdq5R19w9JZfyokw9ZwCGkeCspfcU5wHnJjt5qQ", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.instagram.profileReels({ handle: \"natgeo\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.instagram.profile_reels(handle=\"natgeo\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/instagram/profile/reels \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=natgeo\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_InstagramPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/InstagramPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "InstagramPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "code", "kind", "tagged", "paidPartnership", "countsHidden" ], "properties": { "altText": { "type": [ "string", "null" ], "description": "Instagram's description of the image, for screen readers." }, "code": { "type": "string", "description": "The code in its link (`instagram.com/p/`)." }, "countsHidden": { "type": "boolean", "description": "Whether its author hides its like and view counts." }, "kind": { "$ref": "#/components/schemas/InstagramPostKind" }, "location": { "oneOf": [ { "$ref": "#/components/schemas/InstagramPlaceRef", "description": "The place it was tagged at." }, { "type": "null" } ] }, "paidPartnership": { "type": "boolean", "description": "A paid partnership." }, "sound": { "oneOf": [ { "$ref": "#/components/schemas/InstagramSoundRef", "description": "The sound a reel uses." }, { "type": "null" } ] }, "tagged": { "type": "array", "items": { "type": "string" }, "description": "Accounts tagged in it, by username." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "An Instagram post: a photo, a video, a carousel, a reel, or a story in a highlight." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "InstagramSoundRef": { "type": "object", "description": "The sound a reel uses: a released song (by its audio cluster) or an account's\noriginal audio (by its asset). Read either with `/v1/instagram/sound`.", "required": [ "id", "title", "original" ], "properties": { "artist": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "original": { "type": "boolean" }, "title": { "type": "string" } } }, "InstagramPlaceRef": { "type": "object", "description": "A place a post is tagged at.", "required": [ "id", "name" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" } } }, "InstagramPostKind": { "type": "string", "description": "What a post is.", "enum": [ "photo", "video", "carousel", "reel", "story" ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Profile Similar (/docs/api-reference/instagram/profile-similar) Accounts like this one, as Instagram suggests them. `GET https://api.socialapi.sh/v1/instagram/profile/similar` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.instagram.profileSimilar({ handle: "natgeo" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.instagram.profile_similar(handle="natgeo") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/instagram/profile/similar \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=natgeo" ``` **Response** ```json { "data": [ { "id": "14443889360", "username": "oceansnation", "displayName": "Oceans Nation", "bio": null, "avatarUrl": "https://scontent-bos5-1.cdninstagram.com/v/t51.2885-19/101941578_595012604469085_7877055275964825600_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_cat=1&ig_cache_key=GEqBEwZdH_0qKR0CAAAAAAAK7FBtbkULAAAB1501500j-ccb7-5&ccb=7-5&_nc_sid=669407&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLnd3dy4xMDgwLkMzIn0%3D&_nc_ohc=5ATG8IBRo_0Q7kNvwEK7bcY&_nc_oc=Adq4-2TBUak7OWs4ndJdg8jHKn8dxqlxNl9wMhH3I_Lz1FI88o80pXBB54JS5trASNs&_nc_zt=24&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_ss=79b8c&_nc_ct=RQosPBUCFQIAAAA&oh=00_AQSeN63xxRVrg6K9Bj_h_8oRp0pZEl4k2DxdzhVAyhItrw&oe=6B0CC71C", "url": "https://www.instagram.com/oceansnation/", "verified": true, "private": false, "followers": null, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": null, "ext": { "bioLinks": [], "category": null, "latestStoryAt": null, "hasReels": false, "threadsUsername": null, "memorialized": false, "moreHighlights": false } }, { "id": "1934468093", "username": "natgeo_africa", "displayName": "Nat Geo Channel Africa", "bio": null, "avatarUrl": "https://scontent-bos5-1.cdninstagram.com/v/t51.82787-19/529167135_18487897162068094_3833751336155906899_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_cat=108&_nc_map=urlgen_bucketless&ig_cache_key=GB9zih9_MP3_pK5BAFODwDSHODQ1bmNDAQAB1501500j-ccb7-5&ccb=7-5&_nc_sid=669407&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLnd3dy4xMDQyLkMzIn0%3D&_nc_ohc=z38Q4LwgwOMQ7kNvwFuGyb1&_nc_oc=AdoiyZKzuiR6NVj-D384hbi32i5mj1FYtRAFxsD0PGOzkqm16lSPKyFe9YZl-BatuFs&_nc_zt=24&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_gid=q2iT86wQKjUNRkaxRfTx8w&_nc_ss=79b8c&_nc_ct=RQosPBUCFQIAAAA&oh=00_AQQSmnYDRK5VxQ2CP7z4sNAjb-6vM-f2MZvJ3cN2ZluB_g&oe=6B0CCC26", "url": "https://www.instagram.com/natgeo_africa/", "verified": true, "private": false, "followers": null, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": null, "ext": { "bioLinks": [], "category": null, "latestStoryAt": null, "hasReels": false, "threadsUsername": null, "memorialized": false, "moreHighlights": false } } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/instagram/profile/similar": { "get": { "tags": [ "Instagram" ], "summary": "Accounts like this one, as Instagram suggests them.", "description": "Up to 50, without their counts. Some accounts have none. 5 credits.", "operationId": "instagramProfileSimilar", "parameters": [ { "name": "handle", "in": "query", "description": "The username, with or without `@`.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "The profile's link, instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_InstagramProfile" }, "example": { "data": [ { "id": "14443889360", "username": "oceansnation", "displayName": "Oceans Nation", "bio": null, "avatarUrl": "https://scontent-bos5-1.cdninstagram.com/v/t51.2885-19/101941578_595012604469085_7877055275964825600_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_cat=1&ig_cache_key=GEqBEwZdH_0qKR0CAAAAAAAK7FBtbkULAAAB1501500j-ccb7-5&ccb=7-5&_nc_sid=669407&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLnd3dy4xMDgwLkMzIn0%3D&_nc_ohc=5ATG8IBRo_0Q7kNvwEK7bcY&_nc_oc=Adq4-2TBUak7OWs4ndJdg8jHKn8dxqlxNl9wMhH3I_Lz1FI88o80pXBB54JS5trASNs&_nc_zt=24&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_ss=79b8c&_nc_ct=RQosPBUCFQIAAAA&oh=00_AQSeN63xxRVrg6K9Bj_h_8oRp0pZEl4k2DxdzhVAyhItrw&oe=6B0CC71C", "url": "https://www.instagram.com/oceansnation/", "verified": true, "private": false, "followers": null, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": null, "ext": { "bioLinks": [], "category": null, "latestStoryAt": null, "hasReels": false, "threadsUsername": null, "memorialized": false, "moreHighlights": false } }, { "id": "1934468093", "username": "natgeo_africa", "displayName": "Nat Geo Channel Africa", "bio": null, "avatarUrl": "https://scontent-bos5-1.cdninstagram.com/v/t51.82787-19/529167135_18487897162068094_3833751336155906899_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_cat=108&_nc_map=urlgen_bucketless&ig_cache_key=GB9zih9_MP3_pK5BAFODwDSHODQ1bmNDAQAB1501500j-ccb7-5&ccb=7-5&_nc_sid=669407&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLnd3dy4xMDQyLkMzIn0%3D&_nc_ohc=z38Q4LwgwOMQ7kNvwFuGyb1&_nc_oc=AdoiyZKzuiR6NVj-D384hbi32i5mj1FYtRAFxsD0PGOzkqm16lSPKyFe9YZl-BatuFs&_nc_zt=24&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_gid=q2iT86wQKjUNRkaxRfTx8w&_nc_ss=79b8c&_nc_ct=RQosPBUCFQIAAAA&oh=00_AQQSmnYDRK5VxQ2CP7z4sNAjb-6vM-f2MZvJ3cN2ZluB_g&oe=6B0CCC26", "url": "https://www.instagram.com/natgeo_africa/", "verified": true, "private": false, "followers": null, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": null, "ext": { "bioLinks": [], "category": null, "latestStoryAt": null, "hasReels": false, "threadsUsername": null, "memorialized": false, "moreHighlights": false } } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.instagram.profileSimilar({ handle: \"natgeo\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.instagram.profile_similar(handle=\"natgeo\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/instagram/profile/similar \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=natgeo\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_InstagramProfile": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/InstagramProfile" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "InstagramProfile": { "allOf": [ { "type": "object", "description": "An account.", "required": [ "id", "username", "url", "verified", "private", "ext" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "bio": { "type": [ "string", "null" ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "displayName": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "bioLinks", "hasReels", "memorialized", "moreHighlights" ], "properties": { "bioLinks": { "type": "array", "items": { "$ref": "#/components/schemas/InstagramBioLink" }, "description": "Every link in the bio, in order (`externalUrl` is the first)." }, "category": { "type": [ "string", "null" ], "description": "The business category, where the account shows one." }, "hasReels": { "type": "boolean", "description": "Whether it has posted reels." }, "latestStoryAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "When its latest story was posted, while one is up." }, { "type": "null" } ] }, "memorialized": { "type": "boolean", "description": "A memorialized account." }, "moreHighlights": { "type": "boolean", "description": "Whether it has more than the first 10 story highlights, all a visitor is shown." }, "threadsUsername": { "type": [ "string", "null" ], "description": "Its Threads username, when its profile shows the Threads badge." } } }, { "type": "object", "description": "What only this platform has." } ] }, "externalUrl": { "type": [ "string", "null" ], "description": "The link in the bio." }, "followers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "following": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "id": { "type": "string", "description": "The platform's id for the account." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "description": "Likes the account's posts received in total.", "minimum": 0 }, "posts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "private": { "type": "boolean" }, "url": { "type": "string", "description": "The profile's page." }, "username": { "type": "string", "description": "The handle, without `@`." }, "verified": { "type": "boolean" } } }, { "type": "object", "description": "An Instagram account." } ] }, "Timestamp": { "type": "string", "format": "date-time" }, "InstagramBioLink": { "type": "object", "required": [ "url" ], "properties": { "title": { "type": [ "string", "null" ] }, "url": { "type": "string" } } } } } } ``` # Profile (/docs/api-reference/instagram/profile) A profile with its follower and following counts. `GET https://api.socialapi.sh/v1/instagram/profile` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.instagram.profile({ handle: "natgeo" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.instagram.profile(handle="natgeo").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/instagram/profile \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=natgeo" ``` **Response** ```json { "data": { "id": "787132", "username": "natgeo", "displayName": "National Geographic", "bio": "Step into wonder and find your inner explorer with National Geographic 🌎", "avatarUrl": "https://scontent-bos5-1.cdninstagram.com/v/t51.82787-19/683576066_18653628823019133_9051036240972105113_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_cat=1&ig_cache_key=GAKLvih9nsRnYEVCAJlFVLiBvZt9bmNDAQAB1501500j-ccb7-5&ccb=7-5&_nc_sid=669407&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLnd3dy40MDAuQzMifQ%3D%3D&_nc_ohc=Fzq-SLmj7IoQ7kNvwGv6Q-m&_nc_oc=Adqba9tyEQDxQEp3-B2IZh6tpjHxc5VaFSfndZ5toAR85RUYhlNWPGd0hJZIDC29xxg&_nc_zt=24&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_gid=DKToTpAPnxQ3-31AVDAh2w&_nc_ss=79b8c&_nc_ct=RQosPBUCFQIAAAA&oh=00_AQQjsSzc6M516mz06KVhu_tGEUutW9TNo7UVxSYTkJDp-g&oe=6B0CB22B", "url": "https://www.instagram.com/natgeo/", "verified": true, "private": false, "followers": 267265090, "following": 195, "likes": null, "posts": null, "externalUrl": "http://visitstore.bio/natgeo", "createdAt": null, "ext": { "bioLinks": [ { "url": "http://visitstore.bio/natgeo", "title": null }, { "url": "https://ngmdomsubs.nationalgeographic.com/servlet/OrdersGateway?cds_mag_code=NGM&cds_page_id=283562&cds_response_key=I5FX10002", "title": "Subscribe Here!" } ], "category": null, "latestStoryAt": "2026-11-24T23:09:17.000Z", "hasReels": true, "threadsUsername": "natgeo", "memorialized": false, "moreHighlights": false } } } ``` **OpenAPI** ```json { "paths": { "/v1/instagram/profile": { "get": { "tags": [ "Instagram" ], "summary": "A profile with its follower and following counts.", "description": "Name, bio and its links, verified, private, follower and following counts. Instagram\ndoes not show a visitor the post count, so `posts` is absent. 1 credit.", "operationId": "instagramProfile", "parameters": [ { "name": "handle", "in": "query", "description": "The username, with or without `@`.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "The profile's link (`https://www.instagram.com/nike/`), instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_InstagramProfile" }, "example": { "data": { "id": "787132", "username": "natgeo", "displayName": "National Geographic", "bio": "Step into wonder and find your inner explorer with National Geographic 🌎", "avatarUrl": "https://scontent-bos5-1.cdninstagram.com/v/t51.82787-19/683576066_18653628823019133_9051036240972105113_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_cat=1&ig_cache_key=GAKLvih9nsRnYEVCAJlFVLiBvZt9bmNDAQAB1501500j-ccb7-5&ccb=7-5&_nc_sid=669407&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLnd3dy40MDAuQzMifQ%3D%3D&_nc_ohc=Fzq-SLmj7IoQ7kNvwGv6Q-m&_nc_oc=Adqba9tyEQDxQEp3-B2IZh6tpjHxc5VaFSfndZ5toAR85RUYhlNWPGd0hJZIDC29xxg&_nc_zt=24&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_gid=DKToTpAPnxQ3-31AVDAh2w&_nc_ss=79b8c&_nc_ct=RQosPBUCFQIAAAA&oh=00_AQQjsSzc6M516mz06KVhu_tGEUutW9TNo7UVxSYTkJDp-g&oe=6B0CB22B", "url": "https://www.instagram.com/natgeo/", "verified": true, "private": false, "followers": 267265090, "following": 195, "likes": null, "posts": null, "externalUrl": "http://visitstore.bio/natgeo", "createdAt": null, "ext": { "bioLinks": [ { "url": "http://visitstore.bio/natgeo", "title": null }, { "url": "https://ngmdomsubs.nationalgeographic.com/servlet/OrdersGateway?cds_mag_code=NGM&cds_page_id=283562&cds_response_key=I5FX10002", "title": "Subscribe Here!" } ], "category": null, "latestStoryAt": "2026-11-24T23:09:17.000Z", "hasReels": true, "threadsUsername": "natgeo", "memorialized": false, "moreHighlights": false } } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.instagram.profile({ handle: \"natgeo\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.instagram.profile(handle=\"natgeo\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/instagram/profile \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=natgeo\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_InstagramProfile": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/InstagramProfile" } } }, "InstagramProfile": { "allOf": [ { "type": "object", "description": "An account.", "required": [ "id", "username", "url", "verified", "private", "ext" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "bio": { "type": [ "string", "null" ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "displayName": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "bioLinks", "hasReels", "memorialized", "moreHighlights" ], "properties": { "bioLinks": { "type": "array", "items": { "$ref": "#/components/schemas/InstagramBioLink" }, "description": "Every link in the bio, in order (`externalUrl` is the first)." }, "category": { "type": [ "string", "null" ], "description": "The business category, where the account shows one." }, "hasReels": { "type": "boolean", "description": "Whether it has posted reels." }, "latestStoryAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "When its latest story was posted, while one is up." }, { "type": "null" } ] }, "memorialized": { "type": "boolean", "description": "A memorialized account." }, "moreHighlights": { "type": "boolean", "description": "Whether it has more than the first 10 story highlights, all a visitor is shown." }, "threadsUsername": { "type": [ "string", "null" ], "description": "Its Threads username, when its profile shows the Threads badge." } } }, { "type": "object", "description": "What only this platform has." } ] }, "externalUrl": { "type": [ "string", "null" ], "description": "The link in the bio." }, "followers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "following": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "id": { "type": "string", "description": "The platform's id for the account." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "description": "Likes the account's posts received in total.", "minimum": 0 }, "posts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "private": { "type": "boolean" }, "url": { "type": "string", "description": "The profile's page." }, "username": { "type": "string", "description": "The handle, without `@`." }, "verified": { "type": "boolean" } } }, { "type": "object", "description": "An Instagram account." } ] }, "Timestamp": { "type": "string", "format": "date-time" }, "InstagramBioLink": { "type": "object", "required": [ "url" ], "properties": { "title": { "type": [ "string", "null" ] }, "url": { "type": "string" } } } } } } ``` # Search (/docs/api-reference/instagram/search) Popular posts for a word or hashtag, 12 a page. `GET https://api.socialapi.sh/v1/instagram/search` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.instagram.search({ query: "nike" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.instagram.search(query="nike") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/instagram/search \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "query=nike" ``` **Response** ```json { "data": [ { "id": "3935381392055233617", "url": "https://www.instagram.com/p/DadSIaJImxR/", "text": "Nike Mind 002\n\nВ наявності ✅\n🏷 3299 грн\n\n▫️Відправка протягом 24 годин, доставка 1-2 дні\n▫️Є післяплата, обмін та повернення\n\nБільше кольорів в профілі 📌", "createdAt": null, "author": { "id": "54487985067", "username": "vizor.shop", "displayName": null, "avatarUrl": "https://scontent-bos5-1.cdninstagram.com/v/t51.82787-19/583616532_18005222363817068_2191034518434292938_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_cat=105&_nc_map=urlgen_bucketless&ig_cache_key=GBRIySJs5BiDp-c-AMok5TFJHmgebmNDAQAB1501500j-ccb7-5&ccb=7-5&_nc_sid=669407&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLnd3dy4xMDAwLkMzIn0%3D&_nc_ohc=QFKujkOsFoAQ7kNvwE38KCV&_nc_oc=AdqgQZSAqIkkMakDCVnjHLomfSdpng9BH9nVHmcwgo1Y0Yt2T-V3-VDfL6T2CdotrBM&_nc_zt=24&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_gid=xtaH93upmjpbK-Tld1dv4w&_nc_ss=79b8c&_nc_ct=RQosPBUCFQIAAAA&oh=00_AQRP7cwj2xz6D7Qv5NojCxNAfX46pQiHtXBnXmbmNIUpfQ&oe=6B0CAF77", "verified": false, "url": "https://www.instagram.com/vizor.shop/" }, "stats": { "views": 11845, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://scontent-bos5-1.cdninstagram.com/o1/v/t2/f2/m86/AQNyCf21lx-JshAZL74jOLrukokdSMzk74CRmCmNvfqJcqwYrN2D4mP42w6d8WWXgPd0twumeFDYXEfWxtTX3QE48OO40hksGeZ5GTA.mp4?_nc_cat=106&_nc_sid=5e9851&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_ohc=6LSoTX47_UQQ7kNvwEfUY5h&efg=eyJ2ZW5jb2RlX3RhZyI6Inhwdl9wcm9ncmVzc2l2ZS5JTlNUQUdSQU0uQUQuQzMuNzIwLmRhc2hfYmFzZWxpbmVfMV92MSIsInhwdl9hc3NldF9pZCI6MjIwMDc0Nzk1NzQ0NTA4MiwiYXNzZXRfYWdlX2RheXMiOjE0MSwidmlfdXNlY2FzZV9pZCI6MTAwOTksImR1cmF0aW9uX3MiOjE5LCJ1cmxnZW5fc291cmNlIjoid3d3In0%3D&ccb=17-1&vs=3f90583c11a596ac&_nc_vs=HBksFQIYUmlnX3hwdl9yZWVsc19wZXJtYW5lbnRfc3JfcHJvZC9EMzRCOTEyRTQ4M0Q5NTFDNkFGRUU3ODI3MDI0RkM5NV92aWRlb19kYXNoaW5pdC5tcDQVAALIARIAFQIYUWlnX3hwdl9wbGFjZW1lbnRfcGVybWFuZW50X3YyLzgxNDgxNzlCREVDMEEzQjk2MzkxNTU5RjI4OTVEQTkyX2F1ZGlvX2Rhc2hpbml0Lm1wNBUCAsgBEgAoABgAGwOIB3VzZV9vaWwBMRJwcm9ncmVzc2l2ZV9yZWNpcGUBMRJjb3B5X3NhbXBsZV9ncm91cHMBMRUAACa0h_ODsuToBxUCKAJDMywXQDPu2RaHKwIYEmRhc2hfYmFzZWxpbmVfMV92MREAdfAHZeadAQA&_nc_gid=xtaH93upmjpbK-Tld1dv4w&_nc_ss=79b8c&_nc_map=urlgen_bucketless&_nc_zt=28&_nc_enc=Utt4SZGIVoGBPmWMB2AueAwvphdjwt1bXUXhh58rahid5JyWDtVdbHmMPlJMItu0DvvdMqvlRjpK4uzdh5x5VrNir88ioEIK6qLksY3bHf4nlp14Z_xBi73mOm8&oh=00_AQRj6FNQwy_I15xFVqTUL613ROTjI5rTI1qIMIWhzf3Eyw&oe=6B08CC17", "thumbnailUrl": "https://scontent-bos5-1.cdninstagram.com/v/t51.82787-15/735286999_18032518088817068_5956644756715406427_n.jpg?stp=dst-jpg_e35_s640x640_tt6&_nc_cat=110&_nc_map=urlgen_bucketless&ccb=7-5&_nc_sid=18de74&efg=eyJlZmdfdGFnIjoiQ0xJUFMuYmVzdF9pbWFnZV91cmxnZW4uQzMifQ%3D%3D&_nc_ohc=rypd5C5AVuYQ7kNvwHJb_xB&_nc_oc=AdpPx83AwlH6FRDqA89ZUPjJ9jIK4vgHtb9E2p4VsCi96J_RFYArMV7pNRdCyG6M7FU&_nc_zt=23&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_gid=xtaH93upmjpbK-Tld1dv4w&_nc_ss=79b8c&_nc_ct=RQosPBUKFQQAAAA&oh=00_AQQrvhEoy52B1R8NCRBWsEib5vWk5ckpCahSoV_udUQM_w&oe=6B0CBF2B", "width": null, "height": null, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "code": "DadSIaJImxR", "kind": "video", "location": null, "sound": null, "tagged": [], "paidPartnership": false, "countsHidden": false, "altText": null } }, { "id": "3088315863657374211", "url": "https://www.instagram.com/p/Crb5upXgGID/", "text": "Rate these 1-10🤯🔥\n\nWhat are your thoughts in the ‘Jarritos’ Nike SB Dunk Low?🤔\n\n#jarritos #sneakers #nikesb #nikedunk", "createdAt": null, "author": { "id": "40025386872", "username": "commonhype", "displayName": null, "avatarUrl": "https://scontent-bos5-1.cdninstagram.com/v/t51.2885-19/316153321_1159531031669180_3593654818307342430_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_cat=101&_nc_map=urlgen_bucketless&ig_cache_key=GOkd2BK8qT9blh4EAF6AlGoEOt8xbkULAAAB1501500j-ccb7-5&ccb=7-5&_nc_sid=669407&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLnd3dy4xMDI0LkMzIn0%3D&_nc_ohc=9V1cZNdBG9AQ7kNvwHQKNxf&_nc_oc=AdrXR5lErzz1krCuI9CenfI-n4MG0Yj35pByl356lq2D_o4KeaPT93ecUWlDEzqJBX4&_nc_zt=24&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_ss=79b8c&_nc_ct=RQosPBUCFQIAAAA&oh=00_AQTL_e7K9PsSid8jYER_yL0nosizK6YLgYsKNINhKCS7xA&oe=6B0CB117", "verified": false, "url": "https://www.instagram.com/commonhype/" }, "stats": { "views": 1466770, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://scontent-bos5-1.cdninstagram.com/o1/v/t2/f2/m82/AQPyeSHlheGidJONYuJ_E5XS1qNVDoD9IA8roE4VsFfsb2PAFxWbV288zfULpIxfaKc_6Ec6H1jKhIWc1h7agwfcuYjKJluVS7mB5YE.mp4?_nc_cat=105&_nc_sid=5e9851&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_ohc=kdSyOKPKYQ8Q7kNvwH9ImBt&efg=eyJ2ZW5jb2RlX3RhZyI6Inhwdl9wcm9ncmVzc2l2ZS5JTlNUQUdSQU0uQ0xJUFMuQzMuNzIwLmRhc2hfYmFzZWxpbmVfMV92MSIsInhwdl9hc3NldF9pZCI6MTQ0OTgwMjU1OTA4ODg1MSwiYXNzZXRfYWdlX2RheXMiOjEzMTAsInZpX3VzZWNhc2VfaWQiOjEwMDk5LCJkdXJhdGlvbl9zIjo5LCJ1cmxnZW5fc291cmNlIjoid3d3In0%3D&ccb=17-1&vs=c0adb41f21392e5b&_nc_vs=HBksFQIYT2lnX3hwdl9yZWVsc19wZXJtYW5lbnRfcHJvZC9CNjRGRkY0OTYzMUU5ODg4RTc5NzFFQTZCQTI0QjI4Q192aWRlb19kYXNoaW5pdC5tcDQVAALIARIAFQIYOnBhc3N0aHJvdWdoX2V2ZXJzdG9yZS9HQWZZZHhULUxxd3BjaFVFQUpQZ0RXOHNKdkI5YnFfRUFBQUYVAgLIARIAKAAYABsDiAd1c2Vfb2lsATEScHJvZ3Jlc3NpdmVfcmVjaXBlATESY29weV9zYW1wbGVfZ3JvdXBzATEVAAAmpqO76M6lkwUVAigCQzMsF0AimZmZmZmaGBJkYXNoX2Jhc2VsaW5lXzFfdjERAHX-B2XmnQEA&_nc_gid=xtaH93upmjpbK-Tld1dv4w&_nc_ss=79b8c&_nc_map=urlgen_bucketless&_nc_zt=28&oh=00_AQSBV3TM_kgc3I3qGtbuiaRXHGkN5003__LtP6_UgTnyBw&oe=6B08C086", "thumbnailUrl": "https://scontent-bos5-1.cdninstagram.com/v/t51.71878-15/496879814_1921819795220456_6608012940039790147_n.jpg?stp=dst-jpg_e35_s640x640_tt6&_nc_cat=105&_nc_map=urlgen_bucketless&ccb=7-5&_nc_sid=18de74&efg=eyJlZmdfdGFnIjoiQ0xJUFMuYmVzdF9pbWFnZV91cmxnZW4uQzMifQ%3D%3D&_nc_ohc=F0EnvdXXmk8Q7kNvwGpEtG1&_nc_oc=AdquF0_pBpAcjn-A5T0sN2xOSVLDxYGtydh_CZ-fJKv44vwzFWStDD_GbvyjPRrzViM&_nc_zt=23&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_gid=xtaH93upmjpbK-Tld1dv4w&_nc_ss=79b8c&_nc_ct=RQosPBUKFQQAAAA&oh=00_AQRywebADm-pU0khKrCiQ4FJOZVbYX0-7ENwTv8W_Z9_VA&oe=6B0CBFCA", "width": null, "height": null, "durationSeconds": null } ], "hashtags": [ "jarritos", "sneakers", "nikesb" ], "mentions": [], "ext": { "code": "Crb5upXgGID", "kind": "video", "location": null, "sound": null, "tagged": [], "paidPartnership": false, "countsHidden": false, "altText": null } } ], "pagination": { "nextCursor": "AQHTfhBSNyIVlLnHZUrh1EXUuZiVGdtIv05WJSx2uQHJ6IW1Yb5pPy3HljfdpFqbAQGP", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/instagram/search": { "get": { "tags": [ "Instagram" ], "summary": "Popular posts for a word or hashtag, 12 a page.", "description": "Mostly reels with their plays, from its popular page, about 100 in all, as Instagram\nshows a visitor. Some words have no such page and answer an empty list. 1 credit a\npage.", "operationId": "instagramSearch", "parameters": [ { "name": "query", "in": "query", "description": "A word or a hashtag (`nike`, `#summer outfits`).", "required": true, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_InstagramPost" }, "example": { "data": [ { "id": "3935381392055233617", "url": "https://www.instagram.com/p/DadSIaJImxR/", "text": "Nike Mind 002\n\nВ наявності ✅\n🏷 3299 грн\n\n▫️Відправка протягом 24 годин, доставка 1-2 дні\n▫️Є післяплата, обмін та повернення\n\nБільше кольорів в профілі 📌", "createdAt": null, "author": { "id": "54487985067", "username": "vizor.shop", "displayName": null, "avatarUrl": "https://scontent-bos5-1.cdninstagram.com/v/t51.82787-19/583616532_18005222363817068_2191034518434292938_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_cat=105&_nc_map=urlgen_bucketless&ig_cache_key=GBRIySJs5BiDp-c-AMok5TFJHmgebmNDAQAB1501500j-ccb7-5&ccb=7-5&_nc_sid=669407&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLnd3dy4xMDAwLkMzIn0%3D&_nc_ohc=QFKujkOsFoAQ7kNvwE38KCV&_nc_oc=AdqgQZSAqIkkMakDCVnjHLomfSdpng9BH9nVHmcwgo1Y0Yt2T-V3-VDfL6T2CdotrBM&_nc_zt=24&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_gid=xtaH93upmjpbK-Tld1dv4w&_nc_ss=79b8c&_nc_ct=RQosPBUCFQIAAAA&oh=00_AQRP7cwj2xz6D7Qv5NojCxNAfX46pQiHtXBnXmbmNIUpfQ&oe=6B0CAF77", "verified": false, "url": "https://www.instagram.com/vizor.shop/" }, "stats": { "views": 11845, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://scontent-bos5-1.cdninstagram.com/o1/v/t2/f2/m86/AQNyCf21lx-JshAZL74jOLrukokdSMzk74CRmCmNvfqJcqwYrN2D4mP42w6d8WWXgPd0twumeFDYXEfWxtTX3QE48OO40hksGeZ5GTA.mp4?_nc_cat=106&_nc_sid=5e9851&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_ohc=6LSoTX47_UQQ7kNvwEfUY5h&efg=eyJ2ZW5jb2RlX3RhZyI6Inhwdl9wcm9ncmVzc2l2ZS5JTlNUQUdSQU0uQUQuQzMuNzIwLmRhc2hfYmFzZWxpbmVfMV92MSIsInhwdl9hc3NldF9pZCI6MjIwMDc0Nzk1NzQ0NTA4MiwiYXNzZXRfYWdlX2RheXMiOjE0MSwidmlfdXNlY2FzZV9pZCI6MTAwOTksImR1cmF0aW9uX3MiOjE5LCJ1cmxnZW5fc291cmNlIjoid3d3In0%3D&ccb=17-1&vs=3f90583c11a596ac&_nc_vs=HBksFQIYUmlnX3hwdl9yZWVsc19wZXJtYW5lbnRfc3JfcHJvZC9EMzRCOTEyRTQ4M0Q5NTFDNkFGRUU3ODI3MDI0RkM5NV92aWRlb19kYXNoaW5pdC5tcDQVAALIARIAFQIYUWlnX3hwdl9wbGFjZW1lbnRfcGVybWFuZW50X3YyLzgxNDgxNzlCREVDMEEzQjk2MzkxNTU5RjI4OTVEQTkyX2F1ZGlvX2Rhc2hpbml0Lm1wNBUCAsgBEgAoABgAGwOIB3VzZV9vaWwBMRJwcm9ncmVzc2l2ZV9yZWNpcGUBMRJjb3B5X3NhbXBsZV9ncm91cHMBMRUAACa0h_ODsuToBxUCKAJDMywXQDPu2RaHKwIYEmRhc2hfYmFzZWxpbmVfMV92MREAdfAHZeadAQA&_nc_gid=xtaH93upmjpbK-Tld1dv4w&_nc_ss=79b8c&_nc_map=urlgen_bucketless&_nc_zt=28&_nc_enc=Utt4SZGIVoGBPmWMB2AueAwvphdjwt1bXUXhh58rahid5JyWDtVdbHmMPlJMItu0DvvdMqvlRjpK4uzdh5x5VrNir88ioEIK6qLksY3bHf4nlp14Z_xBi73mOm8&oh=00_AQRj6FNQwy_I15xFVqTUL613ROTjI5rTI1qIMIWhzf3Eyw&oe=6B08CC17", "thumbnailUrl": "https://scontent-bos5-1.cdninstagram.com/v/t51.82787-15/735286999_18032518088817068_5956644756715406427_n.jpg?stp=dst-jpg_e35_s640x640_tt6&_nc_cat=110&_nc_map=urlgen_bucketless&ccb=7-5&_nc_sid=18de74&efg=eyJlZmdfdGFnIjoiQ0xJUFMuYmVzdF9pbWFnZV91cmxnZW4uQzMifQ%3D%3D&_nc_ohc=rypd5C5AVuYQ7kNvwHJb_xB&_nc_oc=AdpPx83AwlH6FRDqA89ZUPjJ9jIK4vgHtb9E2p4VsCi96J_RFYArMV7pNRdCyG6M7FU&_nc_zt=23&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_gid=xtaH93upmjpbK-Tld1dv4w&_nc_ss=79b8c&_nc_ct=RQosPBUKFQQAAAA&oh=00_AQQrvhEoy52B1R8NCRBWsEib5vWk5ckpCahSoV_udUQM_w&oe=6B0CBF2B", "width": null, "height": null, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "code": "DadSIaJImxR", "kind": "video", "location": null, "sound": null, "tagged": [], "paidPartnership": false, "countsHidden": false, "altText": null } }, { "id": "3088315863657374211", "url": "https://www.instagram.com/p/Crb5upXgGID/", "text": "Rate these 1-10🤯🔥\n\nWhat are your thoughts in the ‘Jarritos’ Nike SB Dunk Low?🤔\n\n#jarritos #sneakers #nikesb #nikedunk", "createdAt": null, "author": { "id": "40025386872", "username": "commonhype", "displayName": null, "avatarUrl": "https://scontent-bos5-1.cdninstagram.com/v/t51.2885-19/316153321_1159531031669180_3593654818307342430_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_cat=101&_nc_map=urlgen_bucketless&ig_cache_key=GOkd2BK8qT9blh4EAF6AlGoEOt8xbkULAAAB1501500j-ccb7-5&ccb=7-5&_nc_sid=669407&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLnd3dy4xMDI0LkMzIn0%3D&_nc_ohc=9V1cZNdBG9AQ7kNvwHQKNxf&_nc_oc=AdrXR5lErzz1krCuI9CenfI-n4MG0Yj35pByl356lq2D_o4KeaPT93ecUWlDEzqJBX4&_nc_zt=24&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_ss=79b8c&_nc_ct=RQosPBUCFQIAAAA&oh=00_AQTL_e7K9PsSid8jYER_yL0nosizK6YLgYsKNINhKCS7xA&oe=6B0CB117", "verified": false, "url": "https://www.instagram.com/commonhype/" }, "stats": { "views": 1466770, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://scontent-bos5-1.cdninstagram.com/o1/v/t2/f2/m82/AQPyeSHlheGidJONYuJ_E5XS1qNVDoD9IA8roE4VsFfsb2PAFxWbV288zfULpIxfaKc_6Ec6H1jKhIWc1h7agwfcuYjKJluVS7mB5YE.mp4?_nc_cat=105&_nc_sid=5e9851&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_ohc=kdSyOKPKYQ8Q7kNvwH9ImBt&efg=eyJ2ZW5jb2RlX3RhZyI6Inhwdl9wcm9ncmVzc2l2ZS5JTlNUQUdSQU0uQ0xJUFMuQzMuNzIwLmRhc2hfYmFzZWxpbmVfMV92MSIsInhwdl9hc3NldF9pZCI6MTQ0OTgwMjU1OTA4ODg1MSwiYXNzZXRfYWdlX2RheXMiOjEzMTAsInZpX3VzZWNhc2VfaWQiOjEwMDk5LCJkdXJhdGlvbl9zIjo5LCJ1cmxnZW5fc291cmNlIjoid3d3In0%3D&ccb=17-1&vs=c0adb41f21392e5b&_nc_vs=HBksFQIYT2lnX3hwdl9yZWVsc19wZXJtYW5lbnRfcHJvZC9CNjRGRkY0OTYzMUU5ODg4RTc5NzFFQTZCQTI0QjI4Q192aWRlb19kYXNoaW5pdC5tcDQVAALIARIAFQIYOnBhc3N0aHJvdWdoX2V2ZXJzdG9yZS9HQWZZZHhULUxxd3BjaFVFQUpQZ0RXOHNKdkI5YnFfRUFBQUYVAgLIARIAKAAYABsDiAd1c2Vfb2lsATEScHJvZ3Jlc3NpdmVfcmVjaXBlATESY29weV9zYW1wbGVfZ3JvdXBzATEVAAAmpqO76M6lkwUVAigCQzMsF0AimZmZmZmaGBJkYXNoX2Jhc2VsaW5lXzFfdjERAHX-B2XmnQEA&_nc_gid=xtaH93upmjpbK-Tld1dv4w&_nc_ss=79b8c&_nc_map=urlgen_bucketless&_nc_zt=28&oh=00_AQSBV3TM_kgc3I3qGtbuiaRXHGkN5003__LtP6_UgTnyBw&oe=6B08C086", "thumbnailUrl": "https://scontent-bos5-1.cdninstagram.com/v/t51.71878-15/496879814_1921819795220456_6608012940039790147_n.jpg?stp=dst-jpg_e35_s640x640_tt6&_nc_cat=105&_nc_map=urlgen_bucketless&ccb=7-5&_nc_sid=18de74&efg=eyJlZmdfdGFnIjoiQ0xJUFMuYmVzdF9pbWFnZV91cmxnZW4uQzMifQ%3D%3D&_nc_ohc=F0EnvdXXmk8Q7kNvwGpEtG1&_nc_oc=AdquF0_pBpAcjn-A5T0sN2xOSVLDxYGtydh_CZ-fJKv44vwzFWStDD_GbvyjPRrzViM&_nc_zt=23&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_gid=xtaH93upmjpbK-Tld1dv4w&_nc_ss=79b8c&_nc_ct=RQosPBUKFQQAAAA&oh=00_AQRywebADm-pU0khKrCiQ4FJOZVbYX0-7ENwTv8W_Z9_VA&oe=6B0CBFCA", "width": null, "height": null, "durationSeconds": null } ], "hashtags": [ "jarritos", "sneakers", "nikesb" ], "mentions": [], "ext": { "code": "Crb5upXgGID", "kind": "video", "location": null, "sound": null, "tagged": [], "paidPartnership": false, "countsHidden": false, "altText": null } } ], "pagination": { "nextCursor": "AQHTfhBSNyIVlLnHZUrh1EXUuZiVGdtIv05WJSx2uQHJ6IW1Yb5pPy3HljfdpFqbAQGP", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.instagram.search({ query: \"nike\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.instagram.search(query=\"nike\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/instagram/search \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"query=nike\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_InstagramPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/InstagramPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "InstagramPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "code", "kind", "tagged", "paidPartnership", "countsHidden" ], "properties": { "altText": { "type": [ "string", "null" ], "description": "Instagram's description of the image, for screen readers." }, "code": { "type": "string", "description": "The code in its link (`instagram.com/p/`)." }, "countsHidden": { "type": "boolean", "description": "Whether its author hides its like and view counts." }, "kind": { "$ref": "#/components/schemas/InstagramPostKind" }, "location": { "oneOf": [ { "$ref": "#/components/schemas/InstagramPlaceRef", "description": "The place it was tagged at." }, { "type": "null" } ] }, "paidPartnership": { "type": "boolean", "description": "A paid partnership." }, "sound": { "oneOf": [ { "$ref": "#/components/schemas/InstagramSoundRef", "description": "The sound a reel uses." }, { "type": "null" } ] }, "tagged": { "type": "array", "items": { "type": "string" }, "description": "Accounts tagged in it, by username." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "An Instagram post: a photo, a video, a carousel, a reel, or a story in a highlight." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "InstagramSoundRef": { "type": "object", "description": "The sound a reel uses: a released song (by its audio cluster) or an account's\noriginal audio (by its asset). Read either with `/v1/instagram/sound`.", "required": [ "id", "title", "original" ], "properties": { "artist": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "original": { "type": "boolean" }, "title": { "type": "string" } } }, "InstagramPlaceRef": { "type": "object", "description": "A place a post is tagged at.", "required": [ "id", "name" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" } } }, "InstagramPostKind": { "type": "string", "description": "What a post is.", "enum": [ "photo", "video", "carousel", "reel", "story" ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Sound Posts (/docs/api-reference/instagram/sound-posts) The reels that use a sound, 12 a page. `GET https://api.socialapi.sh/v1/instagram/sound/posts` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.instagram.soundPosts({ id: "29753987437528017" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.instagram.sound_posts(id="29753987437528017") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/instagram/sound/posts \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "id=29753987437528017" ``` **Response** ```json { "data": [ { "id": "4037787067701342133", "url": "https://www.instagram.com/reel/DgJGfHpAS-1/", "text": "Much of the land in Cape Froward, Chile, is untamed—and it's set to remain that way when it becomes the 19th national park in Patagonia’s 1,700-mile Route of Parks by the end of 2027. Situated at the southernmost tip of mainland South America, the region offers visitors a chance to learn about the region’s whaling history and the native Kawésqar people as they explore untouched wildness. \n\nWhere d…", "createdAt": "2026-11-24T23:09:51.000Z", "author": { "id": "787132", "username": "natgeo", "displayName": "National Geographic", "avatarUrl": "https://scontent-bos5-1.cdninstagram.com/v/t51.82787-19/683576066_18653628823019133_9051036240972105113_n.jpg?stp=dst-jpg_s150x150_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby40MDAuYzIifQ&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_cat=1&_nc_oc=Q6cZ2gE7Pvk8b0t0m17NOIp_0ROAFbkovlpLLxE5pFcYu9XWgrAwgpmV2Pvn29u64pX50Vs&_nc_ohc=VmaJS6IR_2wQ7kNvwEXt4oP&_nc_gid=4DyLHeK_EBu5mEx6kV6Hcw&edm=APs17CUBAAAA&ccb=7-5&_nc_ct=RQAsPBUCFQIAAAA&oh=00_AQThIiVgDCUR-J55kDCVtU-T_uTqdo67LswqIuAiPU6nWg&oe=6B0CB22B&_nc_sid=10d13b", "verified": true, "url": "https://www.instagram.com/natgeo/" }, "stats": { "views": 796512, "likes": 39088, "comments": 140, "shares": null, "saves": null, "engagementRate": 0.0492 }, "media": [ { "kind": "video", "url": "https://scontent-bos5-1.cdninstagram.com/o1/v/t2/f2/m86/AQOpKDUeAbwUH7CcDvZ3pExVFbs7w4WQ1aJdzB64Vf3ccAZXtBSAP0qk6QEj_FEDVmugczXB74OCbWNYe9R7_HPkvZIyk0xyvuS6U2E.mp4?_nc_cat=109&_nc_sid=5e9851&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_ohc=woU9SI7LZhkQ7kNvwGUEbVH&efg=eyJ2ZW5jb2RlX3RhZyI6Inhwdl9wcm9ncmVzc2l2ZS5JTlNUQUdSQU0uQ0xJUFMuQzMuNzIwLmRhc2hfYmFzZWxpbmVfMV92MSIsInhwdl9hc3NldF9pZCI6MTM1NjA1NjI2MzIxNjIwNywiYXNzZXRfYWdlX2RheXMiOjAsInZpX3VzZWNhc2VfaWQiOjEwMDk5LCJkdXJhdGlvbl9zIjoxMSwidXJsZ2VuX3NvdXJjZSI6Ind3dyJ9&ccb=17-1&vs=c1a0dbb3953c2dc6&_nc_vs=HBksFQIYUmlnX3hwdl9yZWVsc19wZXJtYW5lbnRfc3JfcHJvZC80QjE3MEFCMTE3Q0Q0NUU1OEUyODdDNDRBMEVFNDhDMl92aWRlb19kYXNoaW5pdC5tcDQVAALIARIAFQIYUWlnX3hwdl9wbGFjZW1lbnRfcGVybWFuZW50X3YyLzVBRjcwQTZGNUUyNjQ5QTE5Q0ZDOTE2Mjk2OTBEMzY2X2F1ZGlvX2Rhc2hpbml0Lm1wNBUCAsgBEgAoABgAGwOIB3VzZV9vaWwBMRJwcm9ncmVzc2l2ZV9yZWNpcGUBMRJjb3B5X3NhbXBsZV9ncm91cHMBMRUAACaeseq97tToBBUCKAJDMywXQCcn752yLQ4YEmRhc2hfYmFzZWxpbmVfMV92MREAdf4HZeadAQA&_nc_gid=4DyLHeK_EBu5mEx6kV6Hcw&_nc_ss=79b8c&_nc_map=urlgen_bucketless&_nc_zt=28&oh=00_AQT-4YUlKZ6uJnrF8EnLsIl316S0TqAwKrm9h-ZK61GwFA&oe=6B08D252", "thumbnailUrl": "https://scontent-bos5-1.cdninstagram.com/v/t51.82787-15/921525947_18722563309019133_591112174822918768_n.jpg?stp=dst-jpg_e15_tt6&_nc_cat=104&_nc_map=urlgen_bucketless&ig_cache_key=NDAzNzc4NzA2NzcwMTM0MjEzMzE4NzIyNTYzMzA2MDE5MTMz.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNMSVBTLnhwaWRzLjUzNC5zZHIudmlkZW9fZGVmYXVsdF9jb3Zlcl9mcmFtZS5DMyJ9&_nc_ohc=8erJMuyaCRsQ7kNvwGebUs4&_nc_oc=Adro2gsSUTVAqbp3O5DF0VsOBjyqJbetNcNVOc1xXSxsMcynYC1rPKsEo4-q64EEvMQ&_nc_zt=23&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_gid=4DyLHeK_EBu5mEx6kV6Hcw&_nc_ss=79b8c&_nc_ct=RQosPBUIFQQlBAAAAA&oh=00_AQR-PU-Vl7BgBBnbtkr5wZ7tl4Rv837Ooo0ZU6I1bH_o2Q&oe=6B0CAD83", "width": 720, "height": 1280, "durationSeconds": 11.584 } ], "hashtags": [ "BestOfTheWorld" ], "mentions": [ "bystephanievermillion" ], "ext": { "code": "DgJGfHpAS-1", "kind": "reel", "location": null, "sound": { "id": "29753987437528017", "title": "Original audio", "artist": "natgeo", "original": true }, "tagged": [], "paidPartnership": false, "countsHidden": false, "altText": null } } ], "pagination": { "nextCursor": "GhbqvomQvfyMiXAmgor4scJoFAI0AikIGAAaCDoGGQwA", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/instagram/sound/posts": { "get": { "tags": [ "Instagram" ], "summary": "The reels that use a sound, 12 a page.", "description": "With their plays, likes, comments and times. 1 credit a page.", "operationId": "instagramSoundPosts", "parameters": [ { "name": "url", "in": "query", "description": "The sound's link.", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The sound's id, instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_InstagramPost" }, "example": { "data": [ { "id": "4037787067701342133", "url": "https://www.instagram.com/reel/DgJGfHpAS-1/", "text": "Much of the land in Cape Froward, Chile, is untamed—and it's set to remain that way when it becomes the 19th national park in Patagonia’s 1,700-mile Route of Parks by the end of 2027. Situated at the southernmost tip of mainland South America, the region offers visitors a chance to learn about the region’s whaling history and the native Kawésqar people as they explore untouched wildness. \n\nWhere d…", "createdAt": "2026-11-24T23:09:51.000Z", "author": { "id": "787132", "username": "natgeo", "displayName": "National Geographic", "avatarUrl": "https://scontent-bos5-1.cdninstagram.com/v/t51.82787-19/683576066_18653628823019133_9051036240972105113_n.jpg?stp=dst-jpg_s150x150_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby40MDAuYzIifQ&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_cat=1&_nc_oc=Q6cZ2gE7Pvk8b0t0m17NOIp_0ROAFbkovlpLLxE5pFcYu9XWgrAwgpmV2Pvn29u64pX50Vs&_nc_ohc=VmaJS6IR_2wQ7kNvwEXt4oP&_nc_gid=4DyLHeK_EBu5mEx6kV6Hcw&edm=APs17CUBAAAA&ccb=7-5&_nc_ct=RQAsPBUCFQIAAAA&oh=00_AQThIiVgDCUR-J55kDCVtU-T_uTqdo67LswqIuAiPU6nWg&oe=6B0CB22B&_nc_sid=10d13b", "verified": true, "url": "https://www.instagram.com/natgeo/" }, "stats": { "views": 796512, "likes": 39088, "comments": 140, "shares": null, "saves": null, "engagementRate": 0.0492 }, "media": [ { "kind": "video", "url": "https://scontent-bos5-1.cdninstagram.com/o1/v/t2/f2/m86/AQOpKDUeAbwUH7CcDvZ3pExVFbs7w4WQ1aJdzB64Vf3ccAZXtBSAP0qk6QEj_FEDVmugczXB74OCbWNYe9R7_HPkvZIyk0xyvuS6U2E.mp4?_nc_cat=109&_nc_sid=5e9851&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_ohc=woU9SI7LZhkQ7kNvwGUEbVH&efg=eyJ2ZW5jb2RlX3RhZyI6Inhwdl9wcm9ncmVzc2l2ZS5JTlNUQUdSQU0uQ0xJUFMuQzMuNzIwLmRhc2hfYmFzZWxpbmVfMV92MSIsInhwdl9hc3NldF9pZCI6MTM1NjA1NjI2MzIxNjIwNywiYXNzZXRfYWdlX2RheXMiOjAsInZpX3VzZWNhc2VfaWQiOjEwMDk5LCJkdXJhdGlvbl9zIjoxMSwidXJsZ2VuX3NvdXJjZSI6Ind3dyJ9&ccb=17-1&vs=c1a0dbb3953c2dc6&_nc_vs=HBksFQIYUmlnX3hwdl9yZWVsc19wZXJtYW5lbnRfc3JfcHJvZC80QjE3MEFCMTE3Q0Q0NUU1OEUyODdDNDRBMEVFNDhDMl92aWRlb19kYXNoaW5pdC5tcDQVAALIARIAFQIYUWlnX3hwdl9wbGFjZW1lbnRfcGVybWFuZW50X3YyLzVBRjcwQTZGNUUyNjQ5QTE5Q0ZDOTE2Mjk2OTBEMzY2X2F1ZGlvX2Rhc2hpbml0Lm1wNBUCAsgBEgAoABgAGwOIB3VzZV9vaWwBMRJwcm9ncmVzc2l2ZV9yZWNpcGUBMRJjb3B5X3NhbXBsZV9ncm91cHMBMRUAACaeseq97tToBBUCKAJDMywXQCcn752yLQ4YEmRhc2hfYmFzZWxpbmVfMV92MREAdf4HZeadAQA&_nc_gid=4DyLHeK_EBu5mEx6kV6Hcw&_nc_ss=79b8c&_nc_map=urlgen_bucketless&_nc_zt=28&oh=00_AQT-4YUlKZ6uJnrF8EnLsIl316S0TqAwKrm9h-ZK61GwFA&oe=6B08D252", "thumbnailUrl": "https://scontent-bos5-1.cdninstagram.com/v/t51.82787-15/921525947_18722563309019133_591112174822918768_n.jpg?stp=dst-jpg_e15_tt6&_nc_cat=104&_nc_map=urlgen_bucketless&ig_cache_key=NDAzNzc4NzA2NzcwMTM0MjEzMzE4NzIyNTYzMzA2MDE5MTMz.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNMSVBTLnhwaWRzLjUzNC5zZHIudmlkZW9fZGVmYXVsdF9jb3Zlcl9mcmFtZS5DMyJ9&_nc_ohc=8erJMuyaCRsQ7kNvwGebUs4&_nc_oc=Adro2gsSUTVAqbp3O5DF0VsOBjyqJbetNcNVOc1xXSxsMcynYC1rPKsEo4-q64EEvMQ&_nc_zt=23&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_gid=4DyLHeK_EBu5mEx6kV6Hcw&_nc_ss=79b8c&_nc_ct=RQosPBUIFQQlBAAAAA&oh=00_AQR-PU-Vl7BgBBnbtkr5wZ7tl4Rv837Ooo0ZU6I1bH_o2Q&oe=6B0CAD83", "width": 720, "height": 1280, "durationSeconds": 11.584 } ], "hashtags": [ "BestOfTheWorld" ], "mentions": [ "bystephanievermillion" ], "ext": { "code": "DgJGfHpAS-1", "kind": "reel", "location": null, "sound": { "id": "29753987437528017", "title": "Original audio", "artist": "natgeo", "original": true }, "tagged": [], "paidPartnership": false, "countsHidden": false, "altText": null } } ], "pagination": { "nextCursor": "GhbqvomQvfyMiXAmgor4scJoFAI0AikIGAAaCDoGGQwA", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.instagram.soundPosts({ id: \"29753987437528017\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.instagram.sound_posts(id=\"29753987437528017\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/instagram/sound/posts \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"id=29753987437528017\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_InstagramPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/InstagramPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "InstagramPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "code", "kind", "tagged", "paidPartnership", "countsHidden" ], "properties": { "altText": { "type": [ "string", "null" ], "description": "Instagram's description of the image, for screen readers." }, "code": { "type": "string", "description": "The code in its link (`instagram.com/p/`)." }, "countsHidden": { "type": "boolean", "description": "Whether its author hides its like and view counts." }, "kind": { "$ref": "#/components/schemas/InstagramPostKind" }, "location": { "oneOf": [ { "$ref": "#/components/schemas/InstagramPlaceRef", "description": "The place it was tagged at." }, { "type": "null" } ] }, "paidPartnership": { "type": "boolean", "description": "A paid partnership." }, "sound": { "oneOf": [ { "$ref": "#/components/schemas/InstagramSoundRef", "description": "The sound a reel uses." }, { "type": "null" } ] }, "tagged": { "type": "array", "items": { "type": "string" }, "description": "Accounts tagged in it, by username." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "An Instagram post: a photo, a video, a carousel, a reel, or a story in a highlight." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "InstagramSoundRef": { "type": "object", "description": "The sound a reel uses: a released song (by its audio cluster) or an account's\noriginal audio (by its asset). Read either with `/v1/instagram/sound`.", "required": [ "id", "title", "original" ], "properties": { "artist": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "original": { "type": "boolean" }, "title": { "type": "string" } } }, "InstagramPlaceRef": { "type": "object", "description": "A place a post is tagged at.", "required": [ "id", "name" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" } } }, "InstagramPostKind": { "type": "string", "description": "What a post is.", "enum": [ "photo", "video", "carousel", "reel", "story" ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Sound (/docs/api-reference/instagram/sound) A sound, and how many reels use it. `GET https://api.socialapi.sh/v1/instagram/sound` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.instagram.sound({ id: "29753987437528017" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.instagram.sound(id="29753987437528017").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/instagram/sound \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "id=29753987437528017" ``` **Response** ```json { "data": { "id": "29753987437528017", "title": "Original audio", "artist": "National Geographic", "url": "https://www.instagram.com/reels/audio/29753987437528017/", "coverUrl": "https://scontent-bos5-1.cdninstagram.com/v/t51.82787-19/683576066_18653628823019133_9051036240972105113_n.jpg?stp=dst-jpg_s150x150_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby40MDAuYzIifQ&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_cat=1&_nc_oc=Q6cZ2gH0PEBKiPt7ZLGFI06I9eMyiRQjhMkeHxP7p_aohRcud3_uJm_XFcMD8f2uJN3X7qg&_nc_ohc=VmaJS6IR_2wQ7kNvwEXt4oP&_nc_gid=q5jhd9F0F4dWG4ScnS5KHA&edm=APs17CUBAAAA&ccb=7-5&_nc_ct=RQAsPBUCFQIAAAA&oh=00_AQRj1cwet5S863NiSBAI4JWfOma5vq_QDotUQPYbt4gXDw&oe=6B0CB22B&_nc_sid=10d13b", "playUrl": null, "durationSeconds": 11.584, "original": true, "posts": 1, "ext": { "artistUsername": "natgeo", "postsLabel": "1 reel", "explicit": false } } } ``` **OpenAPI** ```json { "paths": { "/v1/instagram/sound": { "get": { "tags": [ "Instagram" ], "summary": "A sound, and how many reels use it.", "description": "A song (title, artist, cover, length) or an account's original audio. 1 credit.", "operationId": "instagramSound", "parameters": [ { "name": "url", "in": "query", "description": "The sound's link (`https://www.instagram.com/reels/audio//`).", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The sound's id (a reel's `ext.sound.id`), instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_InstagramSound" }, "example": { "data": { "id": "29753987437528017", "title": "Original audio", "artist": "National Geographic", "url": "https://www.instagram.com/reels/audio/29753987437528017/", "coverUrl": "https://scontent-bos5-1.cdninstagram.com/v/t51.82787-19/683576066_18653628823019133_9051036240972105113_n.jpg?stp=dst-jpg_s150x150_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby40MDAuYzIifQ&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_cat=1&_nc_oc=Q6cZ2gH0PEBKiPt7ZLGFI06I9eMyiRQjhMkeHxP7p_aohRcud3_uJm_XFcMD8f2uJN3X7qg&_nc_ohc=VmaJS6IR_2wQ7kNvwEXt4oP&_nc_gid=q5jhd9F0F4dWG4ScnS5KHA&edm=APs17CUBAAAA&ccb=7-5&_nc_ct=RQAsPBUCFQIAAAA&oh=00_AQRj1cwet5S863NiSBAI4JWfOma5vq_QDotUQPYbt4gXDw&oe=6B0CB22B&_nc_sid=10d13b", "playUrl": null, "durationSeconds": 11.584, "original": true, "posts": 1, "ext": { "artistUsername": "natgeo", "postsLabel": "1 reel", "explicit": false } } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.instagram.sound({ id: \"29753987437528017\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.instagram.sound(id=\"29753987437528017\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/instagram/sound \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"id=29753987437528017\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_InstagramSound": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/InstagramSound" } } }, "InstagramSound": { "allOf": [ { "type": "object", "description": "A sound or song posts use.", "required": [ "id", "title", "url", "original", "ext" ], "properties": { "artist": { "type": [ "string", "null" ], "description": "The artist, or the account the original sound is from." }, "coverUrl": { "type": [ "string", "null" ] }, "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "ext": { "allOf": [ { "type": "object", "required": [ "explicit" ], "properties": { "artistUsername": { "type": [ "string", "null" ], "description": "The username of the artist's account, or of the account an original audio is from." }, "explicit": { "type": "boolean" }, "postsLabel": { "type": [ "string", "null" ], "description": "The reels count as its page shows it (\"609K reels\"): what it can list." } } }, { "type": "object", "description": "What only this platform has." } ] }, "id": { "type": "string" }, "original": { "type": "boolean", "description": "Whether it is an account's own recording rather than a released song." }, "playUrl": { "type": [ "string", "null" ] }, "posts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "title": { "type": "string" }, "url": { "type": "string" } } }, { "type": "object", "description": "An Instagram sound: a song, or an account's original audio." } ] } } } } ``` # Trending Topics (/docs/api-reference/instagram/trending-topics) The explore page's trending keywords and accounts. `GET https://api.socialapi.sh/v1/instagram/trending/topics` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.instagram.trendingTopics(); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.instagram.trending_topics() ``` **cURL** ```bash curl https://api.socialapi.sh/v1/instagram/trending/topics \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" ``` **Response** ```json { "data": [ { "section": "trending_now", "sectionTitle": "Trending now", "rank": 1, "keyword": "dwtsfinale", "posts": 8915, "thumbnailUrl": "https://scontent-muc2-1.cdninstagram.com/v/t51.71878-15/671736852_1338987388110511_1179155925416770258_n.jpg?stp=dst-jpg_e35_tt6&_nc_cat=104&_nc_map=urlgen_bucketless&ccb=7-5&_nc_sid=18de74&efg=eyJlZmdfdGFnIjoiQ0xJUFMuYmVzdF9pbWFnZV91cmxnZW4uQzMifQ%3D%3D&_nc_ohc=QwB4fYSyJXsQ7kNvwFqyiZU&_nc_oc=AdpX1UJnYMVf9ERPPq6K4nEZWzZaHPrmz1A9BwHSXGg_qKpRJyqYqJmV0oKNdQvBGWg&_nc_zt=23&_nc_ht=scontent-muc2-1.cdninstagram.com&_nc_gid=5fKCgaav_IWc5oylm2qsHw&_nc_ss=79389&_nc_ct=RQosPBUKFQgAAAA&oh=00_AQTUrvPSOXf8WlkvyA6jtThGVlkYcldYj7K9Q7hXxt9Vkw&oe=6B0CA8F8", "url": "https://www.instagram.com/popular/dwtsfinale/", "account": null }, { "section": "trending_now", "sectionTitle": "Trending now", "rank": 2, "keyword": "supermoon", "posts": 12915758, "thumbnailUrl": "https://scontent-muc2-1.cdninstagram.com/v/t51.82787-15/920627306_18117843902589255_2564109489731007136_n.jpg?stp=dst-jpg_e35_tt6&_nc_cat=108&_nc_map=urlgen_bucketless&ccb=7-5&_nc_sid=18de74&efg=eyJlZmdfdGFnIjoiQ0xJUFMuYmVzdF9pbWFnZV91cmxnZW4uQzMifQ%3D%3D&_nc_ohc=oJzrz9OjLh8Q7kNvwFzaE7n&_nc_oc=Adr3q_AqsRbNovbo6MQnYqR0PooXdwEfqc5AMKxXX2aD03jKyacsVMguvCf2Lvi29_g&_nc_zt=23&_nc_ht=scontent-muc2-1.cdninstagram.com&_nc_gid=5fKCgaav_IWc5oylm2qsHw&_nc_ss=79389&_nc_ct=RQosPBUKFQQAAAA&oh=00_AQSEhsLc21Wt8Wx_BxuFiEZp3osAnvHPX4NVP5jElxo_Dg&oe=6B0CD792", "url": "https://www.instagram.com/popular/supermoon/", "account": null } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/instagram/trending/topics": { "get": { "tags": [ "Instagram" ], "summary": "The explore page's trending keywords and accounts.", "description": "Keywords with their post counts and categories, and accounts to watch, by section.\n1 credit.", "operationId": "instagramTrendingTopics", "parameters": [ { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_InstagramTrend" }, "example": { "data": [ { "section": "trending_now", "sectionTitle": "Trending now", "rank": 1, "keyword": "dwtsfinale", "posts": 8915, "thumbnailUrl": "https://scontent-muc2-1.cdninstagram.com/v/t51.71878-15/671736852_1338987388110511_1179155925416770258_n.jpg?stp=dst-jpg_e35_tt6&_nc_cat=104&_nc_map=urlgen_bucketless&ccb=7-5&_nc_sid=18de74&efg=eyJlZmdfdGFnIjoiQ0xJUFMuYmVzdF9pbWFnZV91cmxnZW4uQzMifQ%3D%3D&_nc_ohc=QwB4fYSyJXsQ7kNvwFqyiZU&_nc_oc=AdpX1UJnYMVf9ERPPq6K4nEZWzZaHPrmz1A9BwHSXGg_qKpRJyqYqJmV0oKNdQvBGWg&_nc_zt=23&_nc_ht=scontent-muc2-1.cdninstagram.com&_nc_gid=5fKCgaav_IWc5oylm2qsHw&_nc_ss=79389&_nc_ct=RQosPBUKFQgAAAA&oh=00_AQTUrvPSOXf8WlkvyA6jtThGVlkYcldYj7K9Q7hXxt9Vkw&oe=6B0CA8F8", "url": "https://www.instagram.com/popular/dwtsfinale/", "account": null }, { "section": "trending_now", "sectionTitle": "Trending now", "rank": 2, "keyword": "supermoon", "posts": 12915758, "thumbnailUrl": "https://scontent-muc2-1.cdninstagram.com/v/t51.82787-15/920627306_18117843902589255_2564109489731007136_n.jpg?stp=dst-jpg_e35_tt6&_nc_cat=108&_nc_map=urlgen_bucketless&ccb=7-5&_nc_sid=18de74&efg=eyJlZmdfdGFnIjoiQ0xJUFMuYmVzdF9pbWFnZV91cmxnZW4uQzMifQ%3D%3D&_nc_ohc=oJzrz9OjLh8Q7kNvwFzaE7n&_nc_oc=Adr3q_AqsRbNovbo6MQnYqR0PooXdwEfqc5AMKxXX2aD03jKyacsVMguvCf2Lvi29_g&_nc_zt=23&_nc_ht=scontent-muc2-1.cdninstagram.com&_nc_gid=5fKCgaav_IWc5oylm2qsHw&_nc_ss=79389&_nc_ct=RQosPBUKFQQAAAA&oh=00_AQSEhsLc21Wt8Wx_BxuFiEZp3osAnvHPX4NVP5jElxo_Dg&oe=6B0CD792", "url": "https://www.instagram.com/popular/supermoon/", "account": null } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.instagram.trendingTopics();" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.instagram.trending_topics()" }, { "lang": "bash", "label": "cURL", "source": "curl https://api.socialapi.sh/v1/instagram/trending/topics \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_InstagramTrend": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/InstagramTrend" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "InstagramTrend": { "allOf": [ { "type": "object", "description": "One entry of the explore page: a trending keyword, a category, or an account to look\nout for.", "required": [ "section", "url" ], "properties": { "account": { "oneOf": [ { "$ref": "#/components/schemas/InstagramTrendAccount", "description": "The account, in the accounts section." }, { "type": "null" } ] }, "keyword": { "type": [ "string", "null" ], "description": "The keyword (for every section but accounts); search it with\n`/v1/instagram/search`." }, "posts": { "type": [ "integer", "null" ], "format": "int64", "description": "Posts under the keyword, where Instagram counts them.", "minimum": 0 }, "rank": { "type": [ "integer", "null" ], "format": "int64", "description": "Its place in the section, from 1.", "minimum": 0 }, "section": { "type": "string", "description": "The section it is in (`trending_now`, `entertainment`, `celebrities`,\n`browse_categories`…), and its title on the page." }, "sectionTitle": { "type": [ "string", "null" ] }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": "string" } } }, { "type": "object", "description": "An entry of Instagram's explore page." } ] }, "InstagramTrendAccount": { "type": "object", "required": [ "id", "username", "verified" ], "properties": { "displayName": { "type": [ "string", "null" ] }, "followers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "id": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Trending (/docs/api-reference/instagram/trending) The reels feed Instagram gives a visitor, 8 a page. `GET https://api.socialapi.sh/v1/instagram/trending` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.instagram.trending(); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.instagram.trending() ``` **cURL** ```bash curl https://api.socialapi.sh/v1/instagram/trending \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" ``` **Response** ```json { "data": [ { "id": "4036242852903255494", "url": "https://www.instagram.com/p/DgDnX1igf3G/", "text": "When you scratch the itch in just the right spot 😂", "createdAt": "2026-11-22T20:01:27.000Z", "author": { "id": "1073701485", "username": "evanrosenman", "displayName": null, "avatarUrl": "https://scontent-bos5-1.cdninstagram.com/v/t51.82787-19/560093181_18534984328037486_2958532596433864309_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_cat=1&ig_cache_key=GP1XYiFuRMpUeNlBAHXG2rK40Q4pbmNDAQAB1501500j-ccb7-5&ccb=7-5&_nc_sid=669407&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLnd3dy4xMDgwLkMzIn0%3D&_nc_ohc=nFhJlUPDpkoQ7kNvwEG39ru&_nc_oc=AdqJwUSsfqGlyOhg5qXTEclWCq_y5romA8pM8AI07B49HTC3JnFQ935PdU3YJwSsZU4&_nc_zt=24&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_gid=FLH1cVH0DY2FYo-kifBI3Q&_nc_ss=79389&_nc_ct=RQosPBUCFQIAAAA&oh=00_AQQIbH8ae6PyXLMx2Edl8mUeilGFft06XQXVKc6zZlkgJQ&oe=6B0CBB56", "verified": false, "url": "https://www.instagram.com/evanrosenman/" }, "stats": { "views": null, "likes": 64077, "comments": 476, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://scontent-bos5-1.cdninstagram.com/o1/v/t2/f2/m86/AQNPkZeFxzJF7Ewx0QuIzG5ryYM0j5jJQ2aXR1Pm-FTwdK5esBktPhZglNMwRnxXSmSqluyTYKjDZERsyAISMaKKntI1YVLsVROFGdg.mp4?_nc_cat=107&_nc_sid=5e9851&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_ohc=tD0kA3M8xB8Q7kNvwETMBcO&efg=eyJ2ZW5jb2RlX3RhZyI6Inhwdl9wcm9ncmVzc2l2ZS5JTlNUQUdSQU0uQ0xJUFMuQzMuNzIwLmRhc2hfYmFzZWxpbmVfMV92MSIsInhwdl9hc3NldF9pZCI6MTg2NjEyNzI4NzEwMzc0ODYsImFzc2V0X2FnZV9kYXlzIjoyLCJ2aV91c2VjYXNlX2lkIjoxMDA5OSwiZHVyYXRpb25fcyI6MTIsInVybGdlbl9zb3VyY2UiOiJ3d3cifQ%3D%3D&ccb=17-1&vs=c4d159e2d397810c&_nc_vs=HBksFQIYUmlnX3hwdl9yZWVsc19wZXJtYW5lbnRfc3JfcHJvZC81QjFFMzEwREEyQTg0RTFEOEUxRDU1RkUzMTkyOTlFRl92aWRlb19kYXNoaW5pdC5tcDQVAALIARIAFQIYUWlnX3hwdl9wbGFjZW1lbnRfcGVybWFuZW50X3YyLzdCOTY4RUEyNjhCNjRFQjNBMEMzQTc0QTFCOUI5NzA3X2F1ZGlvX2Rhc2hpbml0Lm1wNBUCAsgBEgAoABgAGwOIB3VzZV9vaWwBMRJwcm9ncmVzc2l2ZV9yZWNpcGUBMRJjb3B5X3NhbXBsZV9ncm91cHMBMRUAACbcqMfIhZWmQhUCKAJDMywXQCgU_fO2RaIYEmRhc2hfYmFzZWxpbmVfMV92MREAdf4HZeadAQA&_nc_gid=FLH1cVH0DY2FYo-kifBI3Q&_nc_ss=79b8c&_nc_map=urlgen_bucketless&_nc_zt=28&_nc_enc=Ui_JniPnoUQcGOnq94J35O6ICXfU49oLHbUxo5AOgh8WB28uomnB-CgJIXuEM9X3GGbzkK7WY2z1c_BMq8wu6AepcKkNLaeJf5BExcIlCgfgaI5bn3leNKGl-dc&oh=00_AQQZc99ujdsBQ4Y2iMdy6g5bHbddLKB2SXXSHI2vJQS9xA&oe=6B08BDDC", "thumbnailUrl": "https://scontent-bos5-1.cdninstagram.com/v/t51.82787-15/920350673_18661273105037486_3009290956098131643_n.jpg?stp=dst-jpg_e15_tt6&_nc_cat=103&_nc_map=urlgen_bucketless&ig_cache_key=NDAzNjI0Mjg1MjkwMzI1NTQ5NDE4NjYxMjczMDk5MDM3NDg2.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNMSVBTLnhwaWRzLjcyMC5zZHIudmlkZW9fZGVmYXVsdF9jb3Zlcl9mcmFtZS5DMyJ9&_nc_ohc=ZNX5_uNnJZkQ7kNvwEkipvZ&_nc_oc=AdoHCC5yeWgqxFZohTsKG_nYwqSfAdzHkRkFzDRcZkAjysOFOUjUazzFTFbWYsPKMXM&_nc_zt=23&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_gid=FLH1cVH0DY2FYo-kifBI3Q&_nc_ss=79b8c&_nc_ct=RQosPBUIFQQlBAAAAA&oh=00_AQS7WiHCn5MKcPBWdCPgnoJtg3kJE4rF8K_nNd0mlA3nug&oe=6B0CCFF8", "width": 720, "height": 1280, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "code": "DgDnX1igf3G", "kind": "video", "location": null, "sound": null, "tagged": [], "paidPartnership": false, "countsHidden": false, "altText": null } }, { "id": "4037020708453825890", "url": "https://www.instagram.com/p/DgGYPH-ST1i/", "text": "quite literally saved the last dance 😩😭 #dwts @missjuliastiles", "createdAt": "2026-11-23T21:50:20.000Z", "author": { "id": "23873043", "username": "ezra.sosa", "displayName": null, "avatarUrl": "https://scontent-bos5-1.cdninstagram.com/v/t51.82787-19/793596732_18615119668001044_1162280206309991929_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_cat=1&ig_cache_key=GDxTTS8UOUNLWiJCAPklk4qwPyEQbmNDAQAB1501500j-ccb7-5&ccb=7-5&_nc_sid=669407&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLnd3dy4xMDgwLkMzIn0%3D&_nc_ohc=qxtrc0fPGvUQ7kNvwFvU3so&_nc_oc=AdpN7nc6ptOLhNwGnvkBSPLJdo1HdUsvmw9pzGiftKqJvVpq8GF1uSQw0lJugQL6g0w&_nc_zt=24&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_gid=FLH1cVH0DY2FYo-kifBI3Q&_nc_ss=79389&_nc_ct=RQosPBUCFQIAAAA&oh=00_AQQ5vSgN3vZXHyoCFAsEWe0KZbZcSApMDPTsn75kPsGiQA&oe=6B0CDBA5", "verified": false, "url": "https://www.instagram.com/ezra.sosa/" }, "stats": { "views": null, "likes": 338031, "comments": 5197, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://scontent-bos5-1.cdninstagram.com/o1/v/t2/f2/m86/AQO2OK39G4KFR-oL4skmzqbXwL8i2uC8HrVMWKtoj2JQiv3F6_P1oiV4kt-lfa19U1buyEf9UwuPTnMMx-eST8rB3Xqt31hnel1_gYY.mp4?_nc_cat=111&_nc_sid=5e9851&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_ohc=kPPu6ADK23UQ7kNvwF8LbEP&efg=eyJ2ZW5jb2RlX3RhZyI6Inhwdl9wcm9ncmVzc2l2ZS5JTlNUQUdSQU0uQ0xJUFMuQzMuNzIwLmRhc2hfYmFzZWxpbmVfMV92MSIsInhwdl9hc3NldF9pZCI6MTQ0OTE5NjM0MDE2MjM0NiwiYXNzZXRfYWdlX2RheXMiOjEsInZpX3VzZWNhc2VfaWQiOjEwMDk5LCJkdXJhdGlvbl9zIjoxMTIsInVybGdlbl9zb3VyY2UiOiJ3d3cifQ%3D%3D&ccb=17-1&vs=807c9f5abb0956ef&_nc_vs=HBksFQIYUmlnX3hwdl9yZWVsc19wZXJtYW5lbnRfc3JfcHJvZC8wQjZBRTI5NTBGREU0REIzOERFNkRBRDAzOTMwQzEyMl92aWRlb19kYXNoaW5pdC5tcDQVAALIARIAFQIYUWlnX3hwdl9wbGFjZW1lbnRfcGVybWFuZW50X3YyL0UzNEE0NUFENzQyNTQ0ODM5QzgzNUE0MTU4MDVDNzk3X2F1ZGlvX2Rhc2hpbml0Lm1wNBUCAsgBEgAoABgAGwOIB3VzZV9vaWwBMRJwcm9ncmVzc2l2ZV9yZWNpcGUBMRJjb3B5X3NhbXBsZV9ncm91cHMBMRUAACbUvIWRqoKTBRUCKAJDMywXQFwRBiTdLxsYEmRhc2hfYmFzZWxpbmVfMV92MREAdf4HZeadAQA&_nc_gid=FLH1cVH0DY2FYo-kifBI3Q&_nc_ss=79b8c&_nc_map=urlgen_bucketless&_nc_zt=28&oh=00_AQQdiUeFNszCJIPGTPvRDbhA_3du18p_oHnVCPXGyYTYfw&oe=6B08BC44", "thumbnailUrl": "https://scontent-bos5-1.cdninstagram.com/v/t51.82787-15/926262620_18642818497001044_1343823141613365777_n.jpg?stp=dst-jpg_e15_tt6&_nc_cat=106&_nc_map=urlgen_bucketless&ig_cache_key=NDAzNzAyMDcwODQ1MzgyNTg5MDE4NjQyODE4NDk0MDAxMDQ0.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNMSVBTLnhwaWRzLjcyMC5zZHIudmlkZW9fdXNlcl9zZWxlY3RlZF90aHVtYm5haWwuQzMifQ%3D%3D&_nc_ohc=fcv-GWnqY64Q7kNvwHVF3QI&_nc_oc=AdpcMkTsEHh3ieIQv6fY-O9rp8tVx4K6Pb0plHt8RQRcHOHfuHXYHKyQ0MpLmKKcGwc&_nc_zt=23&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_gid=FLH1cVH0DY2FYo-kifBI3Q&_nc_ss=79b8c&_nc_ct=RQosPBUIFQ4lBAAAAA&oh=00_AQTso74IhiV_wYJpSpRaFd4eFhMtx_q-Ioe4wAFyZ9vsXw&oe=6B0CA96E", "width": 1080, "height": 1920, "durationSeconds": null } ], "hashtags": [ "dwts" ], "mentions": [ "missjuliastiles" ], "ext": { "code": "DgGYPH-ST1i", "kind": "video", "location": null, "sound": null, "tagged": [], "paidPartnership": false, "countsHidden": false, "altText": null } } ], "pagination": { "nextCursor": "GoaM94-orN_Og3DE9cnkv7ywhnC2wOHL7qDFg3DwmYuj8PDIg3CmtNi78pyUhXD-v8OUmoCnhHDk3tGUwayihnDclqOwmanBg3Am8J74scJoFBBZCBgAGgg6BhkMAA==", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/instagram/trending": { "get": { "tags": [ "Instagram" ], "summary": "The reels feed Instagram gives a visitor, 8 a page.", "description": "With likes, comments and times. 5 credits a page.", "operationId": "instagramTrending", "parameters": [ { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_InstagramPost" }, "example": { "data": [ { "id": "4036242852903255494", "url": "https://www.instagram.com/p/DgDnX1igf3G/", "text": "When you scratch the itch in just the right spot 😂", "createdAt": "2026-11-22T20:01:27.000Z", "author": { "id": "1073701485", "username": "evanrosenman", "displayName": null, "avatarUrl": "https://scontent-bos5-1.cdninstagram.com/v/t51.82787-19/560093181_18534984328037486_2958532596433864309_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_cat=1&ig_cache_key=GP1XYiFuRMpUeNlBAHXG2rK40Q4pbmNDAQAB1501500j-ccb7-5&ccb=7-5&_nc_sid=669407&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLnd3dy4xMDgwLkMzIn0%3D&_nc_ohc=nFhJlUPDpkoQ7kNvwEG39ru&_nc_oc=AdqJwUSsfqGlyOhg5qXTEclWCq_y5romA8pM8AI07B49HTC3JnFQ935PdU3YJwSsZU4&_nc_zt=24&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_gid=FLH1cVH0DY2FYo-kifBI3Q&_nc_ss=79389&_nc_ct=RQosPBUCFQIAAAA&oh=00_AQQIbH8ae6PyXLMx2Edl8mUeilGFft06XQXVKc6zZlkgJQ&oe=6B0CBB56", "verified": false, "url": "https://www.instagram.com/evanrosenman/" }, "stats": { "views": null, "likes": 64077, "comments": 476, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://scontent-bos5-1.cdninstagram.com/o1/v/t2/f2/m86/AQNPkZeFxzJF7Ewx0QuIzG5ryYM0j5jJQ2aXR1Pm-FTwdK5esBktPhZglNMwRnxXSmSqluyTYKjDZERsyAISMaKKntI1YVLsVROFGdg.mp4?_nc_cat=107&_nc_sid=5e9851&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_ohc=tD0kA3M8xB8Q7kNvwETMBcO&efg=eyJ2ZW5jb2RlX3RhZyI6Inhwdl9wcm9ncmVzc2l2ZS5JTlNUQUdSQU0uQ0xJUFMuQzMuNzIwLmRhc2hfYmFzZWxpbmVfMV92MSIsInhwdl9hc3NldF9pZCI6MTg2NjEyNzI4NzEwMzc0ODYsImFzc2V0X2FnZV9kYXlzIjoyLCJ2aV91c2VjYXNlX2lkIjoxMDA5OSwiZHVyYXRpb25fcyI6MTIsInVybGdlbl9zb3VyY2UiOiJ3d3cifQ%3D%3D&ccb=17-1&vs=c4d159e2d397810c&_nc_vs=HBksFQIYUmlnX3hwdl9yZWVsc19wZXJtYW5lbnRfc3JfcHJvZC81QjFFMzEwREEyQTg0RTFEOEUxRDU1RkUzMTkyOTlFRl92aWRlb19kYXNoaW5pdC5tcDQVAALIARIAFQIYUWlnX3hwdl9wbGFjZW1lbnRfcGVybWFuZW50X3YyLzdCOTY4RUEyNjhCNjRFQjNBMEMzQTc0QTFCOUI5NzA3X2F1ZGlvX2Rhc2hpbml0Lm1wNBUCAsgBEgAoABgAGwOIB3VzZV9vaWwBMRJwcm9ncmVzc2l2ZV9yZWNpcGUBMRJjb3B5X3NhbXBsZV9ncm91cHMBMRUAACbcqMfIhZWmQhUCKAJDMywXQCgU_fO2RaIYEmRhc2hfYmFzZWxpbmVfMV92MREAdf4HZeadAQA&_nc_gid=FLH1cVH0DY2FYo-kifBI3Q&_nc_ss=79b8c&_nc_map=urlgen_bucketless&_nc_zt=28&_nc_enc=Ui_JniPnoUQcGOnq94J35O6ICXfU49oLHbUxo5AOgh8WB28uomnB-CgJIXuEM9X3GGbzkK7WY2z1c_BMq8wu6AepcKkNLaeJf5BExcIlCgfgaI5bn3leNKGl-dc&oh=00_AQQZc99ujdsBQ4Y2iMdy6g5bHbddLKB2SXXSHI2vJQS9xA&oe=6B08BDDC", "thumbnailUrl": "https://scontent-bos5-1.cdninstagram.com/v/t51.82787-15/920350673_18661273105037486_3009290956098131643_n.jpg?stp=dst-jpg_e15_tt6&_nc_cat=103&_nc_map=urlgen_bucketless&ig_cache_key=NDAzNjI0Mjg1MjkwMzI1NTQ5NDE4NjYxMjczMDk5MDM3NDg2.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNMSVBTLnhwaWRzLjcyMC5zZHIudmlkZW9fZGVmYXVsdF9jb3Zlcl9mcmFtZS5DMyJ9&_nc_ohc=ZNX5_uNnJZkQ7kNvwEkipvZ&_nc_oc=AdoHCC5yeWgqxFZohTsKG_nYwqSfAdzHkRkFzDRcZkAjysOFOUjUazzFTFbWYsPKMXM&_nc_zt=23&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_gid=FLH1cVH0DY2FYo-kifBI3Q&_nc_ss=79b8c&_nc_ct=RQosPBUIFQQlBAAAAA&oh=00_AQS7WiHCn5MKcPBWdCPgnoJtg3kJE4rF8K_nNd0mlA3nug&oe=6B0CCFF8", "width": 720, "height": 1280, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "code": "DgDnX1igf3G", "kind": "video", "location": null, "sound": null, "tagged": [], "paidPartnership": false, "countsHidden": false, "altText": null } }, { "id": "4037020708453825890", "url": "https://www.instagram.com/p/DgGYPH-ST1i/", "text": "quite literally saved the last dance 😩😭 #dwts @missjuliastiles", "createdAt": "2026-11-23T21:50:20.000Z", "author": { "id": "23873043", "username": "ezra.sosa", "displayName": null, "avatarUrl": "https://scontent-bos5-1.cdninstagram.com/v/t51.82787-19/793596732_18615119668001044_1162280206309991929_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_cat=1&ig_cache_key=GDxTTS8UOUNLWiJCAPklk4qwPyEQbmNDAQAB1501500j-ccb7-5&ccb=7-5&_nc_sid=669407&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLnd3dy4xMDgwLkMzIn0%3D&_nc_ohc=qxtrc0fPGvUQ7kNvwFvU3so&_nc_oc=AdpN7nc6ptOLhNwGnvkBSPLJdo1HdUsvmw9pzGiftKqJvVpq8GF1uSQw0lJugQL6g0w&_nc_zt=24&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_gid=FLH1cVH0DY2FYo-kifBI3Q&_nc_ss=79389&_nc_ct=RQosPBUCFQIAAAA&oh=00_AQQ5vSgN3vZXHyoCFAsEWe0KZbZcSApMDPTsn75kPsGiQA&oe=6B0CDBA5", "verified": false, "url": "https://www.instagram.com/ezra.sosa/" }, "stats": { "views": null, "likes": 338031, "comments": 5197, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://scontent-bos5-1.cdninstagram.com/o1/v/t2/f2/m86/AQO2OK39G4KFR-oL4skmzqbXwL8i2uC8HrVMWKtoj2JQiv3F6_P1oiV4kt-lfa19U1buyEf9UwuPTnMMx-eST8rB3Xqt31hnel1_gYY.mp4?_nc_cat=111&_nc_sid=5e9851&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_ohc=kPPu6ADK23UQ7kNvwF8LbEP&efg=eyJ2ZW5jb2RlX3RhZyI6Inhwdl9wcm9ncmVzc2l2ZS5JTlNUQUdSQU0uQ0xJUFMuQzMuNzIwLmRhc2hfYmFzZWxpbmVfMV92MSIsInhwdl9hc3NldF9pZCI6MTQ0OTE5NjM0MDE2MjM0NiwiYXNzZXRfYWdlX2RheXMiOjEsInZpX3VzZWNhc2VfaWQiOjEwMDk5LCJkdXJhdGlvbl9zIjoxMTIsInVybGdlbl9zb3VyY2UiOiJ3d3cifQ%3D%3D&ccb=17-1&vs=807c9f5abb0956ef&_nc_vs=HBksFQIYUmlnX3hwdl9yZWVsc19wZXJtYW5lbnRfc3JfcHJvZC8wQjZBRTI5NTBGREU0REIzOERFNkRBRDAzOTMwQzEyMl92aWRlb19kYXNoaW5pdC5tcDQVAALIARIAFQIYUWlnX3hwdl9wbGFjZW1lbnRfcGVybWFuZW50X3YyL0UzNEE0NUFENzQyNTQ0ODM5QzgzNUE0MTU4MDVDNzk3X2F1ZGlvX2Rhc2hpbml0Lm1wNBUCAsgBEgAoABgAGwOIB3VzZV9vaWwBMRJwcm9ncmVzc2l2ZV9yZWNpcGUBMRJjb3B5X3NhbXBsZV9ncm91cHMBMRUAACbUvIWRqoKTBRUCKAJDMywXQFwRBiTdLxsYEmRhc2hfYmFzZWxpbmVfMV92MREAdf4HZeadAQA&_nc_gid=FLH1cVH0DY2FYo-kifBI3Q&_nc_ss=79b8c&_nc_map=urlgen_bucketless&_nc_zt=28&oh=00_AQQdiUeFNszCJIPGTPvRDbhA_3du18p_oHnVCPXGyYTYfw&oe=6B08BC44", "thumbnailUrl": "https://scontent-bos5-1.cdninstagram.com/v/t51.82787-15/926262620_18642818497001044_1343823141613365777_n.jpg?stp=dst-jpg_e15_tt6&_nc_cat=106&_nc_map=urlgen_bucketless&ig_cache_key=NDAzNzAyMDcwODQ1MzgyNTg5MDE4NjQyODE4NDk0MDAxMDQ0.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNMSVBTLnhwaWRzLjcyMC5zZHIudmlkZW9fdXNlcl9zZWxlY3RlZF90aHVtYm5haWwuQzMifQ%3D%3D&_nc_ohc=fcv-GWnqY64Q7kNvwHVF3QI&_nc_oc=AdpcMkTsEHh3ieIQv6fY-O9rp8tVx4K6Pb0plHt8RQRcHOHfuHXYHKyQ0MpLmKKcGwc&_nc_zt=23&_nc_ht=scontent-bos5-1.cdninstagram.com&_nc_gid=FLH1cVH0DY2FYo-kifBI3Q&_nc_ss=79b8c&_nc_ct=RQosPBUIFQ4lBAAAAA&oh=00_AQTso74IhiV_wYJpSpRaFd4eFhMtx_q-Ioe4wAFyZ9vsXw&oe=6B0CA96E", "width": 1080, "height": 1920, "durationSeconds": null } ], "hashtags": [ "dwts" ], "mentions": [ "missjuliastiles" ], "ext": { "code": "DgGYPH-ST1i", "kind": "video", "location": null, "sound": null, "tagged": [], "paidPartnership": false, "countsHidden": false, "altText": null } } ], "pagination": { "nextCursor": "GoaM94-orN_Og3DE9cnkv7ywhnC2wOHL7qDFg3DwmYuj8PDIg3CmtNi78pyUhXD-v8OUmoCnhHDk3tGUwayihnDclqOwmanBg3Am8J74scJoFBBZCBgAGgg6BhkMAA==", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.instagram.trending();" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.instagram.trending()" }, { "lang": "bash", "label": "cURL", "source": "curl https://api.socialapi.sh/v1/instagram/trending \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_InstagramPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/InstagramPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "InstagramPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "code", "kind", "tagged", "paidPartnership", "countsHidden" ], "properties": { "altText": { "type": [ "string", "null" ], "description": "Instagram's description of the image, for screen readers." }, "code": { "type": "string", "description": "The code in its link (`instagram.com/p/`)." }, "countsHidden": { "type": "boolean", "description": "Whether its author hides its like and view counts." }, "kind": { "$ref": "#/components/schemas/InstagramPostKind" }, "location": { "oneOf": [ { "$ref": "#/components/schemas/InstagramPlaceRef", "description": "The place it was tagged at." }, { "type": "null" } ] }, "paidPartnership": { "type": "boolean", "description": "A paid partnership." }, "sound": { "oneOf": [ { "$ref": "#/components/schemas/InstagramSoundRef", "description": "The sound a reel uses." }, { "type": "null" } ] }, "tagged": { "type": "array", "items": { "type": "string" }, "description": "Accounts tagged in it, by username." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "An Instagram post: a photo, a video, a carousel, a reel, or a story in a highlight." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "InstagramSoundRef": { "type": "object", "description": "The sound a reel uses: a released song (by its audio cluster) or an account's\noriginal audio (by its asset). Read either with `/v1/instagram/sound`.", "required": [ "id", "title", "original" ], "properties": { "artist": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "original": { "type": "boolean" }, "title": { "type": "string" } } }, "InstagramPlaceRef": { "type": "object", "description": "A place a post is tagged at.", "required": [ "id", "name" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" } } }, "InstagramPostKind": { "type": "string", "description": "What a post is.", "enum": [ "photo", "video", "carousel", "reel", "story" ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Category Clips (/docs/api-reference/kick/category-clips) A category's clips, 20 a page. `GET https://api.socialapi.sh/v1/kick/category/clips` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.kick.categoryClips({ slug: "just-chatting" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.kick.category_clips(slug="just-chatting") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/kick/category/clips \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "slug=just-chatting" ``` **Response** ```json { "data": [ { "id": "clip_01M7X2WVSJ7HB2PFGHBCACCKS3", "url": "https://kick.com/xqc/clips/clip_01M7X2WVSJ7HB2PFGHBCACCKS3", "text": "ddsgsrgesrdfsrg", "createdAt": "2026-11-20T18:19:54.717Z", "author": { "id": "668", "username": "xqc", "displayName": "xQc", "avatarUrl": "https://files.kick.com/images/user/676/profile_image/conversion/151f289a-5bff-4f31-b125-0c54c542519e-thumb.webp", "verified": false, "url": "https://kick.com/xqc" }, "stats": { "views": 19060, "likes": 0, "comments": null, "shares": null, "saves": null, "engagementRate": 0 }, "media": [ { "kind": "video", "url": "https://clips.kick.com/clips/98/clip_01M7X2WVSJ7HB2PFGHBCACCKS3/playlist.m3u8", "thumbnailUrl": "https://clips.kick.com/clips/98/clip_01M7X2WVSJ7HB2PFGHBCACCKS3/thumbnail.webp", "width": null, "height": null, "durationSeconds": 180 } ], "hashtags": [], "mentions": [], "ext": { "kind": "clip", "title": "ddsgsrgesrdfsrg", "category": { "id": "15", "name": "Just Chatting", "slug": "just-chatting", "url": "https://kick.com/category/just-chatting" }, "language": null, "durationSeconds": 180, "recording": false, "mature": true, "tags": [], "curator": { "id": "106988558", "username": "gugugagi69", "displayName": "GUguGAgi69", "avatarUrl": null, "verified": false, "url": "https://kick.com/gugugagi69" }, "videoId": null, "videoOffsetSeconds": 0 } }, { "id": "clip_01M87Y3XVP3XNMJT0AW1SRA4KT", "url": "https://kick.com/destiny/clips/clip_01M87Y3XVP3XNMJT0AW1SRA4KT", "text": "dndgnn", "createdAt": "2026-11-24T23:27:54.886Z", "author": { "id": "1772249", "username": "destiny", "displayName": "Destiny", "avatarUrl": "https://files.kick.com/images/user/1823122/profile_image/conversion/72da0b52-5f20-4ca8-9d36-2b66e72dd094-thumb.webp", "verified": false, "url": "https://kick.com/destiny" }, "stats": { "views": 15995, "likes": 0, "comments": null, "shares": null, "saves": null, "engagementRate": 0 }, "media": [ { "kind": "video", "url": "https://clips.kick.com/clips/71/clip_01M87Y3XVP3XNMJT0AW1SRA4KT/playlist.m3u8", "thumbnailUrl": "https://clips.kick.com/clips/71/clip_01M87Y3XVP3XNMJT0AW1SRA4KT/thumbnail.webp", "width": null, "height": null, "durationSeconds": 76 } ], "hashtags": [], "mentions": [], "ext": { "kind": "clip", "title": "dndgnn", "category": { "id": "15", "name": "Just Chatting", "slug": "just-chatting", "url": "https://kick.com/category/just-chatting" }, "language": null, "durationSeconds": 76, "recording": false, "mature": false, "tags": [], "curator": { "id": "96865912", "username": "plutotrades111", "displayName": "plutotrades111", "avatarUrl": null, "verified": false, "url": "https://kick.com/plutotrades111" }, "videoId": null, "videoOffsetSeconds": 0 } } ], "pagination": { "nextCursor": "clip_01M81Z0R21G8FF2CWG6EN6RQAM", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/kick/category/clips": { "get": { "tags": [ "Kick" ], "summary": "A category's clips, 20 a page.", "description": "Most viewed or newest first, over the last day, week, month or all time. 1 credit a\npage.", "operationId": "kickCategoryClips", "parameters": [ { "name": "slug", "in": "query", "description": "The name in the category's link (`just-chatting`).", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "Its link, instead of `slug`.", "required": false, "schema": { "type": "string" } }, { "name": "sort", "in": "query", "description": "`views` (the default) or `latest`.", "required": false, "schema": { "type": "string", "description": "How a list of clips is ordered.", "enum": [ "views", "latest" ] } }, { "name": "period", "in": "query", "description": "How far back: `day`, `week` (the default), `month` or `all`.", "required": false, "schema": { "type": "string", "description": "How far back a list of clips looks.", "enum": [ "day", "week", "month", "all" ] } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_KickPost" }, "example": { "data": [ { "id": "clip_01M7X2WVSJ7HB2PFGHBCACCKS3", "url": "https://kick.com/xqc/clips/clip_01M7X2WVSJ7HB2PFGHBCACCKS3", "text": "ddsgsrgesrdfsrg", "createdAt": "2026-11-20T18:19:54.717Z", "author": { "id": "668", "username": "xqc", "displayName": "xQc", "avatarUrl": "https://files.kick.com/images/user/676/profile_image/conversion/151f289a-5bff-4f31-b125-0c54c542519e-thumb.webp", "verified": false, "url": "https://kick.com/xqc" }, "stats": { "views": 19060, "likes": 0, "comments": null, "shares": null, "saves": null, "engagementRate": 0 }, "media": [ { "kind": "video", "url": "https://clips.kick.com/clips/98/clip_01M7X2WVSJ7HB2PFGHBCACCKS3/playlist.m3u8", "thumbnailUrl": "https://clips.kick.com/clips/98/clip_01M7X2WVSJ7HB2PFGHBCACCKS3/thumbnail.webp", "width": null, "height": null, "durationSeconds": 180 } ], "hashtags": [], "mentions": [], "ext": { "kind": "clip", "title": "ddsgsrgesrdfsrg", "category": { "id": "15", "name": "Just Chatting", "slug": "just-chatting", "url": "https://kick.com/category/just-chatting" }, "language": null, "durationSeconds": 180, "recording": false, "mature": true, "tags": [], "curator": { "id": "106988558", "username": "gugugagi69", "displayName": "GUguGAgi69", "avatarUrl": null, "verified": false, "url": "https://kick.com/gugugagi69" }, "videoId": null, "videoOffsetSeconds": 0 } }, { "id": "clip_01M87Y3XVP3XNMJT0AW1SRA4KT", "url": "https://kick.com/destiny/clips/clip_01M87Y3XVP3XNMJT0AW1SRA4KT", "text": "dndgnn", "createdAt": "2026-11-24T23:27:54.886Z", "author": { "id": "1772249", "username": "destiny", "displayName": "Destiny", "avatarUrl": "https://files.kick.com/images/user/1823122/profile_image/conversion/72da0b52-5f20-4ca8-9d36-2b66e72dd094-thumb.webp", "verified": false, "url": "https://kick.com/destiny" }, "stats": { "views": 15995, "likes": 0, "comments": null, "shares": null, "saves": null, "engagementRate": 0 }, "media": [ { "kind": "video", "url": "https://clips.kick.com/clips/71/clip_01M87Y3XVP3XNMJT0AW1SRA4KT/playlist.m3u8", "thumbnailUrl": "https://clips.kick.com/clips/71/clip_01M87Y3XVP3XNMJT0AW1SRA4KT/thumbnail.webp", "width": null, "height": null, "durationSeconds": 76 } ], "hashtags": [], "mentions": [], "ext": { "kind": "clip", "title": "dndgnn", "category": { "id": "15", "name": "Just Chatting", "slug": "just-chatting", "url": "https://kick.com/category/just-chatting" }, "language": null, "durationSeconds": 76, "recording": false, "mature": false, "tags": [], "curator": { "id": "96865912", "username": "plutotrades111", "displayName": "plutotrades111", "avatarUrl": null, "verified": false, "url": "https://kick.com/plutotrades111" }, "videoId": null, "videoOffsetSeconds": 0 } } ], "pagination": { "nextCursor": "clip_01M81Z0R21G8FF2CWG6EN6RQAM", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.kick.categoryClips({ slug: \"just-chatting\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.kick.category_clips(slug=\"just-chatting\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/kick/category/clips \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"slug=just-chatting\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_KickPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/KickPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "KickPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "kind", "recording", "mature", "tags" ], "properties": { "category": { "oneOf": [ { "$ref": "#/components/schemas/KickCategoryRef" }, { "type": "null" } ] }, "curator": { "oneOf": [ { "$ref": "#/components/schemas/Author", "description": "Who cut the clip." }, { "type": "null" } ] }, "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "kind": { "$ref": "#/components/schemas/KickPostKind" }, "language": { "type": [ "string", "null" ], "description": "The broadcast's language, as Kick names it (`English`)." }, "mature": { "type": "boolean", "description": "Marked for adults." }, "recording": { "type": "boolean", "description": "A broadcast still on air: its video is being recorded, and grows." }, "tags": { "type": "array", "items": { "type": "string" }, "description": "The tags its channel gave the broadcast." }, "title": { "type": [ "string", "null" ], "description": "The title (`text` says the same: Kick's posts have no other text)." }, "videoId": { "type": [ "string", "null" ], "description": "The video a clip was cut from, and where in it, in seconds." }, "videoOffsetSeconds": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A video (a past broadcast) or a clip." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "KickPostKind": { "type": "string", "description": "What a post is.", "enum": [ "video", "clip" ] }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } }, "KickCategoryRef": { "type": "object", "description": "A category as a channel, a video, a clip or a broadcast names it.", "required": [ "id", "name" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "slug": { "type": [ "string", "null" ], "description": "The name in its link (`just-chatting`)." }, "url": { "type": [ "string", "null" ] } } }, "Timestamp": { "type": "string", "format": "date-time" } } } } ``` # Category Lives (/docs/api-reference/kick/category-lives) A category's live broadcasts, most watched first. `GET https://api.socialapi.sh/v1/kick/category/lives` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.kick.categoryLives({ slug: "just-chatting" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.kick.category_lives(slug="just-chatting") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/kick/category/lives \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "slug=just-chatting" ``` **Response** ```json { "data": [ { "live": true, "roomId": "01a21d91-2c18-73bb-b3a1-0286d3558888", "title": "BIGG BOSS WATCH PARTY - SUPPORT SCOUTOP", "viewers": 38553, "startedAt": "2026-11-27T15:13:03.000Z", "coverUrl": "https://web.kick.com/api/v1/channels/105409796/thumbnail.jpeg?height=720", "host": { "id": "105409796", "username": "kaashplays", "displayName": "Kaashplays", "avatarUrl": "https://files.kick.com/images/user/106644581/profile_image/conversion/02f2388a-dfd4-42f4-9851-28c5e4fdb668-medium.webp", "verified": false, "url": "https://kick.com/kaashplays" }, "ext": { "category": { "id": "15", "name": "Just Chatting", "slug": "just-chatting", "url": "https://kick.com/category/just-chatting" }, "language": "en-IN", "tags": [], "mature": false, "playbackUrl": null } }, { "live": true, "roomId": "01a21d7d-f620-7109-b20e-2adc0af3a506", "title": "🚨BIGBOSS WATCHPARTY WITH NEYOO🚨 FAMILY WEEK 🚨 SUPPORT SCOUT OP🚨", "viewers": 28299, "startedAt": "2026-11-27T14:52:04.000Z", "coverUrl": "https://web.kick.com/api/v1/channels/105216099/thumbnail.jpeg?height=720", "host": { "id": "105216099", "username": "neyoo_gaming", "displayName": "Neyoo_Gaming", "avatarUrl": "https://files.kick.com/images/user/106450641/profile_image/conversion/0b10f3b6-e42a-4f4b-8a7b-7694426b6c17-medium.webp", "verified": false, "url": "https://kick.com/neyoo_gaming" }, "ext": { "category": { "id": "15", "name": "Just Chatting", "slug": "just-chatting", "url": "https://kick.com/category/just-chatting" }, "language": "en-IN", "tags": [], "mature": false, "playbackUrl": null } } ], "pagination": { "nextCursor": "eyJvIjo1MH0", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/kick/category/lives": { "get": { "tags": [ "Kick" ], "summary": "A category's live broadcasts, most watched first.", "description": "50 a page, or Kick's own pick first (`featured`), by language if asked. 1 credit a\npage.", "operationId": "kickCategoryLives", "parameters": [ { "name": "slug", "in": "query", "description": "The name in the category's link (`just-chatting`).", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "Its link, instead of `slug`.", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "Its numeric id, instead of either.", "required": false, "schema": { "type": "string" } }, { "name": "sort", "in": "query", "description": "`viewers` (the default) or `featured`.", "required": false, "schema": { "type": "string", "description": "How a list of live broadcasts is ordered.", "enum": [ "viewers", "featured" ] } }, { "name": "language", "in": "query", "description": "Only broadcasts in this language (`en`, `tr`).", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_KickLive" }, "example": { "data": [ { "live": true, "roomId": "01a21d91-2c18-73bb-b3a1-0286d3558888", "title": "BIGG BOSS WATCH PARTY - SUPPORT SCOUTOP", "viewers": 38553, "startedAt": "2026-11-27T15:13:03.000Z", "coverUrl": "https://web.kick.com/api/v1/channels/105409796/thumbnail.jpeg?height=720", "host": { "id": "105409796", "username": "kaashplays", "displayName": "Kaashplays", "avatarUrl": "https://files.kick.com/images/user/106644581/profile_image/conversion/02f2388a-dfd4-42f4-9851-28c5e4fdb668-medium.webp", "verified": false, "url": "https://kick.com/kaashplays" }, "ext": { "category": { "id": "15", "name": "Just Chatting", "slug": "just-chatting", "url": "https://kick.com/category/just-chatting" }, "language": "en-IN", "tags": [], "mature": false, "playbackUrl": null } }, { "live": true, "roomId": "01a21d7d-f620-7109-b20e-2adc0af3a506", "title": "🚨BIGBOSS WATCHPARTY WITH NEYOO🚨 FAMILY WEEK 🚨 SUPPORT SCOUT OP🚨", "viewers": 28299, "startedAt": "2026-11-27T14:52:04.000Z", "coverUrl": "https://web.kick.com/api/v1/channels/105216099/thumbnail.jpeg?height=720", "host": { "id": "105216099", "username": "neyoo_gaming", "displayName": "Neyoo_Gaming", "avatarUrl": "https://files.kick.com/images/user/106450641/profile_image/conversion/0b10f3b6-e42a-4f4b-8a7b-7694426b6c17-medium.webp", "verified": false, "url": "https://kick.com/neyoo_gaming" }, "ext": { "category": { "id": "15", "name": "Just Chatting", "slug": "just-chatting", "url": "https://kick.com/category/just-chatting" }, "language": "en-IN", "tags": [], "mature": false, "playbackUrl": null } } ], "pagination": { "nextCursor": "eyJvIjo1MH0", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.kick.categoryLives({ slug: \"just-chatting\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.kick.category_lives(slug=\"just-chatting\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/kick/category/lives \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"slug=just-chatting\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_KickLive": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/KickLive" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "KickLive": { "allOf": [ { "type": "object", "description": "An account's live broadcast.", "required": [ "live", "ext" ], "properties": { "coverUrl": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "tags", "mature" ], "properties": { "category": { "oneOf": [ { "$ref": "#/components/schemas/KickCategoryRef" }, { "type": "null" } ] }, "language": { "type": [ "string", "null" ], "description": "The broadcast's language (`en`, or as Kick names it, `English`)." }, "mature": { "type": "boolean", "description": "Marked for adults." }, "playbackUrl": { "type": [ "string", "null" ], "description": "Its stream's HLS playlist; on `/live` only. It carries a token that expires." }, "tags": { "type": "array", "items": { "type": "string" }, "description": "The tags the channel gave the broadcast." } } }, { "type": "object", "description": "What only this platform has." } ] }, "host": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "live": { "type": "boolean" }, "roomId": { "type": [ "string", "null" ] }, "startedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "title": { "type": [ "string", "null" ] }, "viewers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, { "type": "object", "description": "A live broadcast, or a channel's live status." } ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } }, "KickCategoryRef": { "type": "object", "description": "A category as a channel, a video, a clip or a broadcast names it.", "required": [ "id", "name" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "slug": { "type": [ "string", "null" ], "description": "The name in its link (`just-chatting`)." }, "url": { "type": [ "string", "null" ] } } } } } } ``` # Category (/docs/api-reference/kick/category) A category with its viewers and followers. `GET https://api.socialapi.sh/v1/kick/category` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.kick.category({ slug: "just-chatting" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.kick.category(slug="just-chatting").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/kick/category \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "slug=just-chatting" ``` **Response** ```json { "data": { "id": "15", "name": "Just Chatting", "slug": "just-chatting", "url": "https://kick.com/category/just-chatting", "description": null, "coverUrl": "https://files.kick.com/images/subcategories/15/banner/conversion/5546d68b-e9f9-49f9-a658-9d2ece637064-banner.webp", "viewers": 199781, "channels": null, "followers": 3338796, "tags": [ "IRL", "Casual" ], "parent": "IRL", "mature": false } } ``` **OpenAPI** ```json { "paths": { "/v1/kick/category": { "get": { "tags": [ "Kick" ], "summary": "A category with its viewers and followers.", "description": "A game, or a kind of broadcast such as Just Chatting, with its description, banner,\ngenres and the group it is in. 1 credit.", "operationId": "kickCategory", "parameters": [ { "name": "slug", "in": "query", "description": "The name in the category's link (`just-chatting`).", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "Its link (`https://kick.com/category/just-chatting`), instead of `slug`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_KickCategory" }, "example": { "data": { "id": "15", "name": "Just Chatting", "slug": "just-chatting", "url": "https://kick.com/category/just-chatting", "description": null, "coverUrl": "https://files.kick.com/images/subcategories/15/banner/conversion/5546d68b-e9f9-49f9-a658-9d2ece637064-banner.webp", "viewers": 199781, "channels": null, "followers": 3338796, "tags": [ "IRL", "Casual" ], "parent": "IRL", "mature": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.kick.category({ slug: \"just-chatting\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.kick.category(slug=\"just-chatting\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/kick/category \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"slug=just-chatting\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_KickCategory": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/KickCategory" } } }, "KickCategory": { "type": "object", "description": "A category: a game, or a kind of broadcast such as Just Chatting.", "required": [ "id", "name", "slug", "url", "tags", "mature" ], "properties": { "channels": { "type": [ "integer", "null" ], "format": "int64", "description": "Channels broadcasting it now; in searches only.", "minimum": 0 }, "coverUrl": { "type": [ "string", "null" ], "description": "Its banner." }, "description": { "type": [ "string", "null" ] }, "followers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "id": { "type": "string" }, "mature": { "type": "boolean", "description": "Marked for adults." }, "name": { "type": "string" }, "parent": { "type": [ "string", "null" ], "description": "The group it is in (`Games`, `IRL`)." }, "slug": { "type": "string", "description": "The name in its link (`just-chatting`)." }, "tags": { "type": "array", "items": { "type": "string" }, "description": "Kick's genres for it (`Shooter`, `IRL`)." }, "url": { "type": "string" }, "viewers": { "type": [ "integer", "null" ], "format": "int64", "description": "People watching it now.", "minimum": 0 } } } } } } ``` # Kick API (/docs/api-reference/kick) Every Kick endpoint, by group. Each is a `GET` under `/v1/kick`. ## Quick Reference [#quick-reference] | Property | Value | | --- | --- | | Base path | `/v1/kick` | | Endpoints | 16 | | Credits | See Below | | Guide | [Kick](/docs/kick) | ## Accounts [#accounts] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/kick/profile`](/docs/api-reference/kick/profile) | A channel with its follower count and links. | 1 | | [`GET /v1/kick/profile/clips`](/docs/api-reference/kick/profile-clips) | A channel's clips, 20 a page. | 1 | | [`GET /v1/kick/profile/posts`](/docs/api-reference/kick/profile-posts) | A channel's videos, every one it keeps. | 1 | | [`GET /v1/kick/live`](/docs/api-reference/kick/live) | Whether a channel is live, with its broadcast. | 1 | ## Posts [#posts] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/kick/post`](/docs/api-reference/kick/post) | One video or clip with its views and a link to play it. | 1 | | [`GET /v1/kick/post/comments`](/docs/api-reference/kick/post-comments) | A video's chat replay, 25 messages a page. | 1 | | [`GET /v1/kick/post/transcript`](/docs/api-reference/kick/post-transcript) | A video's or clip's captions as text, with timings. | 10 | ## Categories [#categories] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/kick/category`](/docs/api-reference/kick/category) | A category with its viewers and followers. | 1 | | [`GET /v1/kick/category/clips`](/docs/api-reference/kick/category-clips) | A category's clips, 20 a page. | 1 | | [`GET /v1/kick/category/lives`](/docs/api-reference/kick/category-lives) | A category's live broadcasts, most watched first. | 1 | ## Discovery [#discovery] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/kick/search/categories`](/docs/api-reference/kick/search-categories) | Categories matching a search, up to 50. | 1 | | [`GET /v1/kick/search/lives`](/docs/api-reference/kick/search-lives) | Live broadcasts matching a search, up to 10. | 1 | | [`GET /v1/kick/search/users`](/docs/api-reference/kick/search-users) | Channels matching a search, up to 50. | 1 | | [`GET /v1/kick/trending`](/docs/api-reference/kick/trending) | The live broadcasts most watched now, 50 a page. | 1 | | [`GET /v1/kick/trending/categories`](/docs/api-reference/kick/trending-categories) | The categories most watched now. | 1 | | [`GET /v1/kick/trending/clips`](/docs/api-reference/kick/trending-clips) | The site's most viewed clips, 20 a page. | 1 | ## Example Request [#example-request] Every Kick endpoint is called this way: its path, and what to read as query parameters. **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.kick.profile({ handle: "xqc" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.kick.profile(handle="xqc").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/kick/profile \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=xqc" ``` **Response** ```json { "data": { "id": "668", "username": "xqc", "displayName": "xQc", "bio": "THE BEST AT ABSOLUTELY EVERYTHING. THE JUICER. LEADER OF THE JUICERS.", "avatarUrl": "https://files.kick.com/images/user/676/profile_image/conversion/931b4e8f-5445-427c-bd82-b473530390cc-fullsize.webp", "url": "https://kick.com/xqc", "verified": true, "private": false, "followers": 1879042, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": "2022-10-22T06:59:51.000Z", "ext": { "userId": "676", "live": false, "affiliate": false, "videosEnabled": true, "subscriptionsEnabled": true, "bannerUrl": "https://files.kick.com/images/channel/668/banner_image/6fcf7418-df00-460b-9467-1fa95b8eb981", "offlineBannerUrl": null, "socials": [ { "network": "instagram", "name": "xqcow1/", "url": "https://www.instagram.com/xqcow1/" }, { "network": "x", "name": "xqc", "url": "https://x.com/xqc" }, { "network": "youtube", "name": "channel/UCmDTrq0LNgPodDOFZiSbsww", "url": "https://www.youtube.com/channel/UCmDTrq0LNgPodDOFZiSbsww" } ], "links": [ { "title": null, "description": null, "url": "https://streamelements.com/xqc/tip", "imageUrl": "https://files.kick.com/images/channel-links/605185/image/conversion/4d8e57a6-2c10-4a3c-9dff-c19d861d073c-image.webp" }, { "title": null, "description": null, "url": "https://www.youtube.com/channel/UCmDTrq0LNgPodDOFZiSbsww", "imageUrl": "https://files.kick.com/images/channel-links/605197/image/conversion/9e82a1f8-b742-4fdc-807a-ddc679fa7bc1-image.webp" }, { "title": null, "description": null, "url": "https://discord.gg/xqcow", "imageUrl": "https://files.kick.com/images/channel-links/605147/image/conversion/1dfb542b-59d4-4b65-925b-9f7ccbdc521a-image.webp" } ], "recentCategories": [ { "id": "15", "name": "Just Chatting", "slug": "just-chatting", "url": "https://kick.com/category/just-chatting" }, { "id": "19671", "name": "The Legend of Zelda: Ocarina of Time", "slug": "the-legend-of-zelda-ocarina-of-time-1", "url": "https://kick.com/category/the-legend-of-zelda-ocarina-of-time-1" }, { "id": "13155", "name": "Grand Theft Auto VI (GTA)", "slug": "grand-theft-auto-vi", "url": "https://kick.com/category/grand-theft-auto-vi" } ], "chatroomId": "668" } } } ``` ## Errors [#errors] A call that fails costs nothing. See [Errors](/docs/errors) for every code. # Live (/docs/api-reference/kick/live) Whether a channel is live, with its broadcast. `GET https://api.socialapi.sh/v1/kick/live` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.kick.live({ handle: "xqc" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.kick.live(handle="xqc").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/kick/live \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=xqc" ``` **Response** ```json { "data": { "live": false, "roomId": null, "title": null, "viewers": null, "startedAt": null, "coverUrl": null, "host": { "id": "668", "username": "xqc", "displayName": "xQc", "avatarUrl": "https://files.kick.com/images/user/676/profile_image/conversion/931b4e8f-5445-427c-bd82-b473530390cc-fullsize.webp", "verified": true, "url": "https://kick.com/xqc" }, "ext": { "category": null, "language": null, "tags": [], "mature": false, "playbackUrl": null } } } ``` **OpenAPI** ```json { "paths": { "/v1/kick/live": { "get": { "tags": [ "Kick" ], "summary": "Whether a channel is live, with its broadcast.", "description": "When it is on: its title, viewers, start, category, language, tags and its stream's\nplaylist (a link with a token that expires). 1 credit.", "operationId": "kickLive", "parameters": [ { "name": "handle", "in": "query", "description": "The channel's name in its link (`xqc`).", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "The channel's link (`https://kick.com/xqc`), instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_KickLive" }, "example": { "data": { "live": false, "roomId": null, "title": null, "viewers": null, "startedAt": null, "coverUrl": null, "host": { "id": "668", "username": "xqc", "displayName": "xQc", "avatarUrl": "https://files.kick.com/images/user/676/profile_image/conversion/931b4e8f-5445-427c-bd82-b473530390cc-fullsize.webp", "verified": true, "url": "https://kick.com/xqc" }, "ext": { "category": null, "language": null, "tags": [], "mature": false, "playbackUrl": null } } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.kick.live({ handle: \"xqc\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.kick.live(handle=\"xqc\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/kick/live \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=xqc\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_KickLive": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/KickLive" } } }, "KickLive": { "allOf": [ { "type": "object", "description": "An account's live broadcast.", "required": [ "live", "ext" ], "properties": { "coverUrl": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "tags", "mature" ], "properties": { "category": { "oneOf": [ { "$ref": "#/components/schemas/KickCategoryRef" }, { "type": "null" } ] }, "language": { "type": [ "string", "null" ], "description": "The broadcast's language (`en`, or as Kick names it, `English`)." }, "mature": { "type": "boolean", "description": "Marked for adults." }, "playbackUrl": { "type": [ "string", "null" ], "description": "Its stream's HLS playlist; on `/live` only. It carries a token that expires." }, "tags": { "type": "array", "items": { "type": "string" }, "description": "The tags the channel gave the broadcast." } } }, { "type": "object", "description": "What only this platform has." } ] }, "host": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "live": { "type": "boolean" }, "roomId": { "type": [ "string", "null" ] }, "startedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "title": { "type": [ "string", "null" ] }, "viewers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, { "type": "object", "description": "A live broadcast, or a channel's live status." } ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } }, "KickCategoryRef": { "type": "object", "description": "A category as a channel, a video, a clip or a broadcast names it.", "required": [ "id", "name" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "slug": { "type": [ "string", "null" ], "description": "The name in its link (`just-chatting`)." }, "url": { "type": [ "string", "null" ] } } } } } } ``` # Post Comments (/docs/api-reference/kick/post-comments) A video's chat replay, 25 messages a page. `GET https://api.socialapi.sh/v1/kick/post/comments` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.kick.postComments({ url: "https://kick.com/xqc/videos/6060da49-216a-4828-ac41-62d307ce8825", offset: 1800 }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.kick.post_comments(url="https://kick.com/xqc/videos/6060da49-216a-4828-ac41-62d307ce8825", offset=1800) ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/kick/post/comments \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://kick.com/xqc/videos/6060da49-216a-4828-ac41-62d307ce8825" \ --data-urlencode "offset=1800" ``` **Response** ```json { "data": [ { "id": "03cc0ade-36f5-4db3-ae0b-409e2f410740", "postId": "6060da49-216a-4828-ac41-62d307ce8825", "parentId": null, "text": "EZ", "createdAt": "2026-11-25T22:49:54.000Z", "author": { "id": "79139944", "username": "raphaelsd86", "displayName": "Raphaelsd86", "avatarUrl": null, "verified": false, "url": "https://kick.com/raphaelsd86" }, "likes": null, "replies": null, "ext": { "offsetSeconds": 1799, "color": "#93EBE0", "badges": [], "emotes": [ "5756668" ] } }, { "id": "1704b0a8-21a8-4a3c-a7b2-7e8604092cab", "postId": "6060da49-216a-4828-ac41-62d307ce8825", "parentId": null, "text": "jensens dong has got it going on", "createdAt": "2026-11-25T22:49:53.000Z", "author": { "id": "1000387660", "username": "human-paladin", "displayName": "human_paladin", "avatarUrl": null, "verified": false, "url": "https://kick.com/human-paladin" }, "likes": null, "replies": null, "ext": { "offsetSeconds": 1798, "color": "#FEA0CF", "badges": [], "emotes": [] } } ], "pagination": { "nextCursor": "1795646972005822", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/kick/post/comments": { "get": { "tags": [ "Kick" ], "summary": "A video's chat replay, 25 messages a page.", "description": "The messages written while it was live, newest first, back from a moment of the video\n(`offset`, its end by default) to its start, each with its author, its place in the\nvideo in seconds, the message it answers, its badges and emotes. 1 credit a page.", "operationId": "kickPostComments", "parameters": [ { "name": "url", "in": "query", "description": "The video's link.", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The video's UUID, instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "offset", "in": "query", "description": "The moment of the video to read back from, in seconds from its start (default: its\nend).", "required": false, "schema": { "type": "integer", "format": "int32", "minimum": 0 } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page; `offset` is not read with it.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_KickComment" }, "example": { "data": [ { "id": "03cc0ade-36f5-4db3-ae0b-409e2f410740", "postId": "6060da49-216a-4828-ac41-62d307ce8825", "parentId": null, "text": "EZ", "createdAt": "2026-11-25T22:49:54.000Z", "author": { "id": "79139944", "username": "raphaelsd86", "displayName": "Raphaelsd86", "avatarUrl": null, "verified": false, "url": "https://kick.com/raphaelsd86" }, "likes": null, "replies": null, "ext": { "offsetSeconds": 1799, "color": "#93EBE0", "badges": [], "emotes": [ "5756668" ] } }, { "id": "1704b0a8-21a8-4a3c-a7b2-7e8604092cab", "postId": "6060da49-216a-4828-ac41-62d307ce8825", "parentId": null, "text": "jensens dong has got it going on", "createdAt": "2026-11-25T22:49:53.000Z", "author": { "id": "1000387660", "username": "human-paladin", "displayName": "human_paladin", "avatarUrl": null, "verified": false, "url": "https://kick.com/human-paladin" }, "likes": null, "replies": null, "ext": { "offsetSeconds": 1798, "color": "#FEA0CF", "badges": [], "emotes": [] } } ], "pagination": { "nextCursor": "1795646972005822", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.kick.postComments({ url: \"https://kick.com/xqc/videos/6060da49-216a-4828-ac41-62d307ce8825\", offset: 1800 });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.kick.post_comments(url=\"https://kick.com/xqc/videos/6060da49-216a-4828-ac41-62d307ce8825\", offset=1800)" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/kick/post/comments \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://kick.com/xqc/videos/6060da49-216a-4828-ac41-62d307ce8825\" \\\n --data-urlencode \"offset=1800\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_KickComment": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/KickComment" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "KickComment": { "allOf": [ { "type": "object", "description": "A comment or a reply.", "required": [ "id", "postId", "text", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "badges", "emotes" ], "properties": { "badges": { "type": "array", "items": { "type": "string" }, "description": "Its author's chat badges (`subscriber`, `moderator`, `vip`)." }, "color": { "type": [ "string", "null" ], "description": "The colour of its author's name (`#FEA0CF`)." }, "emotes": { "type": "array", "items": { "type": "string" }, "description": "The ids of the emotes in it; each is written in `text` by its name." }, "offsetSeconds": { "type": [ "integer", "null" ], "format": "int64", "description": "Where in the video it was written, in seconds.", "minimum": 0 } } }, { "type": "object", "description": "What only this platform has." } ] }, "id": { "type": "string" }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "parentId": { "type": [ "string", "null" ], "description": "The comment this replies to; absent on a top-level comment." }, "postId": { "type": "string" }, "replies": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "text": { "type": "string" } } }, { "type": "object", "description": "A message of a video's chat replay." } ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Post Transcript (/docs/api-reference/kick/post-transcript) A video's or clip's captions as text, with timings. `GET https://api.socialapi.sh/v1/kick/post/transcript` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.kick.postTranscript({ url: "https://kick.com/xqc/clips/clip_01M8D3TY706JDNJFQ3KX49XEKQ" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.kick.post_transcript(url="https://kick.com/xqc/clips/clip_01M8D3TY706JDNJFQ3KX49XEKQ").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/kick/post/transcript \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://kick.com/xqc/clips/clip_01M8D3TY706JDNJFQ3KX49XEKQ" ``` **Response** ```json { "data": { "postId": "clip_01M8D3TY706JDNJFQ3KX49XEKQ", "language": "en", "languages": [ "en", "fr", "de" ], "startSeconds": 0, "endSeconds": 12, "text": "Yeah, I have a few no not you anyone else okay good Andrea make sure everyone has what they need get changed, get set meet back here a go time got your outfits upstairs home mean the outfits outfits\nwhat man you on the outfit you fucking bitch you no role play man fucking dump with this game I'm returning to the store many jobs like this one", "cues": [ { "startSeconds": 0, "endSeconds": 6.89600000000064, "text": "Yeah, I have a few no not you anyone else okay good Andrea make sure everyone has what they need get changed, get set meet back here a go time got your outfits upstairs home mean the outfits outfits" }, { "startSeconds": 6.89600000000064, "endSeconds": 12.700000000000728, "text": "what man you on the outfit you fucking bitch you no role play man fucking dump with this game I'm returning to the store many jobs like this one" } ] } } ``` **OpenAPI** ```json { "paths": { "/v1/kick/post/transcript": { "get": { "tags": [ "Kick" ], "summary": "A video's or clip's captions as text, with timings.", "description": "Kick's own captions, in the language asked for (the broadcast's own by default) and\nthe languages it has. A clip is read whole; a video ten minutes at a time from\n`offset`. 10 credits.", "operationId": "kickPostTranscript", "parameters": [ { "name": "url", "in": "query", "description": "A video's or a clip's link.", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "A video's UUID or a clip's id, instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "language", "in": "query", "description": "The captions' language (`en`, `es`, `tr`); default: the broadcast's own, else\nEnglish, else the first Kick has.", "required": false, "schema": { "type": "string" } }, { "name": "offset", "in": "query", "description": "For a video: where the ten minutes read begin, in seconds from its start (default\n0). A clip is read whole.", "required": false, "schema": { "type": "integer", "format": "int32", "minimum": 0 } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_KickTranscript" }, "example": { "data": { "postId": "clip_01M8D3TY706JDNJFQ3KX49XEKQ", "language": "en", "languages": [ "en", "fr", "de" ], "startSeconds": 0, "endSeconds": 12, "text": "Yeah, I have a few no not you anyone else okay good Andrea make sure everyone has what they need get changed, get set meet back here a go time got your outfits upstairs home mean the outfits outfits\nwhat man you on the outfit you fucking bitch you no role play man fucking dump with this game I'm returning to the store many jobs like this one", "cues": [ { "startSeconds": 0, "endSeconds": 6.89600000000064, "text": "Yeah, I have a few no not you anyone else okay good Andrea make sure everyone has what they need get changed, get set meet back here a go time got your outfits upstairs home mean the outfits outfits" }, { "startSeconds": 6.89600000000064, "endSeconds": 12.700000000000728, "text": "what man you on the outfit you fucking bitch you no role play man fucking dump with this game I'm returning to the store many jobs like this one" } ] } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.kick.postTranscript({ url: \"https://kick.com/xqc/clips/clip_01M8D3TY706JDNJFQ3KX49XEKQ\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.kick.post_transcript(url=\"https://kick.com/xqc/clips/clip_01M8D3TY706JDNJFQ3KX49XEKQ\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/kick/post/transcript \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://kick.com/xqc/clips/clip_01M8D3TY706JDNJFQ3KX49XEKQ\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_KickTranscript": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/KickTranscript" } } }, "KickTranscript": { "type": "object", "description": "A video's or a clip's captions as text: Kick's own, in the languages it lists.", "required": [ "postId", "languages", "startSeconds", "endSeconds", "text", "cues" ], "properties": { "cues": { "type": "array", "items": { "$ref": "#/components/schemas/KickCue" } }, "endSeconds": { "type": "number", "format": "double" }, "language": { "type": [ "string", "null" ] }, "languages": { "type": "array", "items": { "type": "string" }, "description": "Every language Kick has captions in for it (`en`, `es`, `tr`)." }, "postId": { "type": "string" }, "startSeconds": { "type": "number", "format": "double", "description": "The stretch read, in seconds from the start: a clip whole, a video ten minutes\nfrom `offset`." }, "text": { "type": "string", "description": "The captions as plain text, one line a cue." } } }, "KickCue": { "type": "object", "required": [ "startSeconds", "endSeconds", "text" ], "properties": { "endSeconds": { "type": "number", "format": "double" }, "startSeconds": { "type": "number", "format": "double" }, "text": { "type": "string" } } } } } } ``` # Post (/docs/api-reference/kick/post) One video or clip with its views and a link to play it. `GET https://api.socialapi.sh/v1/kick/post` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.kick.post({ url: "https://kick.com/xqc/videos/6060da49-216a-4828-ac41-62d307ce8825" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.kick.post(url="https://kick.com/xqc/videos/6060da49-216a-4828-ac41-62d307ce8825").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/kick/post \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://kick.com/xqc/videos/6060da49-216a-4828-ac41-62d307ce8825" ``` **Response** ```json { "data": { "id": "6060da49-216a-4828-ac41-62d307ce8825", "url": "https://kick.com/xqc/videos/6060da49-216a-4828-ac41-62d307ce8825", "text": "🐝LIVE🐝CLICK🐝HERE🐝DRAMA🐝NEWS🐝VIDEOS🐝LOCK IN🐝QUICKLY🐝IMPORTANT MEGA DAY🐝WOW🐝I LOVE IT🐝", "createdAt": "2026-11-25T22:19:55.000Z", "author": { "id": "668", "username": "xqc", "displayName": "xQc", "avatarUrl": "https://files.kick.com/images/user/676/profile_image/conversion/931b4e8f-5445-427c-bd82-b473530390cc-fullsize.webp", "verified": true, "url": "https://kick.com/xqc" }, "stats": { "views": 33825, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://stream.kick.com/3c81249a5ce0/ivs/v1/196233775518/DsuAwCgUc9Bh/2026/11/25/22/19/grz1HiLuGURr/media/hls/master.m3u8", "thumbnailUrl": "https://kick-prod-videos-30-day.s3.us-west-2.amazonaws.com/thumbnails/livestream/140270814/thumb0/video_thumbnail/thumb0.jpg?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAS3MDRZGPNNNM6JOI%2F20261127%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20261127T161439Z&X-Amz-SignedHeaders=host&X-Amz-Expires=300&X-Amz-Signature=cd7643a8e772167a5ede47a6cc9130d67636d699345b05cc4e88e3ecb5b30a5c", "width": null, "height": null, "durationSeconds": 41017 } ], "hashtags": [], "mentions": [], "ext": { "kind": "video", "title": "🐝LIVE🐝CLICK🐝HERE🐝DRAMA🐝NEWS🐝VIDEOS🐝LOCK IN🐝QUICKLY🐝IMPORTANT MEGA DAY🐝WOW🐝I LOVE IT🐝", "category": { "id": "15", "name": "Just Chatting", "slug": "just-chatting", "url": "https://kick.com/category/just-chatting" }, "language": "English", "durationSeconds": 41017, "recording": false, "mature": true, "tags": [], "curator": null, "videoId": null, "videoOffsetSeconds": null } } } ``` **OpenAPI** ```json { "paths": { "/v1/kick/post": { "get": { "tags": [ "Kick" ], "summary": "One video or clip with its views and a link to play it.", "description": "A video's title, length, views, category, language and playlist; a clip's title, views,\nlikes, who cut it, the video it is from and where, and its file. 1 credit.", "operationId": "kickPost", "parameters": [ { "name": "url", "in": "query", "description": "A video's link (`https://kick.com/xqc/videos/6060da49-…`) or a clip's\n(`https://kick.com/xqc/clips/clip_01M8…`, `https://kick.com/xqc?clip=…`).", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "A video's UUID or a clip's id, instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_KickPost" }, "example": { "data": { "id": "6060da49-216a-4828-ac41-62d307ce8825", "url": "https://kick.com/xqc/videos/6060da49-216a-4828-ac41-62d307ce8825", "text": "🐝LIVE🐝CLICK🐝HERE🐝DRAMA🐝NEWS🐝VIDEOS🐝LOCK IN🐝QUICKLY🐝IMPORTANT MEGA DAY🐝WOW🐝I LOVE IT🐝", "createdAt": "2026-11-25T22:19:55.000Z", "author": { "id": "668", "username": "xqc", "displayName": "xQc", "avatarUrl": "https://files.kick.com/images/user/676/profile_image/conversion/931b4e8f-5445-427c-bd82-b473530390cc-fullsize.webp", "verified": true, "url": "https://kick.com/xqc" }, "stats": { "views": 33825, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://stream.kick.com/3c81249a5ce0/ivs/v1/196233775518/DsuAwCgUc9Bh/2026/11/25/22/19/grz1HiLuGURr/media/hls/master.m3u8", "thumbnailUrl": "https://kick-prod-videos-30-day.s3.us-west-2.amazonaws.com/thumbnails/livestream/140270814/thumb0/video_thumbnail/thumb0.jpg?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAS3MDRZGPNNNM6JOI%2F20261127%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20261127T161439Z&X-Amz-SignedHeaders=host&X-Amz-Expires=300&X-Amz-Signature=cd7643a8e772167a5ede47a6cc9130d67636d699345b05cc4e88e3ecb5b30a5c", "width": null, "height": null, "durationSeconds": 41017 } ], "hashtags": [], "mentions": [], "ext": { "kind": "video", "title": "🐝LIVE🐝CLICK🐝HERE🐝DRAMA🐝NEWS🐝VIDEOS🐝LOCK IN🐝QUICKLY🐝IMPORTANT MEGA DAY🐝WOW🐝I LOVE IT🐝", "category": { "id": "15", "name": "Just Chatting", "slug": "just-chatting", "url": "https://kick.com/category/just-chatting" }, "language": "English", "durationSeconds": 41017, "recording": false, "mature": true, "tags": [], "curator": null, "videoId": null, "videoOffsetSeconds": null } } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.kick.post({ url: \"https://kick.com/xqc/videos/6060da49-216a-4828-ac41-62d307ce8825\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.kick.post(url=\"https://kick.com/xqc/videos/6060da49-216a-4828-ac41-62d307ce8825\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/kick/post \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://kick.com/xqc/videos/6060da49-216a-4828-ac41-62d307ce8825\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_KickPost": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/KickPost" } } }, "KickPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "kind", "recording", "mature", "tags" ], "properties": { "category": { "oneOf": [ { "$ref": "#/components/schemas/KickCategoryRef" }, { "type": "null" } ] }, "curator": { "oneOf": [ { "$ref": "#/components/schemas/Author", "description": "Who cut the clip." }, { "type": "null" } ] }, "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "kind": { "$ref": "#/components/schemas/KickPostKind" }, "language": { "type": [ "string", "null" ], "description": "The broadcast's language, as Kick names it (`English`)." }, "mature": { "type": "boolean", "description": "Marked for adults." }, "recording": { "type": "boolean", "description": "A broadcast still on air: its video is being recorded, and grows." }, "tags": { "type": "array", "items": { "type": "string" }, "description": "The tags its channel gave the broadcast." }, "title": { "type": [ "string", "null" ], "description": "The title (`text` says the same: Kick's posts have no other text)." }, "videoId": { "type": [ "string", "null" ], "description": "The video a clip was cut from, and where in it, in seconds." }, "videoOffsetSeconds": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A video (a past broadcast) or a clip." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "KickPostKind": { "type": "string", "description": "What a post is.", "enum": [ "video", "clip" ] }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } }, "KickCategoryRef": { "type": "object", "description": "A category as a channel, a video, a clip or a broadcast names it.", "required": [ "id", "name" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "slug": { "type": [ "string", "null" ], "description": "The name in its link (`just-chatting`)." }, "url": { "type": [ "string", "null" ] } } }, "Timestamp": { "type": "string", "format": "date-time" } } } } ``` # Profile Clips (/docs/api-reference/kick/profile-clips) A channel's clips, 20 a page. `GET https://api.socialapi.sh/v1/kick/profile/clips` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.kick.profileClips({ handle: "xqc", sort: "latest", period: "month" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.kick.profile_clips(handle="xqc", sort="latest", period="month") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/kick/profile/clips \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=xqc" \ --data-urlencode "sort=latest" \ --data-urlencode "period=month" ``` **Response** ```json { "data": [ { "id": "clip_01M8D3TY706JDNJFQ3KX49XEKQ", "url": "https://kick.com/xqc/clips/clip_01M8D3TY706JDNJFQ3KX49XEKQ", "text": "asd", "createdAt": "2026-11-26T23:43:15.189Z", "author": { "id": "668", "username": "xqc", "displayName": "xQc", "avatarUrl": "https://files.kick.com/images/user/676/profile_image/conversion/151f289a-5bff-4f31-b125-0c54c542519e-thumb.webp", "verified": false, "url": "https://kick.com/xqc" }, "stats": { "views": 53, "likes": 0, "comments": null, "shares": null, "saves": null, "engagementRate": 0 }, "media": [ { "kind": "video", "url": "https://clips.kick.com/clips/fb/clip_01M8D3TY706JDNJFQ3KX49XEKQ/master.m3u8", "thumbnailUrl": "https://clips.kick.com/clips/fb/clip_01M8D3TY706JDNJFQ3KX49XEKQ/thumbnail.webp", "width": null, "height": null, "durationSeconds": 12 } ], "hashtags": [], "mentions": [], "ext": { "kind": "clip", "title": "asd", "category": { "id": "13155", "name": "Grand Theft Auto VI (GTA)", "slug": "grand-theft-auto-vi", "url": "https://kick.com/category/grand-theft-auto-vi" }, "language": null, "durationSeconds": 12, "recording": false, "mature": true, "tags": [], "curator": { "id": "23443665", "username": "eromanga", "displayName": "eromanga", "avatarUrl": null, "verified": false, "url": "https://kick.com/eromanga" }, "videoId": null, "videoOffsetSeconds": 0 } }, { "id": "clip_01M8D3CDDY4ZTNV2M4MK7RZRVG", "url": "https://kick.com/xqc/clips/clip_01M8D3CDDY4ZTNV2M4MK7RZRVG", "text": "6", "createdAt": "2026-11-26T23:35:04.661Z", "author": { "id": "668", "username": "xqc", "displayName": "xQc", "avatarUrl": "https://files.kick.com/images/user/676/profile_image/conversion/151f289a-5bff-4f31-b125-0c54c542519e-thumb.webp", "verified": false, "url": "https://kick.com/xqc" }, "stats": { "views": 28, "likes": 0, "comments": null, "shares": null, "saves": null, "engagementRate": 0 }, "media": [ { "kind": "video", "url": "https://clips.kick.com/clips/1b/clip_01M8D3CDDY4ZTNV2M4MK7RZRVG/master.m3u8", "thumbnailUrl": "https://clips.kick.com/clips/1b/clip_01M8D3CDDY4ZTNV2M4MK7RZRVG/thumbnail.webp", "width": null, "height": null, "durationSeconds": 20 } ], "hashtags": [], "mentions": [], "ext": { "kind": "clip", "title": "6", "category": { "id": "13155", "name": "Grand Theft Auto VI (GTA)", "slug": "grand-theft-auto-vi", "url": "https://kick.com/category/grand-theft-auto-vi" }, "language": null, "durationSeconds": 20, "recording": false, "mature": true, "tags": [], "curator": { "id": "23443665", "username": "eromanga", "displayName": "eromanga", "avatarUrl": null, "verified": false, "url": "https://kick.com/eromanga" }, "videoId": null, "videoOffsetSeconds": 0 } } ], "pagination": { "nextCursor": "{\"view\":0,\"id\":\"clip_01M8BJQCGTC5XZ1G9FAQHK3KWZ\"}", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/kick/profile/clips": { "get": { "tags": [ "Kick" ], "summary": "A channel's clips, 20 a page.", "description": "Most viewed or newest first, over the last day, week, month or all time, each with its\nviews, likes, length, who cut it, the video it is from and its file. 1 credit a page.", "operationId": "kickProfileClips", "parameters": [ { "name": "handle", "in": "query", "description": "The channel's name in its link (`xqc`).", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "The channel's link, instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "sort", "in": "query", "description": "`views` (the default) or `latest`.", "required": false, "schema": { "type": "string", "description": "How a list of clips is ordered.", "enum": [ "views", "latest" ] } }, { "name": "period", "in": "query", "description": "How far back: `day`, `week` (the default), `month` or `all`.", "required": false, "schema": { "type": "string", "description": "How far back a list of clips looks.", "enum": [ "day", "week", "month", "all" ] } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_KickPost" }, "example": { "data": [ { "id": "clip_01M8D3TY706JDNJFQ3KX49XEKQ", "url": "https://kick.com/xqc/clips/clip_01M8D3TY706JDNJFQ3KX49XEKQ", "text": "asd", "createdAt": "2026-11-26T23:43:15.189Z", "author": { "id": "668", "username": "xqc", "displayName": "xQc", "avatarUrl": "https://files.kick.com/images/user/676/profile_image/conversion/151f289a-5bff-4f31-b125-0c54c542519e-thumb.webp", "verified": false, "url": "https://kick.com/xqc" }, "stats": { "views": 53, "likes": 0, "comments": null, "shares": null, "saves": null, "engagementRate": 0 }, "media": [ { "kind": "video", "url": "https://clips.kick.com/clips/fb/clip_01M8D3TY706JDNJFQ3KX49XEKQ/master.m3u8", "thumbnailUrl": "https://clips.kick.com/clips/fb/clip_01M8D3TY706JDNJFQ3KX49XEKQ/thumbnail.webp", "width": null, "height": null, "durationSeconds": 12 } ], "hashtags": [], "mentions": [], "ext": { "kind": "clip", "title": "asd", "category": { "id": "13155", "name": "Grand Theft Auto VI (GTA)", "slug": "grand-theft-auto-vi", "url": "https://kick.com/category/grand-theft-auto-vi" }, "language": null, "durationSeconds": 12, "recording": false, "mature": true, "tags": [], "curator": { "id": "23443665", "username": "eromanga", "displayName": "eromanga", "avatarUrl": null, "verified": false, "url": "https://kick.com/eromanga" }, "videoId": null, "videoOffsetSeconds": 0 } }, { "id": "clip_01M8D3CDDY4ZTNV2M4MK7RZRVG", "url": "https://kick.com/xqc/clips/clip_01M8D3CDDY4ZTNV2M4MK7RZRVG", "text": "6", "createdAt": "2026-11-26T23:35:04.661Z", "author": { "id": "668", "username": "xqc", "displayName": "xQc", "avatarUrl": "https://files.kick.com/images/user/676/profile_image/conversion/151f289a-5bff-4f31-b125-0c54c542519e-thumb.webp", "verified": false, "url": "https://kick.com/xqc" }, "stats": { "views": 28, "likes": 0, "comments": null, "shares": null, "saves": null, "engagementRate": 0 }, "media": [ { "kind": "video", "url": "https://clips.kick.com/clips/1b/clip_01M8D3CDDY4ZTNV2M4MK7RZRVG/master.m3u8", "thumbnailUrl": "https://clips.kick.com/clips/1b/clip_01M8D3CDDY4ZTNV2M4MK7RZRVG/thumbnail.webp", "width": null, "height": null, "durationSeconds": 20 } ], "hashtags": [], "mentions": [], "ext": { "kind": "clip", "title": "6", "category": { "id": "13155", "name": "Grand Theft Auto VI (GTA)", "slug": "grand-theft-auto-vi", "url": "https://kick.com/category/grand-theft-auto-vi" }, "language": null, "durationSeconds": 20, "recording": false, "mature": true, "tags": [], "curator": { "id": "23443665", "username": "eromanga", "displayName": "eromanga", "avatarUrl": null, "verified": false, "url": "https://kick.com/eromanga" }, "videoId": null, "videoOffsetSeconds": 0 } } ], "pagination": { "nextCursor": "{\"view\":0,\"id\":\"clip_01M8BJQCGTC5XZ1G9FAQHK3KWZ\"}", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.kick.profileClips({ handle: \"xqc\", sort: \"latest\", period: \"month\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.kick.profile_clips(handle=\"xqc\", sort=\"latest\", period=\"month\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/kick/profile/clips \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=xqc\" \\\n --data-urlencode \"sort=latest\" \\\n --data-urlencode \"period=month\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_KickPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/KickPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "KickPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "kind", "recording", "mature", "tags" ], "properties": { "category": { "oneOf": [ { "$ref": "#/components/schemas/KickCategoryRef" }, { "type": "null" } ] }, "curator": { "oneOf": [ { "$ref": "#/components/schemas/Author", "description": "Who cut the clip." }, { "type": "null" } ] }, "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "kind": { "$ref": "#/components/schemas/KickPostKind" }, "language": { "type": [ "string", "null" ], "description": "The broadcast's language, as Kick names it (`English`)." }, "mature": { "type": "boolean", "description": "Marked for adults." }, "recording": { "type": "boolean", "description": "A broadcast still on air: its video is being recorded, and grows." }, "tags": { "type": "array", "items": { "type": "string" }, "description": "The tags its channel gave the broadcast." }, "title": { "type": [ "string", "null" ], "description": "The title (`text` says the same: Kick's posts have no other text)." }, "videoId": { "type": [ "string", "null" ], "description": "The video a clip was cut from, and where in it, in seconds." }, "videoOffsetSeconds": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A video (a past broadcast) or a clip." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "KickPostKind": { "type": "string", "description": "What a post is.", "enum": [ "video", "clip" ] }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } }, "KickCategoryRef": { "type": "object", "description": "A category as a channel, a video, a clip or a broadcast names it.", "required": [ "id", "name" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "slug": { "type": [ "string", "null" ], "description": "The name in its link (`just-chatting`)." }, "url": { "type": [ "string", "null" ] } } }, "Timestamp": { "type": "string", "format": "date-time" } } } } ``` # Profile Posts (/docs/api-reference/kick/profile-posts) A channel's videos, every one it keeps. `GET https://api.socialapi.sh/v1/kick/profile/posts` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.kick.profilePosts({ handle: "xqc" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.kick.profile_posts(handle="xqc") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/kick/profile/posts \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=xqc" ``` **Response** ```json { "data": [ { "id": "6060da49-216a-4828-ac41-62d307ce8825", "url": "https://kick.com/xqc/videos/6060da49-216a-4828-ac41-62d307ce8825", "text": "🐝LIVE🐝CLICK🐝HERE🐝DRAMA🐝NEWS🐝VIDEOS🐝LOCK IN🐝QUICKLY🐝IMPORTANT MEGA DAY🐝WOW🐝I LOVE IT🐝", "createdAt": "2026-11-25T22:19:55.000Z", "author": { "id": "668", "username": "xqc", "displayName": null, "avatarUrl": null, "verified": false, "url": "https://kick.com/xqc" }, "stats": { "views": 33825, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://stream.kick.com/3c81249a5ce0/ivs/v1/196233775518/DsuAwCgUc9Bh/2026/11/25/22/19/grz1HiLuGURr/media/hls/master.m3u8", "thumbnailUrl": "https://web.kick.com/api/v1/channels/668/thumbnail.jpeg?height=720", "width": null, "height": null, "durationSeconds": 41017 } ], "hashtags": [], "mentions": [], "ext": { "kind": "video", "title": "🐝LIVE🐝CLICK🐝HERE🐝DRAMA🐝NEWS🐝VIDEOS🐝LOCK IN🐝QUICKLY🐝IMPORTANT MEGA DAY🐝WOW🐝I LOVE IT🐝", "category": { "id": "15", "name": "Just Chatting", "slug": "just-chatting", "url": "https://kick.com/category/just-chatting" }, "language": "English", "durationSeconds": 41017, "recording": false, "mature": true, "tags": [], "curator": null, "videoId": null, "videoOffsetSeconds": null } }, { "id": "98f0cdd3-ee98-47ef-a7d1-244fa982fe74", "url": "https://kick.com/xqc/videos/98f0cdd3-ee98-47ef-a7d1-244fa982fe74", "text": "🐌LIVE🐌DRAMA🐌NEWS🐌VIDEOS🐌GAMES🐌IMPORTANT🐌BROADCAST🐌THINGS🐌LOCK IN🐌PULL UP🐌QUICK🐌", "createdAt": "2026-11-24T20:50:31.000Z", "author": { "id": "668", "username": "xqc", "displayName": null, "avatarUrl": null, "verified": false, "url": "https://kick.com/xqc" }, "stats": { "views": 36075, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://stream.kick.com/3c81249a5ce0/ivs/v1/196233775518/DsuAwCgUc9Bh/2026/11/24/20/50/6WthFt1XRyTZ/media/hls/master.m3u8", "thumbnailUrl": "https://web.kick.com/api/v1/channels/668/thumbnail.jpeg?height=720", "width": null, "height": null, "durationSeconds": 38828 } ], "hashtags": [], "mentions": [], "ext": { "kind": "video", "title": "🐌LIVE🐌DRAMA🐌NEWS🐌VIDEOS🐌GAMES🐌IMPORTANT🐌BROADCAST🐌THINGS🐌LOCK IN🐌PULL UP🐌QUICK🐌", "category": { "id": "19671", "name": "The Legend of Zelda: Ocarina of Time", "slug": "the-legend-of-zelda-ocarina-of-time-1", "url": "https://kick.com/category/the-legend-of-zelda-ocarina-of-time-1" }, "language": "English", "durationSeconds": 38828, "recording": false, "mature": true, "tags": [], "curator": null, "videoId": null, "videoOffsetSeconds": null } } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/kick/profile/posts": { "get": { "tags": [ "Kick" ], "summary": "A channel's videos, every one it keeps.", "description": "Its past broadcasts, newest first, with their views, length, category, language and a\nlink to play each (an HLS playlist). Kick keeps a channel's broadcasts about 30 days;\nthey come in one page. 1 credit.", "operationId": "kickProfilePosts", "parameters": [ { "name": "handle", "in": "query", "description": "The channel's name in its link (`xqc`).", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "The channel's link (`https://kick.com/xqc`), instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_KickPost" }, "example": { "data": [ { "id": "6060da49-216a-4828-ac41-62d307ce8825", "url": "https://kick.com/xqc/videos/6060da49-216a-4828-ac41-62d307ce8825", "text": "🐝LIVE🐝CLICK🐝HERE🐝DRAMA🐝NEWS🐝VIDEOS🐝LOCK IN🐝QUICKLY🐝IMPORTANT MEGA DAY🐝WOW🐝I LOVE IT🐝", "createdAt": "2026-11-25T22:19:55.000Z", "author": { "id": "668", "username": "xqc", "displayName": null, "avatarUrl": null, "verified": false, "url": "https://kick.com/xqc" }, "stats": { "views": 33825, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://stream.kick.com/3c81249a5ce0/ivs/v1/196233775518/DsuAwCgUc9Bh/2026/11/25/22/19/grz1HiLuGURr/media/hls/master.m3u8", "thumbnailUrl": "https://web.kick.com/api/v1/channels/668/thumbnail.jpeg?height=720", "width": null, "height": null, "durationSeconds": 41017 } ], "hashtags": [], "mentions": [], "ext": { "kind": "video", "title": "🐝LIVE🐝CLICK🐝HERE🐝DRAMA🐝NEWS🐝VIDEOS🐝LOCK IN🐝QUICKLY🐝IMPORTANT MEGA DAY🐝WOW🐝I LOVE IT🐝", "category": { "id": "15", "name": "Just Chatting", "slug": "just-chatting", "url": "https://kick.com/category/just-chatting" }, "language": "English", "durationSeconds": 41017, "recording": false, "mature": true, "tags": [], "curator": null, "videoId": null, "videoOffsetSeconds": null } }, { "id": "98f0cdd3-ee98-47ef-a7d1-244fa982fe74", "url": "https://kick.com/xqc/videos/98f0cdd3-ee98-47ef-a7d1-244fa982fe74", "text": "🐌LIVE🐌DRAMA🐌NEWS🐌VIDEOS🐌GAMES🐌IMPORTANT🐌BROADCAST🐌THINGS🐌LOCK IN🐌PULL UP🐌QUICK🐌", "createdAt": "2026-11-24T20:50:31.000Z", "author": { "id": "668", "username": "xqc", "displayName": null, "avatarUrl": null, "verified": false, "url": "https://kick.com/xqc" }, "stats": { "views": 36075, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://stream.kick.com/3c81249a5ce0/ivs/v1/196233775518/DsuAwCgUc9Bh/2026/11/24/20/50/6WthFt1XRyTZ/media/hls/master.m3u8", "thumbnailUrl": "https://web.kick.com/api/v1/channels/668/thumbnail.jpeg?height=720", "width": null, "height": null, "durationSeconds": 38828 } ], "hashtags": [], "mentions": [], "ext": { "kind": "video", "title": "🐌LIVE🐌DRAMA🐌NEWS🐌VIDEOS🐌GAMES🐌IMPORTANT🐌BROADCAST🐌THINGS🐌LOCK IN🐌PULL UP🐌QUICK🐌", "category": { "id": "19671", "name": "The Legend of Zelda: Ocarina of Time", "slug": "the-legend-of-zelda-ocarina-of-time-1", "url": "https://kick.com/category/the-legend-of-zelda-ocarina-of-time-1" }, "language": "English", "durationSeconds": 38828, "recording": false, "mature": true, "tags": [], "curator": null, "videoId": null, "videoOffsetSeconds": null } } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.kick.profilePosts({ handle: \"xqc\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.kick.profile_posts(handle=\"xqc\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/kick/profile/posts \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=xqc\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_KickPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/KickPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "KickPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "kind", "recording", "mature", "tags" ], "properties": { "category": { "oneOf": [ { "$ref": "#/components/schemas/KickCategoryRef" }, { "type": "null" } ] }, "curator": { "oneOf": [ { "$ref": "#/components/schemas/Author", "description": "Who cut the clip." }, { "type": "null" } ] }, "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "kind": { "$ref": "#/components/schemas/KickPostKind" }, "language": { "type": [ "string", "null" ], "description": "The broadcast's language, as Kick names it (`English`)." }, "mature": { "type": "boolean", "description": "Marked for adults." }, "recording": { "type": "boolean", "description": "A broadcast still on air: its video is being recorded, and grows." }, "tags": { "type": "array", "items": { "type": "string" }, "description": "The tags its channel gave the broadcast." }, "title": { "type": [ "string", "null" ], "description": "The title (`text` says the same: Kick's posts have no other text)." }, "videoId": { "type": [ "string", "null" ], "description": "The video a clip was cut from, and where in it, in seconds." }, "videoOffsetSeconds": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A video (a past broadcast) or a clip." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "KickPostKind": { "type": "string", "description": "What a post is.", "enum": [ "video", "clip" ] }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } }, "KickCategoryRef": { "type": "object", "description": "A category as a channel, a video, a clip or a broadcast names it.", "required": [ "id", "name" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "slug": { "type": [ "string", "null" ], "description": "The name in its link (`just-chatting`)." }, "url": { "type": [ "string", "null" ] } } }, "Timestamp": { "type": "string", "format": "date-time" } } } } ``` # Profile (/docs/api-reference/kick/profile) A channel with its follower count and links. `GET https://api.socialapi.sh/v1/kick/profile` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.kick.profile({ handle: "xqc" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.kick.profile(handle="xqc").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/kick/profile \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=xqc" ``` **Response** ```json { "data": { "id": "668", "username": "xqc", "displayName": "xQc", "bio": "THE BEST AT ABSOLUTELY EVERYTHING. THE JUICER. LEADER OF THE JUICERS.", "avatarUrl": "https://files.kick.com/images/user/676/profile_image/conversion/931b4e8f-5445-427c-bd82-b473530390cc-fullsize.webp", "url": "https://kick.com/xqc", "verified": true, "private": false, "followers": 1879042, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": "2022-10-22T06:59:51.000Z", "ext": { "userId": "676", "live": false, "affiliate": false, "videosEnabled": true, "subscriptionsEnabled": true, "bannerUrl": "https://files.kick.com/images/channel/668/banner_image/6fcf7418-df00-460b-9467-1fa95b8eb981", "offlineBannerUrl": null, "socials": [ { "network": "instagram", "name": "xqcow1/", "url": "https://www.instagram.com/xqcow1/" }, { "network": "x", "name": "xqc", "url": "https://x.com/xqc" }, { "network": "youtube", "name": "channel/UCmDTrq0LNgPodDOFZiSbsww", "url": "https://www.youtube.com/channel/UCmDTrq0LNgPodDOFZiSbsww" } ], "links": [ { "title": null, "description": null, "url": "https://streamelements.com/xqc/tip", "imageUrl": "https://files.kick.com/images/channel-links/605185/image/conversion/4d8e57a6-2c10-4a3c-9dff-c19d861d073c-image.webp" }, { "title": null, "description": null, "url": "https://www.youtube.com/channel/UCmDTrq0LNgPodDOFZiSbsww", "imageUrl": "https://files.kick.com/images/channel-links/605197/image/conversion/9e82a1f8-b742-4fdc-807a-ddc679fa7bc1-image.webp" }, { "title": null, "description": null, "url": "https://discord.gg/xqcow", "imageUrl": "https://files.kick.com/images/channel-links/605147/image/conversion/1dfb542b-59d4-4b65-925b-9f7ccbdc521a-image.webp" } ], "recentCategories": [ { "id": "15", "name": "Just Chatting", "slug": "just-chatting", "url": "https://kick.com/category/just-chatting" }, { "id": "19671", "name": "The Legend of Zelda: Ocarina of Time", "slug": "the-legend-of-zelda-ocarina-of-time-1", "url": "https://kick.com/category/the-legend-of-zelda-ocarina-of-time-1" }, { "id": "13155", "name": "Grand Theft Auto VI (GTA)", "slug": "grand-theft-auto-vi", "url": "https://kick.com/category/grand-theft-auto-vi" } ], "chatroomId": "668" } } } ``` **OpenAPI** ```json { "paths": { "/v1/kick/profile": { "get": { "tags": [ "Kick" ], "summary": "A channel with its follower count and links.", "description": "Name, bio, pictures, exact followers, whether it is verified, an affiliate and live, the\naccounts elsewhere it names, the links under its player and the categories it last\nbroadcast in. 1 credit.", "operationId": "kickProfile", "parameters": [ { "name": "handle", "in": "query", "description": "The channel's name in its link (`xqc`).", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "The channel's link (`https://kick.com/xqc`), instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_KickProfile" }, "example": { "data": { "id": "668", "username": "xqc", "displayName": "xQc", "bio": "THE BEST AT ABSOLUTELY EVERYTHING. THE JUICER. LEADER OF THE JUICERS.", "avatarUrl": "https://files.kick.com/images/user/676/profile_image/conversion/931b4e8f-5445-427c-bd82-b473530390cc-fullsize.webp", "url": "https://kick.com/xqc", "verified": true, "private": false, "followers": 1879042, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": "2022-10-22T06:59:51.000Z", "ext": { "userId": "676", "live": false, "affiliate": false, "videosEnabled": true, "subscriptionsEnabled": true, "bannerUrl": "https://files.kick.com/images/channel/668/banner_image/6fcf7418-df00-460b-9467-1fa95b8eb981", "offlineBannerUrl": null, "socials": [ { "network": "instagram", "name": "xqcow1/", "url": "https://www.instagram.com/xqcow1/" }, { "network": "x", "name": "xqc", "url": "https://x.com/xqc" }, { "network": "youtube", "name": "channel/UCmDTrq0LNgPodDOFZiSbsww", "url": "https://www.youtube.com/channel/UCmDTrq0LNgPodDOFZiSbsww" } ], "links": [ { "title": null, "description": null, "url": "https://streamelements.com/xqc/tip", "imageUrl": "https://files.kick.com/images/channel-links/605185/image/conversion/4d8e57a6-2c10-4a3c-9dff-c19d861d073c-image.webp" }, { "title": null, "description": null, "url": "https://www.youtube.com/channel/UCmDTrq0LNgPodDOFZiSbsww", "imageUrl": "https://files.kick.com/images/channel-links/605197/image/conversion/9e82a1f8-b742-4fdc-807a-ddc679fa7bc1-image.webp" }, { "title": null, "description": null, "url": "https://discord.gg/xqcow", "imageUrl": "https://files.kick.com/images/channel-links/605147/image/conversion/1dfb542b-59d4-4b65-925b-9f7ccbdc521a-image.webp" } ], "recentCategories": [ { "id": "15", "name": "Just Chatting", "slug": "just-chatting", "url": "https://kick.com/category/just-chatting" }, { "id": "19671", "name": "The Legend of Zelda: Ocarina of Time", "slug": "the-legend-of-zelda-ocarina-of-time-1", "url": "https://kick.com/category/the-legend-of-zelda-ocarina-of-time-1" }, { "id": "13155", "name": "Grand Theft Auto VI (GTA)", "slug": "grand-theft-auto-vi", "url": "https://kick.com/category/grand-theft-auto-vi" } ], "chatroomId": "668" } } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.kick.profile({ handle: \"xqc\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.kick.profile(handle=\"xqc\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/kick/profile \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=xqc\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_KickProfile": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/KickProfile" } } }, "KickProfile": { "allOf": [ { "type": "object", "description": "An account.", "required": [ "id", "username", "url", "verified", "private", "ext" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "bio": { "type": [ "string", "null" ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "displayName": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "live", "socials", "links", "recentCategories" ], "properties": { "affiliate": { "type": [ "boolean", "null" ], "description": "A Kick Affiliate; on `/profile` only, as the next two." }, "bannerUrl": { "type": [ "string", "null" ] }, "chatroomId": { "type": [ "string", "null" ], "description": "Its chat's id." }, "links": { "type": "array", "items": { "$ref": "#/components/schemas/KickLink" }, "description": "The links under its player." }, "live": { "type": "boolean", "description": "On air now. `/v1/kick/live` has the broadcast." }, "offlineBannerUrl": { "type": [ "string", "null" ], "description": "The picture its player shows while it is off air." }, "recentCategories": { "type": "array", "items": { "$ref": "#/components/schemas/KickCategoryRef" }, "description": "The categories it broadcast in last." }, "socials": { "type": "array", "items": { "$ref": "#/components/schemas/KickSocial" }, "description": "The accounts elsewhere it names." }, "subscriptionsEnabled": { "type": [ "boolean", "null" ], "description": "Whether it can be subscribed to." }, "userId": { "type": [ "string", "null" ], "description": "The account's id (`id` is the channel's)." }, "videosEnabled": { "type": [ "boolean", "null" ], "description": "Whether it keeps its broadcasts as videos." } } }, { "type": "object", "description": "What only this platform has." } ] }, "externalUrl": { "type": [ "string", "null" ], "description": "The link in the bio." }, "followers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "following": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "id": { "type": "string", "description": "The platform's id for the account." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "description": "Likes the account's posts received in total.", "minimum": 0 }, "posts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "private": { "type": "boolean" }, "url": { "type": "string", "description": "The profile's page." }, "username": { "type": "string", "description": "The handle, without `@`." }, "verified": { "type": "boolean" } } }, { "type": "object", "description": "A Kick channel." } ] }, "KickSocial": { "type": "object", "description": "An account elsewhere that a channel names (Kick keeps one of each).", "required": [ "network", "name", "url" ], "properties": { "name": { "type": "string", "description": "The name as the channel wrote it." }, "network": { "type": "string", "description": "`instagram`, `x`, `youtube`, `discord`, `tiktok` or `facebook`." }, "url": { "type": "string" } } }, "KickCategoryRef": { "type": "object", "description": "A category as a channel, a video, a clip or a broadcast names it.", "required": [ "id", "name" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "slug": { "type": [ "string", "null" ], "description": "The name in its link (`just-chatting`)." }, "url": { "type": [ "string", "null" ] } } }, "KickLink": { "type": "object", "description": "A link under a channel's player.", "required": [ "url" ], "properties": { "description": { "type": [ "string", "null" ] }, "imageUrl": { "type": [ "string", "null" ] }, "title": { "type": [ "string", "null" ] }, "url": { "type": "string" } } }, "Timestamp": { "type": "string", "format": "date-time" } } } } ``` # Search Categories (/docs/api-reference/kick/search-categories) Categories matching a search, up to 50. `GET https://api.socialapi.sh/v1/kick/search/categories` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.kick.searchCategories({ query: "grand" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.kick.search_categories(query="grand") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/kick/search/categories \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "query=grand" ``` **Response** ```json { "data": [ { "id": "17657", "name": "Grand Prix", "slug": "grand-prix", "url": "https://kick.com/category/grand-prix", "description": null, "coverUrl": "https://files.kick.com/images/subcategories/17657/banner/co6i2b.jpg", "viewers": 0, "channels": 0, "followers": null, "tags": [ "Racing", "Arcade", "Action" ], "parent": null, "mature": false }, { "id": "16396", "name": "Grand Chase", "slug": "grand-chase", "url": "https://kick.com/category/grand-chase", "description": null, "coverUrl": "https://files.kick.com/images/subcategories/16396/banner/co4uhi.jpg", "viewers": 0, "channels": 0, "followers": null, "tags": [ "Fighting", "Platformer", "RPG" ], "parent": null, "mature": false } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/kick/search/categories": { "get": { "tags": [ "Kick" ], "summary": "Categories matching a search, up to 50.", "description": "Each with its viewers, live channels and genres. 1 credit.", "operationId": "kickSearchCategories", "parameters": [ { "name": "query", "in": "query", "description": "What to search for.", "required": true, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_KickCategory" }, "example": { "data": [ { "id": "17657", "name": "Grand Prix", "slug": "grand-prix", "url": "https://kick.com/category/grand-prix", "description": null, "coverUrl": "https://files.kick.com/images/subcategories/17657/banner/co6i2b.jpg", "viewers": 0, "channels": 0, "followers": null, "tags": [ "Racing", "Arcade", "Action" ], "parent": null, "mature": false }, { "id": "16396", "name": "Grand Chase", "slug": "grand-chase", "url": "https://kick.com/category/grand-chase", "description": null, "coverUrl": "https://files.kick.com/images/subcategories/16396/banner/co4uhi.jpg", "viewers": 0, "channels": 0, "followers": null, "tags": [ "Fighting", "Platformer", "RPG" ], "parent": null, "mature": false } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.kick.searchCategories({ query: \"grand\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.kick.search_categories(query=\"grand\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/kick/search/categories \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"query=grand\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_KickCategory": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/KickCategory" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "KickCategory": { "type": "object", "description": "A category: a game, or a kind of broadcast such as Just Chatting.", "required": [ "id", "name", "slug", "url", "tags", "mature" ], "properties": { "channels": { "type": [ "integer", "null" ], "format": "int64", "description": "Channels broadcasting it now; in searches only.", "minimum": 0 }, "coverUrl": { "type": [ "string", "null" ], "description": "Its banner." }, "description": { "type": [ "string", "null" ] }, "followers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "id": { "type": "string" }, "mature": { "type": "boolean", "description": "Marked for adults." }, "name": { "type": "string" }, "parent": { "type": [ "string", "null" ], "description": "The group it is in (`Games`, `IRL`)." }, "slug": { "type": "string", "description": "The name in its link (`just-chatting`)." }, "tags": { "type": "array", "items": { "type": "string" }, "description": "Kick's genres for it (`Shooter`, `IRL`)." }, "url": { "type": "string" }, "viewers": { "type": [ "integer", "null" ], "format": "int64", "description": "People watching it now.", "minimum": 0 } } } } } } ``` # Search Lives (/docs/api-reference/kick/search-lives) Live broadcasts matching a search, up to 10. `GET https://api.socialapi.sh/v1/kick/search/lives` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.kick.searchLives({ query: "gta" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.kick.search_lives(query="gta") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/kick/search/lives \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "query=gta" ``` **Response** ```json { "data": [ { "live": true, "roomId": "01a21d8c-d6b8-72be-b849-b27e68d0e8b5", "title": "gta", "viewers": 302, "startedAt": "2026-11-27T15:08:19.000Z", "coverUrl": "https://web.kick.com/api/v1/channels/134951752/thumbnail.jpeg?height=720", "host": { "id": "134951752", "username": "arzellthagoat", "displayName": "Arzellthagoat", "avatarUrl": "https://files.kick.com/images/user/1000521343/profile_image/conversion/40e91c74-5bc9-49d5-93ef-cdbe37a0eed6-medium.webp", "verified": false, "url": "https://kick.com/arzellthagoat" }, "ext": { "category": { "id": "8", "name": "Grand Theft Auto V (GTA)", "slug": "grand-theft-auto-v", "url": "https://kick.com/category/grand-theft-auto-v" }, "language": "en", "tags": [], "mature": true, "playbackUrl": null } }, { "live": true, "roomId": "01a21d97-90d0-7498-8aa0-d1ec869aac51", "title": "GTA 5.5", "viewers": 358, "startedAt": "2026-11-27T15:20:02.000Z", "coverUrl": "https://web.kick.com/api/v1/channels/11043129/thumbnail.jpeg?height=720", "host": { "id": "11043129", "username": "cety01", "displayName": "Cety01", "avatarUrl": "https://files.kick.com/images/user/11804236/profile_image/conversion/a33f5a96-6391-4493-b0fe-a6b356da8d80-medium.webp", "verified": false, "url": "https://kick.com/cety01" }, "ext": { "category": { "id": "8", "name": "Grand Theft Auto V (GTA)", "slug": "grand-theft-auto-v", "url": "https://kick.com/category/grand-theft-auto-v" }, "language": "ar", "tags": [], "mature": false, "playbackUrl": null } } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/kick/search/lives": { "get": { "tags": [ "Kick" ], "summary": "Live broadcasts matching a search, up to 10.", "description": "By their channel's name, their title or their category, each with its viewers. 1\ncredit.", "operationId": "kickSearchLives", "parameters": [ { "name": "query", "in": "query", "description": "What to search for.", "required": true, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_KickLive" }, "example": { "data": [ { "live": true, "roomId": "01a21d8c-d6b8-72be-b849-b27e68d0e8b5", "title": "gta", "viewers": 302, "startedAt": "2026-11-27T15:08:19.000Z", "coverUrl": "https://web.kick.com/api/v1/channels/134951752/thumbnail.jpeg?height=720", "host": { "id": "134951752", "username": "arzellthagoat", "displayName": "Arzellthagoat", "avatarUrl": "https://files.kick.com/images/user/1000521343/profile_image/conversion/40e91c74-5bc9-49d5-93ef-cdbe37a0eed6-medium.webp", "verified": false, "url": "https://kick.com/arzellthagoat" }, "ext": { "category": { "id": "8", "name": "Grand Theft Auto V (GTA)", "slug": "grand-theft-auto-v", "url": "https://kick.com/category/grand-theft-auto-v" }, "language": "en", "tags": [], "mature": true, "playbackUrl": null } }, { "live": true, "roomId": "01a21d97-90d0-7498-8aa0-d1ec869aac51", "title": "GTA 5.5", "viewers": 358, "startedAt": "2026-11-27T15:20:02.000Z", "coverUrl": "https://web.kick.com/api/v1/channels/11043129/thumbnail.jpeg?height=720", "host": { "id": "11043129", "username": "cety01", "displayName": "Cety01", "avatarUrl": "https://files.kick.com/images/user/11804236/profile_image/conversion/a33f5a96-6391-4493-b0fe-a6b356da8d80-medium.webp", "verified": false, "url": "https://kick.com/cety01" }, "ext": { "category": { "id": "8", "name": "Grand Theft Auto V (GTA)", "slug": "grand-theft-auto-v", "url": "https://kick.com/category/grand-theft-auto-v" }, "language": "ar", "tags": [], "mature": false, "playbackUrl": null } } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.kick.searchLives({ query: \"gta\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.kick.search_lives(query=\"gta\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/kick/search/lives \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"query=gta\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_KickLive": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/KickLive" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "KickLive": { "allOf": [ { "type": "object", "description": "An account's live broadcast.", "required": [ "live", "ext" ], "properties": { "coverUrl": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "tags", "mature" ], "properties": { "category": { "oneOf": [ { "$ref": "#/components/schemas/KickCategoryRef" }, { "type": "null" } ] }, "language": { "type": [ "string", "null" ], "description": "The broadcast's language (`en`, or as Kick names it, `English`)." }, "mature": { "type": "boolean", "description": "Marked for adults." }, "playbackUrl": { "type": [ "string", "null" ], "description": "Its stream's HLS playlist; on `/live` only. It carries a token that expires." }, "tags": { "type": "array", "items": { "type": "string" }, "description": "The tags the channel gave the broadcast." } } }, { "type": "object", "description": "What only this platform has." } ] }, "host": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "live": { "type": "boolean" }, "roomId": { "type": [ "string", "null" ] }, "startedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "title": { "type": [ "string", "null" ] }, "viewers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, { "type": "object", "description": "A live broadcast, or a channel's live status." } ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } }, "KickCategoryRef": { "type": "object", "description": "A category as a channel, a video, a clip or a broadcast names it.", "required": [ "id", "name" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "slug": { "type": [ "string", "null" ], "description": "The name in its link (`just-chatting`)." }, "url": { "type": [ "string", "null" ] } } } } } } ``` # Search Users (/docs/api-reference/kick/search-users) Channels matching a search, up to 50. `GET https://api.socialapi.sh/v1/kick/search/users` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.kick.searchUsers({ query: "xqc" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.kick.search_users(query="xqc") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/kick/search/users \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "query=xqc" ``` **Response** ```json { "data": [ { "id": "668", "username": "xqc", "displayName": "xQc", "bio": null, "avatarUrl": "https://files.kick.com/images/user/676/profile_image/conversion/931b4e8f-5445-427c-bd82-b473530390cc-medium.webp", "url": "https://kick.com/xqc", "verified": true, "private": false, "followers": 1880231, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": null, "ext": { "userId": null, "live": false, "affiliate": null, "videosEnabled": null, "subscriptionsEnabled": null, "bannerUrl": null, "offlineBannerUrl": null, "socials": [], "links": [], "recentCategories": [], "chatroomId": null } }, { "id": "122879734", "username": "xqc247", "displayName": "xQc247", "bio": null, "avatarUrl": "https://files.kick.com/images/user/124136666/profile_image/a6389dda-605d-45cb-996d-c93f2878f4e1", "url": "https://kick.com/xqc247", "verified": true, "private": false, "followers": 163, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": null, "ext": { "userId": null, "live": false, "affiliate": null, "videosEnabled": null, "subscriptionsEnabled": null, "bannerUrl": null, "offlineBannerUrl": null, "socials": [], "links": [], "recentCategories": [], "chatroomId": null } } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/kick/search/users": { "get": { "tags": [ "Kick" ], "summary": "Channels matching a search, up to 50.", "description": "Each with its followers and whether it is live. 1 credit.", "operationId": "kickSearchUsers", "parameters": [ { "name": "query", "in": "query", "description": "What to search for.", "required": true, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_KickProfile" }, "example": { "data": [ { "id": "668", "username": "xqc", "displayName": "xQc", "bio": null, "avatarUrl": "https://files.kick.com/images/user/676/profile_image/conversion/931b4e8f-5445-427c-bd82-b473530390cc-medium.webp", "url": "https://kick.com/xqc", "verified": true, "private": false, "followers": 1880231, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": null, "ext": { "userId": null, "live": false, "affiliate": null, "videosEnabled": null, "subscriptionsEnabled": null, "bannerUrl": null, "offlineBannerUrl": null, "socials": [], "links": [], "recentCategories": [], "chatroomId": null } }, { "id": "122879734", "username": "xqc247", "displayName": "xQc247", "bio": null, "avatarUrl": "https://files.kick.com/images/user/124136666/profile_image/a6389dda-605d-45cb-996d-c93f2878f4e1", "url": "https://kick.com/xqc247", "verified": true, "private": false, "followers": 163, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": null, "ext": { "userId": null, "live": false, "affiliate": null, "videosEnabled": null, "subscriptionsEnabled": null, "bannerUrl": null, "offlineBannerUrl": null, "socials": [], "links": [], "recentCategories": [], "chatroomId": null } } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.kick.searchUsers({ query: \"xqc\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.kick.search_users(query=\"xqc\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/kick/search/users \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"query=xqc\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_KickProfile": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/KickProfile" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "KickProfile": { "allOf": [ { "type": "object", "description": "An account.", "required": [ "id", "username", "url", "verified", "private", "ext" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "bio": { "type": [ "string", "null" ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "displayName": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "live", "socials", "links", "recentCategories" ], "properties": { "affiliate": { "type": [ "boolean", "null" ], "description": "A Kick Affiliate; on `/profile` only, as the next two." }, "bannerUrl": { "type": [ "string", "null" ] }, "chatroomId": { "type": [ "string", "null" ], "description": "Its chat's id." }, "links": { "type": "array", "items": { "$ref": "#/components/schemas/KickLink" }, "description": "The links under its player." }, "live": { "type": "boolean", "description": "On air now. `/v1/kick/live` has the broadcast." }, "offlineBannerUrl": { "type": [ "string", "null" ], "description": "The picture its player shows while it is off air." }, "recentCategories": { "type": "array", "items": { "$ref": "#/components/schemas/KickCategoryRef" }, "description": "The categories it broadcast in last." }, "socials": { "type": "array", "items": { "$ref": "#/components/schemas/KickSocial" }, "description": "The accounts elsewhere it names." }, "subscriptionsEnabled": { "type": [ "boolean", "null" ], "description": "Whether it can be subscribed to." }, "userId": { "type": [ "string", "null" ], "description": "The account's id (`id` is the channel's)." }, "videosEnabled": { "type": [ "boolean", "null" ], "description": "Whether it keeps its broadcasts as videos." } } }, { "type": "object", "description": "What only this platform has." } ] }, "externalUrl": { "type": [ "string", "null" ], "description": "The link in the bio." }, "followers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "following": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "id": { "type": "string", "description": "The platform's id for the account." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "description": "Likes the account's posts received in total.", "minimum": 0 }, "posts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "private": { "type": "boolean" }, "url": { "type": "string", "description": "The profile's page." }, "username": { "type": "string", "description": "The handle, without `@`." }, "verified": { "type": "boolean" } } }, { "type": "object", "description": "A Kick channel." } ] }, "KickSocial": { "type": "object", "description": "An account elsewhere that a channel names (Kick keeps one of each).", "required": [ "network", "name", "url" ], "properties": { "name": { "type": "string", "description": "The name as the channel wrote it." }, "network": { "type": "string", "description": "`instagram`, `x`, `youtube`, `discord`, `tiktok` or `facebook`." }, "url": { "type": "string" } } }, "KickCategoryRef": { "type": "object", "description": "A category as a channel, a video, a clip or a broadcast names it.", "required": [ "id", "name" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "slug": { "type": [ "string", "null" ], "description": "The name in its link (`just-chatting`)." }, "url": { "type": [ "string", "null" ] } } }, "KickLink": { "type": "object", "description": "A link under a channel's player.", "required": [ "url" ], "properties": { "description": { "type": [ "string", "null" ] }, "imageUrl": { "type": [ "string", "null" ] }, "title": { "type": [ "string", "null" ] }, "url": { "type": "string" } } }, "Timestamp": { "type": "string", "format": "date-time" } } } } ``` # Trending Categories (/docs/api-reference/kick/trending-categories) The categories most watched now. `GET https://api.socialapi.sh/v1/kick/trending/categories` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.kick.trendingCategories(); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.kick.trending_categories() ``` **cURL** ```bash curl https://api.socialapi.sh/v1/kick/trending/categories \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" ``` **Response** ```json { "data": [ { "id": "8", "name": "Grand Theft Auto V (GTA)", "slug": "grand-theft-auto-v", "url": "https://kick.com/category/grand-theft-auto-v", "description": "Grand Theft Auto V is a vast open world game set in Los Santos, a sprawling sun-soaked metropolis struggling to stay afloat in an era of economic uncertainty and cheap reality TV. The game blends storytelling and gameplay in new ways as players repeatedly jump in and out of the lives of the game’s three lead characters, playing all sides of the game’s interwoven story.", "coverUrl": "https://files.kick.com/images/subcategories/8/banner/conversion/dfc3bcf9-6dd1-4f88-bdac-066f17b7d14d-banner.webp", "viewers": 246872, "channels": null, "followers": null, "tags": [ "Shooter", "Action", "Open World" ], "parent": "Games", "mature": false }, { "id": "15", "name": "Just Chatting", "slug": "just-chatting", "url": "https://kick.com/category/just-chatting", "description": null, "coverUrl": "https://files.kick.com/images/subcategories/15/banner/conversion/5546d68b-e9f9-49f9-a658-9d2ece637064-banner.webp", "viewers": 199413, "channels": null, "followers": null, "tags": [ "IRL", "Casual" ], "parent": "IRL", "mature": false } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/kick/trending/categories": { "get": { "tags": [ "Kick" ], "summary": "The categories most watched now.", "description": "With their viewers, banners and genres, in one page. 1 credit.", "operationId": "kickTrendingCategories", "parameters": [ { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_KickCategory" }, "example": { "data": [ { "id": "8", "name": "Grand Theft Auto V (GTA)", "slug": "grand-theft-auto-v", "url": "https://kick.com/category/grand-theft-auto-v", "description": "Grand Theft Auto V is a vast open world game set in Los Santos, a sprawling sun-soaked metropolis struggling to stay afloat in an era of economic uncertainty and cheap reality TV. The game blends storytelling and gameplay in new ways as players repeatedly jump in and out of the lives of the game’s three lead characters, playing all sides of the game’s interwoven story.", "coverUrl": "https://files.kick.com/images/subcategories/8/banner/conversion/dfc3bcf9-6dd1-4f88-bdac-066f17b7d14d-banner.webp", "viewers": 246872, "channels": null, "followers": null, "tags": [ "Shooter", "Action", "Open World" ], "parent": "Games", "mature": false }, { "id": "15", "name": "Just Chatting", "slug": "just-chatting", "url": "https://kick.com/category/just-chatting", "description": null, "coverUrl": "https://files.kick.com/images/subcategories/15/banner/conversion/5546d68b-e9f9-49f9-a658-9d2ece637064-banner.webp", "viewers": 199413, "channels": null, "followers": null, "tags": [ "IRL", "Casual" ], "parent": "IRL", "mature": false } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.kick.trendingCategories();" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.kick.trending_categories()" }, { "lang": "bash", "label": "cURL", "source": "curl https://api.socialapi.sh/v1/kick/trending/categories \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_KickCategory": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/KickCategory" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "KickCategory": { "type": "object", "description": "A category: a game, or a kind of broadcast such as Just Chatting.", "required": [ "id", "name", "slug", "url", "tags", "mature" ], "properties": { "channels": { "type": [ "integer", "null" ], "format": "int64", "description": "Channels broadcasting it now; in searches only.", "minimum": 0 }, "coverUrl": { "type": [ "string", "null" ], "description": "Its banner." }, "description": { "type": [ "string", "null" ] }, "followers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "id": { "type": "string" }, "mature": { "type": "boolean", "description": "Marked for adults." }, "name": { "type": "string" }, "parent": { "type": [ "string", "null" ], "description": "The group it is in (`Games`, `IRL`)." }, "slug": { "type": "string", "description": "The name in its link (`just-chatting`)." }, "tags": { "type": "array", "items": { "type": "string" }, "description": "Kick's genres for it (`Shooter`, `IRL`)." }, "url": { "type": "string" }, "viewers": { "type": [ "integer", "null" ], "format": "int64", "description": "People watching it now.", "minimum": 0 } } } } } } ``` # Trending Clips (/docs/api-reference/kick/trending-clips) The site's most viewed clips, 20 a page. `GET https://api.socialapi.sh/v1/kick/trending/clips` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.kick.trendingClips({ period: "day" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.kick.trending_clips(period="day") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/kick/trending/clips \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "period=day" ``` **Response** ```json { "data": [ { "id": "clip_01M8BDF182KQ1MBPCD5SMEDBGQ", "url": "https://kick.com/traedakidd/clips/clip_01M8BDF182KQ1MBPCD5SMEDBGQ", "text": "Live", "createdAt": "2026-11-26T07:52:49.923Z", "author": { "id": "129084711", "username": "traedakidd", "displayName": "traedakidd", "avatarUrl": "https://files.kick.com/images/user/130350272/profile_image/conversion/3d015ee1-06b2-457d-b18d-392296532e38-thumb.webp", "verified": false, "url": "https://kick.com/traedakidd" }, "stats": { "views": 7195, "likes": 0, "comments": null, "shares": null, "saves": null, "engagementRate": 0 }, "media": [ { "kind": "video", "url": "https://clips.kick.com/clips/9a/clip_01M8BDF182KQ1MBPCD5SMEDBGQ/playlist.m3u8", "thumbnailUrl": "https://clips.kick.com/clips/9a/clip_01M8BDF182KQ1MBPCD5SMEDBGQ/thumbnail.webp", "width": null, "height": null, "durationSeconds": 50 } ], "hashtags": [], "mentions": [], "ext": { "kind": "clip", "title": "Live", "category": { "id": "15", "name": "Just Chatting", "slug": "just-chatting", "url": "https://kick.com/category/just-chatting" }, "language": null, "durationSeconds": 50, "recording": false, "mature": true, "tags": [], "curator": { "id": "141775885", "username": "trendkiddlive1", "displayName": "Trendkiddlive1", "avatarUrl": null, "verified": false, "url": "https://kick.com/trendkiddlive1" }, "videoId": null, "videoOffsetSeconds": 0 } }, { "id": "clip_01M8CGJK5XC83NW14KGQK6JNDJ", "url": "https://kick.com/tjnv/clips/clip_01M8CGJK5XC83NW14KGQK6JNDJ", "text": "i cant be a hostage, i am incredibley busy", "createdAt": "2026-11-26T18:09:26.828Z", "author": { "id": "63989494", "username": "tjnv", "displayName": "tjnv", "avatarUrl": "https://files.kick.com/images/user/65136534/profile_image/conversion/91da82d0-40b9-4c5c-bb1e-35bcf139dbe7-thumb.webp", "verified": false, "url": "https://kick.com/tjnv" }, "stats": { "views": 5801, "likes": 0, "comments": null, "shares": null, "saves": null, "engagementRate": 0 }, "media": [ { "kind": "video", "url": "https://clips.kick.com/clips/7a/clip_01M8CGJK5XC83NW14KGQK6JNDJ/master.m3u8", "thumbnailUrl": "https://clips.kick.com/clips/7a/clip_01M8CGJK5XC83NW14KGQK6JNDJ/thumbnail.webp", "width": null, "height": null, "durationSeconds": 68 } ], "hashtags": [], "mentions": [], "ext": { "kind": "clip", "title": "i cant be a hostage, i am incredibley busy", "category": { "id": "8", "name": "Grand Theft Auto V (GTA)", "slug": "grand-theft-auto-v", "url": "https://kick.com/category/grand-theft-auto-v" }, "language": null, "durationSeconds": 68, "recording": false, "mature": false, "tags": [], "curator": { "id": "22538834", "username": "cmmj7", "displayName": "Cmmj7", "avatarUrl": null, "verified": false, "url": "https://kick.com/cmmj7" }, "videoId": null, "videoOffsetSeconds": 0 } } ], "pagination": { "nextCursor": "clip_01M8D5M33YWHD2B9QV0ZKR6ETM", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/kick/trending/clips": { "get": { "tags": [ "Kick" ], "summary": "The site's most viewed clips, 20 a page.", "description": "Of the last day, week, month or all time, from every channel. 1 credit a page.", "operationId": "kickTrendingClips", "parameters": [ { "name": "period", "in": "query", "description": "How far back: `day`, `week` (the default), `month` or `all`.", "required": false, "schema": { "type": "string", "description": "How far back a list of clips looks.", "enum": [ "day", "week", "month", "all" ] } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_KickPost" }, "example": { "data": [ { "id": "clip_01M8BDF182KQ1MBPCD5SMEDBGQ", "url": "https://kick.com/traedakidd/clips/clip_01M8BDF182KQ1MBPCD5SMEDBGQ", "text": "Live", "createdAt": "2026-11-26T07:52:49.923Z", "author": { "id": "129084711", "username": "traedakidd", "displayName": "traedakidd", "avatarUrl": "https://files.kick.com/images/user/130350272/profile_image/conversion/3d015ee1-06b2-457d-b18d-392296532e38-thumb.webp", "verified": false, "url": "https://kick.com/traedakidd" }, "stats": { "views": 7195, "likes": 0, "comments": null, "shares": null, "saves": null, "engagementRate": 0 }, "media": [ { "kind": "video", "url": "https://clips.kick.com/clips/9a/clip_01M8BDF182KQ1MBPCD5SMEDBGQ/playlist.m3u8", "thumbnailUrl": "https://clips.kick.com/clips/9a/clip_01M8BDF182KQ1MBPCD5SMEDBGQ/thumbnail.webp", "width": null, "height": null, "durationSeconds": 50 } ], "hashtags": [], "mentions": [], "ext": { "kind": "clip", "title": "Live", "category": { "id": "15", "name": "Just Chatting", "slug": "just-chatting", "url": "https://kick.com/category/just-chatting" }, "language": null, "durationSeconds": 50, "recording": false, "mature": true, "tags": [], "curator": { "id": "141775885", "username": "trendkiddlive1", "displayName": "Trendkiddlive1", "avatarUrl": null, "verified": false, "url": "https://kick.com/trendkiddlive1" }, "videoId": null, "videoOffsetSeconds": 0 } }, { "id": "clip_01M8CGJK5XC83NW14KGQK6JNDJ", "url": "https://kick.com/tjnv/clips/clip_01M8CGJK5XC83NW14KGQK6JNDJ", "text": "i cant be a hostage, i am incredibley busy", "createdAt": "2026-11-26T18:09:26.828Z", "author": { "id": "63989494", "username": "tjnv", "displayName": "tjnv", "avatarUrl": "https://files.kick.com/images/user/65136534/profile_image/conversion/91da82d0-40b9-4c5c-bb1e-35bcf139dbe7-thumb.webp", "verified": false, "url": "https://kick.com/tjnv" }, "stats": { "views": 5801, "likes": 0, "comments": null, "shares": null, "saves": null, "engagementRate": 0 }, "media": [ { "kind": "video", "url": "https://clips.kick.com/clips/7a/clip_01M8CGJK5XC83NW14KGQK6JNDJ/master.m3u8", "thumbnailUrl": "https://clips.kick.com/clips/7a/clip_01M8CGJK5XC83NW14KGQK6JNDJ/thumbnail.webp", "width": null, "height": null, "durationSeconds": 68 } ], "hashtags": [], "mentions": [], "ext": { "kind": "clip", "title": "i cant be a hostage, i am incredibley busy", "category": { "id": "8", "name": "Grand Theft Auto V (GTA)", "slug": "grand-theft-auto-v", "url": "https://kick.com/category/grand-theft-auto-v" }, "language": null, "durationSeconds": 68, "recording": false, "mature": false, "tags": [], "curator": { "id": "22538834", "username": "cmmj7", "displayName": "Cmmj7", "avatarUrl": null, "verified": false, "url": "https://kick.com/cmmj7" }, "videoId": null, "videoOffsetSeconds": 0 } } ], "pagination": { "nextCursor": "clip_01M8D5M33YWHD2B9QV0ZKR6ETM", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.kick.trendingClips({ period: \"day\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.kick.trending_clips(period=\"day\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/kick/trending/clips \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"period=day\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_KickPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/KickPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "KickPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "kind", "recording", "mature", "tags" ], "properties": { "category": { "oneOf": [ { "$ref": "#/components/schemas/KickCategoryRef" }, { "type": "null" } ] }, "curator": { "oneOf": [ { "$ref": "#/components/schemas/Author", "description": "Who cut the clip." }, { "type": "null" } ] }, "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "kind": { "$ref": "#/components/schemas/KickPostKind" }, "language": { "type": [ "string", "null" ], "description": "The broadcast's language, as Kick names it (`English`)." }, "mature": { "type": "boolean", "description": "Marked for adults." }, "recording": { "type": "boolean", "description": "A broadcast still on air: its video is being recorded, and grows." }, "tags": { "type": "array", "items": { "type": "string" }, "description": "The tags its channel gave the broadcast." }, "title": { "type": [ "string", "null" ], "description": "The title (`text` says the same: Kick's posts have no other text)." }, "videoId": { "type": [ "string", "null" ], "description": "The video a clip was cut from, and where in it, in seconds." }, "videoOffsetSeconds": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A video (a past broadcast) or a clip." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "KickPostKind": { "type": "string", "description": "What a post is.", "enum": [ "video", "clip" ] }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } }, "KickCategoryRef": { "type": "object", "description": "A category as a channel, a video, a clip or a broadcast names it.", "required": [ "id", "name" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "slug": { "type": [ "string", "null" ], "description": "The name in its link (`just-chatting`)." }, "url": { "type": [ "string", "null" ] } } }, "Timestamp": { "type": "string", "format": "date-time" } } } } ``` # Trending (/docs/api-reference/kick/trending) The live broadcasts most watched now, 50 a page. `GET https://api.socialapi.sh/v1/kick/trending` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.kick.trending(); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.kick.trending() ``` **cURL** ```bash curl https://api.socialapi.sh/v1/kick/trending \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" ``` **Response** ```json { "data": [ { "live": true, "roomId": "01a21c21-86e8-76f1-92f6-6dacbf7aec4e", "title": "!MT | بث 30 يوم - اليوم السابع والعشرين | #SXBThone", "viewers": 91967, "startedAt": "2026-11-27T08:31:29.000Z", "coverUrl": "https://web.kick.com/api/v1/channels/17883767/thumbnail.jpeg?height=720", "host": { "id": "17883767", "username": "sxb", "displayName": "SXB", "avatarUrl": "https://files.kick.com/images/user/18838562/profile_image/conversion/8a124c9d-761a-4e7e-93ed-03cccaa11c02-medium.webp", "verified": false, "url": "https://kick.com/sxb" }, "ext": { "category": { "id": "8", "name": "Grand Theft Auto V (GTA)", "slug": "grand-theft-auto-v", "url": "https://kick.com/category/grand-theft-auto-v" }, "language": "ar", "tags": [], "mature": false, "playbackUrl": null } }, { "live": true, "roomId": "01a21d91-2c18-73bb-b3a1-0286d3558888", "title": "BIGG BOSS WATCH PARTY - SUPPORT SCOUTOP", "viewers": 38553, "startedAt": "2026-11-27T15:13:03.000Z", "coverUrl": "https://web.kick.com/api/v1/channels/105409796/thumbnail.jpeg?height=720", "host": { "id": "105409796", "username": "kaashplays", "displayName": "Kaashplays", "avatarUrl": "https://files.kick.com/images/user/106644581/profile_image/conversion/02f2388a-dfd4-42f4-9851-28c5e4fdb668-medium.webp", "verified": false, "url": "https://kick.com/kaashplays" }, "ext": { "category": { "id": "15", "name": "Just Chatting", "slug": "just-chatting", "url": "https://kick.com/category/just-chatting" }, "language": "en-IN", "tags": [], "mature": false, "playbackUrl": null } } ], "pagination": { "nextCursor": "eyJvIjo1MH0", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/kick/trending": { "get": { "tags": [ "Kick" ], "summary": "The live broadcasts most watched now, 50 a page.", "description": "Across every category, or Kick's own pick first (`featured`, as its home page), by\nlanguage if asked. 1 credit a page.", "operationId": "kickTrending", "parameters": [ { "name": "sort", "in": "query", "description": "`viewers` (the default) or `featured`.", "required": false, "schema": { "type": "string", "description": "How a list of live broadcasts is ordered.", "enum": [ "viewers", "featured" ] } }, { "name": "language", "in": "query", "description": "Only broadcasts in this language (`en`, `tr`).", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_KickLive" }, "example": { "data": [ { "live": true, "roomId": "01a21c21-86e8-76f1-92f6-6dacbf7aec4e", "title": "!MT | بث 30 يوم - اليوم السابع والعشرين | #SXBThone", "viewers": 91967, "startedAt": "2026-11-27T08:31:29.000Z", "coverUrl": "https://web.kick.com/api/v1/channels/17883767/thumbnail.jpeg?height=720", "host": { "id": "17883767", "username": "sxb", "displayName": "SXB", "avatarUrl": "https://files.kick.com/images/user/18838562/profile_image/conversion/8a124c9d-761a-4e7e-93ed-03cccaa11c02-medium.webp", "verified": false, "url": "https://kick.com/sxb" }, "ext": { "category": { "id": "8", "name": "Grand Theft Auto V (GTA)", "slug": "grand-theft-auto-v", "url": "https://kick.com/category/grand-theft-auto-v" }, "language": "ar", "tags": [], "mature": false, "playbackUrl": null } }, { "live": true, "roomId": "01a21d91-2c18-73bb-b3a1-0286d3558888", "title": "BIGG BOSS WATCH PARTY - SUPPORT SCOUTOP", "viewers": 38553, "startedAt": "2026-11-27T15:13:03.000Z", "coverUrl": "https://web.kick.com/api/v1/channels/105409796/thumbnail.jpeg?height=720", "host": { "id": "105409796", "username": "kaashplays", "displayName": "Kaashplays", "avatarUrl": "https://files.kick.com/images/user/106644581/profile_image/conversion/02f2388a-dfd4-42f4-9851-28c5e4fdb668-medium.webp", "verified": false, "url": "https://kick.com/kaashplays" }, "ext": { "category": { "id": "15", "name": "Just Chatting", "slug": "just-chatting", "url": "https://kick.com/category/just-chatting" }, "language": "en-IN", "tags": [], "mature": false, "playbackUrl": null } } ], "pagination": { "nextCursor": "eyJvIjo1MH0", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.kick.trending();" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.kick.trending()" }, { "lang": "bash", "label": "cURL", "source": "curl https://api.socialapi.sh/v1/kick/trending \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_KickLive": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/KickLive" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "KickLive": { "allOf": [ { "type": "object", "description": "An account's live broadcast.", "required": [ "live", "ext" ], "properties": { "coverUrl": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "tags", "mature" ], "properties": { "category": { "oneOf": [ { "$ref": "#/components/schemas/KickCategoryRef" }, { "type": "null" } ] }, "language": { "type": [ "string", "null" ], "description": "The broadcast's language (`en`, or as Kick names it, `English`)." }, "mature": { "type": "boolean", "description": "Marked for adults." }, "playbackUrl": { "type": [ "string", "null" ], "description": "Its stream's HLS playlist; on `/live` only. It carries a token that expires." }, "tags": { "type": "array", "items": { "type": "string" }, "description": "The tags the channel gave the broadcast." } } }, { "type": "object", "description": "What only this platform has." } ] }, "host": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "live": { "type": "boolean" }, "roomId": { "type": [ "string", "null" ] }, "startedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "title": { "type": [ "string", "null" ] }, "viewers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, { "type": "object", "description": "A live broadcast, or a channel's live status." } ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } }, "KickCategoryRef": { "type": "object", "description": "A category as a channel, a video, a clip or a broadcast names it.", "required": [ "id", "name" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "slug": { "type": [ "string", "null" ], "description": "The name in its link (`just-chatting`)." }, "url": { "type": [ "string", "null" ] } } } } } } ``` # Ad (/docs/api-reference/linkedin/ad) One ad with who paid for it and its reach. `GET https://api.socialapi.sh/v1/linkedin/ad` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.linkedin.ad({ url: "https://www.linkedin.com/ad-library/detail/1646153623" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.linkedin.ad(url="https://www.linkedin.com/ad-library/detail/1646153623").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/linkedin/ad \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://www.linkedin.com/ad-library/detail/1646153623" ``` **Response** ```json { "data": { "id": "1646153623", "url": "https://www.linkedin.com/ad-library/detail/1646153623", "advertiser": { "name": "Sappi Packaging and Speciality Papers", "url": "https://www.linkedin.com/company/37832034" }, "advertiserLogoUrl": "https://media.licdn.com/dms/image/v2/C4D0BAQFAHnUBiwFAfQ/company-logo_100_100/company-logo_100_100/0/1630458380992/sappi_packaging_and_speciality_papers_logo?e=1797465600&v=beta&t=IlR9hfqHqOSswfHwAhR73W8RWE8k1q3QjfimeaYS4Jg", "payer": "Sappi Papier Holding GmbH", "creativeType": "SPONSORED_UPDATE_CAROUSEL", "format": "Carousel Ad", "text": "Discover how Sappi's barrier papers help protect tea quality, supported by shelf-life testing and commercial production results.", "headline": null, "destinationUrl": "https://www.sappi.com/en-gb/insights/campaigns/its-not-plastic-its-fantastic", "media": [ { "kind": "image", "url": "https://media.licdn.com/dms/image/v2/D4D10AQGhm7x4oJi0iQ/image-shrink_1280/B4DaIIGmz7J0AM-/0/1795432279678?e=1796461200&v=beta&t=XaT-HQxyYPWX3I4jGwzmAgtzHTu41XcYe9BFhezPhQw", "thumbnailUrl": null, "width": null, "height": null, "durationSeconds": null }, { "kind": "image", "url": "https://media.licdn.com/dms/image/v2/D4D10AQHjOswxPV9d_w/image-shrink_1280/B4DaIIGm0kKIAI-/0/1795432279791?e=1796461200&v=beta&t=1YKJB4-EIJqEw3aphs-TUWZNk5ce51Y_vZWC7hcr0nc", "thumbnailUrl": null, "width": null, "height": null, "durationSeconds": null }, { "kind": "image", "url": "https://media.licdn.com/dms/image/v2/D4D10AQGqon8iLJdHUw/image-shrink_1280/B4DaIIGnLOJIAI-/0/1795432281252?e=1796461200&v=beta&t=9Q1knEE2Dc0fTECe96kYztauV3xbbhTxsZRl-GPlCpQ", "thumbnailUrl": null, "width": null, "height": null, "durationSeconds": null } ], "ranFrom": "2026-11-25T00:00:00.000Z", "ranTo": "2026-11-27T00:00:00.000Z", "impressions": "1k-5k", "impressionsByCountry": [ { "country": "India", "percent": 34 }, { "country": "Pakistan", "percent": 12 }, { "country": "United Kingdom", "percent": 11 } ], "targeting": [ { "parameter": "Language", "includes": "English", "targeted": null, "excluded": null }, { "parameter": "Location", "includes": "North America, Asia and Europe, Africa, Oceania, Latin America", "targeted": null, "excluded": null }, { "parameter": "Audience", "includes": null, "targeted": false, "excluded": false } ] } } ``` **OpenAPI** ```json { "paths": { "/v1/linkedin/ad": { "get": { "tags": [ "LinkedIn" ], "summary": "One ad with who paid for it and its reach.", "description": "Its advertiser, payer, format, text, media and link; for an ad shown in the EU, when it\nran, its impressions, their split by country, and its targeting. 1 credit.", "operationId": "linkedinAd", "parameters": [ { "name": "url", "in": "query", "description": "The ad's link in the Ad Library (`https://www.linkedin.com/ad-library/detail/…`).", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "Its number (`1703848596`), instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_LinkedInAd" }, "example": { "data": { "id": "1646153623", "url": "https://www.linkedin.com/ad-library/detail/1646153623", "advertiser": { "name": "Sappi Packaging and Speciality Papers", "url": "https://www.linkedin.com/company/37832034" }, "advertiserLogoUrl": "https://media.licdn.com/dms/image/v2/C4D0BAQFAHnUBiwFAfQ/company-logo_100_100/company-logo_100_100/0/1630458380992/sappi_packaging_and_speciality_papers_logo?e=1797465600&v=beta&t=IlR9hfqHqOSswfHwAhR73W8RWE8k1q3QjfimeaYS4Jg", "payer": "Sappi Papier Holding GmbH", "creativeType": "SPONSORED_UPDATE_CAROUSEL", "format": "Carousel Ad", "text": "Discover how Sappi's barrier papers help protect tea quality, supported by shelf-life testing and commercial production results.", "headline": null, "destinationUrl": "https://www.sappi.com/en-gb/insights/campaigns/its-not-plastic-its-fantastic", "media": [ { "kind": "image", "url": "https://media.licdn.com/dms/image/v2/D4D10AQGhm7x4oJi0iQ/image-shrink_1280/B4DaIIGmz7J0AM-/0/1795432279678?e=1796461200&v=beta&t=XaT-HQxyYPWX3I4jGwzmAgtzHTu41XcYe9BFhezPhQw", "thumbnailUrl": null, "width": null, "height": null, "durationSeconds": null }, { "kind": "image", "url": "https://media.licdn.com/dms/image/v2/D4D10AQHjOswxPV9d_w/image-shrink_1280/B4DaIIGm0kKIAI-/0/1795432279791?e=1796461200&v=beta&t=1YKJB4-EIJqEw3aphs-TUWZNk5ce51Y_vZWC7hcr0nc", "thumbnailUrl": null, "width": null, "height": null, "durationSeconds": null }, { "kind": "image", "url": "https://media.licdn.com/dms/image/v2/D4D10AQGqon8iLJdHUw/image-shrink_1280/B4DaIIGnLOJIAI-/0/1795432281252?e=1796461200&v=beta&t=9Q1knEE2Dc0fTECe96kYztauV3xbbhTxsZRl-GPlCpQ", "thumbnailUrl": null, "width": null, "height": null, "durationSeconds": null } ], "ranFrom": "2026-11-25T00:00:00.000Z", "ranTo": "2026-11-27T00:00:00.000Z", "impressions": "1k-5k", "impressionsByCountry": [ { "country": "India", "percent": 34 }, { "country": "Pakistan", "percent": 12 }, { "country": "United Kingdom", "percent": 11 } ], "targeting": [ { "parameter": "Language", "includes": "English", "targeted": null, "excluded": null }, { "parameter": "Location", "includes": "North America, Asia and Europe, Africa, Oceania, Latin America", "targeted": null, "excluded": null }, { "parameter": "Audience", "includes": null, "targeted": false, "excluded": false } ] } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.linkedin.ad({ url: \"https://www.linkedin.com/ad-library/detail/1646153623\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.linkedin.ad(url=\"https://www.linkedin.com/ad-library/detail/1646153623\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/linkedin/ad \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://www.linkedin.com/ad-library/detail/1646153623\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_LinkedInAd": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/LinkedInAd" } } }, "LinkedInAd": { "type": "object", "description": "An ad, as LinkedIn's Ad Library shows it.", "required": [ "id", "url", "media", "impressionsByCountry", "targeting" ], "properties": { "advertiser": { "oneOf": [ { "$ref": "#/components/schemas/LinkedInEntityRef" }, { "type": "null" } ] }, "advertiserLogoUrl": { "type": [ "string", "null" ] }, "creativeType": { "type": [ "string", "null" ], "description": "Its format as LinkedIn names it (`SPONSORED_UPDATE_CAROUSEL`)." }, "destinationUrl": { "type": [ "string", "null" ], "description": "Where it sends a click." }, "format": { "type": [ "string", "null" ], "description": "Its format as the library writes it (`Video Ad`, `Carousel Ad`; its page only)." }, "headline": { "type": [ "string", "null" ], "description": "Its headline, or its carousel's first card's." }, "id": { "type": "string" }, "impressions": { "type": [ "string", "null" ], "description": "Its impressions, as the library buckets them (`1k-5k`; EU ads only)." }, "impressionsByCountry": { "type": "array", "items": { "$ref": "#/components/schemas/LinkedInAdCountry" } }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "payer": { "type": [ "string", "null" ], "description": "Who paid for it (`Paid for by …`)." }, "ranFrom": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "When it ran (its page only, for ads shown in the EU)." }, { "type": "null" } ] }, "ranTo": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "targeting": { "type": "array", "items": { "$ref": "#/components/schemas/LinkedInAdTargeting" } }, "text": { "type": [ "string", "null" ] }, "url": { "type": "string" } } }, "LinkedInAdTargeting": { "type": "object", "description": "One of an ad's targeting parameters, as the Ad Library lists it.", "required": [ "parameter" ], "properties": { "excluded": { "type": [ "boolean", "null" ] }, "includes": { "type": [ "string", "null" ], "description": "What it includes, where the library says (`English`; `North America, Asia, …`)." }, "parameter": { "type": "string", "description": "`Language`, `Location`, `Audience`, `Company`, `Job`…" }, "targeted": { "type": [ "boolean", "null" ] } } }, "Timestamp": { "type": "string", "format": "date-time" }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "LinkedInAdCountry": { "type": "object", "description": "An ad's share of its impressions in one country.", "required": [ "country", "percent" ], "properties": { "country": { "type": "string" }, "percent": { "type": "integer", "format": "int32", "minimum": 0 } } }, "LinkedInEntityRef": { "type": "object", "description": "A company, a school or a member as a page names it in passing.", "required": [ "name" ], "properties": { "name": { "type": "string" }, "url": { "type": [ "string", "null" ], "description": "Its LinkedIn page, when the page links it." } } } } } } ``` # Ads Search (/docs/api-reference/linkedin/ads-search) Ads from LinkedIn's Ad Library, 24 a page. `GET https://api.socialapi.sh/v1/linkedin/ads/search` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.linkedin.adsSearch({ advertiser: "Microsoft" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.linkedin.ads_search(advertiser="Microsoft") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/linkedin/ads/search \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "advertiser=Microsoft" ``` **Response** ```json { "data": [ { "id": "1703848596", "url": "https://www.linkedin.com/ad-library/detail/1703848596", "advertiser": { "name": "Microsoft", "url": null }, "advertiserLogoUrl": "https://media.licdn.com/dms/image/v2/D560BAQH32RJQCl3dDQ/company-logo_100_100/B56ZYQ0mrGGoAU-/0/1744038948046/microsoft_logo?e=1797465600&v=beta&t=1mPm7MOEs16AU_Y5ecOnYzho5hPhO-RAz2_mHEBSLv0", "payer": null, "creativeType": "SPONSORED_VIDEO", "format": "Video Ad", "text": "Watch highlights from the opening of the #MSIgnite keynote and see how we’re building a frontier ecosystem to turn advan…", "headline": "Microsoft Ignite: Opening Keynote 2026", "destinationUrl": null, "media": [ { "kind": "image", "url": "https://media.licdn.com/dms/image/v2/D5610AQEXO53W5nwXIw/videocover-high/B56aITyVLvJEBI-/0/1795628302749?e=2147483647&v=beta&t=KFov1bdOpv0ltuVE0tFnKWcS-p62WjG3nE-sz2TsOeI", "thumbnailUrl": null, "width": null, "height": null, "durationSeconds": null } ], "ranFrom": null, "ranTo": null, "impressions": null, "impressionsByCountry": [], "targeting": [] }, { "id": "1703747846", "url": "https://www.linkedin.com/ad-library/detail/1703747846", "advertiser": { "name": "Microsoft", "url": null }, "advertiserLogoUrl": "https://media.licdn.com/dms/image/v2/D560BAQH32RJQCl3dDQ/company-logo_100_100/B56ZYQ0mrGGoAU-/0/1744038948046/microsoft_logo?e=1797465600&v=beta&t=1mPm7MOEs16AU_Y5ecOnYzho5hPhO-RAz2_mHEBSLv0", "payer": null, "creativeType": "SPONSORED_UPDATE_CAROUSEL", "format": "Carousel Ad", "text": "Toronto, get ready for #MicrosoftFrontierTour on Jan 13. Explore what’s next in AI through expert sessions and hands-on …", "headline": null, "destinationUrl": null, "media": [ { "kind": "image", "url": "https://media.licdn.com/dms/image/v2/D5610AQEoIpVFUI2ieg/image-shrink_1280/B56aIPGxhjKUAI-/0/1795549764014?e=1796461200&v=beta&t=wyA6QwGcuYedNV6oxpFJgTh4LBvQWJK2283SubEXTwI", "thumbnailUrl": null, "width": null, "height": null, "durationSeconds": null }, { "kind": "image", "url": "https://media.licdn.com/dms/image/v2/D5610AQHBhvUGjdiPeQ/image-pad_1200_1200/B4DaITNXfzHYAU-/0/1795618601502?e=1796461200&v=beta&t=UXIAqRjy47cp3koYcSLKKjwh6IeH1C2Eo8-xzqgFu6M", "thumbnailUrl": null, "width": null, "height": null, "durationSeconds": null }, { "kind": "image", "url": "https://media.licdn.com/dms/image/v2/D5610AQE_uC5f3Kluyw/image-pad_1200_1200/B4DaITNXfWKcAU-/0/1795618601262?e=1796461200&v=beta&t=y4MVqMZ4hw-XxsTQHgwolQnOsigrKfksT-KT6uWAnVc", "thumbnailUrl": null, "width": null, "height": null, "durationSeconds": null } ], "ranFrom": null, "ranTo": null, "impressions": null, "impressionsByCountry": [], "targeting": [] } ], "pagination": { "nextCursor": "1651866384-1795616789676", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/linkedin/ads/search": { "get": { "tags": [ "LinkedIn" ], "summary": "Ads from LinkedIn's Ad Library, 24 a page.", "description": "The ads of an `advertiser`, a `payer` or with words (`query`), shown in a `country`,\nover a `period` (a year back at most): each with its advertiser, format, text,\nheadline and media. 1 credit a page.", "operationId": "linkedinAdsSearch", "parameters": [ { "name": "advertiser", "in": "query", "description": "The advertiser's name (`Microsoft`).", "required": false, "schema": { "type": "string" } }, { "name": "payer", "in": "query", "description": "Who paid for the ads, as the library names it.", "required": false, "schema": { "type": "string" } }, { "name": "query", "in": "query", "description": "Words in the ads.", "required": false, "schema": { "type": "string" } }, { "name": "country", "in": "query", "description": "Where the ads were shown, by its ISO code (`DE`); everywhere by default. Ads shown\nin the EU carry their impressions and targeting.", "required": false, "schema": { "type": "string" } }, { "name": "period", "in": "query", "description": "`last-30-days`, `current-month`, `current-year` or `last-year`; any time (since a\nyear ago) by default.", "required": false, "schema": { "type": "string", "description": "How far back an Ad Library search looks.", "enum": [ "last-30-days", "current-month", "current-year", "last-year" ] } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_LinkedInAd" }, "example": { "data": [ { "id": "1703848596", "url": "https://www.linkedin.com/ad-library/detail/1703848596", "advertiser": { "name": "Microsoft", "url": null }, "advertiserLogoUrl": "https://media.licdn.com/dms/image/v2/D560BAQH32RJQCl3dDQ/company-logo_100_100/B56ZYQ0mrGGoAU-/0/1744038948046/microsoft_logo?e=1797465600&v=beta&t=1mPm7MOEs16AU_Y5ecOnYzho5hPhO-RAz2_mHEBSLv0", "payer": null, "creativeType": "SPONSORED_VIDEO", "format": "Video Ad", "text": "Watch highlights from the opening of the #MSIgnite keynote and see how we’re building a frontier ecosystem to turn advan…", "headline": "Microsoft Ignite: Opening Keynote 2026", "destinationUrl": null, "media": [ { "kind": "image", "url": "https://media.licdn.com/dms/image/v2/D5610AQEXO53W5nwXIw/videocover-high/B56aITyVLvJEBI-/0/1795628302749?e=2147483647&v=beta&t=KFov1bdOpv0ltuVE0tFnKWcS-p62WjG3nE-sz2TsOeI", "thumbnailUrl": null, "width": null, "height": null, "durationSeconds": null } ], "ranFrom": null, "ranTo": null, "impressions": null, "impressionsByCountry": [], "targeting": [] }, { "id": "1703747846", "url": "https://www.linkedin.com/ad-library/detail/1703747846", "advertiser": { "name": "Microsoft", "url": null }, "advertiserLogoUrl": "https://media.licdn.com/dms/image/v2/D560BAQH32RJQCl3dDQ/company-logo_100_100/B56ZYQ0mrGGoAU-/0/1744038948046/microsoft_logo?e=1797465600&v=beta&t=1mPm7MOEs16AU_Y5ecOnYzho5hPhO-RAz2_mHEBSLv0", "payer": null, "creativeType": "SPONSORED_UPDATE_CAROUSEL", "format": "Carousel Ad", "text": "Toronto, get ready for #MicrosoftFrontierTour on Jan 13. Explore what’s next in AI through expert sessions and hands-on …", "headline": null, "destinationUrl": null, "media": [ { "kind": "image", "url": "https://media.licdn.com/dms/image/v2/D5610AQEoIpVFUI2ieg/image-shrink_1280/B56aIPGxhjKUAI-/0/1795549764014?e=1796461200&v=beta&t=wyA6QwGcuYedNV6oxpFJgTh4LBvQWJK2283SubEXTwI", "thumbnailUrl": null, "width": null, "height": null, "durationSeconds": null }, { "kind": "image", "url": "https://media.licdn.com/dms/image/v2/D5610AQHBhvUGjdiPeQ/image-pad_1200_1200/B4DaITNXfzHYAU-/0/1795618601502?e=1796461200&v=beta&t=UXIAqRjy47cp3koYcSLKKjwh6IeH1C2Eo8-xzqgFu6M", "thumbnailUrl": null, "width": null, "height": null, "durationSeconds": null }, { "kind": "image", "url": "https://media.licdn.com/dms/image/v2/D5610AQE_uC5f3Kluyw/image-pad_1200_1200/B4DaITNXfWKcAU-/0/1795618601262?e=1796461200&v=beta&t=y4MVqMZ4hw-XxsTQHgwolQnOsigrKfksT-KT6uWAnVc", "thumbnailUrl": null, "width": null, "height": null, "durationSeconds": null } ], "ranFrom": null, "ranTo": null, "impressions": null, "impressionsByCountry": [], "targeting": [] } ], "pagination": { "nextCursor": "1651866384-1795616789676", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.linkedin.adsSearch({ advertiser: \"Microsoft\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.linkedin.ads_search(advertiser=\"Microsoft\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/linkedin/ads/search \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"advertiser=Microsoft\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_LinkedInAd": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/LinkedInAd" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "LinkedInAd": { "type": "object", "description": "An ad, as LinkedIn's Ad Library shows it.", "required": [ "id", "url", "media", "impressionsByCountry", "targeting" ], "properties": { "advertiser": { "oneOf": [ { "$ref": "#/components/schemas/LinkedInEntityRef" }, { "type": "null" } ] }, "advertiserLogoUrl": { "type": [ "string", "null" ] }, "creativeType": { "type": [ "string", "null" ], "description": "Its format as LinkedIn names it (`SPONSORED_UPDATE_CAROUSEL`)." }, "destinationUrl": { "type": [ "string", "null" ], "description": "Where it sends a click." }, "format": { "type": [ "string", "null" ], "description": "Its format as the library writes it (`Video Ad`, `Carousel Ad`; its page only)." }, "headline": { "type": [ "string", "null" ], "description": "Its headline, or its carousel's first card's." }, "id": { "type": "string" }, "impressions": { "type": [ "string", "null" ], "description": "Its impressions, as the library buckets them (`1k-5k`; EU ads only)." }, "impressionsByCountry": { "type": "array", "items": { "$ref": "#/components/schemas/LinkedInAdCountry" } }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "payer": { "type": [ "string", "null" ], "description": "Who paid for it (`Paid for by …`)." }, "ranFrom": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "When it ran (its page only, for ads shown in the EU)." }, { "type": "null" } ] }, "ranTo": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "targeting": { "type": "array", "items": { "$ref": "#/components/schemas/LinkedInAdTargeting" } }, "text": { "type": [ "string", "null" ] }, "url": { "type": "string" } } }, "LinkedInAdTargeting": { "type": "object", "description": "One of an ad's targeting parameters, as the Ad Library lists it.", "required": [ "parameter" ], "properties": { "excluded": { "type": [ "boolean", "null" ] }, "includes": { "type": [ "string", "null" ], "description": "What it includes, where the library says (`English`; `North America, Asia, …`)." }, "parameter": { "type": "string", "description": "`Language`, `Location`, `Audience`, `Company`, `Job`…" }, "targeted": { "type": [ "boolean", "null" ] } } }, "Timestamp": { "type": "string", "format": "date-time" }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "LinkedInAdCountry": { "type": "object", "description": "An ad's share of its impressions in one country.", "required": [ "country", "percent" ], "properties": { "country": { "type": "string" }, "percent": { "type": "integer", "format": "int32", "minimum": 0 } } }, "LinkedInEntityRef": { "type": "object", "description": "A company, a school or a member as a page names it in passing.", "required": [ "name" ], "properties": { "name": { "type": "string" }, "url": { "type": [ "string", "null" ], "description": "Its LinkedIn page, when the page links it." } } } } } } ``` # Article (/docs/api-reference/linkedin/article) An article with its text, reactions and comments. `GET https://api.socialapi.sh/v1/linkedin/article` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.linkedin.article({ url: "https://www.linkedin.com/pulse/how-guinea-beat-tsetse-fly-bill-gates-6mxue" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.linkedin.article(url="https://www.linkedin.com/pulse/how-guinea-beat-tsetse-fly-bill-gates-6mxue").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/linkedin/article \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://www.linkedin.com/pulse/how-guinea-beat-tsetse-fly-bill-gates-6mxue" ``` **Response** ```json { "data": { "id": "how-guinea-beat-tsetse-fly-bill-gates-6mxue", "url": "https://www.linkedin.com/pulse/how-guinea-beat-tsetse-fly-bill-gates-6mxue", "text": "The first sleeping sickness patient that Dr. Mamadou Camara ever diagnosed and treated was brought to him tied up. He’d become so agitated that people around him thought he’d gone mad or been cursed by someone practicing witchcraft; they didn’t know what else to do.\n\nA year later, a healthy young man walked up to greet him, but Mamadou had no idea who he was. Someone had to tell him: “That's Barry…", "createdAt": "2026-11-22T18:16:13.000Z", "author": { "id": "williamhgates", "username": "williamhgates", "displayName": "Bill Gates", "avatarUrl": "https://media.licdn.com/dms/image/v2/D5603AQF-RYZP55jmXA/profile-displayphoto-shrink_400_400/B56ZRi8g.aGsAg-/0/1736826818802?e=2147483647&v=beta&t=r6LJYwKPrJzfFDXVG8qAOoklQnqvEN855sHJ1NxhEAo", "verified": false, "url": "https://www.linkedin.com/in/williamhgates" }, "stats": { "views": null, "likes": 2099, "comments": 299, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://media.licdn.com/dms/image/v2/D4E12AQFcEFxrggBZaA/article-cover_image-shrink_720_1280/B4EaIEZSo9IYAU-/0/1795370068830?e=2147483647&v=beta&t=xp8tkGfC9zilVUZpm_S1mQqQY93Xl57Nks7iWzdFsDE", "thumbnailUrl": null, "width": null, "height": null, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "kind": "article", "title": "How Guinea beat the tsetse fly", "authorHeadline": null, "repostedBy": null, "urn": "urn:li:linkedInArticle:7530327862860726272", "reshared": null, "edited": false, "linkPreview": null, "captions": false, "language": null } } } ``` **OpenAPI** ```json { "paths": { "/v1/linkedin/article": { "get": { "tags": [ "LinkedIn" ], "summary": "An article with its text, reactions and comments.", "description": "An article (LinkedIn Pulse) whole: its title, text, cover, time, author, reactions and\ncomment count. 1 credit.", "operationId": "linkedinArticle", "parameters": [ { "name": "url", "in": "query", "description": "The article's link (`https://www.linkedin.com/pulse/…`).", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The name its link ends with (`how-guinea-beat-tsetse-fly-bill-gates-6mxue`), instead\nof `url`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_LinkedInPost" }, "example": { "data": { "id": "how-guinea-beat-tsetse-fly-bill-gates-6mxue", "url": "https://www.linkedin.com/pulse/how-guinea-beat-tsetse-fly-bill-gates-6mxue", "text": "The first sleeping sickness patient that Dr. Mamadou Camara ever diagnosed and treated was brought to him tied up. He’d become so agitated that people around him thought he’d gone mad or been cursed by someone practicing witchcraft; they didn’t know what else to do.\n\nA year later, a healthy young man walked up to greet him, but Mamadou had no idea who he was. Someone had to tell him: “That's Barry…", "createdAt": "2026-11-22T18:16:13.000Z", "author": { "id": "williamhgates", "username": "williamhgates", "displayName": "Bill Gates", "avatarUrl": "https://media.licdn.com/dms/image/v2/D5603AQF-RYZP55jmXA/profile-displayphoto-shrink_400_400/B56ZRi8g.aGsAg-/0/1736826818802?e=2147483647&v=beta&t=r6LJYwKPrJzfFDXVG8qAOoklQnqvEN855sHJ1NxhEAo", "verified": false, "url": "https://www.linkedin.com/in/williamhgates" }, "stats": { "views": null, "likes": 2099, "comments": 299, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://media.licdn.com/dms/image/v2/D4E12AQFcEFxrggBZaA/article-cover_image-shrink_720_1280/B4EaIEZSo9IYAU-/0/1795370068830?e=2147483647&v=beta&t=xp8tkGfC9zilVUZpm_S1mQqQY93Xl57Nks7iWzdFsDE", "thumbnailUrl": null, "width": null, "height": null, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "kind": "article", "title": "How Guinea beat the tsetse fly", "authorHeadline": null, "repostedBy": null, "urn": "urn:li:linkedInArticle:7530327862860726272", "reshared": null, "edited": false, "linkPreview": null, "captions": false, "language": null } } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.linkedin.article({ url: \"https://www.linkedin.com/pulse/how-guinea-beat-tsetse-fly-bill-gates-6mxue\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.linkedin.article(url=\"https://www.linkedin.com/pulse/how-guinea-beat-tsetse-fly-bill-gates-6mxue\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/linkedin/article \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://www.linkedin.com/pulse/how-guinea-beat-tsetse-fly-bill-gates-6mxue\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_LinkedInPost": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/LinkedInPost" } } }, "LinkedInPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "edited", "captions" ], "properties": { "authorHeadline": { "type": [ "string", "null" ], "description": "What its author says it does (a member's headline, a company's followers line)." }, "captions": { "type": "boolean", "description": "Whether its video has a caption file (`/v1/linkedin/post/transcript`)." }, "edited": { "type": "boolean" }, "kind": { "oneOf": [ { "$ref": "#/components/schemas/LinkedInPostKind" }, { "type": "null" } ] }, "language": { "type": [ "string", "null" ], "description": "Its video's language, as LinkedIn tagged it." }, "linkPreview": { "oneOf": [ { "$ref": "#/components/schemas/LinkedInLinkPreview" }, { "type": "null" } ] }, "repostedBy": { "type": [ "string", "null" ], "description": "Who reposted it, where a page lists another's post as its own activity." }, "reshared": { "type": [ "string", "null" ], "description": "The post it shares with words of its own, by its id (`/v1/linkedin/post`)." }, "title": { "type": [ "string", "null" ], "description": "An article's title." }, "urn": { "type": [ "string", "null" ], "description": "The share or `ugcPost` it is the activity of, as `urn:li:…`." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A LinkedIn post or article." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "LinkedInLinkPreview": { "type": "object", "description": "A link a post shares, as its card shows it.", "required": [ "url" ], "properties": { "subtitle": { "type": [ "string", "null" ], "description": "The site, or the article's author." }, "title": { "type": [ "string", "null" ] }, "url": { "type": "string" } } }, "LinkedInPostKind": { "type": "string", "description": "What a post is.", "enum": [ "post", "article" ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Company Jobs (/docs/api-reference/linkedin/company-jobs) A company's open jobs, 10 a page. `GET https://api.socialapi.sh/v1/linkedin/company/jobs` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.linkedin.companyJobs({ handle: "microsoft" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.linkedin.company_jobs(handle="microsoft") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/linkedin/company/jobs \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=microsoft" ``` **Response** ```json { "data": [ { "id": "4474182677", "url": "https://www.linkedin.com/jobs/view/4474182677/", "title": "Principal Applied Scientist-Ads Monetization", "company": { "name": "Microsoft", "url": "https://www.linkedin.com/company/microsoft" }, "companyLogoUrl": "https://media.licdn.com/dms/image/v2/D560BAQH32RJQCl3dDQ/company-logo_100_100/B56ZYQ0mrGGoAU-/0/1744038948046/microsoft_logo?e=2147483647&v=beta&t=rr_7_bFRKp6umQxIHErPOZHtR8dMPIYeTjlKFdotJBY", "location": "Redmond, WA", "postedAt": "2026-11-12T00:00:00.000Z", "posted": "2 weeks ago", "applicants": null, "salary": null, "insights": [ "Actively Hiring" ], "description": null, "seniority": null, "employmentType": null, "jobFunction": null, "industries": null }, { "id": "4485358429", "url": "https://www.linkedin.com/jobs/view/4485358429/", "title": "Senior Applied Scientist", "company": { "name": "Microsoft", "url": "https://www.linkedin.com/company/microsoft" }, "companyLogoUrl": "https://media.licdn.com/dms/image/v2/D560BAQH32RJQCl3dDQ/company-logo_100_100/B56ZYQ0mrGGoAU-/0/1744038948046/microsoft_logo?e=2147483647&v=beta&t=rr_7_bFRKp6umQxIHErPOZHtR8dMPIYeTjlKFdotJBY", "location": "Redmond, WA", "postedAt": "2026-11-21T00:00:00.000Z", "posted": "6 days ago", "applicants": null, "salary": null, "insights": [ "Actively Hiring" ], "description": null, "seniority": null, "employmentType": null, "jobFunction": null, "industries": null } ], "pagination": { "nextCursor": "10", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/linkedin/company/jobs": { "get": { "tags": [ "LinkedIn" ], "summary": "A company's open jobs, 10 a page.", "description": "The jobs its page's \"See jobs\" lists (its own and its subsidiaries'), or, by its\n`companyId` from `/v1/linkedin/search/companies`, its own: each with its title,\nlocation, the day it was posted and LinkedIn's notes on it; up to 1,000. 1 credit a\npage.", "operationId": "linkedinCompanyJobs", "parameters": [ { "name": "handle", "in": "query", "description": "The company's name in its page's link (`microsoft`); a showcase page's too.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "Its page's link, instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "companyId", "in": "query", "description": "The company by its id (`1035`), as `/v1/linkedin/search/companies` gives it, instead\nof `handle`: its own jobs alone, with no page to read first.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_LinkedInJob" }, "example": { "data": [ { "id": "4474182677", "url": "https://www.linkedin.com/jobs/view/4474182677/", "title": "Principal Applied Scientist-Ads Monetization", "company": { "name": "Microsoft", "url": "https://www.linkedin.com/company/microsoft" }, "companyLogoUrl": "https://media.licdn.com/dms/image/v2/D560BAQH32RJQCl3dDQ/company-logo_100_100/B56ZYQ0mrGGoAU-/0/1744038948046/microsoft_logo?e=2147483647&v=beta&t=rr_7_bFRKp6umQxIHErPOZHtR8dMPIYeTjlKFdotJBY", "location": "Redmond, WA", "postedAt": "2026-11-12T00:00:00.000Z", "posted": "2 weeks ago", "applicants": null, "salary": null, "insights": [ "Actively Hiring" ], "description": null, "seniority": null, "employmentType": null, "jobFunction": null, "industries": null }, { "id": "4485358429", "url": "https://www.linkedin.com/jobs/view/4485358429/", "title": "Senior Applied Scientist", "company": { "name": "Microsoft", "url": "https://www.linkedin.com/company/microsoft" }, "companyLogoUrl": "https://media.licdn.com/dms/image/v2/D560BAQH32RJQCl3dDQ/company-logo_100_100/B56ZYQ0mrGGoAU-/0/1744038948046/microsoft_logo?e=2147483647&v=beta&t=rr_7_bFRKp6umQxIHErPOZHtR8dMPIYeTjlKFdotJBY", "location": "Redmond, WA", "postedAt": "2026-11-21T00:00:00.000Z", "posted": "6 days ago", "applicants": null, "salary": null, "insights": [ "Actively Hiring" ], "description": null, "seniority": null, "employmentType": null, "jobFunction": null, "industries": null } ], "pagination": { "nextCursor": "10", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.linkedin.companyJobs({ handle: \"microsoft\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.linkedin.company_jobs(handle=\"microsoft\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/linkedin/company/jobs \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=microsoft\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_LinkedInJob": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/LinkedInJob" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "LinkedInJob": { "type": "object", "description": "A job posting.", "required": [ "id", "url", "title", "insights" ], "properties": { "applicants": { "type": [ "integer", "null" ], "format": "int64", "description": "Applicants as shown (`30 applicants`; `Over 200 applicants` is 200).", "minimum": 0 }, "company": { "oneOf": [ { "$ref": "#/components/schemas/LinkedInEntityRef" }, { "type": "null" } ] }, "companyLogoUrl": { "type": [ "string", "null" ] }, "description": { "type": [ "string", "null" ], "description": "The posting's text (its page only)." }, "employmentType": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "industries": { "type": [ "string", "null" ] }, "insights": { "type": "array", "items": { "type": "string" }, "description": "LinkedIn's notes on it (`Actively Hiring`, `Be an early applicant`)." }, "jobFunction": { "type": [ "string", "null" ] }, "location": { "type": [ "string", "null" ] }, "posted": { "type": [ "string", "null" ], "description": "How long ago it was posted, as shown (`1 week ago`)." }, "postedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "The day it was posted (search results; a posting's page says only how long ago)." }, { "type": "null" } ] }, "salary": { "type": [ "string", "null" ], "description": "Its pay, when the posting gives it (`$150K/yr - $200K/yr`)." }, "seniority": { "type": [ "string", "null" ] }, "title": { "type": "string" }, "url": { "type": "string" } } }, "Timestamp": { "type": "string", "format": "date-time" }, "LinkedInEntityRef": { "type": "object", "description": "A company, a school or a member as a page names it in passing.", "required": [ "name" ], "properties": { "name": { "type": "string" }, "url": { "type": [ "string", "null" ], "description": "Its LinkedIn page, when the page links it." } } } } } } ``` # Company Posts (/docs/api-reference/linkedin/company-posts) A company's posts, newest first. `GET https://api.socialapi.sh/v1/linkedin/company/posts` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.linkedin.companyPosts({ handle: "microsoft" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.linkedin.company_posts(handle="microsoft") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/linkedin/company/posts \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=microsoft" ``` **Response** ```json { "data": [ { "id": "7532133643872563201", "url": "https://www.linkedin.com/feed/update/urn:li:activity:7532133643872563201/", "text": "Everyone deserves the chance to enjoy the outdoors. Outdoors for All Foundation has made adaptive recreation possible for people with disabilities since 1978. Today, 950+ volunteers help 3,000 participants ski, bike, kayak, climb, and more each year.\n\nMicrosoft employees have contributed $1.9M, including company match, and 11,500 volunteer hours, earning Microsoft recognition as Outdoors for All’s…", "createdAt": "2026-11-27T17:30:00.975Z", "author": { "id": "microsoft", "username": "microsoft", "displayName": "Microsoft", "avatarUrl": "https://media.licdn.com/dms/image/v2/D560BAQH32RJQCl3dDQ/company-logo_100_100/B56ZYQ0mrGGoAU-/0/1744038948046/microsoft_logo?e=2147483647&v=beta&t=rr_7_bFRKp6umQxIHErPOZHtR8dMPIYeTjlKFdotJBY", "verified": false, "url": "https://www.linkedin.com/company/microsoft" }, "stats": { "views": null, "likes": 193, "comments": 18, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://dms.licdn.com/playlist/vid/v2/D4E10AQERDNgGhpwb0Q/mp4-720p-30fp-crf28/B4EaIZY1sDGsBk-/0/1795722288432?e=2147483647&v=beta&t=25wVpX9tQ3aRLDvrE4ZkxKmMRtmeh1Fz1VuqsHtEBP4", "thumbnailUrl": "https://media.licdn.com/dms/image/v2/D4E10AQERDNgGhpwb0Q/videocover-high/B4EaIZY1sDGsAo-/0/1795722284188?e=2147483647&v=beta&t=CmarOMrR2FZ83E_FlS-XveywS0NJy_p3mYfY6FxASlM", "width": null, "height": null, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "kind": "post", "title": null, "authorHeadline": "29,612,189 followers", "repostedBy": null, "urn": "urn:li:ugcPost:7532133642907877376", "reshared": null, "edited": false, "linkPreview": null, "captions": false, "language": "en" } }, { "id": "7531771257290141697", "url": "https://www.linkedin.com/feed/update/urn:li:activity:7531771257290141697/", "text": "Thanksgiving is built around a full table, but for many of our neighbors in Washington state, that remains a challenge. Food Lifeline helps make sure food gets where it's needed most, distributing 75.2 million pounds across 17 counties last year.\n\nMicrosoft employees support Food Lifeline through giving and hands-on volunteering, including sorting and packing food for families across our region. P…", "createdAt": "2026-11-26T17:30:01.281Z", "author": { "id": "microsoft", "username": "microsoft", "displayName": "Microsoft", "avatarUrl": "https://media.licdn.com/dms/image/v2/D560BAQH32RJQCl3dDQ/company-logo_100_100/B56ZYQ0mrGGoAU-/0/1744038948046/microsoft_logo?e=2147483647&v=beta&t=rr_7_bFRKp6umQxIHErPOZHtR8dMPIYeTjlKFdotJBY", "verified": false, "url": "https://www.linkedin.com/company/microsoft" }, "stats": { "views": null, "likes": 204, "comments": 21, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://dms.licdn.com/playlist/vid/v2/D4E10AQFuSNiJowNqgA/mp4-720p-30fp-crf28/B4EaIUfy.gI0Bk-/0/1795640234006?e=2147483647&v=beta&t=Hsb01Cb7FInpNbRBDw7vGuX27r-Op2ACkz4nIVbLYac", "thumbnailUrl": "https://media.licdn.com/dms/image/v2/D4E10AQFuSNiJowNqgA/videocover-high/B4EaIUfy.gI0Ao-/0/1795640224722?e=2147483647&v=beta&t=98qEzkbv9TwTyWcp0u-pRL1sv2YLM5s7D1KWPaRx2NQ", "width": null, "height": null, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "kind": "post", "title": null, "authorHeadline": "29,612,189 followers", "repostedBy": null, "urn": "urn:li:ugcPost:7531771256312864768", "reshared": null, "edited": false, "linkPreview": null, "captions": false, "language": "en" } } ], "pagination": { "nextCursor": "10.1035.0-1795856265863-7da3182c6b4bad878aab0ca794f57602", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/linkedin/company/posts": { "get": { "tags": [ "LinkedIn" ], "summary": "A company's posts, newest first.", "description": "Its page's latest, about 10, then 10 a page, about 70 in all: each with its text,\nmedia, reactions and comments, who wrote it (the company, or a member whose post it\nreposted) and the post it shares. 1 credit a page.", "operationId": "linkedinCompanyPosts", "parameters": [ { "name": "handle", "in": "query", "description": "The company's name in its page's link (`microsoft`); a showcase page's too.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "Its page's link, instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_LinkedInPost" }, "example": { "data": [ { "id": "7532133643872563201", "url": "https://www.linkedin.com/feed/update/urn:li:activity:7532133643872563201/", "text": "Everyone deserves the chance to enjoy the outdoors. Outdoors for All Foundation has made adaptive recreation possible for people with disabilities since 1978. Today, 950+ volunteers help 3,000 participants ski, bike, kayak, climb, and more each year.\n\nMicrosoft employees have contributed $1.9M, including company match, and 11,500 volunteer hours, earning Microsoft recognition as Outdoors for All’s…", "createdAt": "2026-11-27T17:30:00.975Z", "author": { "id": "microsoft", "username": "microsoft", "displayName": "Microsoft", "avatarUrl": "https://media.licdn.com/dms/image/v2/D560BAQH32RJQCl3dDQ/company-logo_100_100/B56ZYQ0mrGGoAU-/0/1744038948046/microsoft_logo?e=2147483647&v=beta&t=rr_7_bFRKp6umQxIHErPOZHtR8dMPIYeTjlKFdotJBY", "verified": false, "url": "https://www.linkedin.com/company/microsoft" }, "stats": { "views": null, "likes": 193, "comments": 18, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://dms.licdn.com/playlist/vid/v2/D4E10AQERDNgGhpwb0Q/mp4-720p-30fp-crf28/B4EaIZY1sDGsBk-/0/1795722288432?e=2147483647&v=beta&t=25wVpX9tQ3aRLDvrE4ZkxKmMRtmeh1Fz1VuqsHtEBP4", "thumbnailUrl": "https://media.licdn.com/dms/image/v2/D4E10AQERDNgGhpwb0Q/videocover-high/B4EaIZY1sDGsAo-/0/1795722284188?e=2147483647&v=beta&t=CmarOMrR2FZ83E_FlS-XveywS0NJy_p3mYfY6FxASlM", "width": null, "height": null, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "kind": "post", "title": null, "authorHeadline": "29,612,189 followers", "repostedBy": null, "urn": "urn:li:ugcPost:7532133642907877376", "reshared": null, "edited": false, "linkPreview": null, "captions": false, "language": "en" } }, { "id": "7531771257290141697", "url": "https://www.linkedin.com/feed/update/urn:li:activity:7531771257290141697/", "text": "Thanksgiving is built around a full table, but for many of our neighbors in Washington state, that remains a challenge. Food Lifeline helps make sure food gets where it's needed most, distributing 75.2 million pounds across 17 counties last year.\n\nMicrosoft employees support Food Lifeline through giving and hands-on volunteering, including sorting and packing food for families across our region. P…", "createdAt": "2026-11-26T17:30:01.281Z", "author": { "id": "microsoft", "username": "microsoft", "displayName": "Microsoft", "avatarUrl": "https://media.licdn.com/dms/image/v2/D560BAQH32RJQCl3dDQ/company-logo_100_100/B56ZYQ0mrGGoAU-/0/1744038948046/microsoft_logo?e=2147483647&v=beta&t=rr_7_bFRKp6umQxIHErPOZHtR8dMPIYeTjlKFdotJBY", "verified": false, "url": "https://www.linkedin.com/company/microsoft" }, "stats": { "views": null, "likes": 204, "comments": 21, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://dms.licdn.com/playlist/vid/v2/D4E10AQFuSNiJowNqgA/mp4-720p-30fp-crf28/B4EaIUfy.gI0Bk-/0/1795640234006?e=2147483647&v=beta&t=Hsb01Cb7FInpNbRBDw7vGuX27r-Op2ACkz4nIVbLYac", "thumbnailUrl": "https://media.licdn.com/dms/image/v2/D4E10AQFuSNiJowNqgA/videocover-high/B4EaIUfy.gI0Ao-/0/1795640224722?e=2147483647&v=beta&t=98qEzkbv9TwTyWcp0u-pRL1sv2YLM5s7D1KWPaRx2NQ", "width": null, "height": null, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "kind": "post", "title": null, "authorHeadline": "29,612,189 followers", "repostedBy": null, "urn": "urn:li:ugcPost:7531771256312864768", "reshared": null, "edited": false, "linkPreview": null, "captions": false, "language": "en" } } ], "pagination": { "nextCursor": "10.1035.0-1795856265863-7da3182c6b4bad878aab0ca794f57602", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.linkedin.companyPosts({ handle: \"microsoft\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.linkedin.company_posts(handle=\"microsoft\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/linkedin/company/posts \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=microsoft\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_LinkedInPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/LinkedInPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "LinkedInPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "edited", "captions" ], "properties": { "authorHeadline": { "type": [ "string", "null" ], "description": "What its author says it does (a member's headline, a company's followers line)." }, "captions": { "type": "boolean", "description": "Whether its video has a caption file (`/v1/linkedin/post/transcript`)." }, "edited": { "type": "boolean" }, "kind": { "oneOf": [ { "$ref": "#/components/schemas/LinkedInPostKind" }, { "type": "null" } ] }, "language": { "type": [ "string", "null" ], "description": "Its video's language, as LinkedIn tagged it." }, "linkPreview": { "oneOf": [ { "$ref": "#/components/schemas/LinkedInLinkPreview" }, { "type": "null" } ] }, "repostedBy": { "type": [ "string", "null" ], "description": "Who reposted it, where a page lists another's post as its own activity." }, "reshared": { "type": [ "string", "null" ], "description": "The post it shares with words of its own, by its id (`/v1/linkedin/post`)." }, "title": { "type": [ "string", "null" ], "description": "An article's title." }, "urn": { "type": [ "string", "null" ], "description": "The share or `ugcPost` it is the activity of, as `urn:li:…`." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A LinkedIn post or article." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "LinkedInLinkPreview": { "type": "object", "description": "A link a post shares, as its card shows it.", "required": [ "url" ], "properties": { "subtitle": { "type": [ "string", "null" ], "description": "The site, or the article's author." }, "title": { "type": [ "string", "null" ] }, "url": { "type": "string" } } }, "LinkedInPostKind": { "type": "string", "description": "What a post is.", "enum": [ "post", "article" ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Company (/docs/api-reference/linkedin/company) A company's page with its followers and employees. `GET https://api.socialapi.sh/v1/linkedin/company` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.linkedin.company({ handle: "microsoft" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.linkedin.company(handle="microsoft").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/linkedin/company \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=microsoft" ``` **Response** ```json { "data": { "id": "1035", "username": "microsoft", "displayName": "Microsoft", "bio": "Every company has a mission. What's ours? To empower every person and every organization to achieve more. We believe technology can and should be a force for good and that meaningful innovation contributes to a brighter world in the future and today. Our culture doesn’t just encourage curiosity; it embraces it. Each day we make progress together by showing up as our authentic selves. We show up wi…", "avatarUrl": "https://media.licdn.com/dms/image/v2/D560BAQH32RJQCl3dDQ/company-logo_200_200/B56ZYQ0mrGGoAM-/0/1744038948046/microsoft_logo?e=2147483647&v=beta&t=ts9MGrTk7Lz3R1bmAfzCL8euuuuPWPCoXfdiLA2_IzM", "url": "https://www.linkedin.com/company/microsoft/", "verified": false, "private": false, "followers": 29612189, "following": null, "likes": null, "posts": null, "externalUrl": "https://news.microsoft.com/", "createdAt": null, "ext": { "kind": "company", "tagline": null, "industry": "Software Development", "size": "10,001+ employees", "employees": 230400, "headquarters": "Redmond, Washington", "organizationType": "Public Company", "founded": null, "specialties": [ "Business Software", "Developer Tools", "Home & Educational Software" ], "coverUrl": "https://media.licdn.com/dms/image/v2/D4E3DAQGWOa_gAs1qXg/image-scale_325_1920/B4EZ8ZTX5SJEAI-/0/1782835937311/microsoft_cover?e=2147483647&v=beta&t=z_r5wUburw7hBaw0p2LprNAGNhvq22Evh-q5biHXpYM", "locations": [ "1 Microsoft Way, Redmond, Washington 98052, US", "1 Denison Street, North Sydney, NSW 2060, AU", "1950 Meadowvale Blvd, Mississauga, Ontario L5N 8L9, CA" ], "affiliated": [ { "name": "GitHub", "url": "https://www.linkedin.com/company/github", "subtitle": "Software Development", "location": "San Francisco, CA", "followers": null }, { "name": "Microsoft Learn", "url": "https://www.linkedin.com/showcase/microsoftlearn/", "subtitle": "IT Services and IT Consulting", "location": "Redmond, Washington", "followers": null }, { "name": "Microsoft Azure", "url": "https://www.linkedin.com/showcase/microsoft-azure/", "subtitle": "Technology, Information and Internet", "location": null, "followers": null } ], "similar": [ { "name": "Google", "url": "https://www.linkedin.com/company/google", "subtitle": "Software Development", "location": "Mountain View, CA", "followers": null }, { "name": "Amazon", "url": "https://www.linkedin.com/company/amazon", "subtitle": "Software Development", "location": null, "followers": null }, { "name": "Apple", "url": "https://www.linkedin.com/company/apple", "subtitle": "Computers and Electronics Manufacturing", "location": "Cupertino, California", "followers": null } ] } } } ``` **OpenAPI** ```json { "paths": { "/v1/linkedin/company": { "get": { "tags": [ "LinkedIn" ], "summary": "A company's page with its followers and employees.", "description": "Its name, logo, about, website, industry, size, headquarters, type, founding year and\nspecialties; its exact followers and members on LinkedIn, its addresses, and its\naffiliated and similar pages. A showcase page (a brand's or a product's) is read the\nsame way. 1 credit.", "operationId": "linkedinCompany", "parameters": [ { "name": "handle", "in": "query", "description": "The company's name in its page's link (`microsoft`); a showcase page's too.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "Its page's link (`https://www.linkedin.com/company/microsoft`, or a `/showcase/` one),\ninstead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_LinkedInCompany" }, "example": { "data": { "id": "1035", "username": "microsoft", "displayName": "Microsoft", "bio": "Every company has a mission. What's ours? To empower every person and every organization to achieve more. We believe technology can and should be a force for good and that meaningful innovation contributes to a brighter world in the future and today. Our culture doesn’t just encourage curiosity; it embraces it. Each day we make progress together by showing up as our authentic selves. We show up wi…", "avatarUrl": "https://media.licdn.com/dms/image/v2/D560BAQH32RJQCl3dDQ/company-logo_200_200/B56ZYQ0mrGGoAM-/0/1744038948046/microsoft_logo?e=2147483647&v=beta&t=ts9MGrTk7Lz3R1bmAfzCL8euuuuPWPCoXfdiLA2_IzM", "url": "https://www.linkedin.com/company/microsoft/", "verified": false, "private": false, "followers": 29612189, "following": null, "likes": null, "posts": null, "externalUrl": "https://news.microsoft.com/", "createdAt": null, "ext": { "kind": "company", "tagline": null, "industry": "Software Development", "size": "10,001+ employees", "employees": 230400, "headquarters": "Redmond, Washington", "organizationType": "Public Company", "founded": null, "specialties": [ "Business Software", "Developer Tools", "Home & Educational Software" ], "coverUrl": "https://media.licdn.com/dms/image/v2/D4E3DAQGWOa_gAs1qXg/image-scale_325_1920/B4EZ8ZTX5SJEAI-/0/1782835937311/microsoft_cover?e=2147483647&v=beta&t=z_r5wUburw7hBaw0p2LprNAGNhvq22Evh-q5biHXpYM", "locations": [ "1 Microsoft Way, Redmond, Washington 98052, US", "1 Denison Street, North Sydney, NSW 2060, AU", "1950 Meadowvale Blvd, Mississauga, Ontario L5N 8L9, CA" ], "affiliated": [ { "name": "GitHub", "url": "https://www.linkedin.com/company/github", "subtitle": "Software Development", "location": "San Francisco, CA", "followers": null }, { "name": "Microsoft Learn", "url": "https://www.linkedin.com/showcase/microsoftlearn/", "subtitle": "IT Services and IT Consulting", "location": "Redmond, Washington", "followers": null }, { "name": "Microsoft Azure", "url": "https://www.linkedin.com/showcase/microsoft-azure/", "subtitle": "Technology, Information and Internet", "location": null, "followers": null } ], "similar": [ { "name": "Google", "url": "https://www.linkedin.com/company/google", "subtitle": "Software Development", "location": "Mountain View, CA", "followers": null }, { "name": "Amazon", "url": "https://www.linkedin.com/company/amazon", "subtitle": "Software Development", "location": null, "followers": null }, { "name": "Apple", "url": "https://www.linkedin.com/company/apple", "subtitle": "Computers and Electronics Manufacturing", "location": "Cupertino, California", "followers": null } ] } } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.linkedin.company({ handle: \"microsoft\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.linkedin.company(handle=\"microsoft\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/linkedin/company \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=microsoft\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_LinkedInCompany": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/LinkedInCompany" } } }, "LinkedInCompany": { "allOf": [ { "type": "object", "description": "An account.", "required": [ "id", "username", "url", "verified", "private", "ext" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "bio": { "type": [ "string", "null" ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "displayName": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "kind", "specialties", "locations", "affiliated", "similar" ], "properties": { "affiliated": { "type": "array", "items": { "$ref": "#/components/schemas/LinkedInCard" }, "description": "Pages LinkedIn lists as its own (subsidiaries, showcases)." }, "coverUrl": { "type": [ "string", "null" ] }, "employees": { "type": [ "integer", "null" ], "format": "int64", "description": "Members who list it as their employer, exactly.", "minimum": 0 }, "founded": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "headquarters": { "type": [ "string", "null" ] }, "industry": { "type": [ "string", "null" ] }, "kind": { "$ref": "#/components/schemas/LinkedInOrgKind" }, "locations": { "type": "array", "items": { "type": "string" }, "description": "Its addresses, the primary one first." }, "organizationType": { "type": [ "string", "null" ], "description": "`Public Company`, `Privately Held`, `Nonprofit`…" }, "similar": { "type": "array", "items": { "$ref": "#/components/schemas/LinkedInCard" }, "description": "\"Similar pages\"." }, "size": { "type": [ "string", "null" ], "description": "Its size as LinkedIn buckets it (`10,001+ employees`)." }, "specialties": { "type": "array", "items": { "type": "string" } }, "tagline": { "type": [ "string", "null" ], "description": "The line under its name (what it does, in a few words)." } } }, { "type": "object", "description": "What only this platform has." } ] }, "externalUrl": { "type": [ "string", "null" ], "description": "The link in the bio." }, "followers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "following": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "id": { "type": "string", "description": "The platform's id for the account." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "description": "Likes the account's posts received in total.", "minimum": 0 }, "posts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "private": { "type": "boolean" }, "url": { "type": "string", "description": "The profile's page." }, "username": { "type": "string", "description": "The handle, without `@`." }, "verified": { "type": "boolean" } } }, { "type": "object", "description": "A LinkedIn company's or showcase's page." } ] }, "LinkedInCard": { "type": "object", "description": "A member or a page as a list beside another shows it (\"Other similar profiles\").", "required": [ "name", "url" ], "properties": { "followers": { "type": [ "integer", "null" ], "format": "int64", "description": "Followers as shown (rounded past 1,000).", "minimum": 0 }, "location": { "type": [ "string", "null" ] }, "name": { "type": "string" }, "subtitle": { "type": [ "string", "null" ], "description": "A member's current company or headline, a page's industry." }, "url": { "type": "string" } } }, "LinkedInOrgKind": { "type": "string", "description": "Which of LinkedIn's organization pages it is.", "enum": [ "company", "showcase" ] }, "Timestamp": { "type": "string", "format": "date-time" } } } } ``` # LinkedIn API (/docs/api-reference/linkedin) Every LinkedIn endpoint, by group. Each is a `GET` under `/v1/linkedin`. ## Quick Reference [#quick-reference] | Property | Value | | --- | --- | | Base path | `/v1/linkedin` | | Endpoints | 17 | | Credits | See Below | | Guide | [LinkedIn](/docs/linkedin) | ## Accounts [#accounts] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/linkedin/profile`](/docs/api-reference/linkedin/profile) | A member's public profile with its followers. | 1 | | [`GET /v1/linkedin/profile/articles`](/docs/api-reference/linkedin/profile-articles) | A member's articles, up to 10. | 1 | | [`GET /v1/linkedin/profile/posts`](/docs/api-reference/linkedin/profile-posts) | A member's latest posts, about 10. | 1 | ## Companies [#companies] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/linkedin/company`](/docs/api-reference/linkedin/company) | A company's page with its followers and employees. | 1 | | [`GET /v1/linkedin/company/jobs`](/docs/api-reference/linkedin/company-jobs) | A company's open jobs, 10 a page. | 1 | | [`GET /v1/linkedin/company/posts`](/docs/api-reference/linkedin/company-posts) | A company's posts, newest first. | 1 | | [`GET /v1/linkedin/search/companies`](/docs/api-reference/linkedin/search-companies) | Companies matching a name, with their ids. | 1 | ## Posts [#posts] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/linkedin/article`](/docs/api-reference/linkedin/article) | An article with its text, reactions and comments. | 1 | | [`GET /v1/linkedin/post`](/docs/api-reference/linkedin/post) | One post with its reactions and comments. | 1 | | [`GET /v1/linkedin/post/comments`](/docs/api-reference/linkedin/post-comments) | A post's first comments, about 10. | 1 | | [`GET /v1/linkedin/post/transcript`](/docs/api-reference/linkedin/post-transcript) | A post's video's captions as text, with timings. | 10 | ## Jobs [#jobs] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/linkedin/job`](/docs/api-reference/linkedin/job) | One job posting with its description. | 1 | | [`GET /v1/linkedin/search/jobs`](/docs/api-reference/linkedin/search-jobs) | Job postings for a search, 10 a page. | 1 | | [`GET /v1/linkedin/search/locations`](/docs/api-reference/linkedin/search-locations) | Places matching a name, with their ids. | 1 | ## Ads [#ads] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/linkedin/ad`](/docs/api-reference/linkedin/ad) | One ad with who paid for it and its reach. | 1 | | [`GET /v1/linkedin/ads/search`](/docs/api-reference/linkedin/ads-search) | Ads from LinkedIn's Ad Library, 24 a page. | 1 | ## Discovery [#discovery] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/linkedin/search/users`](/docs/api-reference/linkedin/search-users) | Members with a first and last name, up to 50. | 1 | ## Example Request [#example-request] Every LinkedIn endpoint is called this way: its path, and what to read as query parameters. **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.linkedin.profile({ handle: "williamhgates" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.linkedin.profile(handle="williamhgates").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/linkedin/profile \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=williamhgates" ``` **Response** ```json { "data": { "id": "williamhgates", "username": "williamhgates", "displayName": "Bill Gates", "bio": "Chair of the Gates Foundation. Founder of Breakthrough Energy. Co-founder of Microsoft. Voracious reader. Avid traveler. Active blogger.", "avatarUrl": "https://media.licdn.com/dms/image/v2/D5603AQF-RYZP55jmXA/profile-displayphoto-shrink_200_200/B56ZRi8g.aGsAY-/0/1736826818802?e=2147483647&v=beta&t=bKWfN6UwwtiCqFWsG7rBELbd48qJOAMLdxhBzzkJV0k", "url": "https://www.linkedin.com/in/williamhgates", "verified": false, "private": false, "followers": 40865050, "following": null, "likes": null, "posts": null, "externalUrl": "https://gatesnot.es/sourcecode-li", "createdAt": null, "ext": { "headline": "Chair, Gates Foundation and Founder, Breakthrough Energy", "location": "Seattle, Washington, United States", "country": "US", "connections": 8, "connectionsMore": false, "labels": [ "Creator", "Top Voice" ], "influencer": true, "coverUrl": "https://media.licdn.com/dms/image/v2/D5616AQEjhPbTCeblYg/profile-displaybackgroundimage-shrink_200_800/B56ZcytR5SGsAc-/0/1748902420393?e=2147483647&v=beta&t=a-tBeZkxzWTHWYY6MAjxt0oTEuxlW33EUkK3gm5_te4", "current": [ { "name": "Gates Foundation", "url": "https://www.linkedin.com/company/gates-foundation" } ], "schools": [ { "name": "Harvard University", "url": "https://www.linkedin.com/school/harvard-university/" } ], "hidden": false, "experience": [ { "title": "Co-chair", "subtitle": "Gates Foundation", "url": "https://www.linkedin.com/company/gates-foundation", "starts": "2000", "ends": null, "current": true, "location": null, "description": null }, { "title": "Founder", "subtitle": "Breakthrough Energy", "url": "https://www.linkedin.com/company/breakthrough-energy", "starts": "2015", "ends": null, "current": true, "location": null, "description": null }, { "title": "Co-founder", "subtitle": "Microsoft", "url": "https://www.linkedin.com/company/microsoft", "starts": "1975", "ends": null, "current": true, "location": null, "description": null } ], "education": [ { "title": "Harvard University", "subtitle": null, "url": "https://www.linkedin.com/school/harvard-university/", "starts": "1973", "ends": "1975", "current": false, "location": null, "description": null }, { "title": "Lakeside School", "subtitle": null, "url": "https://www.linkedin.com/school/lakeside-school/", "starts": null, "ends": null, "current": false, "location": null, "description": null } ], "volunteering": [], "certifications": [], "publications": [], "patents": [], "projects": [], "honors": [], "languages": [], "courses": [], "testScores": [], "organizations": [], "skills": [], "recommendations": [], "websites": [ "https://gatesnot.es/sourcecode-li" ], "similar": [ { "name": "Melinda French Gates", "url": "https://www.linkedin.com/in/melindagates", "subtitle": "Pivotal", "location": "United States", "followers": 7000000 }, { "name": "Tyler Alterman", "url": "https://www.linkedin.com/in/tyleralterman", "subtitle": "Fractal University", "location": "Brooklyn, NY", "followers": 7000 }, { "name": "Todd J. Duckett", "url": "https://www.linkedin.com/in/toddjduckett", "subtitle": "Duckett Enterprises", "location": "Lansing, MI", "followers": 9000 } ] } } } ``` ## Errors [#errors] A call that fails costs nothing. See [Errors](/docs/errors) for every code. # Job (/docs/api-reference/linkedin/job) One job posting with its description. `GET https://api.socialapi.sh/v1/linkedin/job` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.linkedin.job({ id: "4474086156" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.linkedin.job(id="4474086156").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/linkedin/job \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "id=4474086156" ``` **Response** ```json { "data": { "id": "4474086156", "url": "https://www.linkedin.com/jobs/view/4474086156/", "title": "Senior Backend Developer (m/w/d) – C# / .NET", "company": { "name": "Vivecti Group", "url": "https://www.linkedin.com/company/vivecti-group" }, "companyLogoUrl": "https://media.licdn.com/dms/image/v2/D4E0BAQFyu5QCSAKNLA/company-logo_100_100/company-logo_100_100/0/1691130368395/prospitalia_group_logo?e=2147483647&v=beta&t=QjURHx44ViNdi6V6_d9IoJhD_qav3hmLY-LCYCgNF4I", "location": "Berlin, Berlin, Germany", "postedAt": null, "posted": "1 month ago", "applicants": 156, "salary": null, "insights": [], "description": "Du liebst sauberen Code, moderne Softwarearchitekturen und technische Herausforderungen?\n\nDu möchtest nicht nur bestehende Systeme betreuen, sondern aktiv an der Neuentwicklung innovativer Softwarelösungen mitwirken?\n\nDann werde Teil der Vivecti Group und gestalte gemeinsam mit uns die technologische Zukunft des Gesundheitswesens- unterstützt durch moderne Cloud-Technologien und KI-gestützte Entwi…", "seniority": "Mid-Senior level", "employmentType": "Full-time", "jobFunction": null, "industries": "IT Services and IT Consulting" } } ``` **OpenAPI** ```json { "paths": { "/v1/linkedin/job": { "get": { "tags": [ "LinkedIn" ], "summary": "One job posting with its description.", "description": "Its title, company, location, how long ago it was posted, its applicants, its whole\ntext, and its seniority, employment type, job function and industries. 1 credit.", "operationId": "linkedinJob", "parameters": [ { "name": "url", "in": "query", "description": "The job's link (`https://www.linkedin.com/jobs/view/…`).", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "Its number (`4492456914`), instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_LinkedInJob" }, "example": { "data": { "id": "4474086156", "url": "https://www.linkedin.com/jobs/view/4474086156/", "title": "Senior Backend Developer (m/w/d) – C# / .NET", "company": { "name": "Vivecti Group", "url": "https://www.linkedin.com/company/vivecti-group" }, "companyLogoUrl": "https://media.licdn.com/dms/image/v2/D4E0BAQFyu5QCSAKNLA/company-logo_100_100/company-logo_100_100/0/1691130368395/prospitalia_group_logo?e=2147483647&v=beta&t=QjURHx44ViNdi6V6_d9IoJhD_qav3hmLY-LCYCgNF4I", "location": "Berlin, Berlin, Germany", "postedAt": null, "posted": "1 month ago", "applicants": 156, "salary": null, "insights": [], "description": "Du liebst sauberen Code, moderne Softwarearchitekturen und technische Herausforderungen?\n\nDu möchtest nicht nur bestehende Systeme betreuen, sondern aktiv an der Neuentwicklung innovativer Softwarelösungen mitwirken?\n\nDann werde Teil der Vivecti Group und gestalte gemeinsam mit uns die technologische Zukunft des Gesundheitswesens- unterstützt durch moderne Cloud-Technologien und KI-gestützte Entwi…", "seniority": "Mid-Senior level", "employmentType": "Full-time", "jobFunction": null, "industries": "IT Services and IT Consulting" } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.linkedin.job({ id: \"4474086156\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.linkedin.job(id=\"4474086156\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/linkedin/job \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"id=4474086156\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_LinkedInJob": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/LinkedInJob" } } }, "LinkedInJob": { "type": "object", "description": "A job posting.", "required": [ "id", "url", "title", "insights" ], "properties": { "applicants": { "type": [ "integer", "null" ], "format": "int64", "description": "Applicants as shown (`30 applicants`; `Over 200 applicants` is 200).", "minimum": 0 }, "company": { "oneOf": [ { "$ref": "#/components/schemas/LinkedInEntityRef" }, { "type": "null" } ] }, "companyLogoUrl": { "type": [ "string", "null" ] }, "description": { "type": [ "string", "null" ], "description": "The posting's text (its page only)." }, "employmentType": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "industries": { "type": [ "string", "null" ] }, "insights": { "type": "array", "items": { "type": "string" }, "description": "LinkedIn's notes on it (`Actively Hiring`, `Be an early applicant`)." }, "jobFunction": { "type": [ "string", "null" ] }, "location": { "type": [ "string", "null" ] }, "posted": { "type": [ "string", "null" ], "description": "How long ago it was posted, as shown (`1 week ago`)." }, "postedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "The day it was posted (search results; a posting's page says only how long ago)." }, { "type": "null" } ] }, "salary": { "type": [ "string", "null" ], "description": "Its pay, when the posting gives it (`$150K/yr - $200K/yr`)." }, "seniority": { "type": [ "string", "null" ] }, "title": { "type": "string" }, "url": { "type": "string" } } }, "Timestamp": { "type": "string", "format": "date-time" }, "LinkedInEntityRef": { "type": "object", "description": "A company, a school or a member as a page names it in passing.", "required": [ "name" ], "properties": { "name": { "type": "string" }, "url": { "type": [ "string", "null" ], "description": "Its LinkedIn page, when the page links it." } } } } } } ``` # Post Comments (/docs/api-reference/linkedin/post-comments) A post's first comments, about 10. `GET https://api.socialapi.sh/v1/linkedin/post/comments` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.linkedin.postComments({ url: "https://www.linkedin.com/posts/williamhgates_how-ai-is-helping-kenyan-farmers-bill-gates-activity-7531543853288456193-Ku5w" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.linkedin.post_comments(url="https://www.linkedin.com/posts/williamhgates_how-ai-is-helping-kenyan-farmers-bill-gates-activity-7531543853288456193-Ku5w") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/linkedin/post/comments \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://www.linkedin.com/posts/williamhgates_how-ai-is-helping-kenyan-farmers-bill-gates-activity-7531543853288456193-Ku5w" ``` **Response** ```json { "data": [ { "id": "7531591949900939264", "postId": "7531543853288456193", "parentId": null, "text": "The real breakthrough here isn't just the AI model—it’s the zero-friction distribution. Turning complex weather forecasts into actionable text messages on the phones farmers already use removes the biggest barrier to adoption: complexity. Great systems design isn't about forcing users to learn new interfaces; it's about delivering real intelligence seamlessly into their existing habits. Brilliant…", "createdAt": "2026-11-26T05:37:31.068Z", "author": { "id": "chandrashaker-solanki-7806b8235", "username": "chandrashaker-solanki-7806b8235", "displayName": "Chandrashaker Solanki", "avatarUrl": "https://media.licdn.com/dms/image/v2/D5603AQEP_PTsGTQVjg/profile-displayphoto-scale_400_400/B56Z5S7TEqHYAg-/0/1779507737356?e=2147483647&v=beta&t=e0BB92nEgWp-gDulL9zmbcl7KbYZc_2oLEViRVF_PgI", "verified": false, "url": "https://www.linkedin.com/in/chandrashaker-solanki-7806b8235" }, "likes": 24, "replies": null, "ext": { "authorHeadline": null, "edited": false } }, { "id": "7531709678364336128", "postId": "7531543853288456193", "parentId": null, "text": "Text messages are the underrated part here. The model is the expensive bit, but distribution decides whether it reaches anyone, and SMS on a phone people already own has no adoption curve. Curious how the economics work once philanthropy steps back: do farmers, insurers or buyers end up paying for the forecast?", "createdAt": "2026-11-26T13:25:19.721Z", "author": { "id": "luca-rizzello-5597093b6", "username": "luca-rizzello-5597093b6", "displayName": "Luca Rizzello", "avatarUrl": "https://media.licdn.com/dms/image/v2/D5603AQHzGzhdd4Xs7w/profile-displayphoto-scale_400_400/B56aHnGSveIQAg-/0/1794878552900?e=2147483647&v=beta&t=Iq7GtQjzMY4DmndXuped7rM6J8CSN8CONLRuag3SyvY", "verified": false, "url": "https://www.linkedin.com/in/luca-rizzello-5597093b6" }, "likes": 3, "replies": null, "ext": { "authorHeadline": null, "edited": false } } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/linkedin/post/comments": { "get": { "tags": [ "LinkedIn" ], "summary": "A post's first comments, about 10.", "description": "The comments its page shows a visitor, each with its author, time and reactions. 1\ncredit.", "operationId": "linkedinPostComments", "parameters": [ { "name": "url", "in": "query", "description": "The post's link (`https://www.linkedin.com/posts/…`, or a `/feed/update/urn:li:…` one).", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The post's id: its activity's number (`7531543853288456193`), instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_LinkedInComment" }, "example": { "data": [ { "id": "7531591949900939264", "postId": "7531543853288456193", "parentId": null, "text": "The real breakthrough here isn't just the AI model—it’s the zero-friction distribution. Turning complex weather forecasts into actionable text messages on the phones farmers already use removes the biggest barrier to adoption: complexity. Great systems design isn't about forcing users to learn new interfaces; it's about delivering real intelligence seamlessly into their existing habits. Brilliant…", "createdAt": "2026-11-26T05:37:31.068Z", "author": { "id": "chandrashaker-solanki-7806b8235", "username": "chandrashaker-solanki-7806b8235", "displayName": "Chandrashaker Solanki", "avatarUrl": "https://media.licdn.com/dms/image/v2/D5603AQEP_PTsGTQVjg/profile-displayphoto-scale_400_400/B56Z5S7TEqHYAg-/0/1779507737356?e=2147483647&v=beta&t=e0BB92nEgWp-gDulL9zmbcl7KbYZc_2oLEViRVF_PgI", "verified": false, "url": "https://www.linkedin.com/in/chandrashaker-solanki-7806b8235" }, "likes": 24, "replies": null, "ext": { "authorHeadline": null, "edited": false } }, { "id": "7531709678364336128", "postId": "7531543853288456193", "parentId": null, "text": "Text messages are the underrated part here. The model is the expensive bit, but distribution decides whether it reaches anyone, and SMS on a phone people already own has no adoption curve. Curious how the economics work once philanthropy steps back: do farmers, insurers or buyers end up paying for the forecast?", "createdAt": "2026-11-26T13:25:19.721Z", "author": { "id": "luca-rizzello-5597093b6", "username": "luca-rizzello-5597093b6", "displayName": "Luca Rizzello", "avatarUrl": "https://media.licdn.com/dms/image/v2/D5603AQHzGzhdd4Xs7w/profile-displayphoto-scale_400_400/B56aHnGSveIQAg-/0/1794878552900?e=2147483647&v=beta&t=Iq7GtQjzMY4DmndXuped7rM6J8CSN8CONLRuag3SyvY", "verified": false, "url": "https://www.linkedin.com/in/luca-rizzello-5597093b6" }, "likes": 3, "replies": null, "ext": { "authorHeadline": null, "edited": false } } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.linkedin.postComments({ url: \"https://www.linkedin.com/posts/williamhgates_how-ai-is-helping-kenyan-farmers-bill-gates-activity-7531543853288456193-Ku5w\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.linkedin.post_comments(url=\"https://www.linkedin.com/posts/williamhgates_how-ai-is-helping-kenyan-farmers-bill-gates-activity-7531543853288456193-Ku5w\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/linkedin/post/comments \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://www.linkedin.com/posts/williamhgates_how-ai-is-helping-kenyan-farmers-bill-gates-activity-7531543853288456193-Ku5w\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_LinkedInComment": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/LinkedInComment" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "LinkedInComment": { "allOf": [ { "type": "object", "description": "A comment or a reply.", "required": [ "id", "postId", "text", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "edited" ], "properties": { "authorHeadline": { "type": [ "string", "null" ], "description": "What its author says it does, as the comment shows it." }, "edited": { "type": "boolean" } } }, { "type": "object", "description": "What only this platform has." } ] }, "id": { "type": "string" }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "parentId": { "type": [ "string", "null" ], "description": "The comment this replies to; absent on a top-level comment." }, "postId": { "type": "string" }, "replies": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "text": { "type": "string" } } }, { "type": "object", "description": "A comment on a LinkedIn post." } ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Post Transcript (/docs/api-reference/linkedin/post-transcript) A post's video's captions as text, with timings. `GET https://api.socialapi.sh/v1/linkedin/post/transcript` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.linkedin.postTranscript({ id: "7529230174937169921" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.linkedin.post_transcript(id="7529230174937169921").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/linkedin/post/transcript \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "id=7529230174937169921" ``` **Response** ```json { "data": { "postId": "7529230174937169921", "language": "en", "generated": true, "text": "Innovation is always good when it is making my life easier,\nbut should not substitute my judgment, should not\nsubstitute my reason, should not substitute my intelligence,\nwhich is not artificial but is human. That's Cardinal Fabio\nBaggio. As a lifelong missionary, he spent decades working\nalongside migrants and refugees, and he became one of Pope\nFrancis's closest collaborators. That same concern…", "cues": [ { "startSeconds": 0.06, "endSeconds": 4.258, "text": "Innovation is always good when it is making my life easier," }, { "startSeconds": 4.258, "endSeconds": 7.757, "text": "but should not substitute my judgment, should not" }, { "startSeconds": 7.757, "endSeconds": 11.956, "text": "substitute my reason, should not substitute my intelligence," } ] } } ``` **OpenAPI** ```json { "paths": { "/v1/linkedin/post/transcript": { "get": { "tags": [ "LinkedIn" ], "summary": "A post's video's captions as text, with timings.", "description": "LinkedIn's own captions of the video (made from its speech, `generated`, or uploaded\nwith it), whole. A post without a captioned video is a free `404`. 10 credits.", "operationId": "linkedinPostTranscript", "parameters": [ { "name": "url", "in": "query", "description": "The post's link (`https://www.linkedin.com/posts/…`, or a `/feed/update/urn:li:…` one).", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The post's id: its activity's number (`7531543853288456193`), instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_LinkedInTranscript" }, "example": { "data": { "postId": "7529230174937169921", "language": "en", "generated": true, "text": "Innovation is always good when it is making my life easier,\nbut should not substitute my judgment, should not\nsubstitute my reason, should not substitute my intelligence,\nwhich is not artificial but is human. That's Cardinal Fabio\nBaggio. As a lifelong missionary, he spent decades working\nalongside migrants and refugees, and he became one of Pope\nFrancis's closest collaborators. That same concern…", "cues": [ { "startSeconds": 0.06, "endSeconds": 4.258, "text": "Innovation is always good when it is making my life easier," }, { "startSeconds": 4.258, "endSeconds": 7.757, "text": "but should not substitute my judgment, should not" }, { "startSeconds": 7.757, "endSeconds": 11.956, "text": "substitute my reason, should not substitute my intelligence," } ] } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.linkedin.postTranscript({ id: \"7529230174937169921\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.linkedin.post_transcript(id=\"7529230174937169921\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/linkedin/post/transcript \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"id=7529230174937169921\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_LinkedInTranscript": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/LinkedInTranscript" } } }, "LinkedInTranscript": { "type": "object", "description": "A video's captions as text.", "required": [ "postId", "generated", "text", "cues" ], "properties": { "cues": { "type": "array", "items": { "$ref": "#/components/schemas/LinkedInCue" } }, "generated": { "type": "boolean", "description": "Made by LinkedIn from the video's speech, rather than uploaded with it." }, "language": { "type": [ "string", "null" ] }, "postId": { "type": "string" }, "text": { "type": "string", "description": "The captions as plain text, one line a cue." } } }, "LinkedInCue": { "type": "object", "required": [ "startSeconds", "endSeconds", "text" ], "properties": { "endSeconds": { "type": "number", "format": "double" }, "startSeconds": { "type": "number", "format": "double" }, "text": { "type": "string" } } } } } } ``` # Post (/docs/api-reference/linkedin/post) One post with its reactions and comments. `GET https://api.socialapi.sh/v1/linkedin/post` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.linkedin.post({ url: "https://www.linkedin.com/posts/williamhgates_how-ai-is-helping-kenyan-farmers-bill-gates-activity-7531543853288456193-Ku5w" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.linkedin.post(url="https://www.linkedin.com/posts/williamhgates_how-ai-is-helping-kenyan-farmers-bill-gates-activity-7531543853288456193-Ku5w").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/linkedin/post \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://www.linkedin.com/posts/williamhgates_how-ai-is-helping-kenyan-farmers-bill-gates-activity-7531543853288456193-Ku5w" ``` **Response** ```json { "data": { "id": "7531543853288456193", "url": "https://www.linkedin.com/feed/update/urn:li:activity:7531543853288456193/", "text": "In Kenya, TomorrowNow turns AI-powered weather forecasts into text messages with advice farmers can act on—in their own language, on the phones they already use. This is the kind of innovation that can help AI’s benefits reach more people.", "createdAt": "2026-11-26T02:26:23.942Z", "author": { "id": "williamhgates", "username": "williamhgates", "displayName": "Bill Gates", "avatarUrl": "https://media.licdn.com/dms/image/v2/D5603AQF-RYZP55jmXA/profile-displayphoto-shrink_400_400/B56ZRi8g.aGsAg-/0/1736826818802?e=2147483647&v=beta&t=r6LJYwKPrJzfFDXVG8qAOoklQnqvEN855sHJ1NxhEAo", "verified": false, "url": "https://www.linkedin.com/in/williamhgates" }, "stats": { "views": null, "likes": 1139, "comments": 200, "shares": null, "saves": null, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "kind": "post", "title": null, "authorHeadline": "Chair, Gates Foundation and Founder, Breakthrough Energy", "repostedBy": null, "urn": "urn:li:share:7531543852617363456", "reshared": null, "edited": true, "linkPreview": { "url": "https://www.gatesnotes.com/fighting-climate-change-one-text-at-a-time", "title": "How AI is helping Kenyan farmers | Bill Gates", "subtitle": "gatesnotes.com" }, "captions": false, "language": null } } } ``` **OpenAPI** ```json { "paths": { "/v1/linkedin/post": { "get": { "tags": [ "LinkedIn" ], "summary": "One post with its reactions and comments.", "description": "Its text, time, media (pictures, a video with its file and poster), the link it shares,\nits author with their headline, and the post it shares. 1 credit.", "operationId": "linkedinPost", "parameters": [ { "name": "url", "in": "query", "description": "The post's link (`https://www.linkedin.com/posts/…`, or a `/feed/update/urn:li:…` one).", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The post's id: its activity's number (`7531543853288456193`), instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_LinkedInPost" }, "example": { "data": { "id": "7531543853288456193", "url": "https://www.linkedin.com/feed/update/urn:li:activity:7531543853288456193/", "text": "In Kenya, TomorrowNow turns AI-powered weather forecasts into text messages with advice farmers can act on—in their own language, on the phones they already use. This is the kind of innovation that can help AI’s benefits reach more people.", "createdAt": "2026-11-26T02:26:23.942Z", "author": { "id": "williamhgates", "username": "williamhgates", "displayName": "Bill Gates", "avatarUrl": "https://media.licdn.com/dms/image/v2/D5603AQF-RYZP55jmXA/profile-displayphoto-shrink_400_400/B56ZRi8g.aGsAg-/0/1736826818802?e=2147483647&v=beta&t=r6LJYwKPrJzfFDXVG8qAOoklQnqvEN855sHJ1NxhEAo", "verified": false, "url": "https://www.linkedin.com/in/williamhgates" }, "stats": { "views": null, "likes": 1139, "comments": 200, "shares": null, "saves": null, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "kind": "post", "title": null, "authorHeadline": "Chair, Gates Foundation and Founder, Breakthrough Energy", "repostedBy": null, "urn": "urn:li:share:7531543852617363456", "reshared": null, "edited": true, "linkPreview": { "url": "https://www.gatesnotes.com/fighting-climate-change-one-text-at-a-time", "title": "How AI is helping Kenyan farmers | Bill Gates", "subtitle": "gatesnotes.com" }, "captions": false, "language": null } } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.linkedin.post({ url: \"https://www.linkedin.com/posts/williamhgates_how-ai-is-helping-kenyan-farmers-bill-gates-activity-7531543853288456193-Ku5w\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.linkedin.post(url=\"https://www.linkedin.com/posts/williamhgates_how-ai-is-helping-kenyan-farmers-bill-gates-activity-7531543853288456193-Ku5w\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/linkedin/post \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://www.linkedin.com/posts/williamhgates_how-ai-is-helping-kenyan-farmers-bill-gates-activity-7531543853288456193-Ku5w\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_LinkedInPost": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/LinkedInPost" } } }, "LinkedInPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "edited", "captions" ], "properties": { "authorHeadline": { "type": [ "string", "null" ], "description": "What its author says it does (a member's headline, a company's followers line)." }, "captions": { "type": "boolean", "description": "Whether its video has a caption file (`/v1/linkedin/post/transcript`)." }, "edited": { "type": "boolean" }, "kind": { "oneOf": [ { "$ref": "#/components/schemas/LinkedInPostKind" }, { "type": "null" } ] }, "language": { "type": [ "string", "null" ], "description": "Its video's language, as LinkedIn tagged it." }, "linkPreview": { "oneOf": [ { "$ref": "#/components/schemas/LinkedInLinkPreview" }, { "type": "null" } ] }, "repostedBy": { "type": [ "string", "null" ], "description": "Who reposted it, where a page lists another's post as its own activity." }, "reshared": { "type": [ "string", "null" ], "description": "The post it shares with words of its own, by its id (`/v1/linkedin/post`)." }, "title": { "type": [ "string", "null" ], "description": "An article's title." }, "urn": { "type": [ "string", "null" ], "description": "The share or `ugcPost` it is the activity of, as `urn:li:…`." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A LinkedIn post or article." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "LinkedInLinkPreview": { "type": "object", "description": "A link a post shares, as its card shows it.", "required": [ "url" ], "properties": { "subtitle": { "type": [ "string", "null" ], "description": "The site, or the article's author." }, "title": { "type": [ "string", "null" ] }, "url": { "type": "string" } } }, "LinkedInPostKind": { "type": "string", "description": "What a post is.", "enum": [ "post", "article" ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Profile Articles (/docs/api-reference/linkedin/profile-articles) A member's articles, up to 10. `GET https://api.socialapi.sh/v1/linkedin/profile/articles` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.linkedin.profileArticles({ handle: "williamhgates" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.linkedin.profile_articles(handle="williamhgates") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/linkedin/profile/articles \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=williamhgates" ``` **Response** ```json { "data": [ { "id": "how-guinea-beat-tsetse-fly-bill-gates-6mxue", "url": "https://www.linkedin.com/pulse/how-guinea-beat-tsetse-fly-bill-gates-6mxue", "text": "The first sleeping sickness patient that Dr. Mamadou Camara ever diagnosed and treated was brought to him tied up.", "createdAt": "2026-11-22T18:16:13.000Z", "author": { "id": "williamhgates", "username": "williamhgates", "displayName": "Bill Gates", "avatarUrl": "https://media.licdn.com/dms/image/v2/D5603AQF-RYZP55jmXA/profile-displayphoto-shrink_200_200/B56ZRi8g.aGsAY-/0/1736826818802?e=2147483647&v=beta&t=bKWfN6UwwtiCqFWsG7rBELbd48qJOAMLdxhBzzkJV0k", "verified": false, "url": "https://www.linkedin.com/in/williamhgates" }, "stats": { "views": null, "likes": 2099, "comments": 299, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://media.licdn.com/dms/image/v2/D4E12AQFcEFxrggBZaA/article-cover_image-shrink_720_1280/B4EaIEZSo9IYAU-/0/1795370068830?e=2147483647&v=beta&t=xp8tkGfC9zilVUZpm_S1mQqQY93Xl57Nks7iWzdFsDE", "thumbnailUrl": null, "width": null, "height": null, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "kind": "article", "title": "How Guinea beat the tsetse fly", "authorHeadline": null, "repostedBy": null, "urn": null, "reshared": null, "edited": false, "linkPreview": null, "captions": false, "language": null } }, { "id": "fighting-climate-change-one-text-time-bill-gates-1ddze", "url": "https://www.linkedin.com/pulse/fighting-climate-change-one-text-time-bill-gates-1ddze", "text": "In Kenya, AI-powered weather forecasts are helping farmers adapt to a changing climate. When I check the forecast for…", "createdAt": "2026-11-16T03:34:05.000Z", "author": { "id": "williamhgates", "username": "williamhgates", "displayName": "Bill Gates", "avatarUrl": "https://media.licdn.com/dms/image/v2/D5603AQF-RYZP55jmXA/profile-displayphoto-shrink_200_200/B56ZRi8g.aGsAY-/0/1736826818802?e=2147483647&v=beta&t=bKWfN6UwwtiCqFWsG7rBELbd48qJOAMLdxhBzzkJV0k", "verified": false, "url": "https://www.linkedin.com/in/williamhgates" }, "stats": { "views": null, "likes": 2966, "comments": 488, "shares": null, "saves": null, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "kind": "article", "title": "Fighting climate change one text at a time", "authorHeadline": null, "repostedBy": null, "urn": null, "reshared": null, "edited": false, "linkPreview": null, "captions": false, "language": null } } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/linkedin/profile/articles": { "get": { "tags": [ "LinkedIn" ], "summary": "A member's articles, up to 10.", "description": "Its latest articles (LinkedIn Pulse), each with its title, cover, time, reactions and\ncomments; `/v1/linkedin/article` reads one whole. 1 credit.", "operationId": "linkedinProfileArticles", "parameters": [ { "name": "handle", "in": "query", "description": "The member's name in its profile's link (`williamhgates`).", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "Its profile's link (`https://www.linkedin.com/in/williamhgates`), instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_LinkedInPost" }, "example": { "data": [ { "id": "how-guinea-beat-tsetse-fly-bill-gates-6mxue", "url": "https://www.linkedin.com/pulse/how-guinea-beat-tsetse-fly-bill-gates-6mxue", "text": "The first sleeping sickness patient that Dr. Mamadou Camara ever diagnosed and treated was brought to him tied up.", "createdAt": "2026-11-22T18:16:13.000Z", "author": { "id": "williamhgates", "username": "williamhgates", "displayName": "Bill Gates", "avatarUrl": "https://media.licdn.com/dms/image/v2/D5603AQF-RYZP55jmXA/profile-displayphoto-shrink_200_200/B56ZRi8g.aGsAY-/0/1736826818802?e=2147483647&v=beta&t=bKWfN6UwwtiCqFWsG7rBELbd48qJOAMLdxhBzzkJV0k", "verified": false, "url": "https://www.linkedin.com/in/williamhgates" }, "stats": { "views": null, "likes": 2099, "comments": 299, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://media.licdn.com/dms/image/v2/D4E12AQFcEFxrggBZaA/article-cover_image-shrink_720_1280/B4EaIEZSo9IYAU-/0/1795370068830?e=2147483647&v=beta&t=xp8tkGfC9zilVUZpm_S1mQqQY93Xl57Nks7iWzdFsDE", "thumbnailUrl": null, "width": null, "height": null, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "kind": "article", "title": "How Guinea beat the tsetse fly", "authorHeadline": null, "repostedBy": null, "urn": null, "reshared": null, "edited": false, "linkPreview": null, "captions": false, "language": null } }, { "id": "fighting-climate-change-one-text-time-bill-gates-1ddze", "url": "https://www.linkedin.com/pulse/fighting-climate-change-one-text-time-bill-gates-1ddze", "text": "In Kenya, AI-powered weather forecasts are helping farmers adapt to a changing climate. When I check the forecast for…", "createdAt": "2026-11-16T03:34:05.000Z", "author": { "id": "williamhgates", "username": "williamhgates", "displayName": "Bill Gates", "avatarUrl": "https://media.licdn.com/dms/image/v2/D5603AQF-RYZP55jmXA/profile-displayphoto-shrink_200_200/B56ZRi8g.aGsAY-/0/1736826818802?e=2147483647&v=beta&t=bKWfN6UwwtiCqFWsG7rBELbd48qJOAMLdxhBzzkJV0k", "verified": false, "url": "https://www.linkedin.com/in/williamhgates" }, "stats": { "views": null, "likes": 2966, "comments": 488, "shares": null, "saves": null, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "kind": "article", "title": "Fighting climate change one text at a time", "authorHeadline": null, "repostedBy": null, "urn": null, "reshared": null, "edited": false, "linkPreview": null, "captions": false, "language": null } } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.linkedin.profileArticles({ handle: \"williamhgates\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.linkedin.profile_articles(handle=\"williamhgates\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/linkedin/profile/articles \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=williamhgates\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_LinkedInPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/LinkedInPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "LinkedInPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "edited", "captions" ], "properties": { "authorHeadline": { "type": [ "string", "null" ], "description": "What its author says it does (a member's headline, a company's followers line)." }, "captions": { "type": "boolean", "description": "Whether its video has a caption file (`/v1/linkedin/post/transcript`)." }, "edited": { "type": "boolean" }, "kind": { "oneOf": [ { "$ref": "#/components/schemas/LinkedInPostKind" }, { "type": "null" } ] }, "language": { "type": [ "string", "null" ], "description": "Its video's language, as LinkedIn tagged it." }, "linkPreview": { "oneOf": [ { "$ref": "#/components/schemas/LinkedInLinkPreview" }, { "type": "null" } ] }, "repostedBy": { "type": [ "string", "null" ], "description": "Who reposted it, where a page lists another's post as its own activity." }, "reshared": { "type": [ "string", "null" ], "description": "The post it shares with words of its own, by its id (`/v1/linkedin/post`)." }, "title": { "type": [ "string", "null" ], "description": "An article's title." }, "urn": { "type": [ "string", "null" ], "description": "The share or `ugcPost` it is the activity of, as `urn:li:…`." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A LinkedIn post or article." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "LinkedInLinkPreview": { "type": "object", "description": "A link a post shares, as its card shows it.", "required": [ "url" ], "properties": { "subtitle": { "type": [ "string", "null" ], "description": "The site, or the article's author." }, "title": { "type": [ "string", "null" ] }, "url": { "type": "string" } } }, "LinkedInPostKind": { "type": "string", "description": "What a post is.", "enum": [ "post", "article" ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Profile Posts (/docs/api-reference/linkedin/profile-posts) A member's latest posts, about 10. `GET https://api.socialapi.sh/v1/linkedin/profile/posts` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.linkedin.profilePosts({ handle: "williamhgates" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.linkedin.profile_posts(handle="williamhgates") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/linkedin/profile/posts \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=williamhgates" ``` **Response** ```json { "data": [ { "id": "7531543853288456193", "url": "https://www.linkedin.com/posts/williamhgates_how-ai-is-helping-kenyan-farmers-bill-gates-activity-7531543853288456193-Ku5w", "text": "In Kenya, TomorrowNow turns AI-powered weather forecasts into text messages with advice farmers can act on—in their own language, on the phones they already use. This is the kind of innovation that can help AI’s benefits reach more people.", "createdAt": "2026-11-26T02:26:23.941Z", "author": { "id": "williamhgates", "username": "williamhgates", "displayName": "Bill Gates", "avatarUrl": "https://media.licdn.com/dms/image/v2/D5603AQF-RYZP55jmXA/profile-displayphoto-shrink_200_200/B56ZRi8g.aGsAY-/0/1736826818802?e=2147483647&v=beta&t=bKWfN6UwwtiCqFWsG7rBELbd48qJOAMLdxhBzzkJV0k", "verified": false, "url": "https://www.linkedin.com/in/williamhgates" }, "stats": { "views": null, "likes": 1139, "comments": 200, "shares": null, "saves": null, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "kind": "post", "title": null, "authorHeadline": null, "repostedBy": null, "urn": null, "reshared": null, "edited": false, "linkPreview": null, "captions": false, "language": null } }, { "id": "7531156249388843008", "url": "https://www.linkedin.com/posts/williamhgates_nick-kristof-is-masterful-at-getting-people-activity-7531156249388843008-vA8g", "text": "Nick Kristof is masterful at getting people to care about causes that are otherwise overlooked. This year, he’s supporting some incredible organizations through his Holiday Impact Prize.", "createdAt": "2026-11-25T00:46:11.970Z", "author": { "id": "williamhgates", "username": "williamhgates", "displayName": "Bill Gates", "avatarUrl": "https://media.licdn.com/dms/image/v2/D5603AQF-RYZP55jmXA/profile-displayphoto-shrink_200_200/B56ZRi8g.aGsAY-/0/1736826818802?e=2147483647&v=beta&t=bKWfN6UwwtiCqFWsG7rBELbd48qJOAMLdxhBzzkJV0k", "verified": false, "url": "https://www.linkedin.com/in/williamhgates" }, "stats": { "views": null, "likes": 444, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "kind": "post", "title": null, "authorHeadline": null, "repostedBy": null, "urn": null, "reshared": null, "edited": false, "linkPreview": null, "captions": false, "language": null } } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/linkedin/profile/posts": { "get": { "tags": [ "LinkedIn" ], "summary": "A member's latest posts, about 10.", "description": "What its profile shows a visitor: its latest posts, each with its text, time and\nreactions, and its comments where the page counts them. 1 credit.", "operationId": "linkedinProfilePosts", "parameters": [ { "name": "handle", "in": "query", "description": "The member's name in its profile's link (`williamhgates`).", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "Its profile's link (`https://www.linkedin.com/in/williamhgates`), instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_LinkedInPost" }, "example": { "data": [ { "id": "7531543853288456193", "url": "https://www.linkedin.com/posts/williamhgates_how-ai-is-helping-kenyan-farmers-bill-gates-activity-7531543853288456193-Ku5w", "text": "In Kenya, TomorrowNow turns AI-powered weather forecasts into text messages with advice farmers can act on—in their own language, on the phones they already use. This is the kind of innovation that can help AI’s benefits reach more people.", "createdAt": "2026-11-26T02:26:23.941Z", "author": { "id": "williamhgates", "username": "williamhgates", "displayName": "Bill Gates", "avatarUrl": "https://media.licdn.com/dms/image/v2/D5603AQF-RYZP55jmXA/profile-displayphoto-shrink_200_200/B56ZRi8g.aGsAY-/0/1736826818802?e=2147483647&v=beta&t=bKWfN6UwwtiCqFWsG7rBELbd48qJOAMLdxhBzzkJV0k", "verified": false, "url": "https://www.linkedin.com/in/williamhgates" }, "stats": { "views": null, "likes": 1139, "comments": 200, "shares": null, "saves": null, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "kind": "post", "title": null, "authorHeadline": null, "repostedBy": null, "urn": null, "reshared": null, "edited": false, "linkPreview": null, "captions": false, "language": null } }, { "id": "7531156249388843008", "url": "https://www.linkedin.com/posts/williamhgates_nick-kristof-is-masterful-at-getting-people-activity-7531156249388843008-vA8g", "text": "Nick Kristof is masterful at getting people to care about causes that are otherwise overlooked. This year, he’s supporting some incredible organizations through his Holiday Impact Prize.", "createdAt": "2026-11-25T00:46:11.970Z", "author": { "id": "williamhgates", "username": "williamhgates", "displayName": "Bill Gates", "avatarUrl": "https://media.licdn.com/dms/image/v2/D5603AQF-RYZP55jmXA/profile-displayphoto-shrink_200_200/B56ZRi8g.aGsAY-/0/1736826818802?e=2147483647&v=beta&t=bKWfN6UwwtiCqFWsG7rBELbd48qJOAMLdxhBzzkJV0k", "verified": false, "url": "https://www.linkedin.com/in/williamhgates" }, "stats": { "views": null, "likes": 444, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "kind": "post", "title": null, "authorHeadline": null, "repostedBy": null, "urn": null, "reshared": null, "edited": false, "linkPreview": null, "captions": false, "language": null } } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.linkedin.profilePosts({ handle: \"williamhgates\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.linkedin.profile_posts(handle=\"williamhgates\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/linkedin/profile/posts \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=williamhgates\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_LinkedInPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/LinkedInPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "LinkedInPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "edited", "captions" ], "properties": { "authorHeadline": { "type": [ "string", "null" ], "description": "What its author says it does (a member's headline, a company's followers line)." }, "captions": { "type": "boolean", "description": "Whether its video has a caption file (`/v1/linkedin/post/transcript`)." }, "edited": { "type": "boolean" }, "kind": { "oneOf": [ { "$ref": "#/components/schemas/LinkedInPostKind" }, { "type": "null" } ] }, "language": { "type": [ "string", "null" ], "description": "Its video's language, as LinkedIn tagged it." }, "linkPreview": { "oneOf": [ { "$ref": "#/components/schemas/LinkedInLinkPreview" }, { "type": "null" } ] }, "repostedBy": { "type": [ "string", "null" ], "description": "Who reposted it, where a page lists another's post as its own activity." }, "reshared": { "type": [ "string", "null" ], "description": "The post it shares with words of its own, by its id (`/v1/linkedin/post`)." }, "title": { "type": [ "string", "null" ], "description": "An article's title." }, "urn": { "type": [ "string", "null" ], "description": "The share or `ugcPost` it is the activity of, as `urn:li:…`." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A LinkedIn post or article." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "LinkedInLinkPreview": { "type": "object", "description": "A link a post shares, as its card shows it.", "required": [ "url" ], "properties": { "subtitle": { "type": [ "string", "null" ], "description": "The site, or the article's author." }, "title": { "type": [ "string", "null" ] }, "url": { "type": "string" } } }, "LinkedInPostKind": { "type": "string", "description": "What a post is.", "enum": [ "post", "article" ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Profile (/docs/api-reference/linkedin/profile) A member's public profile with its followers. `GET https://api.socialapi.sh/v1/linkedin/profile` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.linkedin.profile({ handle: "williamhgates" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.linkedin.profile(handle="williamhgates").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/linkedin/profile \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=williamhgates" ``` **Response** ```json { "data": { "id": "williamhgates", "username": "williamhgates", "displayName": "Bill Gates", "bio": "Chair of the Gates Foundation. Founder of Breakthrough Energy. Co-founder of Microsoft. Voracious reader. Avid traveler. Active blogger.", "avatarUrl": "https://media.licdn.com/dms/image/v2/D5603AQF-RYZP55jmXA/profile-displayphoto-shrink_200_200/B56ZRi8g.aGsAY-/0/1736826818802?e=2147483647&v=beta&t=bKWfN6UwwtiCqFWsG7rBELbd48qJOAMLdxhBzzkJV0k", "url": "https://www.linkedin.com/in/williamhgates", "verified": false, "private": false, "followers": 40865050, "following": null, "likes": null, "posts": null, "externalUrl": "https://gatesnot.es/sourcecode-li", "createdAt": null, "ext": { "headline": "Chair, Gates Foundation and Founder, Breakthrough Energy", "location": "Seattle, Washington, United States", "country": "US", "connections": 8, "connectionsMore": false, "labels": [ "Creator", "Top Voice" ], "influencer": true, "coverUrl": "https://media.licdn.com/dms/image/v2/D5616AQEjhPbTCeblYg/profile-displaybackgroundimage-shrink_200_800/B56ZcytR5SGsAc-/0/1748902420393?e=2147483647&v=beta&t=a-tBeZkxzWTHWYY6MAjxt0oTEuxlW33EUkK3gm5_te4", "current": [ { "name": "Gates Foundation", "url": "https://www.linkedin.com/company/gates-foundation" } ], "schools": [ { "name": "Harvard University", "url": "https://www.linkedin.com/school/harvard-university/" } ], "hidden": false, "experience": [ { "title": "Co-chair", "subtitle": "Gates Foundation", "url": "https://www.linkedin.com/company/gates-foundation", "starts": "2000", "ends": null, "current": true, "location": null, "description": null }, { "title": "Founder", "subtitle": "Breakthrough Energy", "url": "https://www.linkedin.com/company/breakthrough-energy", "starts": "2015", "ends": null, "current": true, "location": null, "description": null }, { "title": "Co-founder", "subtitle": "Microsoft", "url": "https://www.linkedin.com/company/microsoft", "starts": "1975", "ends": null, "current": true, "location": null, "description": null } ], "education": [ { "title": "Harvard University", "subtitle": null, "url": "https://www.linkedin.com/school/harvard-university/", "starts": "1973", "ends": "1975", "current": false, "location": null, "description": null }, { "title": "Lakeside School", "subtitle": null, "url": "https://www.linkedin.com/school/lakeside-school/", "starts": null, "ends": null, "current": false, "location": null, "description": null } ], "volunteering": [], "certifications": [], "publications": [], "patents": [], "projects": [], "honors": [], "languages": [], "courses": [], "testScores": [], "organizations": [], "skills": [], "recommendations": [], "websites": [ "https://gatesnot.es/sourcecode-li" ], "similar": [ { "name": "Melinda French Gates", "url": "https://www.linkedin.com/in/melindagates", "subtitle": "Pivotal", "location": "United States", "followers": 7000000 }, { "name": "Tyler Alterman", "url": "https://www.linkedin.com/in/tyleralterman", "subtitle": "Fractal University", "location": "Brooklyn, NY", "followers": 7000 }, { "name": "Todd J. Duckett", "url": "https://www.linkedin.com/in/toddjduckett", "subtitle": "Duckett Enterprises", "location": "Lansing, MI", "followers": 9000 } ] } } } ``` **OpenAPI** ```json { "paths": { "/v1/linkedin/profile": { "get": { "tags": [ "LinkedIn" ], "summary": "A member's public profile with its followers.", "description": "Its name, location, exact followers, connections (`500+`), about, current company and\nschool, websites, and the sections it filled in: volunteering, certifications,\npublications, patents, projects, honors, languages, courses, test scores,\norganizations, skills, recommendations, and similar profiles. Positions and schools\nare shown whole for members LinkedIn features (Top Voices, Influencers); for most,\nLinkedIn hides them from a visitor (`ext.hidden`). 1 credit.", "operationId": "linkedinProfile", "parameters": [ { "name": "handle", "in": "query", "description": "The member's name in its profile's link (`williamhgates`).", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "Its profile's link (`https://www.linkedin.com/in/williamhgates`), instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_LinkedInProfile" }, "example": { "data": { "id": "williamhgates", "username": "williamhgates", "displayName": "Bill Gates", "bio": "Chair of the Gates Foundation. Founder of Breakthrough Energy. Co-founder of Microsoft. Voracious reader. Avid traveler. Active blogger.", "avatarUrl": "https://media.licdn.com/dms/image/v2/D5603AQF-RYZP55jmXA/profile-displayphoto-shrink_200_200/B56ZRi8g.aGsAY-/0/1736826818802?e=2147483647&v=beta&t=bKWfN6UwwtiCqFWsG7rBELbd48qJOAMLdxhBzzkJV0k", "url": "https://www.linkedin.com/in/williamhgates", "verified": false, "private": false, "followers": 40865050, "following": null, "likes": null, "posts": null, "externalUrl": "https://gatesnot.es/sourcecode-li", "createdAt": null, "ext": { "headline": "Chair, Gates Foundation and Founder, Breakthrough Energy", "location": "Seattle, Washington, United States", "country": "US", "connections": 8, "connectionsMore": false, "labels": [ "Creator", "Top Voice" ], "influencer": true, "coverUrl": "https://media.licdn.com/dms/image/v2/D5616AQEjhPbTCeblYg/profile-displaybackgroundimage-shrink_200_800/B56ZcytR5SGsAc-/0/1748902420393?e=2147483647&v=beta&t=a-tBeZkxzWTHWYY6MAjxt0oTEuxlW33EUkK3gm5_te4", "current": [ { "name": "Gates Foundation", "url": "https://www.linkedin.com/company/gates-foundation" } ], "schools": [ { "name": "Harvard University", "url": "https://www.linkedin.com/school/harvard-university/" } ], "hidden": false, "experience": [ { "title": "Co-chair", "subtitle": "Gates Foundation", "url": "https://www.linkedin.com/company/gates-foundation", "starts": "2000", "ends": null, "current": true, "location": null, "description": null }, { "title": "Founder", "subtitle": "Breakthrough Energy", "url": "https://www.linkedin.com/company/breakthrough-energy", "starts": "2015", "ends": null, "current": true, "location": null, "description": null }, { "title": "Co-founder", "subtitle": "Microsoft", "url": "https://www.linkedin.com/company/microsoft", "starts": "1975", "ends": null, "current": true, "location": null, "description": null } ], "education": [ { "title": "Harvard University", "subtitle": null, "url": "https://www.linkedin.com/school/harvard-university/", "starts": "1973", "ends": "1975", "current": false, "location": null, "description": null }, { "title": "Lakeside School", "subtitle": null, "url": "https://www.linkedin.com/school/lakeside-school/", "starts": null, "ends": null, "current": false, "location": null, "description": null } ], "volunteering": [], "certifications": [], "publications": [], "patents": [], "projects": [], "honors": [], "languages": [], "courses": [], "testScores": [], "organizations": [], "skills": [], "recommendations": [], "websites": [ "https://gatesnot.es/sourcecode-li" ], "similar": [ { "name": "Melinda French Gates", "url": "https://www.linkedin.com/in/melindagates", "subtitle": "Pivotal", "location": "United States", "followers": 7000000 }, { "name": "Tyler Alterman", "url": "https://www.linkedin.com/in/tyleralterman", "subtitle": "Fractal University", "location": "Brooklyn, NY", "followers": 7000 }, { "name": "Todd J. Duckett", "url": "https://www.linkedin.com/in/toddjduckett", "subtitle": "Duckett Enterprises", "location": "Lansing, MI", "followers": 9000 } ] } } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.linkedin.profile({ handle: \"williamhgates\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.linkedin.profile(handle=\"williamhgates\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/linkedin/profile \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=williamhgates\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_LinkedInProfile": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/LinkedInProfile" } } }, "LinkedInProfile": { "allOf": [ { "type": "object", "description": "An account.", "required": [ "id", "username", "url", "verified", "private", "ext" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "bio": { "type": [ "string", "null" ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "displayName": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "connectionsMore", "labels", "influencer", "current", "schools", "hidden", "experience", "education", "volunteering", "certifications", "publications", "patents", "projects", "honors", "languages", "courses", "testScores", "organizations", "skills", "recommendations", "websites", "similar" ], "properties": { "certifications": { "type": "array", "items": { "$ref": "#/components/schemas/LinkedInEntry" } }, "connections": { "type": [ "integer", "null" ], "format": "int64", "description": "Its connections as shown: at most 500 (`500+`, see `connectionsMore`).", "minimum": 0 }, "connectionsMore": { "type": "boolean", "description": "More connections than shown (`500+`)." }, "country": { "type": [ "string", "null" ], "description": "Its country's ISO code." }, "courses": { "type": "array", "items": { "$ref": "#/components/schemas/LinkedInEntry" } }, "coverUrl": { "type": [ "string", "null" ] }, "current": { "type": "array", "items": { "$ref": "#/components/schemas/LinkedInEntityRef" }, "description": "Its current companies and its school, as its card names them." }, "education": { "type": "array", "items": { "$ref": "#/components/schemas/LinkedInEntry" } }, "experience": { "type": "array", "items": { "$ref": "#/components/schemas/LinkedInEntry" } }, "headline": { "type": [ "string", "null" ], "description": "What the member says it does, under its name (shown for members LinkedIn features,\nsuch as Top Voices; absent for most)." }, "hidden": { "type": "boolean", "description": "Whether LinkedIn hides its positions and schools from a visitor (most members since\nNovember 2025): `experience` and `education` are then empty, and `current` and\n`schools` name what it shows (its current company, its first school)." }, "honors": { "type": "array", "items": { "$ref": "#/components/schemas/LinkedInEntry" } }, "influencer": { "type": "boolean" }, "labels": { "type": "array", "items": { "type": "string" }, "description": "LinkedIn's labels for it (`Creator`, `Top Voice`), and whether it is an Influencer." }, "languages": { "type": "array", "items": { "$ref": "#/components/schemas/LinkedInEntry" } }, "location": { "type": [ "string", "null" ], "description": "Where it is, as written (`Seattle, Washington, United States`)." }, "organizations": { "type": "array", "items": { "$ref": "#/components/schemas/LinkedInEntry" } }, "patents": { "type": "array", "items": { "$ref": "#/components/schemas/LinkedInEntry" } }, "projects": { "type": "array", "items": { "$ref": "#/components/schemas/LinkedInEntry" } }, "publications": { "type": "array", "items": { "$ref": "#/components/schemas/LinkedInEntry" } }, "recommendations": { "type": "array", "items": { "$ref": "#/components/schemas/LinkedInRecommendation" } }, "schools": { "type": "array", "items": { "$ref": "#/components/schemas/LinkedInEntityRef" } }, "similar": { "type": "array", "items": { "$ref": "#/components/schemas/LinkedInCard" }, "description": "\"Other similar profiles\"." }, "skills": { "type": "array", "items": { "type": "string" } }, "testScores": { "type": "array", "items": { "$ref": "#/components/schemas/LinkedInEntry" } }, "volunteering": { "type": "array", "items": { "$ref": "#/components/schemas/LinkedInEntry" } }, "websites": { "type": "array", "items": { "type": "string" }, "description": "Its websites, as its card lists them." } } }, { "type": "object", "description": "What only this platform has." } ] }, "externalUrl": { "type": [ "string", "null" ], "description": "The link in the bio." }, "followers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "following": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "id": { "type": "string", "description": "The platform's id for the account." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "description": "Likes the account's posts received in total.", "minimum": 0 }, "posts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "private": { "type": "boolean" }, "url": { "type": "string", "description": "The profile's page." }, "username": { "type": "string", "description": "The handle, without `@`." }, "verified": { "type": "boolean" } } }, { "type": "object", "description": "A LinkedIn member's public profile." } ] }, "LinkedInEntry": { "type": "object", "description": "One item of a profile's section: a position, a school, a certification, a\npublication… as the section shows it.", "required": [ "title", "current" ], "properties": { "current": { "type": "boolean", "description": "Whether it lasts (\"Present\")." }, "description": { "type": [ "string", "null" ] }, "ends": { "type": [ "string", "null" ], "description": "When it ended, as LinkedIn writes it; absent while it lasts (`current`)." }, "location": { "type": [ "string", "null" ] }, "starts": { "type": [ "string", "null" ], "description": "When it began, as LinkedIn writes it (`Jan 2025`, `2000`)." }, "subtitle": { "type": [ "string", "null" ], "description": "The company, the degree, the issuer, the publisher, a language's proficiency." }, "title": { "type": "string", "description": "The position's title, the school's or the certification's name." }, "url": { "type": [ "string", "null" ], "description": "The LinkedIn page of the company, school or issuer, when linked." } } }, "LinkedInCard": { "type": "object", "description": "A member or a page as a list beside another shows it (\"Other similar profiles\").", "required": [ "name", "url" ], "properties": { "followers": { "type": [ "integer", "null" ], "format": "int64", "description": "Followers as shown (rounded past 1,000).", "minimum": 0 }, "location": { "type": [ "string", "null" ] }, "name": { "type": "string" }, "subtitle": { "type": [ "string", "null" ], "description": "A member's current company or headline, a page's industry." }, "url": { "type": "string" } } }, "LinkedInEntityRef": { "type": "object", "description": "A company, a school or a member as a page names it in passing.", "required": [ "name" ], "properties": { "name": { "type": "string" }, "url": { "type": [ "string", "null" ], "description": "Its LinkedIn page, when the page links it." } } }, "LinkedInRecommendation": { "type": "object", "description": "A recommendation another member wrote.", "required": [ "author", "text" ], "properties": { "author": { "type": "string" }, "authorUrl": { "type": [ "string", "null" ] }, "text": { "type": "string" } } }, "Timestamp": { "type": "string", "format": "date-time" } } } } ``` # Search Companies (/docs/api-reference/linkedin/search-companies) Companies matching a name, with their ids. `GET https://api.socialapi.sh/v1/linkedin/search/companies` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.linkedin.searchCompanies({ query: "microsoft" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.linkedin.search_companies(query="microsoft") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/linkedin/search/companies \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "query=microsoft" ``` **Response** ```json { "data": [ { "id": "1035", "name": "Microsoft" }, { "id": "18201534", "name": "Microsoft AI" } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/linkedin/search/companies": { "get": { "tags": [ "LinkedIn" ], "summary": "Companies matching a name, with their ids.", "description": "The companies LinkedIn's job search suggests for a name, the best match first, at most\n10: each with its id, which `/v1/linkedin/company/jobs` takes as `companyId`, and its\nname. An empty list when none matches. 1 credit, cached a day.", "operationId": "linkedinSearchCompanies", "parameters": [ { "name": "query", "in": "query", "description": "The words to match, as a search box takes them (`berlin`, `microsoft`).", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_LinkedInCompanyMatch" }, "example": { "data": [ { "id": "1035", "name": "Microsoft" }, { "id": "18201534", "name": "Microsoft AI" } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.linkedin.searchCompanies({ query: \"microsoft\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.linkedin.search_companies(query=\"microsoft\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/linkedin/search/companies \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"query=microsoft\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_LinkedInCompanyMatch": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/LinkedInCompanyMatch" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "LinkedInCompanyMatch": { "type": "object", "description": "A company as job search's company filter suggests it.", "required": [ "id", "name" ], "properties": { "id": { "type": "string", "description": "Its numeric id: the company's jobs' `companyId` (`/v1/linkedin/company/jobs`)." }, "name": { "type": "string" } } } } } } ``` # Search Jobs (/docs/api-reference/linkedin/search-jobs) Job postings for a search, 10 a page. `GET https://api.socialapi.sh/v1/linkedin/search/jobs` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.linkedin.searchJobs({ query: "software engineer", locationId: "106967730" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.linkedin.search_jobs(query="software engineer", location_id="106967730") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/linkedin/search/jobs \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "query=software engineer" \ --data-urlencode "locationId=106967730" ``` **Response** ```json { "data": [ { "id": "4474086156", "url": "https://www.linkedin.com/jobs/view/4474086156/", "title": "Senior Backend Developer (m/w/d) – C# / .NET", "company": { "name": "Vivecti Group", "url": "https://www.linkedin.com/company/vivecti-group" }, "companyLogoUrl": "https://media.licdn.com/dms/image/v2/D4E0BAQFyu5QCSAKNLA/company-logo_100_100/company-logo_100_100/0/1691130368395/prospitalia_group_logo?e=2147483647&v=beta&t=QjURHx44ViNdi6V6_d9IoJhD_qav3hmLY-LCYCgNF4I", "location": "Berlin, Berlin, Germany", "postedAt": "2026-10-06T00:00:00.000Z", "posted": "1 month ago", "applicants": null, "salary": null, "insights": [], "description": null, "seniority": null, "employmentType": null, "jobFunction": null, "industries": null }, { "id": "4447350659", "url": "https://www.linkedin.com/jobs/view/4447350659/", "title": "Softwareentwickler C# / .Net Core (m/w/d) - Berlin", "company": { "name": "Nexus AG", "url": "https://www.linkedin.com/company/nexus-ag" }, "companyLogoUrl": "https://media.licdn.com/dms/image/v2/D4E0BAQGDrCsIQBYT-Q/company-logo_100_100/B4EZcV5meHHQAU-/0/1748419111257/nexus_ag_logo?e=2147483647&v=beta&t=CLWFWfUgD77IQ8I-_CQwv7JPKHuRtie2lTThq5Qd0yY", "location": "Berlin, Berlin, Germany", "postedAt": "2026-08-05T00:00:00.000Z", "posted": "3 months ago", "applicants": null, "salary": null, "insights": [], "description": null, "seniority": null, "employmentType": null, "jobFunction": null, "industries": null } ], "pagination": { "nextCursor": "10", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/linkedin/search/jobs": { "get": { "tags": [ "LinkedIn" ], "summary": "Job postings for a search, 10 a page.", "description": "LinkedIn's job search by words and a place (as written, or by its `locationId` from\n`/v1/linkedin/search/locations`), posted within a `day`, `week` or `month`, by contract\n`type`, `experience` and `workplace`: each job with its company, location, the day it\nwas posted, its pay where given and LinkedIn's notes on it; up to 1,000. 1 credit a\npage, cached 2 minutes.", "operationId": "linkedinSearchJobs", "parameters": [ { "name": "query", "in": "query", "description": "What to search for: a title, skills, a company.", "required": false, "schema": { "type": "string" } }, { "name": "location", "in": "query", "description": "Where: a city, a region or a country, as written (`Berlin, Germany`).", "required": false, "schema": { "type": "string" } }, { "name": "locationId", "in": "query", "description": "Where, by a place's id from `/v1/linkedin/search/locations` (`106967730`, Berlin,\nGermany), instead of `location`: the place meant, where a name is several places'.", "required": false, "schema": { "type": "string" } }, { "name": "posted", "in": "query", "description": "`day`, `week` or `month`: posted that recently.", "required": false, "schema": { "type": "string", "description": "How recently a job was posted.", "enum": [ "day", "week", "month" ] } }, { "name": "type", "in": "query", "description": "Comma-separated: `full-time`, `part-time`, `contract`, `temporary`, `internship`,\n`volunteer`, `other`.", "required": false, "schema": { "type": "string" } }, { "name": "experience", "in": "query", "description": "Comma-separated: `internship`, `entry`, `associate`, `mid-senior`, `director`,\n`executive`.", "required": false, "schema": { "type": "string" } }, { "name": "workplace", "in": "query", "description": "Comma-separated: `on-site`, `remote`, `hybrid`.", "required": false, "schema": { "type": "string" } }, { "name": "sort", "in": "query", "description": "`relevance` (the default) or `recent` (the newest first).", "required": false, "schema": { "type": "string", "description": "How job search orders its results.", "enum": [ "relevance", "recent" ] } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_LinkedInJob" }, "example": { "data": [ { "id": "4474086156", "url": "https://www.linkedin.com/jobs/view/4474086156/", "title": "Senior Backend Developer (m/w/d) – C# / .NET", "company": { "name": "Vivecti Group", "url": "https://www.linkedin.com/company/vivecti-group" }, "companyLogoUrl": "https://media.licdn.com/dms/image/v2/D4E0BAQFyu5QCSAKNLA/company-logo_100_100/company-logo_100_100/0/1691130368395/prospitalia_group_logo?e=2147483647&v=beta&t=QjURHx44ViNdi6V6_d9IoJhD_qav3hmLY-LCYCgNF4I", "location": "Berlin, Berlin, Germany", "postedAt": "2026-10-06T00:00:00.000Z", "posted": "1 month ago", "applicants": null, "salary": null, "insights": [], "description": null, "seniority": null, "employmentType": null, "jobFunction": null, "industries": null }, { "id": "4447350659", "url": "https://www.linkedin.com/jobs/view/4447350659/", "title": "Softwareentwickler C# / .Net Core (m/w/d) - Berlin", "company": { "name": "Nexus AG", "url": "https://www.linkedin.com/company/nexus-ag" }, "companyLogoUrl": "https://media.licdn.com/dms/image/v2/D4E0BAQGDrCsIQBYT-Q/company-logo_100_100/B4EZcV5meHHQAU-/0/1748419111257/nexus_ag_logo?e=2147483647&v=beta&t=CLWFWfUgD77IQ8I-_CQwv7JPKHuRtie2lTThq5Qd0yY", "location": "Berlin, Berlin, Germany", "postedAt": "2026-08-05T00:00:00.000Z", "posted": "3 months ago", "applicants": null, "salary": null, "insights": [], "description": null, "seniority": null, "employmentType": null, "jobFunction": null, "industries": null } ], "pagination": { "nextCursor": "10", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.linkedin.searchJobs({ query: \"software engineer\", locationId: \"106967730\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.linkedin.search_jobs(query=\"software engineer\", location_id=\"106967730\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/linkedin/search/jobs \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"query=software engineer\" \\\n --data-urlencode \"locationId=106967730\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_LinkedInJob": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/LinkedInJob" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "LinkedInJob": { "type": "object", "description": "A job posting.", "required": [ "id", "url", "title", "insights" ], "properties": { "applicants": { "type": [ "integer", "null" ], "format": "int64", "description": "Applicants as shown (`30 applicants`; `Over 200 applicants` is 200).", "minimum": 0 }, "company": { "oneOf": [ { "$ref": "#/components/schemas/LinkedInEntityRef" }, { "type": "null" } ] }, "companyLogoUrl": { "type": [ "string", "null" ] }, "description": { "type": [ "string", "null" ], "description": "The posting's text (its page only)." }, "employmentType": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "industries": { "type": [ "string", "null" ] }, "insights": { "type": "array", "items": { "type": "string" }, "description": "LinkedIn's notes on it (`Actively Hiring`, `Be an early applicant`)." }, "jobFunction": { "type": [ "string", "null" ] }, "location": { "type": [ "string", "null" ] }, "posted": { "type": [ "string", "null" ], "description": "How long ago it was posted, as shown (`1 week ago`)." }, "postedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "The day it was posted (search results; a posting's page says only how long ago)." }, { "type": "null" } ] }, "salary": { "type": [ "string", "null" ], "description": "Its pay, when the posting gives it (`$150K/yr - $200K/yr`)." }, "seniority": { "type": [ "string", "null" ] }, "title": { "type": "string" }, "url": { "type": "string" } } }, "Timestamp": { "type": "string", "format": "date-time" }, "LinkedInEntityRef": { "type": "object", "description": "A company, a school or a member as a page names it in passing.", "required": [ "name" ], "properties": { "name": { "type": "string" }, "url": { "type": [ "string", "null" ], "description": "Its LinkedIn page, when the page links it." } } } } } } ``` # Search Locations (/docs/api-reference/linkedin/search-locations) Places matching a name, with their ids. `GET https://api.socialapi.sh/v1/linkedin/search/locations` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.linkedin.searchLocations({ query: "berlin" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.linkedin.search_locations(query="berlin") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/linkedin/search/locations \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "query=berlin" ``` **Response** ```json { "data": [ { "id": "106967730", "name": "Berlin, Berlin, Germany" }, { "id": "90009712", "name": "Berlin Metropolitan Area" } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/linkedin/search/locations": { "get": { "tags": [ "LinkedIn" ], "summary": "Places matching a name, with their ids.", "description": "The cities, regions, metropolitan areas and countries LinkedIn's job search suggests\nfor a name, the best match first, at most 10: each with its id, which\n`/v1/linkedin/search/jobs` takes as `locationId`, and its full name (`Berlin, Berlin,\nGermany`), so the place meant is told from others of its name. An empty list when none\nmatches. 1 credit, cached a day.", "operationId": "linkedinSearchLocations", "parameters": [ { "name": "query", "in": "query", "description": "The words to match, as a search box takes them (`berlin`, `microsoft`).", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_LinkedInLocation" }, "example": { "data": [ { "id": "106967730", "name": "Berlin, Berlin, Germany" }, { "id": "90009712", "name": "Berlin Metropolitan Area" } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.linkedin.searchLocations({ query: \"berlin\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.linkedin.search_locations(query=\"berlin\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/linkedin/search/locations \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"query=berlin\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_LinkedInLocation": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/LinkedInLocation" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "LinkedInLocation": { "type": "object", "description": "A place job search knows, as its location box suggests it.", "required": [ "id", "name" ], "properties": { "id": { "type": "string", "description": "Its id: job search's `locationId` (`/v1/linkedin/search/jobs`)." }, "name": { "type": "string", "description": "Its name as LinkedIn writes it (`Berlin, Berlin, Germany`, `Berlin Metropolitan\nArea`)." } } } } } } ``` # Search Users (/docs/api-reference/linkedin/search-users) Members with a first and last name, up to 50. `GET https://api.socialapi.sh/v1/linkedin/search/users` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.linkedin.searchUsers({ firstName: "John", lastName: "Smith" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.linkedin.search_users(first_name="John", last_name="Smith") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/linkedin/search/users \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "firstName=John" \ --data-urlencode "lastName=Smith" ``` **Response** ```json { "data": [ { "id": "john-smith-53b964", "username": "john-smith-53b964", "displayName": "John Smith", "bio": null, "avatarUrl": null, "url": "https://www.linkedin.com/in/john-smith-53b964", "verified": false, "private": false, "followers": null, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": null, "ext": { "headline": null, "location": "Amersham", "country": null, "connections": null, "connectionsMore": false, "labels": [], "influencer": false, "coverUrl": null, "current": [], "schools": [], "hidden": false, "experience": [], "education": [], "volunteering": [], "certifications": [], "publications": [], "patents": [], "projects": [], "honors": [], "languages": [], "courses": [], "testScores": [], "organizations": [], "skills": [], "recommendations": [], "websites": [], "similar": [] } }, { "id": "johnsidneysmith", "username": "johnsidneysmith", "displayName": "John Smith", "bio": null, "avatarUrl": null, "url": "https://www.linkedin.com/in/johnsidneysmith", "verified": false, "private": false, "followers": null, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": null, "ext": { "headline": null, "location": "Amsterdam", "country": null, "connections": null, "connectionsMore": false, "labels": [], "influencer": false, "coverUrl": null, "current": [ { "name": "PPG", "url": null } ], "schools": [], "hidden": false, "experience": [], "education": [], "volunteering": [], "certifications": [], "publications": [], "patents": [], "projects": [], "honors": [], "languages": [], "courses": [], "testScores": [], "organizations": [], "skills": [], "recommendations": [], "websites": [], "similar": [] } } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/linkedin/search/users": { "get": { "tags": [ "LinkedIn" ], "summary": "Members with a first and last name, up to 50.", "description": "LinkedIn's people directory of a name: each member with its location and current\ncompanies, as the directory lists them. 1 credit.", "operationId": "linkedinSearchUsers", "parameters": [ { "name": "firstName", "in": "query", "description": "The first name, as members write it.", "required": false, "schema": { "type": "string" } }, { "name": "lastName", "in": "query", "description": "The last name.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_LinkedInProfile" }, "example": { "data": [ { "id": "john-smith-53b964", "username": "john-smith-53b964", "displayName": "John Smith", "bio": null, "avatarUrl": null, "url": "https://www.linkedin.com/in/john-smith-53b964", "verified": false, "private": false, "followers": null, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": null, "ext": { "headline": null, "location": "Amersham", "country": null, "connections": null, "connectionsMore": false, "labels": [], "influencer": false, "coverUrl": null, "current": [], "schools": [], "hidden": false, "experience": [], "education": [], "volunteering": [], "certifications": [], "publications": [], "patents": [], "projects": [], "honors": [], "languages": [], "courses": [], "testScores": [], "organizations": [], "skills": [], "recommendations": [], "websites": [], "similar": [] } }, { "id": "johnsidneysmith", "username": "johnsidneysmith", "displayName": "John Smith", "bio": null, "avatarUrl": null, "url": "https://www.linkedin.com/in/johnsidneysmith", "verified": false, "private": false, "followers": null, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": null, "ext": { "headline": null, "location": "Amsterdam", "country": null, "connections": null, "connectionsMore": false, "labels": [], "influencer": false, "coverUrl": null, "current": [ { "name": "PPG", "url": null } ], "schools": [], "hidden": false, "experience": [], "education": [], "volunteering": [], "certifications": [], "publications": [], "patents": [], "projects": [], "honors": [], "languages": [], "courses": [], "testScores": [], "organizations": [], "skills": [], "recommendations": [], "websites": [], "similar": [] } } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.linkedin.searchUsers({ firstName: \"John\", lastName: \"Smith\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.linkedin.search_users(first_name=\"John\", last_name=\"Smith\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/linkedin/search/users \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"firstName=John\" \\\n --data-urlencode \"lastName=Smith\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_LinkedInProfile": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/LinkedInProfile" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "LinkedInProfile": { "allOf": [ { "type": "object", "description": "An account.", "required": [ "id", "username", "url", "verified", "private", "ext" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "bio": { "type": [ "string", "null" ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "displayName": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "connectionsMore", "labels", "influencer", "current", "schools", "hidden", "experience", "education", "volunteering", "certifications", "publications", "patents", "projects", "honors", "languages", "courses", "testScores", "organizations", "skills", "recommendations", "websites", "similar" ], "properties": { "certifications": { "type": "array", "items": { "$ref": "#/components/schemas/LinkedInEntry" } }, "connections": { "type": [ "integer", "null" ], "format": "int64", "description": "Its connections as shown: at most 500 (`500+`, see `connectionsMore`).", "minimum": 0 }, "connectionsMore": { "type": "boolean", "description": "More connections than shown (`500+`)." }, "country": { "type": [ "string", "null" ], "description": "Its country's ISO code." }, "courses": { "type": "array", "items": { "$ref": "#/components/schemas/LinkedInEntry" } }, "coverUrl": { "type": [ "string", "null" ] }, "current": { "type": "array", "items": { "$ref": "#/components/schemas/LinkedInEntityRef" }, "description": "Its current companies and its school, as its card names them." }, "education": { "type": "array", "items": { "$ref": "#/components/schemas/LinkedInEntry" } }, "experience": { "type": "array", "items": { "$ref": "#/components/schemas/LinkedInEntry" } }, "headline": { "type": [ "string", "null" ], "description": "What the member says it does, under its name (shown for members LinkedIn features,\nsuch as Top Voices; absent for most)." }, "hidden": { "type": "boolean", "description": "Whether LinkedIn hides its positions and schools from a visitor (most members since\nNovember 2025): `experience` and `education` are then empty, and `current` and\n`schools` name what it shows (its current company, its first school)." }, "honors": { "type": "array", "items": { "$ref": "#/components/schemas/LinkedInEntry" } }, "influencer": { "type": "boolean" }, "labels": { "type": "array", "items": { "type": "string" }, "description": "LinkedIn's labels for it (`Creator`, `Top Voice`), and whether it is an Influencer." }, "languages": { "type": "array", "items": { "$ref": "#/components/schemas/LinkedInEntry" } }, "location": { "type": [ "string", "null" ], "description": "Where it is, as written (`Seattle, Washington, United States`)." }, "organizations": { "type": "array", "items": { "$ref": "#/components/schemas/LinkedInEntry" } }, "patents": { "type": "array", "items": { "$ref": "#/components/schemas/LinkedInEntry" } }, "projects": { "type": "array", "items": { "$ref": "#/components/schemas/LinkedInEntry" } }, "publications": { "type": "array", "items": { "$ref": "#/components/schemas/LinkedInEntry" } }, "recommendations": { "type": "array", "items": { "$ref": "#/components/schemas/LinkedInRecommendation" } }, "schools": { "type": "array", "items": { "$ref": "#/components/schemas/LinkedInEntityRef" } }, "similar": { "type": "array", "items": { "$ref": "#/components/schemas/LinkedInCard" }, "description": "\"Other similar profiles\"." }, "skills": { "type": "array", "items": { "type": "string" } }, "testScores": { "type": "array", "items": { "$ref": "#/components/schemas/LinkedInEntry" } }, "volunteering": { "type": "array", "items": { "$ref": "#/components/schemas/LinkedInEntry" } }, "websites": { "type": "array", "items": { "type": "string" }, "description": "Its websites, as its card lists them." } } }, { "type": "object", "description": "What only this platform has." } ] }, "externalUrl": { "type": [ "string", "null" ], "description": "The link in the bio." }, "followers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "following": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "id": { "type": "string", "description": "The platform's id for the account." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "description": "Likes the account's posts received in total.", "minimum": 0 }, "posts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "private": { "type": "boolean" }, "url": { "type": "string", "description": "The profile's page." }, "username": { "type": "string", "description": "The handle, without `@`." }, "verified": { "type": "boolean" } } }, { "type": "object", "description": "A LinkedIn member's public profile." } ] }, "LinkedInEntry": { "type": "object", "description": "One item of a profile's section: a position, a school, a certification, a\npublication… as the section shows it.", "required": [ "title", "current" ], "properties": { "current": { "type": "boolean", "description": "Whether it lasts (\"Present\")." }, "description": { "type": [ "string", "null" ] }, "ends": { "type": [ "string", "null" ], "description": "When it ended, as LinkedIn writes it; absent while it lasts (`current`)." }, "location": { "type": [ "string", "null" ] }, "starts": { "type": [ "string", "null" ], "description": "When it began, as LinkedIn writes it (`Jan 2025`, `2000`)." }, "subtitle": { "type": [ "string", "null" ], "description": "The company, the degree, the issuer, the publisher, a language's proficiency." }, "title": { "type": "string", "description": "The position's title, the school's or the certification's name." }, "url": { "type": [ "string", "null" ], "description": "The LinkedIn page of the company, school or issuer, when linked." } } }, "LinkedInCard": { "type": "object", "description": "A member or a page as a list beside another shows it (\"Other similar profiles\").", "required": [ "name", "url" ], "properties": { "followers": { "type": [ "integer", "null" ], "format": "int64", "description": "Followers as shown (rounded past 1,000).", "minimum": 0 }, "location": { "type": [ "string", "null" ] }, "name": { "type": "string" }, "subtitle": { "type": [ "string", "null" ], "description": "A member's current company or headline, a page's industry." }, "url": { "type": "string" } } }, "LinkedInEntityRef": { "type": "object", "description": "A company, a school or a member as a page names it in passing.", "required": [ "name" ], "properties": { "name": { "type": "string" }, "url": { "type": [ "string", "null" ], "description": "Its LinkedIn page, when the page links it." } } }, "LinkedInRecommendation": { "type": "object", "description": "A recommendation another member wrote.", "required": [ "author", "text" ], "properties": { "author": { "type": "string" }, "authorUrl": { "type": [ "string", "null" ] }, "text": { "type": "string" } } }, "Timestamp": { "type": "string", "format": "date-time" } } } } ``` # Board Posts (/docs/api-reference/pinterest/board-posts) A board's pins, 25 a page. `GET https://api.socialapi.sh/v1/pinterest/board/posts` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.pinterest.boardPosts({ url: "https://www.pinterest.com/nasa/learn-with-nasa/" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.pinterest.board_posts(url="https://www.pinterest.com/nasa/learn-with-nasa/") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/pinterest/board/posts \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://www.pinterest.com/nasa/learn-with-nasa/" ``` **Response** ```json { "data": [ { "id": "e1_AfqPShyR32wzp0E0SUfK16l89tXElInPxuubc7QrT55DYWu4xNSL", "url": "https://www.pinterest.com/pin/e1_AfqPShyR32wzp0E0SUfK16l89tXElInPxuubc7QrT55DYWu4xNSL/", "text": "When NASA engineers design robots to go to extreme places, they often get inspiration from insects! In this challenge, you'll think about the unique characteristics of insects, like their wings or antennae, and draw a design for a robotic insect that can meet the unique challenges of its environment.", "createdAt": null, "author": { "id": "142567281862381039", "username": "nasa", "displayName": "NASA", "avatarUrl": "https://i.pinimg.com/75x75_RS/37/a1/75/37a175e6d2431425576f0b8f81389394.jpg", "verified": true, "url": "https://www.pinterest.com/nasa/" }, "stats": { "views": null, "likes": 357, "comments": null, "shares": null, "saves": 1581, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://i.pinimg.com/originals/89/b3/fe/89b3fe8e465f05f1ad88ab01b6ff409e.jpg", "thumbnailUrl": null, "width": 1000, "height": 1500, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "kind": "image", "title": "Design a Robotic Insect With NASA!", "link": "https://www.jpl.nasa.gov/edu/resources/project/design-a-robotic-insect-2/", "domain": "jpl.nasa.gov", "board": { "id": "142567213143159083", "name": "Learn With NASA", "url": "https://www.pinterest.com/nasa/learn-with-nasa/" }, "commentsId": "5397993390826646980", "openable": false, "dominantColor": "#3d51a1", "altText": "When NASA engineers design robots to go to extreme places, they often get inspiration from insects! In this challenge, you'll think about the unique characteristics of insects, like their wings or antennae, and draw a design for a robotic insect that can meet the unique challenges of its environment.", "commentsDisabled": false } }, { "id": "e1_AfqPShzwtPa3v3lGBz1Je9mRkmi6hgCqSe6QsTbsLUqcDvZ2TxT8", "url": "https://www.pinterest.com/pin/e1_AfqPShzwtPa3v3lGBz1Je9mRkmi6hgCqSe6QsTbsLUqcDvZ2TxT8/", "text": "Explore the wonder of space exploration from home. Here you can find out how to make rockets, Mars rovers and Moon landers out of materials you have at home. Watch videos to learn to make volcanos, cloud mobiles and more with subtitles in Spanish.", "createdAt": null, "author": { "id": "142567281862381039", "username": "nasa", "displayName": "NASA", "avatarUrl": "https://i.pinimg.com/75x75_RS/37/a1/75/37a175e6d2431425576f0b8f81389394.jpg", "verified": true, "url": "https://www.pinterest.com/nasa/" }, "stats": { "views": null, "likes": 437, "comments": null, "shares": null, "saves": 1768, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://i.pinimg.com/originals/44/ef/b3/44efb39ef37d62b2bb57b8408d962810.png", "thumbnailUrl": null, "width": 1000, "height": 1500, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "kind": "image", "title": "Learning Space With NASA at Home", "link": "https://www.nasa.gov/stem-content/learning-space-with-nasa-at-home/", "domain": "nasa.gov", "board": { "id": "142567213143159083", "name": "Learn With NASA", "url": "https://www.pinterest.com/nasa/learn-with-nasa/" }, "commentsId": "5399627297336638381", "openable": false, "dominantColor": "#4d3b40", "altText": "A graphic with a deep blue background to represent space, with stars sprinkled in. In the center of the image are the words \"Learning Space with NASA at Home\" in white lettering with a orange glow around it. Surrounding the words are different icons show how much there is to learn. A cartoon moon is in the bottom right corner, with a rocket to the left of it. Above the rocket is a cartoon astronau…", "commentsDisabled": false } } ], "pagination": { "nextCursor": "Y2JZakk0ZVU1WWQzcE5WRVV4VDBSbmVVMVVXVEpPVkVFd1RsUmpkMHRyWkZKVVEzQTRUa2RTYVZwWFNtaE5WRlp0VG1wSmVWcHRXbXRPUjFKcVdtMVJORmx0UlhsT2VrVjVXbXBhYUU5VVVYbE9Na2t5V1dwamVWcHFaR3hPVkZFd1dYcE9iRTF0V20xYVYxRjZXbFJyZVUweVdtdGFWRmw0V2xoNFQxSldaRGc9fFVIbzVUMkl5Tld4bVJFMTRUVlJWTkU5RVNYaE9hbGt4VFVSUk1VNTZRWEZTTVVaTlMyNTNlazFxV210YVIwVXlUVWRXYkU1dFNURlBSRTB3VG1wb2FsbDZVVEZOYlZKclRWUmthVTVxYUd4Wk1sVjZXbFJSTVU1WFRYaGFS…", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/pinterest/board/posts": { "get": { "tags": [ "Pinterest" ], "summary": "A board's pins, 25 a page.", "description": "Pins saved from others mostly have encrypted ids (`e1_…`), which `/post` cannot open;\ntheir comments are read by `ext.commentsId`. 1 credit a page.", "operationId": "pinterestBoardPosts", "parameters": [ { "name": "url", "in": "query", "description": "The board's link.", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The board's id, instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_PinterestPost" }, "example": { "data": [ { "id": "e1_AfqPShyR32wzp0E0SUfK16l89tXElInPxuubc7QrT55DYWu4xNSL", "url": "https://www.pinterest.com/pin/e1_AfqPShyR32wzp0E0SUfK16l89tXElInPxuubc7QrT55DYWu4xNSL/", "text": "When NASA engineers design robots to go to extreme places, they often get inspiration from insects! In this challenge, you'll think about the unique characteristics of insects, like their wings or antennae, and draw a design for a robotic insect that can meet the unique challenges of its environment.", "createdAt": null, "author": { "id": "142567281862381039", "username": "nasa", "displayName": "NASA", "avatarUrl": "https://i.pinimg.com/75x75_RS/37/a1/75/37a175e6d2431425576f0b8f81389394.jpg", "verified": true, "url": "https://www.pinterest.com/nasa/" }, "stats": { "views": null, "likes": 357, "comments": null, "shares": null, "saves": 1581, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://i.pinimg.com/originals/89/b3/fe/89b3fe8e465f05f1ad88ab01b6ff409e.jpg", "thumbnailUrl": null, "width": 1000, "height": 1500, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "kind": "image", "title": "Design a Robotic Insect With NASA!", "link": "https://www.jpl.nasa.gov/edu/resources/project/design-a-robotic-insect-2/", "domain": "jpl.nasa.gov", "board": { "id": "142567213143159083", "name": "Learn With NASA", "url": "https://www.pinterest.com/nasa/learn-with-nasa/" }, "commentsId": "5397993390826646980", "openable": false, "dominantColor": "#3d51a1", "altText": "When NASA engineers design robots to go to extreme places, they often get inspiration from insects! In this challenge, you'll think about the unique characteristics of insects, like their wings or antennae, and draw a design for a robotic insect that can meet the unique challenges of its environment.", "commentsDisabled": false } }, { "id": "e1_AfqPShzwtPa3v3lGBz1Je9mRkmi6hgCqSe6QsTbsLUqcDvZ2TxT8", "url": "https://www.pinterest.com/pin/e1_AfqPShzwtPa3v3lGBz1Je9mRkmi6hgCqSe6QsTbsLUqcDvZ2TxT8/", "text": "Explore the wonder of space exploration from home. Here you can find out how to make rockets, Mars rovers and Moon landers out of materials you have at home. Watch videos to learn to make volcanos, cloud mobiles and more with subtitles in Spanish.", "createdAt": null, "author": { "id": "142567281862381039", "username": "nasa", "displayName": "NASA", "avatarUrl": "https://i.pinimg.com/75x75_RS/37/a1/75/37a175e6d2431425576f0b8f81389394.jpg", "verified": true, "url": "https://www.pinterest.com/nasa/" }, "stats": { "views": null, "likes": 437, "comments": null, "shares": null, "saves": 1768, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://i.pinimg.com/originals/44/ef/b3/44efb39ef37d62b2bb57b8408d962810.png", "thumbnailUrl": null, "width": 1000, "height": 1500, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "kind": "image", "title": "Learning Space With NASA at Home", "link": "https://www.nasa.gov/stem-content/learning-space-with-nasa-at-home/", "domain": "nasa.gov", "board": { "id": "142567213143159083", "name": "Learn With NASA", "url": "https://www.pinterest.com/nasa/learn-with-nasa/" }, "commentsId": "5399627297336638381", "openable": false, "dominantColor": "#4d3b40", "altText": "A graphic with a deep blue background to represent space, with stars sprinkled in. In the center of the image are the words \"Learning Space with NASA at Home\" in white lettering with a orange glow around it. Surrounding the words are different icons show how much there is to learn. A cartoon moon is in the bottom right corner, with a rocket to the left of it. Above the rocket is a cartoon astronau…", "commentsDisabled": false } } ], "pagination": { "nextCursor": "Y2JZakk0ZVU1WWQzcE5WRVV4VDBSbmVVMVVXVEpPVkVFd1RsUmpkMHRyWkZKVVEzQTRUa2RTYVZwWFNtaE5WRlp0VG1wSmVWcHRXbXRPUjFKcVdtMVJORmx0UlhsT2VrVjVXbXBhYUU5VVVYbE9Na2t5V1dwamVWcHFaR3hPVkZFd1dYcE9iRTF0V20xYVYxRjZXbFJyZVUweVdtdGFWRmw0V2xoNFQxSldaRGc9fFVIbzVUMkl5Tld4bVJFMTRUVlJWTkU5RVNYaE9hbGt4VFVSUk1VNTZRWEZTTVVaTlMyNTNlazFxV210YVIwVXlUVWRXYkU1dFNURlBSRTB3VG1wb2FsbDZVVEZOYlZKclRWUmthVTVxYUd4Wk1sVjZXbFJSTVU1WFRYaGFS…", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.pinterest.boardPosts({ url: \"https://www.pinterest.com/nasa/learn-with-nasa/\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.pinterest.board_posts(url=\"https://www.pinterest.com/nasa/learn-with-nasa/\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/pinterest/board/posts \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://www.pinterest.com/nasa/learn-with-nasa/\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_PinterestPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/PinterestPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "PinterestPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "kind", "openable", "commentsDisabled" ], "properties": { "altText": { "type": [ "string", "null" ], "description": "The description for screen readers." }, "board": { "oneOf": [ { "$ref": "#/components/schemas/PinterestBoardRef", "description": "The board it was saved to." }, { "type": "null" } ] }, "commentsDisabled": { "type": "boolean", "description": "Whether comments are turned off." }, "commentsId": { "type": [ "string", "null" ], "description": "What `/v1/pinterest/post/comments` takes as `commentsId`: the id of the pin's\ncomments, which every pin has, encrypted ones included." }, "domain": { "type": [ "string", "null" ] }, "dominantColor": { "type": [ "string", "null" ], "description": "The image's main colour (`#133b66`)." }, "kind": { "$ref": "#/components/schemas/PinterestPinKind" }, "link": { "type": [ "string", "null" ], "description": "The page the pin links to, and its host." }, "openable": { "type": "boolean", "description": "Whether `/v1/pinterest/post` can open it. Pinterest gives most pins in search and\non others' boards an encrypted id (`e1_…`) that it does not open for a visitor." }, "title": { "type": [ "string", "null" ], "description": "The pin's title (`text` is its description)." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A pin: an image, a video, a carousel or an Idea pin." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "PinterestPinKind": { "type": "string", "description": "What a pin is.", "enum": [ "image", "video", "carousel", "story" ] }, "PinterestBoardRef": { "type": "object", "description": "A board as a pin names it.", "required": [ "id", "name" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "url": { "type": [ "string", "null" ] } } }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Board Section Posts (/docs/api-reference/pinterest/board-section-posts) A board section's pins, about 25 a page. `GET https://api.socialapi.sh/v1/pinterest/board/section/posts` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.pinterest.boardSectionPosts({ id: "5485478297959732390" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.pinterest.board_section_posts(id="5485478297959732390") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/pinterest/board/section/posts \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "id=5485478297959732390" ``` **Response** ```json { "data": [ { "id": "796152040423109979", "url": "https://www.pinterest.com/pin/796152040423109979/", "text": "Mayrem", "createdAt": null, "author": { "id": "796152177784588548", "username": "gentianaamorina", "displayName": "Genta🌸", "avatarUrl": "https://i.pinimg.com/75x75_RS/e1/b5/8c/e1b58cb7cb0d1011f278cd11a05d0802.jpg", "verified": false, "url": "https://www.pinterest.com/gentianaamorina/" }, "stats": { "views": null, "likes": 1, "comments": null, "shares": null, "saves": 1, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://i.pinimg.com/originals/d1/2c/9c/d12c9c9e9bb3d41aa2ad2e6e6593d667.jpg", "thumbnailUrl": null, "width": 815, "height": 1222, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "kind": "story", "title": "Coffee shared with biscuits", "link": null, "domain": "Uploaded by user", "board": { "id": "796152109065775648", "name": "Coffee", "url": "https://www.pinterest.com/gentianaamorina/coffee/" }, "commentsId": "4049350515845275968", "openable": true, "dominantColor": "#907969", "altText": null, "commentsDisabled": false } }, { "id": "796152040423053562", "url": "https://www.pinterest.com/pin/796152040423053562/", "text": null, "createdAt": null, "author": { "id": "796152177784588548", "username": "gentianaamorina", "displayName": "Genta🌸", "avatarUrl": "https://i.pinimg.com/75x75_RS/e1/b5/8c/e1b58cb7cb0d1011f278cd11a05d0802.jpg", "verified": false, "url": "https://www.pinterest.com/gentianaamorina/" }, "stats": { "views": null, "likes": 1, "comments": null, "shares": null, "saves": 2, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://i.pinimg.com/originals/78/4b/8e/784b8ee31fa79bdd3ce85846bb7e52f6.jpg", "thumbnailUrl": null, "width": 983, "height": 1474, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "kind": "story", "title": "Coffee shared with sweet snacks", "link": null, "domain": "Uploaded by user", "board": { "id": "796152109065775648", "name": "Coffee", "url": "https://www.pinterest.com/gentianaamorina/coffee/" }, "commentsId": "4039550666115996288", "openable": true, "dominantColor": "#959085", "altText": "two cups of coffee and some cookies on a table", "commentsDisabled": false } } ], "pagination": { "nextCursor": "LT43OTYxNTIwNDA0MjEyNDcwODl8MjV8MjV8NTE2OTA1NjIxNjQ5MDA4NCpHUUwqfDkyNDVmNjM4Y2E3OTk3MmMwZDEzZTkzMTFmNThkNDM1OGU1MDc1M2NhOTI1NTZkYzYyYzBjNDI4ZDdmZDA4N2V8TkVXfA==", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/pinterest/board/section/posts": { "get": { "tags": [ "Pinterest" ], "summary": "A board section's pins, about 25 a page.", "description": "By the section's id from `/board/sections`. 1 credit a page.", "operationId": "pinterestBoardSectionPosts", "parameters": [ { "name": "id", "in": "query", "description": "The section's id, from `/v1/pinterest/board/sections`.", "required": true, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_PinterestPost" }, "example": { "data": [ { "id": "796152040423109979", "url": "https://www.pinterest.com/pin/796152040423109979/", "text": "Mayrem", "createdAt": null, "author": { "id": "796152177784588548", "username": "gentianaamorina", "displayName": "Genta🌸", "avatarUrl": "https://i.pinimg.com/75x75_RS/e1/b5/8c/e1b58cb7cb0d1011f278cd11a05d0802.jpg", "verified": false, "url": "https://www.pinterest.com/gentianaamorina/" }, "stats": { "views": null, "likes": 1, "comments": null, "shares": null, "saves": 1, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://i.pinimg.com/originals/d1/2c/9c/d12c9c9e9bb3d41aa2ad2e6e6593d667.jpg", "thumbnailUrl": null, "width": 815, "height": 1222, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "kind": "story", "title": "Coffee shared with biscuits", "link": null, "domain": "Uploaded by user", "board": { "id": "796152109065775648", "name": "Coffee", "url": "https://www.pinterest.com/gentianaamorina/coffee/" }, "commentsId": "4049350515845275968", "openable": true, "dominantColor": "#907969", "altText": null, "commentsDisabled": false } }, { "id": "796152040423053562", "url": "https://www.pinterest.com/pin/796152040423053562/", "text": null, "createdAt": null, "author": { "id": "796152177784588548", "username": "gentianaamorina", "displayName": "Genta🌸", "avatarUrl": "https://i.pinimg.com/75x75_RS/e1/b5/8c/e1b58cb7cb0d1011f278cd11a05d0802.jpg", "verified": false, "url": "https://www.pinterest.com/gentianaamorina/" }, "stats": { "views": null, "likes": 1, "comments": null, "shares": null, "saves": 2, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://i.pinimg.com/originals/78/4b/8e/784b8ee31fa79bdd3ce85846bb7e52f6.jpg", "thumbnailUrl": null, "width": 983, "height": 1474, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "kind": "story", "title": "Coffee shared with sweet snacks", "link": null, "domain": "Uploaded by user", "board": { "id": "796152109065775648", "name": "Coffee", "url": "https://www.pinterest.com/gentianaamorina/coffee/" }, "commentsId": "4039550666115996288", "openable": true, "dominantColor": "#959085", "altText": "two cups of coffee and some cookies on a table", "commentsDisabled": false } } ], "pagination": { "nextCursor": "LT43OTYxNTIwNDA0MjEyNDcwODl8MjV8MjV8NTE2OTA1NjIxNjQ5MDA4NCpHUUwqfDkyNDVmNjM4Y2E3OTk3MmMwZDEzZTkzMTFmNThkNDM1OGU1MDc1M2NhOTI1NTZkYzYyYzBjNDI4ZDdmZDA4N2V8TkVXfA==", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.pinterest.boardSectionPosts({ id: \"5485478297959732390\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.pinterest.board_section_posts(id=\"5485478297959732390\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/pinterest/board/section/posts \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"id=5485478297959732390\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_PinterestPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/PinterestPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "PinterestPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "kind", "openable", "commentsDisabled" ], "properties": { "altText": { "type": [ "string", "null" ], "description": "The description for screen readers." }, "board": { "oneOf": [ { "$ref": "#/components/schemas/PinterestBoardRef", "description": "The board it was saved to." }, { "type": "null" } ] }, "commentsDisabled": { "type": "boolean", "description": "Whether comments are turned off." }, "commentsId": { "type": [ "string", "null" ], "description": "What `/v1/pinterest/post/comments` takes as `commentsId`: the id of the pin's\ncomments, which every pin has, encrypted ones included." }, "domain": { "type": [ "string", "null" ] }, "dominantColor": { "type": [ "string", "null" ], "description": "The image's main colour (`#133b66`)." }, "kind": { "$ref": "#/components/schemas/PinterestPinKind" }, "link": { "type": [ "string", "null" ], "description": "The page the pin links to, and its host." }, "openable": { "type": "boolean", "description": "Whether `/v1/pinterest/post` can open it. Pinterest gives most pins in search and\non others' boards an encrypted id (`e1_…`) that it does not open for a visitor." }, "title": { "type": [ "string", "null" ], "description": "The pin's title (`text` is its description)." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A pin: an image, a video, a carousel or an Idea pin." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "PinterestPinKind": { "type": "string", "description": "What a pin is.", "enum": [ "image", "video", "carousel", "story" ] }, "PinterestBoardRef": { "type": "object", "description": "A board as a pin names it.", "required": [ "id", "name" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "url": { "type": [ "string", "null" ] } } }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Board Sections (/docs/api-reference/pinterest/board-sections) A board's sections with their pin counts. `GET https://api.socialapi.sh/v1/pinterest/board/sections` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.pinterest.boardSections({ id: "796152109065775648" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.pinterest.board_sections(id="796152109065775648") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/pinterest/board/sections \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "id=796152109065775648" ``` **Response** ```json { "data": [ { "id": "5485478297959732390", "name": "Coffee shared with...", "url": null, "coverUrl": null, "posts": 38, "ext": { "slug": "coffee-shared-with" } }, { "id": "5469726460256259048", "name": "Tea", "url": null, "coverUrl": null, "posts": 9, "ext": { "slug": "tea" } } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/pinterest/board/sections": { "get": { "tags": [ "Pinterest" ], "summary": "A board's sections with their pin counts.", "description": "All of them, on one page. 1 credit.", "operationId": "pinterestBoardSections", "parameters": [ { "name": "url", "in": "query", "description": "The board's link.", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The board's id, instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_PinterestSection" }, "example": { "data": [ { "id": "5485478297959732390", "name": "Coffee shared with...", "url": null, "coverUrl": null, "posts": 38, "ext": { "slug": "coffee-shared-with" } }, { "id": "5469726460256259048", "name": "Tea", "url": null, "coverUrl": null, "posts": 9, "ext": { "slug": "tea" } } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.pinterest.boardSections({ id: \"796152109065775648\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.pinterest.board_sections(id=\"796152109065775648\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/pinterest/board/sections \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"id=796152109065775648\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_PinterestSection": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/PinterestSection" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "PinterestSection": { "allOf": [ { "type": "object", "description": "A playlist, mix or collection of posts.", "required": [ "id", "name", "ext" ], "properties": { "coverUrl": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "properties": { "slug": { "type": [ "string", "null" ], "description": "The name in its link." } } }, { "type": "object", "description": "What only this platform has." } ] }, "id": { "type": "string" }, "name": { "type": "string" }, "posts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "url": { "type": [ "string", "null" ] } } }, { "type": "object", "description": "A board's section." } ] } } } } ``` # Board (/docs/api-reference/pinterest/board) A board with its pin and follower counts. `GET https://api.socialapi.sh/v1/pinterest/board` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.pinterest.board({ url: "https://www.pinterest.com/nasa/learn-with-nasa/" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.pinterest.board(url="https://www.pinterest.com/nasa/learn-with-nasa/").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/pinterest/board \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://www.pinterest.com/nasa/learn-with-nasa/" ``` **Response** ```json { "data": { "id": "142567213143159083", "name": "Learn With NASA", "url": "https://www.pinterest.com/nasa/learn-with-nasa/", "coverUrl": "https://i.pinimg.com/custom_covers/200x150/142567213143159083_1751395484.jpg", "posts": 1627, "ext": { "description": "Activities, resources, and opportunities from NASA and its partners that are designed to engage K-12 students in the agency's missions.", "followers": 527417, "sections": 0, "owner": { "id": "142567281862381039", "username": "nasa", "displayName": "NASA", "avatarUrl": "https://i.pinimg.com/280x280_RS/37/a1/75/37a175e6d2431425576f0b8f81389394.jpg", "verified": true, "url": "https://www.pinterest.com/nasa/" }, "privacy": "public", "category": "education", "collaborative": false, "collaborators": 0, "createdAt": null, "updatedAt": "2026-11-20T16:39:36.000Z" } } } ``` **OpenAPI** ```json { "paths": { "/v1/pinterest/board": { "get": { "tags": [ "Pinterest" ], "summary": "A board with its pin and follower counts.", "description": "Name, description, owner, pins, followers, sections, category and when it was made.\n1 credit.", "operationId": "pinterestBoard", "parameters": [ { "name": "url", "in": "query", "description": "The board's link (`https://www.pinterest.com/nasa/learn-with-nasa/`).", "required": true, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_PinterestBoard" }, "example": { "data": { "id": "142567213143159083", "name": "Learn With NASA", "url": "https://www.pinterest.com/nasa/learn-with-nasa/", "coverUrl": "https://i.pinimg.com/custom_covers/200x150/142567213143159083_1751395484.jpg", "posts": 1627, "ext": { "description": "Activities, resources, and opportunities from NASA and its partners that are designed to engage K-12 students in the agency's missions.", "followers": 527417, "sections": 0, "owner": { "id": "142567281862381039", "username": "nasa", "displayName": "NASA", "avatarUrl": "https://i.pinimg.com/280x280_RS/37/a1/75/37a175e6d2431425576f0b8f81389394.jpg", "verified": true, "url": "https://www.pinterest.com/nasa/" }, "privacy": "public", "category": "education", "collaborative": false, "collaborators": 0, "createdAt": null, "updatedAt": "2026-11-20T16:39:36.000Z" } } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.pinterest.board({ url: \"https://www.pinterest.com/nasa/learn-with-nasa/\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.pinterest.board(url=\"https://www.pinterest.com/nasa/learn-with-nasa/\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/pinterest/board \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://www.pinterest.com/nasa/learn-with-nasa/\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_PinterestBoard": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/PinterestBoard" } } }, "PinterestBoard": { "allOf": [ { "type": "object", "description": "A playlist, mix or collection of posts.", "required": [ "id", "name", "ext" ], "properties": { "coverUrl": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "collaborative" ], "properties": { "category": { "type": [ "string", "null" ], "description": "Pinterest's category (`education`, `food_drink`)." }, "collaborative": { "type": "boolean", "description": "Others can save to it." }, "collaborators": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "description": { "type": [ "string", "null" ] }, "followers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "owner": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "privacy": { "type": [ "string", "null" ], "description": "`public` or `secret` (a secret board is never answered to a visitor)." }, "sections": { "type": [ "integer", "null" ], "format": "int64", "description": "Its sections.", "minimum": 0 }, "updatedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "When a pin was last saved to it." }, { "type": "null" } ] } } }, { "type": "object", "description": "What only this platform has." } ] }, "id": { "type": "string" }, "name": { "type": "string" }, "posts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "url": { "type": [ "string", "null" ] } } }, { "type": "object", "description": "A board." } ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Pinterest API (/docs/api-reference/pinterest) Every Pinterest endpoint, by group. Each is a `GET` under `/v1/pinterest`. ## Quick Reference [#quick-reference] | Property | Value | | --- | --- | | Base path | `/v1/pinterest` | | Endpoints | 19 | | Credits | See Below | | Guide | [Pinterest](/docs/pinterest) | ## Accounts [#accounts] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/pinterest/profile`](/docs/api-reference/pinterest/profile) | A profile with its follower and pin counts. | 1 | | [`GET /v1/pinterest/profile/boards`](/docs/api-reference/pinterest/profile-boards) | An account's boards, 25 a page. | 1 | | [`GET /v1/pinterest/profile/posts`](/docs/api-reference/pinterest/profile-posts) | The pins an account created, newest first, 25 a page. | 1 | ## Boards [#boards] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/pinterest/board`](/docs/api-reference/pinterest/board) | A board with its pin and follower counts. | 1 | | [`GET /v1/pinterest/board/posts`](/docs/api-reference/pinterest/board-posts) | A board's pins, 25 a page. | 1 | | [`GET /v1/pinterest/board/section/posts`](/docs/api-reference/pinterest/board-section-posts) | A board section's pins, about 25 a page. | 1 | | [`GET /v1/pinterest/board/sections`](/docs/api-reference/pinterest/board-sections) | A board's sections with their pin counts. | 1 | ## Posts [#posts] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/pinterest/post`](/docs/api-reference/pinterest/post) | One pin with its saves, reactions and comment count. | 1 | | [`GET /v1/pinterest/post/comments`](/docs/api-reference/pinterest/post-comments) | A pin's comments, 25 a page. | 1 | | [`GET /v1/pinterest/post/comment/replies`](/docs/api-reference/pinterest/post-comment-replies) | A comment's replies, 25 a page. | 1 | ## Discovery [#discovery] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/pinterest/search`](/docs/api-reference/pinterest/search) | Pins matching a query, about 25 a page. | 1 | | [`GET /v1/pinterest/search/boards`](/docs/api-reference/pinterest/search-boards) | Boards matching a query, about 50 a page. | 1 | | [`GET /v1/pinterest/search/suggestions`](/docs/api-reference/pinterest/search-suggestions) | What the search box suggests for a few letters. | 1 | | [`GET /v1/pinterest/search/users`](/docs/api-reference/pinterest/search-users) | Accounts matching a query, about 48 a page. | 1 | | [`GET /v1/pinterest/search/videos`](/docs/api-reference/pinterest/search-videos) | Video pins matching a query, 25 a page. | 1 | | [`GET /v1/pinterest/topic`](/docs/api-reference/pinterest/topic) | A topic's Ideas page with its followers and searches. | 1 | | [`GET /v1/pinterest/topic/posts`](/docs/api-reference/pinterest/topic-posts) | A topic's top pins, about 20. | 1 | | [`GET /v1/pinterest/trending`](/docs/api-reference/pinterest/trending) | What a country searches for on Pinterest Trends. | 10 | | [`GET /v1/pinterest/url`](/docs/api-reference/pinterest/url) | How many times a web page was saved to Pinterest. | 1 | ## Example Request [#example-request] Every Pinterest endpoint is called this way: its path, and what to read as query parameters. **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.pinterest.profile({ handle: "nasa" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.pinterest.profile(handle="nasa").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/pinterest/profile \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=nasa" ``` **Response** ```json { "data": { "id": "142567281862381039", "username": "nasa", "displayName": "NASA", "bio": "Explore the universe and discover our home planet with the official NASA boards on Pinterest. Visit us at www.nasa.gov", "avatarUrl": "https://i.pinimg.com/280x280_RS/37/a1/75/37a175e6d2431425576f0b8f81389394.jpg", "url": "https://www.pinterest.com/nasa/", "verified": true, "private": false, "followers": 556819, "following": 5, "likes": null, "posts": 10555, "externalUrl": "http://www.nasa.gov/", "createdAt": "2012-03-05T16:37:07.000Z", "ext": { "boards": 82, "monthlyViews": 4677213, "coverUrl": "https://i.pinimg.com/originals/53/29/e7/5329e71b2f85d2758cd3ec1d18452c26.jpg", "domain": "www.nasa.gov", "verifiedMerchant": false, "lastSavedAt": "2026-11-20T16:39:34.000Z" } } } ``` ## Errors [#errors] A call that fails costs nothing. See [Errors](/docs/errors) for every code. # Post Comment Replies (/docs/api-reference/pinterest/post-comment-replies) A comment's replies, 25 a page. `GET https://api.socialapi.sh/v1/pinterest/post/comment/replies` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.pinterest.postCommentReplies({ id: "3792139686593983104" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.pinterest.post_comment_replies(id="3792139686593983104") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/pinterest/post/comment/replies \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "id=3792139686593983104" ``` **Response** ```json { "data": [ { "id": "3980304314303891904", "postId": "578712620904597973", "parentId": "3792139686593983104", "text": "No bruh", "createdAt": "2026-10-26T22:38:32.000Z", "author": { "id": "1129488918954251904", "username": "thisislily44", "displayName": "Lily McCann", "avatarUrl": "https://i.pinimg.com/75x75_RS/e0/90/1d/e0901db2125784664edee3e34d4cbdab.jpg", "verified": false, "url": "https://www.pinterest.com/thisislily44/" }, "likes": null, "replies": 0, "ext": { "helpful": 0 } }, { "id": "3966492723594302400", "postId": "578712620904597973", "parentId": "3792139686593983104", "text": "I think the mugs are handmade", "createdAt": "2026-10-22T04:18:14.000Z", "author": { "id": "598767850366303867", "username": "thewanderingpalomino", "displayName": "Jo ♡", "avatarUrl": "https://i.pinimg.com/75x75_RS/c8/81/e6/c881e662df7001e880c3b99bbfe57b61.jpg", "verified": false, "url": "https://www.pinterest.com/thewanderingpalomino/" }, "likes": null, "replies": 0, "ext": { "helpful": 0 } } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/pinterest/post/comment/replies": { "get": { "tags": [ "Pinterest" ], "summary": "A comment's replies, 25 a page.", "description": "By the comment's id. 1 credit a page.", "operationId": "pinterestPostCommentReplies", "parameters": [ { "name": "id", "in": "query", "description": "The comment's id.", "required": true, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_PinterestComment" }, "example": { "data": [ { "id": "3980304314303891904", "postId": "578712620904597973", "parentId": "3792139686593983104", "text": "No bruh", "createdAt": "2026-10-26T22:38:32.000Z", "author": { "id": "1129488918954251904", "username": "thisislily44", "displayName": "Lily McCann", "avatarUrl": "https://i.pinimg.com/75x75_RS/e0/90/1d/e0901db2125784664edee3e34d4cbdab.jpg", "verified": false, "url": "https://www.pinterest.com/thisislily44/" }, "likes": null, "replies": 0, "ext": { "helpful": 0 } }, { "id": "3966492723594302400", "postId": "578712620904597973", "parentId": "3792139686593983104", "text": "I think the mugs are handmade", "createdAt": "2026-10-22T04:18:14.000Z", "author": { "id": "598767850366303867", "username": "thewanderingpalomino", "displayName": "Jo ♡", "avatarUrl": "https://i.pinimg.com/75x75_RS/c8/81/e6/c881e662df7001e880c3b99bbfe57b61.jpg", "verified": false, "url": "https://www.pinterest.com/thewanderingpalomino/" }, "likes": null, "replies": 0, "ext": { "helpful": 0 } } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.pinterest.postCommentReplies({ id: \"3792139686593983104\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.pinterest.post_comment_replies(id=\"3792139686593983104\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/pinterest/post/comment/replies \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"id=3792139686593983104\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_PinterestComment": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/PinterestComment" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "PinterestComment": { "allOf": [ { "type": "object", "description": "A comment or a reply.", "required": [ "id", "postId", "text", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "properties": { "helpful": { "type": [ "integer", "null" ], "format": "int64", "description": "People who marked it helpful.", "minimum": 0 } } }, { "type": "object", "description": "What only this platform has." } ] }, "id": { "type": "string" }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "parentId": { "type": [ "string", "null" ], "description": "The comment this replies to; absent on a top-level comment." }, "postId": { "type": "string" }, "replies": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "text": { "type": "string" } } }, { "type": "object", "description": "A comment on a pin, or a reply." } ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Post Comments (/docs/api-reference/pinterest/post-comments) A pin's comments, 25 a page. `GET https://api.socialapi.sh/v1/pinterest/post/comments` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.pinterest.postComments({ commentsId: "5399464036580508789" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.pinterest.post_comments(comments_id="5399464036580508789") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/pinterest/post/comments \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "commentsId=5399464036580508789" ``` **Response** ```json { "data": [ { "id": "3981913529230731392", "postId": "961026007995291996", "parentId": null, "text": "I hate coffe and alcohol but espresso martini is the best thing in life", "createdAt": "2026-10-27T11:57:50.000Z", "author": { "id": "878694714705110794", "username": "paula_pudding618", "displayName": "Baulaa", "avatarUrl": "https://i.pinimg.com/75x75_RS/ad/6c/61/ad6c6186e20be6b10513fc6d795acb25.jpg", "verified": false, "url": "https://www.pinterest.com/paula_pudding618/" }, "likes": 2, "replies": 0, "ext": { "helpful": 0 } }, { "id": "3792139686593983104", "postId": "578712620904597973", "parentId": null, "text": "Is this ai?", "createdAt": "2026-08-23T00:56:09.000Z", "author": { "id": "905997787445992333", "username": "nataliasemon", "displayName": "anesenchuk", "avatarUrl": "https://s.pinimg.com/images/user/default_75.png", "verified": false, "url": "https://www.pinterest.com/nataliasemon/" }, "likes": 1, "replies": 4, "ext": { "helpful": 0 } } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/pinterest/post/comments": { "get": { "tags": [ "Pinterest" ], "summary": "A pin's comments, 25 a page.", "description": "With their likes and reply counts. Any pin's, encrypted ones included, by its\n`ext.commentsId`. 1 credit a page.", "operationId": "pinterestPostComments", "parameters": [ { "name": "url", "in": "query", "description": "The pin's link.", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The pin's id, instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "commentsId", "in": "query", "description": "The pin's `ext.commentsId`, instead of either: what an encrypted pin (`e1_…`, from\nsearch or a board) is read by.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_PinterestComment" }, "example": { "data": [ { "id": "3981913529230731392", "postId": "961026007995291996", "parentId": null, "text": "I hate coffe and alcohol but espresso martini is the best thing in life", "createdAt": "2026-10-27T11:57:50.000Z", "author": { "id": "878694714705110794", "username": "paula_pudding618", "displayName": "Baulaa", "avatarUrl": "https://i.pinimg.com/75x75_RS/ad/6c/61/ad6c6186e20be6b10513fc6d795acb25.jpg", "verified": false, "url": "https://www.pinterest.com/paula_pudding618/" }, "likes": 2, "replies": 0, "ext": { "helpful": 0 } }, { "id": "3792139686593983104", "postId": "578712620904597973", "parentId": null, "text": "Is this ai?", "createdAt": "2026-08-23T00:56:09.000Z", "author": { "id": "905997787445992333", "username": "nataliasemon", "displayName": "anesenchuk", "avatarUrl": "https://s.pinimg.com/images/user/default_75.png", "verified": false, "url": "https://www.pinterest.com/nataliasemon/" }, "likes": 1, "replies": 4, "ext": { "helpful": 0 } } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.pinterest.postComments({ commentsId: \"5399464036580508789\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.pinterest.post_comments(comments_id=\"5399464036580508789\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/pinterest/post/comments \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"commentsId=5399464036580508789\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_PinterestComment": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/PinterestComment" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "PinterestComment": { "allOf": [ { "type": "object", "description": "A comment or a reply.", "required": [ "id", "postId", "text", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "properties": { "helpful": { "type": [ "integer", "null" ], "format": "int64", "description": "People who marked it helpful.", "minimum": 0 } } }, { "type": "object", "description": "What only this platform has." } ] }, "id": { "type": "string" }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "parentId": { "type": [ "string", "null" ], "description": "The comment this replies to; absent on a top-level comment." }, "postId": { "type": "string" }, "replies": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "text": { "type": "string" } } }, { "type": "object", "description": "A comment on a pin, or a reply." } ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Post (/docs/api-reference/pinterest/post) One pin with its saves, reactions and comment count. `GET https://api.socialapi.sh/v1/pinterest/post` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.pinterest.post({ url: "https://www.pinterest.com/pin/142567144449130105/" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.pinterest.post(url="https://www.pinterest.com/pin/142567144449130105/").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/pinterest/post \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://www.pinterest.com/pin/142567144449130105/" ``` **Response** ```json { "data": { "id": "142567144449130105", "url": "https://www.pinterest.com/pin/142567144449130105/", "text": "NASA is returning astronauts to the Moon – and this time they will spend more time on the lunar surface. The Moon Base is humanity’s first lunar outpost. It will be a place where astronauts live, work, and explore.\n\nLearn more about Moon Base!", "createdAt": "2026-11-20T16:39:34.000Z", "author": { "id": "142567281862381039", "username": "nasa", "displayName": "NASA", "avatarUrl": "https://i.pinimg.com/75x75_RS/37/a1/75/37a175e6d2431425576f0b8f81389394.jpg", "verified": true, "url": "https://www.pinterest.com/nasa/" }, "stats": { "views": null, "likes": 4, "comments": 2, "shares": 1, "saves": 1, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://i.pinimg.com/originals/7f/b0/7c/7fb07c79a6280dd11eab9165b4120300.png", "thumbnailUrl": null, "width": 1000, "height": 1500, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "kind": "image", "title": "What is the Moon Base?", "link": "https://www.nasa.gov/learning-resources/for-kids-and-students/what-is-the-moon-base/", "domain": "nasa.gov", "board": { "id": "142567213143159083", "name": "Learn With NASA", "url": "https://www.pinterest.com/nasa/learn-with-nasa/" }, "commentsId": "4052059193040676096", "openable": true, "dominantColor": "#151212", "altText": "An artist's depiction of an astronaut pointing at a moon lander. Light blue text reads, \"What is the Moon Base?\"", "commentsDisabled": false } } } ``` **OpenAPI** ```json { "paths": { "/v1/pinterest/post": { "get": { "tags": [ "Pinterest" ], "summary": "One pin with its saves, reactions and comment count.", "description": "Title, description, link, media (the image, video or each slide), saves, reactions,\nshares, comments, the board and who saved it. 1 credit.", "operationId": "pinterestPost", "parameters": [ { "name": "url", "in": "query", "description": "The pin's link (`https://www.pinterest.com/pin/142567144449130105/`), or a\n`pin.it` link.", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The pin's id, instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_PinterestPost" }, "example": { "data": { "id": "142567144449130105", "url": "https://www.pinterest.com/pin/142567144449130105/", "text": "NASA is returning astronauts to the Moon – and this time they will spend more time on the lunar surface. The Moon Base is humanity’s first lunar outpost. It will be a place where astronauts live, work, and explore.\n\nLearn more about Moon Base!", "createdAt": "2026-11-20T16:39:34.000Z", "author": { "id": "142567281862381039", "username": "nasa", "displayName": "NASA", "avatarUrl": "https://i.pinimg.com/75x75_RS/37/a1/75/37a175e6d2431425576f0b8f81389394.jpg", "verified": true, "url": "https://www.pinterest.com/nasa/" }, "stats": { "views": null, "likes": 4, "comments": 2, "shares": 1, "saves": 1, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://i.pinimg.com/originals/7f/b0/7c/7fb07c79a6280dd11eab9165b4120300.png", "thumbnailUrl": null, "width": 1000, "height": 1500, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "kind": "image", "title": "What is the Moon Base?", "link": "https://www.nasa.gov/learning-resources/for-kids-and-students/what-is-the-moon-base/", "domain": "nasa.gov", "board": { "id": "142567213143159083", "name": "Learn With NASA", "url": "https://www.pinterest.com/nasa/learn-with-nasa/" }, "commentsId": "4052059193040676096", "openable": true, "dominantColor": "#151212", "altText": "An artist's depiction of an astronaut pointing at a moon lander. Light blue text reads, \"What is the Moon Base?\"", "commentsDisabled": false } } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.pinterest.post({ url: \"https://www.pinterest.com/pin/142567144449130105/\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.pinterest.post(url=\"https://www.pinterest.com/pin/142567144449130105/\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/pinterest/post \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://www.pinterest.com/pin/142567144449130105/\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_PinterestPost": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/PinterestPost" } } }, "PinterestPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "kind", "openable", "commentsDisabled" ], "properties": { "altText": { "type": [ "string", "null" ], "description": "The description for screen readers." }, "board": { "oneOf": [ { "$ref": "#/components/schemas/PinterestBoardRef", "description": "The board it was saved to." }, { "type": "null" } ] }, "commentsDisabled": { "type": "boolean", "description": "Whether comments are turned off." }, "commentsId": { "type": [ "string", "null" ], "description": "What `/v1/pinterest/post/comments` takes as `commentsId`: the id of the pin's\ncomments, which every pin has, encrypted ones included." }, "domain": { "type": [ "string", "null" ] }, "dominantColor": { "type": [ "string", "null" ], "description": "The image's main colour (`#133b66`)." }, "kind": { "$ref": "#/components/schemas/PinterestPinKind" }, "link": { "type": [ "string", "null" ], "description": "The page the pin links to, and its host." }, "openable": { "type": "boolean", "description": "Whether `/v1/pinterest/post` can open it. Pinterest gives most pins in search and\non others' boards an encrypted id (`e1_…`) that it does not open for a visitor." }, "title": { "type": [ "string", "null" ], "description": "The pin's title (`text` is its description)." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A pin: an image, a video, a carousel or an Idea pin." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "PinterestPinKind": { "type": "string", "description": "What a pin is.", "enum": [ "image", "video", "carousel", "story" ] }, "PinterestBoardRef": { "type": "object", "description": "A board as a pin names it.", "required": [ "id", "name" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "url": { "type": [ "string", "null" ] } } }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Profile Boards (/docs/api-reference/pinterest/profile-boards) An account's boards, 25 a page. `GET https://api.socialapi.sh/v1/pinterest/profile/boards` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.pinterest.profileBoards({ handle: "nasa" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.pinterest.profile_boards(handle="nasa") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/pinterest/profile/boards \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=nasa" ``` **Response** ```json { "data": [ { "id": "142567213143159083", "name": "Learn With NASA", "url": "https://www.pinterest.com/nasa/learn-with-nasa/", "coverUrl": "https://i.pinimg.com/474x/bc/4b/d4/bc4bd4150190ef8ac96e9ff6c4f3e806.jpg", "posts": 1627, "ext": { "description": "Activities, resources, and opportunities from NASA and its partners that are designed to engage K-12 students in the agency's missions.", "followers": 527417, "sections": 0, "owner": { "id": "142567281862381039", "username": "nasa", "displayName": "NASA", "avatarUrl": "https://i.pinimg.com/75x75_RS/37/a1/75/37a175e6d2431425576f0b8f81389394.jpg", "verified": true, "url": "https://www.pinterest.com/nasa/" }, "privacy": "public", "category": null, "collaborative": false, "collaborators": 0, "createdAt": "2016-12-05T19:34:54.000Z", "updatedAt": "2026-11-20T16:39:36.000Z" } }, { "id": "142567213143304042", "name": "First Woman", "url": "https://www.pinterest.com/nasa/first-woman/", "coverUrl": "https://i.pinimg.com/474x/f2/71/86/f2718619a55e3d61c52bb9e7bb6aed2e.jpg", "posts": 6, "ext": { "description": null, "followers": 526505, "sections": 0, "owner": { "id": "142567281862381039", "username": "nasa", "displayName": "NASA", "avatarUrl": "https://i.pinimg.com/75x75_RS/37/a1/75/37a175e6d2431425576f0b8f81389394.jpg", "verified": true, "url": "https://www.pinterest.com/nasa/" }, "privacy": "public", "category": null, "collaborative": false, "collaborators": 0, "createdAt": "2021-07-26T19:35:40.000Z", "updatedAt": "2024-02-20T13:34:06.000Z" } } ], "pagination": { "nextCursor": "LT4xNDI1NjcyMTMxNDMyMzUyMzh8MjV8MTY4MTA2MTc1MjQzOTM3MSpHUUwqfDhiZDViM2IxODY5NjllYTQyZGY4YWYwM2RlMzlhMDNhNzVlZTIyZTc4Y2E0ZTUwZGQyNGY0OWYwZmY4ZmFkY2R8TkVXfA==", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/pinterest/profile/boards": { "get": { "tags": [ "Pinterest" ], "summary": "An account's boards, 25 a page.", "description": "With their pin, follower and section counts. 1 credit a page.", "operationId": "pinterestProfileBoards", "parameters": [ { "name": "handle", "in": "query", "description": "The username.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "The profile's link, instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_PinterestBoard" }, "example": { "data": [ { "id": "142567213143159083", "name": "Learn With NASA", "url": "https://www.pinterest.com/nasa/learn-with-nasa/", "coverUrl": "https://i.pinimg.com/474x/bc/4b/d4/bc4bd4150190ef8ac96e9ff6c4f3e806.jpg", "posts": 1627, "ext": { "description": "Activities, resources, and opportunities from NASA and its partners that are designed to engage K-12 students in the agency's missions.", "followers": 527417, "sections": 0, "owner": { "id": "142567281862381039", "username": "nasa", "displayName": "NASA", "avatarUrl": "https://i.pinimg.com/75x75_RS/37/a1/75/37a175e6d2431425576f0b8f81389394.jpg", "verified": true, "url": "https://www.pinterest.com/nasa/" }, "privacy": "public", "category": null, "collaborative": false, "collaborators": 0, "createdAt": "2016-12-05T19:34:54.000Z", "updatedAt": "2026-11-20T16:39:36.000Z" } }, { "id": "142567213143304042", "name": "First Woman", "url": "https://www.pinterest.com/nasa/first-woman/", "coverUrl": "https://i.pinimg.com/474x/f2/71/86/f2718619a55e3d61c52bb9e7bb6aed2e.jpg", "posts": 6, "ext": { "description": null, "followers": 526505, "sections": 0, "owner": { "id": "142567281862381039", "username": "nasa", "displayName": "NASA", "avatarUrl": "https://i.pinimg.com/75x75_RS/37/a1/75/37a175e6d2431425576f0b8f81389394.jpg", "verified": true, "url": "https://www.pinterest.com/nasa/" }, "privacy": "public", "category": null, "collaborative": false, "collaborators": 0, "createdAt": "2021-07-26T19:35:40.000Z", "updatedAt": "2024-02-20T13:34:06.000Z" } } ], "pagination": { "nextCursor": "LT4xNDI1NjcyMTMxNDMyMzUyMzh8MjV8MTY4MTA2MTc1MjQzOTM3MSpHUUwqfDhiZDViM2IxODY5NjllYTQyZGY4YWYwM2RlMzlhMDNhNzVlZTIyZTc4Y2E0ZTUwZGQyNGY0OWYwZmY4ZmFkY2R8TkVXfA==", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.pinterest.profileBoards({ handle: \"nasa\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.pinterest.profile_boards(handle=\"nasa\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/pinterest/profile/boards \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=nasa\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_PinterestBoard": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/PinterestBoard" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "PinterestBoard": { "allOf": [ { "type": "object", "description": "A playlist, mix or collection of posts.", "required": [ "id", "name", "ext" ], "properties": { "coverUrl": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "collaborative" ], "properties": { "category": { "type": [ "string", "null" ], "description": "Pinterest's category (`education`, `food_drink`)." }, "collaborative": { "type": "boolean", "description": "Others can save to it." }, "collaborators": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "description": { "type": [ "string", "null" ] }, "followers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "owner": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "privacy": { "type": [ "string", "null" ], "description": "`public` or `secret` (a secret board is never answered to a visitor)." }, "sections": { "type": [ "integer", "null" ], "format": "int64", "description": "Its sections.", "minimum": 0 }, "updatedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "When a pin was last saved to it." }, { "type": "null" } ] } } }, { "type": "object", "description": "What only this platform has." } ] }, "id": { "type": "string" }, "name": { "type": "string" }, "posts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "url": { "type": [ "string", "null" ] } } }, { "type": "object", "description": "A board." } ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Profile Posts (/docs/api-reference/pinterest/profile-posts) The pins an account created, newest first, 25 a page. `GET https://api.socialapi.sh/v1/pinterest/profile/posts` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.pinterest.profilePosts({ handle: "nasa" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.pinterest.profile_posts(handle="nasa") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/pinterest/profile/posts \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=nasa" ``` **Response** ```json { "data": [ { "id": "142567144449130105", "url": "https://www.pinterest.com/pin/142567144449130105/", "text": "NASA is returning astronauts to the Moon – and this time they will spend more time on the lunar surface. The Moon Base is humanity’s first lunar outpost. It will be a place where astronauts live, work, and explore.\n\nLearn more about Moon Base!", "createdAt": "2026-11-20T16:39:34.000Z", "author": { "id": "142567281862381039", "username": "nasa", "displayName": "NASA", "avatarUrl": "https://i.pinimg.com/140x140_RS/37/a1/75/37a175e6d2431425576f0b8f81389394.jpg", "verified": true, "url": "https://www.pinterest.com/nasa/" }, "stats": { "views": null, "likes": 4, "comments": null, "shares": null, "saves": 1, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://i.pinimg.com/originals/7f/b0/7c/7fb07c79a6280dd11eab9165b4120300.png", "thumbnailUrl": null, "width": 1000, "height": 1500, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "kind": "image", "title": "What is the Moon Base?", "link": "https://www.nasa.gov/learning-resources/for-kids-and-students/what-is-the-moon-base/", "domain": "nasa.gov", "board": { "id": "142567213143159083", "name": "Learn With NASA", "url": "https://www.pinterest.com/nasa/learn-with-nasa/" }, "commentsId": "4052059193040676096", "openable": true, "dominantColor": "#151212", "altText": "An artist's depiction of an astronaut pointing at a moon lander. Light blue text reads, \"What is the Moon Base?\"", "commentsDisabled": false } }, { "id": "142567144449081155", "url": "https://www.pinterest.com/pin/142567144449081155/", "text": "Next stop: Titan! NASA's Dragonfly mission is heading to Saturn's largest moon to explore its mysterious dunes and investigate the chemistry that could offer clues about the building blocks of life. Want to be part of the journey? Sign up to send your name to Titan aboard Dragonfly and get your own digital boarding pass.", "createdAt": "2026-10-29T19:53:31.000Z", "author": { "id": "142567281862381039", "username": "nasa", "displayName": "NASA", "avatarUrl": "https://i.pinimg.com/140x140_RS/37/a1/75/37a175e6d2431425576f0b8f81389394.jpg", "verified": true, "url": "https://www.pinterest.com/nasa/" }, "stats": { "views": null, "likes": 13, "comments": null, "shares": null, "saves": 20, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://i.pinimg.com/originals/bb/a1/e7/bba1e7fb6fe37433e1314ad3cf4e3434.png", "thumbnailUrl": null, "width": 1000, "height": 1500, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "kind": "image", "title": "Your Journey to Titan Starts Here | NASA's Dragonfly Mission", "link": "https://my.nasa.gov/specialevents/s/send-your-name-with-dragonfly", "domain": "my.nasa.gov", "board": { "id": "142567213143159083", "name": "Learn With NASA", "url": "https://www.pinterest.com/nasa/learn-with-nasa/" }, "commentsId": "3988669411217409856", "openable": true, "dominantColor": "#efbd8a", "altText": "An artist's depiction of the Dragonfly rotorcraft. A light orange background with dark orange text reads, \"Journey to Titan Fly Your Name to Another World\"", "commentsDisabled": false } } ], "pagination": { "nextCursor": "Pz8xNDI1NjcxNDQ0NDc4NzAwODU6MTc1Mzg4NDIwNHwxMzY1NTg2NTA5NDExMzI2KkdRTCp8NDA5N2RjNzgxYWUzNDZiNWEwNDVjNDAyMjU2YWUxOGQ3OGMyZDRkYzQzYTMzMDM4M2YzOGY1MGFkMDUwMDYyOXxORVd8", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/pinterest/profile/posts": { "get": { "tags": [ "Pinterest" ], "summary": "The pins an account created, newest first, 25 a page.", "description": "With their saves, reactions and media. 1 credit a page.", "operationId": "pinterestProfilePosts", "parameters": [ { "name": "handle", "in": "query", "description": "The username.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "The profile's link, instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_PinterestPost" }, "example": { "data": [ { "id": "142567144449130105", "url": "https://www.pinterest.com/pin/142567144449130105/", "text": "NASA is returning astronauts to the Moon – and this time they will spend more time on the lunar surface. The Moon Base is humanity’s first lunar outpost. It will be a place where astronauts live, work, and explore.\n\nLearn more about Moon Base!", "createdAt": "2026-11-20T16:39:34.000Z", "author": { "id": "142567281862381039", "username": "nasa", "displayName": "NASA", "avatarUrl": "https://i.pinimg.com/140x140_RS/37/a1/75/37a175e6d2431425576f0b8f81389394.jpg", "verified": true, "url": "https://www.pinterest.com/nasa/" }, "stats": { "views": null, "likes": 4, "comments": null, "shares": null, "saves": 1, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://i.pinimg.com/originals/7f/b0/7c/7fb07c79a6280dd11eab9165b4120300.png", "thumbnailUrl": null, "width": 1000, "height": 1500, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "kind": "image", "title": "What is the Moon Base?", "link": "https://www.nasa.gov/learning-resources/for-kids-and-students/what-is-the-moon-base/", "domain": "nasa.gov", "board": { "id": "142567213143159083", "name": "Learn With NASA", "url": "https://www.pinterest.com/nasa/learn-with-nasa/" }, "commentsId": "4052059193040676096", "openable": true, "dominantColor": "#151212", "altText": "An artist's depiction of an astronaut pointing at a moon lander. Light blue text reads, \"What is the Moon Base?\"", "commentsDisabled": false } }, { "id": "142567144449081155", "url": "https://www.pinterest.com/pin/142567144449081155/", "text": "Next stop: Titan! NASA's Dragonfly mission is heading to Saturn's largest moon to explore its mysterious dunes and investigate the chemistry that could offer clues about the building blocks of life. Want to be part of the journey? Sign up to send your name to Titan aboard Dragonfly and get your own digital boarding pass.", "createdAt": "2026-10-29T19:53:31.000Z", "author": { "id": "142567281862381039", "username": "nasa", "displayName": "NASA", "avatarUrl": "https://i.pinimg.com/140x140_RS/37/a1/75/37a175e6d2431425576f0b8f81389394.jpg", "verified": true, "url": "https://www.pinterest.com/nasa/" }, "stats": { "views": null, "likes": 13, "comments": null, "shares": null, "saves": 20, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://i.pinimg.com/originals/bb/a1/e7/bba1e7fb6fe37433e1314ad3cf4e3434.png", "thumbnailUrl": null, "width": 1000, "height": 1500, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "kind": "image", "title": "Your Journey to Titan Starts Here | NASA's Dragonfly Mission", "link": "https://my.nasa.gov/specialevents/s/send-your-name-with-dragonfly", "domain": "my.nasa.gov", "board": { "id": "142567213143159083", "name": "Learn With NASA", "url": "https://www.pinterest.com/nasa/learn-with-nasa/" }, "commentsId": "3988669411217409856", "openable": true, "dominantColor": "#efbd8a", "altText": "An artist's depiction of the Dragonfly rotorcraft. A light orange background with dark orange text reads, \"Journey to Titan Fly Your Name to Another World\"", "commentsDisabled": false } } ], "pagination": { "nextCursor": "Pz8xNDI1NjcxNDQ0NDc4NzAwODU6MTc1Mzg4NDIwNHwxMzY1NTg2NTA5NDExMzI2KkdRTCp8NDA5N2RjNzgxYWUzNDZiNWEwNDVjNDAyMjU2YWUxOGQ3OGMyZDRkYzQzYTMzMDM4M2YzOGY1MGFkMDUwMDYyOXxORVd8", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.pinterest.profilePosts({ handle: \"nasa\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.pinterest.profile_posts(handle=\"nasa\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/pinterest/profile/posts \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=nasa\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_PinterestPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/PinterestPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "PinterestPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "kind", "openable", "commentsDisabled" ], "properties": { "altText": { "type": [ "string", "null" ], "description": "The description for screen readers." }, "board": { "oneOf": [ { "$ref": "#/components/schemas/PinterestBoardRef", "description": "The board it was saved to." }, { "type": "null" } ] }, "commentsDisabled": { "type": "boolean", "description": "Whether comments are turned off." }, "commentsId": { "type": [ "string", "null" ], "description": "What `/v1/pinterest/post/comments` takes as `commentsId`: the id of the pin's\ncomments, which every pin has, encrypted ones included." }, "domain": { "type": [ "string", "null" ] }, "dominantColor": { "type": [ "string", "null" ], "description": "The image's main colour (`#133b66`)." }, "kind": { "$ref": "#/components/schemas/PinterestPinKind" }, "link": { "type": [ "string", "null" ], "description": "The page the pin links to, and its host." }, "openable": { "type": "boolean", "description": "Whether `/v1/pinterest/post` can open it. Pinterest gives most pins in search and\non others' boards an encrypted id (`e1_…`) that it does not open for a visitor." }, "title": { "type": [ "string", "null" ], "description": "The pin's title (`text` is its description)." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A pin: an image, a video, a carousel or an Idea pin." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "PinterestPinKind": { "type": "string", "description": "What a pin is.", "enum": [ "image", "video", "carousel", "story" ] }, "PinterestBoardRef": { "type": "object", "description": "A board as a pin names it.", "required": [ "id", "name" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "url": { "type": [ "string", "null" ] } } }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Profile (/docs/api-reference/pinterest/profile) A profile with its follower and pin counts. `GET https://api.socialapi.sh/v1/pinterest/profile` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.pinterest.profile({ handle: "nasa" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.pinterest.profile(handle="nasa").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/pinterest/profile \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=nasa" ``` **Response** ```json { "data": { "id": "142567281862381039", "username": "nasa", "displayName": "NASA", "bio": "Explore the universe and discover our home planet with the official NASA boards on Pinterest. Visit us at www.nasa.gov", "avatarUrl": "https://i.pinimg.com/280x280_RS/37/a1/75/37a175e6d2431425576f0b8f81389394.jpg", "url": "https://www.pinterest.com/nasa/", "verified": true, "private": false, "followers": 556819, "following": 5, "likes": null, "posts": 10555, "externalUrl": "http://www.nasa.gov/", "createdAt": "2012-03-05T16:37:07.000Z", "ext": { "boards": 82, "monthlyViews": 4677213, "coverUrl": "https://i.pinimg.com/originals/53/29/e7/5329e71b2f85d2758cd3ec1d18452c26.jpg", "domain": "www.nasa.gov", "verifiedMerchant": false, "lastSavedAt": "2026-11-20T16:39:34.000Z" } } } ``` **OpenAPI** ```json { "paths": { "/v1/pinterest/profile": { "get": { "tags": [ "Pinterest" ], "summary": "A profile with its follower and pin counts.", "description": "Name, bio, website, followers, following, pins, boards, monthly views and when it\njoined. 1 credit.", "operationId": "pinterestProfile", "parameters": [ { "name": "handle", "in": "query", "description": "The username.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "The profile's link (`https://www.pinterest.com/nasa/`), instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_PinterestProfile" }, "example": { "data": { "id": "142567281862381039", "username": "nasa", "displayName": "NASA", "bio": "Explore the universe and discover our home planet with the official NASA boards on Pinterest. Visit us at www.nasa.gov", "avatarUrl": "https://i.pinimg.com/280x280_RS/37/a1/75/37a175e6d2431425576f0b8f81389394.jpg", "url": "https://www.pinterest.com/nasa/", "verified": true, "private": false, "followers": 556819, "following": 5, "likes": null, "posts": 10555, "externalUrl": "http://www.nasa.gov/", "createdAt": "2012-03-05T16:37:07.000Z", "ext": { "boards": 82, "monthlyViews": 4677213, "coverUrl": "https://i.pinimg.com/originals/53/29/e7/5329e71b2f85d2758cd3ec1d18452c26.jpg", "domain": "www.nasa.gov", "verifiedMerchant": false, "lastSavedAt": "2026-11-20T16:39:34.000Z" } } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.pinterest.profile({ handle: \"nasa\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.pinterest.profile(handle=\"nasa\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/pinterest/profile \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=nasa\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_PinterestProfile": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/PinterestProfile" } } }, "PinterestProfile": { "allOf": [ { "type": "object", "description": "An account.", "required": [ "id", "username", "url", "verified", "private", "ext" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "bio": { "type": [ "string", "null" ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "displayName": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "verifiedMerchant" ], "properties": { "boards": { "type": [ "integer", "null" ], "format": "int64", "description": "Its boards.", "minimum": 0 }, "coverUrl": { "type": [ "string", "null" ], "description": "The profile's cover picture." }, "domain": { "type": [ "string", "null" ], "description": "The website it claimed, as shown (`nasa.gov`)." }, "lastSavedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "When it last saved a pin." }, { "type": "null" } ] }, "monthlyViews": { "type": [ "integer", "null" ], "format": "int64", "description": "Monthly views, as the profile shows them.", "minimum": 0 }, "verifiedMerchant": { "type": "boolean", "description": "A verified merchant (a shop)." } } }, { "type": "object", "description": "What only this platform has." } ] }, "externalUrl": { "type": [ "string", "null" ], "description": "The link in the bio." }, "followers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "following": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "id": { "type": "string", "description": "The platform's id for the account." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "description": "Likes the account's posts received in total.", "minimum": 0 }, "posts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "private": { "type": "boolean" }, "url": { "type": "string", "description": "The profile's page." }, "username": { "type": "string", "description": "The handle, without `@`." }, "verified": { "type": "boolean" } } }, { "type": "object", "description": "A Pinterest account." } ] }, "Timestamp": { "type": "string", "format": "date-time" } } } } ``` # Search Boards (/docs/api-reference/pinterest/search-boards) Boards matching a query, about 50 a page. `GET https://api.socialapi.sh/v1/pinterest/search/boards` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.pinterest.searchBoards({ query: "coffee" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.pinterest.search_boards(query="coffee") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/pinterest/search/boards \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "query=coffee" ``` **Response** ```json { "data": [ { "id": "704250529170647881", "name": "coffee", "url": "https://www.pinterest.com/zaddyszn/coffee/", "coverUrl": "https://i.pinimg.com/474x/bc/c6/95/bcc69550d88784909fff6e5291c05836.jpg", "posts": 45, "ext": { "description": null, "followers": null, "sections": 0, "owner": { "id": "704250597888532593", "username": "zaddyszn", "displayName": "tariroxx", "avatarUrl": "https://i.pinimg.com/140x140_RS/7e/b2/95/7eb29547b5f2263b0641e67f146e5ca9.jpg", "verified": false, "url": "https://www.pinterest.com/zaddyszn/" }, "privacy": "public", "category": null, "collaborative": false, "collaborators": 0, "createdAt": null, "updatedAt": "2026-11-24T03:06:37.000Z" } }, { "id": "862509834825915211", "name": "☕Coffee.☕", "url": "https://www.pinterest.com/igkladova77/coffee/", "coverUrl": "https://i.pinimg.com/474x/d8/cd/df/d8cddfea8bf49d4233a7b64406993313.jpg", "posts": 8238, "ext": { "description": "I thank my co-authors for their cooperation.🕊️🌹🤝👌", "followers": null, "sections": 0, "owner": { "id": "862509903544328320", "username": "igkladova77", "displayName": "🕊Irina🕊️", "avatarUrl": "https://i.pinimg.com/140x140_RS/ff/e6/1b/ffe61b03f612af6c9ad159d3ff600078.jpg", "verified": false, "url": "https://www.pinterest.com/igkladova77/" }, "privacy": "public", "category": null, "collaborative": true, "collaborators": 22, "createdAt": null, "updatedAt": "2026-11-23T07:05:56.000Z" } } ], "pagination": { "nextCursor": "b281MHw5NTE4Mjg2NDY0NDk1MjkwKkdRTCp8MzU5MDgxMzJhMzdiZmY4NTYxNWY4ZjhhZjU4MjYyYTZkZjY1MDkxYzRjZGE0ZWVlNzc0MDFkMmUwNjhkMjFjNHxORVd8", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/pinterest/search/boards": { "get": { "tags": [ "Pinterest" ], "summary": "Boards matching a query, about 50 a page.", "description": "1 credit a page.", "operationId": "pinterestSearchBoards", "parameters": [ { "name": "query", "in": "query", "description": "What to search for.", "required": true, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_PinterestBoard" }, "example": { "data": [ { "id": "704250529170647881", "name": "coffee", "url": "https://www.pinterest.com/zaddyszn/coffee/", "coverUrl": "https://i.pinimg.com/474x/bc/c6/95/bcc69550d88784909fff6e5291c05836.jpg", "posts": 45, "ext": { "description": null, "followers": null, "sections": 0, "owner": { "id": "704250597888532593", "username": "zaddyszn", "displayName": "tariroxx", "avatarUrl": "https://i.pinimg.com/140x140_RS/7e/b2/95/7eb29547b5f2263b0641e67f146e5ca9.jpg", "verified": false, "url": "https://www.pinterest.com/zaddyszn/" }, "privacy": "public", "category": null, "collaborative": false, "collaborators": 0, "createdAt": null, "updatedAt": "2026-11-24T03:06:37.000Z" } }, { "id": "862509834825915211", "name": "☕Coffee.☕", "url": "https://www.pinterest.com/igkladova77/coffee/", "coverUrl": "https://i.pinimg.com/474x/d8/cd/df/d8cddfea8bf49d4233a7b64406993313.jpg", "posts": 8238, "ext": { "description": "I thank my co-authors for their cooperation.🕊️🌹🤝👌", "followers": null, "sections": 0, "owner": { "id": "862509903544328320", "username": "igkladova77", "displayName": "🕊Irina🕊️", "avatarUrl": "https://i.pinimg.com/140x140_RS/ff/e6/1b/ffe61b03f612af6c9ad159d3ff600078.jpg", "verified": false, "url": "https://www.pinterest.com/igkladova77/" }, "privacy": "public", "category": null, "collaborative": true, "collaborators": 22, "createdAt": null, "updatedAt": "2026-11-23T07:05:56.000Z" } } ], "pagination": { "nextCursor": "b281MHw5NTE4Mjg2NDY0NDk1MjkwKkdRTCp8MzU5MDgxMzJhMzdiZmY4NTYxNWY4ZjhhZjU4MjYyYTZkZjY1MDkxYzRjZGE0ZWVlNzc0MDFkMmUwNjhkMjFjNHxORVd8", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.pinterest.searchBoards({ query: \"coffee\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.pinterest.search_boards(query=\"coffee\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/pinterest/search/boards \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"query=coffee\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_PinterestBoard": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/PinterestBoard" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "PinterestBoard": { "allOf": [ { "type": "object", "description": "A playlist, mix or collection of posts.", "required": [ "id", "name", "ext" ], "properties": { "coverUrl": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "collaborative" ], "properties": { "category": { "type": [ "string", "null" ], "description": "Pinterest's category (`education`, `food_drink`)." }, "collaborative": { "type": "boolean", "description": "Others can save to it." }, "collaborators": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "description": { "type": [ "string", "null" ] }, "followers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "owner": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "privacy": { "type": [ "string", "null" ], "description": "`public` or `secret` (a secret board is never answered to a visitor)." }, "sections": { "type": [ "integer", "null" ], "format": "int64", "description": "Its sections.", "minimum": 0 }, "updatedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "When a pin was last saved to it." }, { "type": "null" } ] } } }, { "type": "object", "description": "What only this platform has." } ] }, "id": { "type": "string" }, "name": { "type": "string" }, "posts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "url": { "type": [ "string", "null" ] } } }, { "type": "object", "description": "A board." } ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Search Suggestions (/docs/api-reference/pinterest/search-suggestions) What the search box suggests for a few letters. `GET https://api.socialapi.sh/v1/pinterest/search/suggestions` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.pinterest.searchSuggestions({ query: "coff" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.pinterest.search_suggestions(query="coff") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/pinterest/search/suggestions \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "query=coff" ``` **Response** ```json { "data": [ { "text": "coffee" }, { "text": "coffee aesthetic" } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/pinterest/search/suggestions": { "get": { "tags": [ "Pinterest" ], "summary": "What the search box suggests for a few letters.", "description": "Up to 10 searches. 1 credit.", "operationId": "pinterestSearchSuggestions", "parameters": [ { "name": "query", "in": "query", "description": "The first letters of a search.", "required": true, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_Suggestion" }, "example": { "data": [ { "text": "coffee" }, { "text": "coffee aesthetic" } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.pinterest.searchSuggestions({ query: \"coff\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.pinterest.search_suggestions(query=\"coff\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/pinterest/search/suggestions \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"query=coff\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_Suggestion": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Suggestion" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "Suggestion": { "type": "object", "description": "A search suggestion.", "required": [ "text" ], "properties": { "text": { "type": "string" } } } } } } ``` # Search Users (/docs/api-reference/pinterest/search-users) Accounts matching a query, about 48 a page. `GET https://api.socialapi.sh/v1/pinterest/search/users` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.pinterest.searchUsers({ query: "coffee" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.pinterest.search_users(query="coffee") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/pinterest/search/users \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "query=coffee" ``` **Response** ```json { "data": [ { "id": "130393489119643810", "username": "andipreston", "displayName": "This Coffee Life", "bio": null, "avatarUrl": "https://i.pinimg.com/280x280_RS/ad/8c/76/ad8c7667cf17cc1da9ac0637cb4b5039.jpg", "url": "https://www.pinterest.com/andipreston/", "verified": false, "private": false, "followers": 3408, "following": null, "likes": null, "posts": 7605, "externalUrl": null, "createdAt": null, "ext": { "boards": 62, "monthlyViews": null, "coverUrl": null, "domain": null, "verifiedMerchant": false, "lastSavedAt": "2026-06-25T17:00:03.000Z" } }, { "id": "740068288675059890", "username": "BrewEspressoCoffee", "displayName": "Brew Espresso Coffee", "bio": null, "avatarUrl": "https://i.pinimg.com/280x280_RS/2a/e2/cf/2ae2cf4840c408c8af37c0070fe6e325.jpg", "url": "https://www.pinterest.com/BrewEspressoCoffee/", "verified": false, "private": false, "followers": 2457, "following": null, "likes": null, "posts": 2960, "externalUrl": null, "createdAt": null, "ext": { "boards": 23, "monthlyViews": null, "coverUrl": null, "domain": null, "verifiedMerchant": false, "lastSavedAt": "2026-10-14T14:00:36.000Z" } } ], "pagination": { "nextCursor": "b281MHw2MzE0OTMxODk0NDI5MzMxKkdRTCp8ZTY3M2Q3MjY1NTdhNThlYWQxMzhkMGI5MWE3ZmNjZWM3OThmYzgwODIyYTk2ODZmMmQwNmRkYWYyMzFmZGYxNHxORVd8", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/pinterest/search/users": { "get": { "tags": [ "Pinterest" ], "summary": "Accounts matching a query, about 48 a page.", "description": "With their follower, pin and board counts. 1 credit a page.", "operationId": "pinterestSearchUsers", "parameters": [ { "name": "query", "in": "query", "description": "What to search for.", "required": true, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_PinterestProfile" }, "example": { "data": [ { "id": "130393489119643810", "username": "andipreston", "displayName": "This Coffee Life", "bio": null, "avatarUrl": "https://i.pinimg.com/280x280_RS/ad/8c/76/ad8c7667cf17cc1da9ac0637cb4b5039.jpg", "url": "https://www.pinterest.com/andipreston/", "verified": false, "private": false, "followers": 3408, "following": null, "likes": null, "posts": 7605, "externalUrl": null, "createdAt": null, "ext": { "boards": 62, "monthlyViews": null, "coverUrl": null, "domain": null, "verifiedMerchant": false, "lastSavedAt": "2026-06-25T17:00:03.000Z" } }, { "id": "740068288675059890", "username": "BrewEspressoCoffee", "displayName": "Brew Espresso Coffee", "bio": null, "avatarUrl": "https://i.pinimg.com/280x280_RS/2a/e2/cf/2ae2cf4840c408c8af37c0070fe6e325.jpg", "url": "https://www.pinterest.com/BrewEspressoCoffee/", "verified": false, "private": false, "followers": 2457, "following": null, "likes": null, "posts": 2960, "externalUrl": null, "createdAt": null, "ext": { "boards": 23, "monthlyViews": null, "coverUrl": null, "domain": null, "verifiedMerchant": false, "lastSavedAt": "2026-10-14T14:00:36.000Z" } } ], "pagination": { "nextCursor": "b281MHw2MzE0OTMxODk0NDI5MzMxKkdRTCp8ZTY3M2Q3MjY1NTdhNThlYWQxMzhkMGI5MWE3ZmNjZWM3OThmYzgwODIyYTk2ODZmMmQwNmRkYWYyMzFmZGYxNHxORVd8", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.pinterest.searchUsers({ query: \"coffee\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.pinterest.search_users(query=\"coffee\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/pinterest/search/users \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"query=coffee\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_PinterestProfile": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/PinterestProfile" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "PinterestProfile": { "allOf": [ { "type": "object", "description": "An account.", "required": [ "id", "username", "url", "verified", "private", "ext" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "bio": { "type": [ "string", "null" ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "displayName": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "verifiedMerchant" ], "properties": { "boards": { "type": [ "integer", "null" ], "format": "int64", "description": "Its boards.", "minimum": 0 }, "coverUrl": { "type": [ "string", "null" ], "description": "The profile's cover picture." }, "domain": { "type": [ "string", "null" ], "description": "The website it claimed, as shown (`nasa.gov`)." }, "lastSavedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "When it last saved a pin." }, { "type": "null" } ] }, "monthlyViews": { "type": [ "integer", "null" ], "format": "int64", "description": "Monthly views, as the profile shows them.", "minimum": 0 }, "verifiedMerchant": { "type": "boolean", "description": "A verified merchant (a shop)." } } }, { "type": "object", "description": "What only this platform has." } ] }, "externalUrl": { "type": [ "string", "null" ], "description": "The link in the bio." }, "followers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "following": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "id": { "type": "string", "description": "The platform's id for the account." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "description": "Likes the account's posts received in total.", "minimum": 0 }, "posts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "private": { "type": "boolean" }, "url": { "type": "string", "description": "The profile's page." }, "username": { "type": "string", "description": "The handle, without `@`." }, "verified": { "type": "boolean" } } }, { "type": "object", "description": "A Pinterest account." } ] }, "Timestamp": { "type": "string", "format": "date-time" } } } } ``` # Search Videos (/docs/api-reference/pinterest/search-videos) Video pins matching a query, 25 a page. `GET https://api.socialapi.sh/v1/pinterest/search/videos` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.pinterest.searchVideos({ query: "coffee" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.pinterest.search_videos(query="coffee") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/pinterest/search/videos \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "query=coffee" ``` **Response** ```json { "data": [ { "id": "e1_AfqPShzPBg3Nu48fISCOBtphoxjpwNS1zrOdDkwycToGN2q1SU1o", "url": "https://www.pinterest.com/pin/e1_AfqPShzPBg3Nu48fISCOBtphoxjpwNS1zrOdDkwycToGN2q1SU1o/", "text": "The force is strong with this brew! May the fourth be filled with aromatic coffee vibes and the power of a perfectly brewed cup.\n\nwww.kimbocoffee.com\n\n#MayTheFourth #CoffeeForceAwakens #KimboCoffee #ACupOfNaples", "createdAt": "2024-05-04T18:47:20.000Z", "author": { "id": "977281325297976093", "username": "kimbocoffeeusa", "displayName": "Kimbo Coffee", "avatarUrl": "https://i.pinimg.com/140x140_RS/91/6b/94/916b94f053ade57e65eab98cf5475f72.jpg", "verified": false, "url": "https://www.pinterest.com/kimbocoffeeusa/" }, "stats": { "views": null, "likes": 92, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://v1.pinimg.com/videos/iht/hls/cc/38/12/cc3812a66e550fa656a302f4c64eb9ec.m3u8", "thumbnailUrl": "https://i.pinimg.com/videos/thumbnails/originals/cc/38/12/cc3812a66e550fa656a302f4c64eb9ec.0000000.jpg", "width": 1080, "height": 1920, "durationSeconds": 28.6 } ], "hashtags": [ "MayTheFourth", "CoffeeForceAwakens", "KimboCoffee" ], "mentions": [], "ext": { "kind": "video", "title": "May The Fourth Be With You", "link": null, "domain": "Uploaded by user", "board": { "id": "977281256578899310", "name": "Kimbo Coffee USA", "url": "https://www.pinterest.com/kimbocoffeeusa/kimbo-coffee-usa/" }, "commentsId": "5362153104320018748", "openable": false, "dominantColor": "#361c11", "altText": "coffee beans falling down into the air", "commentsDisabled": false } }, { "id": "e1_AfqPShzWsW6YL7GNT1uEXftmzbeoZBTQoHDf459UbqK5CqG_i_FV", "url": "https://www.pinterest.com/pin/e1_AfqPShzWsW6YL7GNT1uEXftmzbeoZBTQoHDf459UbqK5CqG_i_FV/", "text": "No dobra, Kochani, kto dzisiaj zaczyna dzień od kawki? ☕ Ja myślę, że dobra kawa i trochę dobrego humoru to całkiem niezły duet!\nCzasami wystarczy taki mały przyjemny moment, żeby od razu zrobiło się milej. Człowiek bierze pierwszy łyk i już świat wydaje się trochę bardziej przyjazny. A jak do tego wpadnie jakiś fajny pomysł, to wiadomo… zaraz ręce same rwą się do roboty!\nU mnie z pomysłami to róż…", "createdAt": "2026-10-13T03:03:27.000Z", "author": { "id": "286049151240642883", "username": "kotrysgruhlke", "displayName": "Małgorzata Kotrys-Gruhlke", "avatarUrl": "https://i.pinimg.com/140x140_RS/60/87/38/608738b59bad4b4c8f92668c252a716b.jpg", "verified": false, "url": "https://www.pinterest.com/kotrysgruhlke/" }, "stats": { "views": null, "likes": 219, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://v1.pinimg.com/videos/iht/hls/d2/25/61/d225613a08ca9eeb8ad77c46dde55b0a.m3u8", "thumbnailUrl": "https://i.pinimg.com/videos/thumbnails/originals/d2/25/61/d225613a08ca9eeb8ad77c46dde55b0a.0000000.jpg", "width": 720, "height": 1280, "durationSeconds": 15.1 } ], "hashtags": [], "mentions": [], "ext": { "kind": "video", "title": null, "link": "https://www.instagram.com/reel/DeZA2dZtn9i/", "domain": "instagram.com", "board": { "id": "286049082521624943", "name": "sieci społecznościowe", "url": "https://www.pinterest.com/kotrysgruhlke/sieci-spo%C5%82eczno%C5%9Bciowe/" }, "commentsId": "3940250446035985600", "openable": false, "dominantColor": "#b28d68", "altText": "coffee being poured into the word coffee with steam rising from it and liquid coming out", "commentsDisabled": false } } ], "pagination": { "nextCursor": "Y2JVSG81V2sxcmNHRlpWM1J5VFVad1YxWlVSbGhXTVVreVZrZHpNV0pIU2toa1JGcFhVbnBXTTFadGN6RlNhelZYVm14V1dGSXlhRkZYVm1Rd1ZqQTFjMVZzYUdwVFJYQlBWbXhvVTJWV1pISlhhM1JYVm10V05sVldVbE5YUjBwWlVXNUtXbFpzVmpSWk1WcHpUbXhXY2s1V1pFNVdiRlkwVm1wR1UxTXhWbkpPVmxwT1YwWktWbGxzWkc5VU1WSllaRVphVGxadFVubFhhMVpoVkcxS1NHVklhRlpOVjJoMlZrZDRXbVF5UlhwYVJsWlhUVEJLVEZaR1ZsWmtNbFpYVjI1U2FGSlViRmhWYkZKWFpXeFplV1ZHVGxWTmExcDVWR3RvYzFaR1dr…", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/pinterest/search/videos": { "get": { "tags": [ "Pinterest" ], "summary": "Video pins matching a query, 25 a page.", "description": "1 credit a page.", "operationId": "pinterestSearchVideos", "parameters": [ { "name": "query", "in": "query", "description": "What to search for.", "required": true, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_PinterestPost" }, "example": { "data": [ { "id": "e1_AfqPShzPBg3Nu48fISCOBtphoxjpwNS1zrOdDkwycToGN2q1SU1o", "url": "https://www.pinterest.com/pin/e1_AfqPShzPBg3Nu48fISCOBtphoxjpwNS1zrOdDkwycToGN2q1SU1o/", "text": "The force is strong with this brew! May the fourth be filled with aromatic coffee vibes and the power of a perfectly brewed cup.\n\nwww.kimbocoffee.com\n\n#MayTheFourth #CoffeeForceAwakens #KimboCoffee #ACupOfNaples", "createdAt": "2024-05-04T18:47:20.000Z", "author": { "id": "977281325297976093", "username": "kimbocoffeeusa", "displayName": "Kimbo Coffee", "avatarUrl": "https://i.pinimg.com/140x140_RS/91/6b/94/916b94f053ade57e65eab98cf5475f72.jpg", "verified": false, "url": "https://www.pinterest.com/kimbocoffeeusa/" }, "stats": { "views": null, "likes": 92, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://v1.pinimg.com/videos/iht/hls/cc/38/12/cc3812a66e550fa656a302f4c64eb9ec.m3u8", "thumbnailUrl": "https://i.pinimg.com/videos/thumbnails/originals/cc/38/12/cc3812a66e550fa656a302f4c64eb9ec.0000000.jpg", "width": 1080, "height": 1920, "durationSeconds": 28.6 } ], "hashtags": [ "MayTheFourth", "CoffeeForceAwakens", "KimboCoffee" ], "mentions": [], "ext": { "kind": "video", "title": "May The Fourth Be With You", "link": null, "domain": "Uploaded by user", "board": { "id": "977281256578899310", "name": "Kimbo Coffee USA", "url": "https://www.pinterest.com/kimbocoffeeusa/kimbo-coffee-usa/" }, "commentsId": "5362153104320018748", "openable": false, "dominantColor": "#361c11", "altText": "coffee beans falling down into the air", "commentsDisabled": false } }, { "id": "e1_AfqPShzWsW6YL7GNT1uEXftmzbeoZBTQoHDf459UbqK5CqG_i_FV", "url": "https://www.pinterest.com/pin/e1_AfqPShzWsW6YL7GNT1uEXftmzbeoZBTQoHDf459UbqK5CqG_i_FV/", "text": "No dobra, Kochani, kto dzisiaj zaczyna dzień od kawki? ☕ Ja myślę, że dobra kawa i trochę dobrego humoru to całkiem niezły duet!\nCzasami wystarczy taki mały przyjemny moment, żeby od razu zrobiło się milej. Człowiek bierze pierwszy łyk i już świat wydaje się trochę bardziej przyjazny. A jak do tego wpadnie jakiś fajny pomysł, to wiadomo… zaraz ręce same rwą się do roboty!\nU mnie z pomysłami to róż…", "createdAt": "2026-10-13T03:03:27.000Z", "author": { "id": "286049151240642883", "username": "kotrysgruhlke", "displayName": "Małgorzata Kotrys-Gruhlke", "avatarUrl": "https://i.pinimg.com/140x140_RS/60/87/38/608738b59bad4b4c8f92668c252a716b.jpg", "verified": false, "url": "https://www.pinterest.com/kotrysgruhlke/" }, "stats": { "views": null, "likes": 219, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://v1.pinimg.com/videos/iht/hls/d2/25/61/d225613a08ca9eeb8ad77c46dde55b0a.m3u8", "thumbnailUrl": "https://i.pinimg.com/videos/thumbnails/originals/d2/25/61/d225613a08ca9eeb8ad77c46dde55b0a.0000000.jpg", "width": 720, "height": 1280, "durationSeconds": 15.1 } ], "hashtags": [], "mentions": [], "ext": { "kind": "video", "title": null, "link": "https://www.instagram.com/reel/DeZA2dZtn9i/", "domain": "instagram.com", "board": { "id": "286049082521624943", "name": "sieci społecznościowe", "url": "https://www.pinterest.com/kotrysgruhlke/sieci-spo%C5%82eczno%C5%9Bciowe/" }, "commentsId": "3940250446035985600", "openable": false, "dominantColor": "#b28d68", "altText": "coffee being poured into the word coffee with steam rising from it and liquid coming out", "commentsDisabled": false } } ], "pagination": { "nextCursor": "Y2JVSG81V2sxcmNHRlpWM1J5VFVad1YxWlVSbGhXTVVreVZrZHpNV0pIU2toa1JGcFhVbnBXTTFadGN6RlNhelZYVm14V1dGSXlhRkZYVm1Rd1ZqQTFjMVZzYUdwVFJYQlBWbXhvVTJWV1pISlhhM1JYVm10V05sVldVbE5YUjBwWlVXNUtXbFpzVmpSWk1WcHpUbXhXY2s1V1pFNVdiRlkwVm1wR1UxTXhWbkpPVmxwT1YwWktWbGxzWkc5VU1WSllaRVphVGxadFVubFhhMVpoVkcxS1NHVklhRlpOVjJoMlZrZDRXbVF5UlhwYVJsWlhUVEJLVEZaR1ZsWmtNbFpYVjI1U2FGSlViRmhWYkZKWFpXeFplV1ZHVGxWTmExcDVWR3RvYzFaR1dr…", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.pinterest.searchVideos({ query: \"coffee\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.pinterest.search_videos(query=\"coffee\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/pinterest/search/videos \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"query=coffee\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_PinterestPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/PinterestPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "PinterestPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "kind", "openable", "commentsDisabled" ], "properties": { "altText": { "type": [ "string", "null" ], "description": "The description for screen readers." }, "board": { "oneOf": [ { "$ref": "#/components/schemas/PinterestBoardRef", "description": "The board it was saved to." }, { "type": "null" } ] }, "commentsDisabled": { "type": "boolean", "description": "Whether comments are turned off." }, "commentsId": { "type": [ "string", "null" ], "description": "What `/v1/pinterest/post/comments` takes as `commentsId`: the id of the pin's\ncomments, which every pin has, encrypted ones included." }, "domain": { "type": [ "string", "null" ] }, "dominantColor": { "type": [ "string", "null" ], "description": "The image's main colour (`#133b66`)." }, "kind": { "$ref": "#/components/schemas/PinterestPinKind" }, "link": { "type": [ "string", "null" ], "description": "The page the pin links to, and its host." }, "openable": { "type": "boolean", "description": "Whether `/v1/pinterest/post` can open it. Pinterest gives most pins in search and\non others' boards an encrypted id (`e1_…`) that it does not open for a visitor." }, "title": { "type": [ "string", "null" ], "description": "The pin's title (`text` is its description)." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A pin: an image, a video, a carousel or an Idea pin." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "PinterestPinKind": { "type": "string", "description": "What a pin is.", "enum": [ "image", "video", "carousel", "story" ] }, "PinterestBoardRef": { "type": "object", "description": "A board as a pin names it.", "required": [ "id", "name" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "url": { "type": [ "string", "null" ] } } }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Search (/docs/api-reference/pinterest/search) Pins matching a query, about 25 a page. `GET https://api.socialapi.sh/v1/pinterest/search` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.pinterest.search({ query: "coffee" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.pinterest.search(query="coffee") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/pinterest/search \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "query=coffee" ``` **Response** ```json { "data": [ { "id": "e1_AfqPShy3WPDLBnGwaUF0Xhx8bap5Jv-tnSTZHBbS_D5DAYfDEpj8jA", "url": "https://www.pinterest.com/pin/e1_AfqPShy3WPDLBnGwaUF0Xhx8bap5Jv-tnSTZHBbS_D5DAYfDEpj8jA/", "text": null, "createdAt": "2026-11-17T03:13:11.000Z", "author": { "id": "1019080359339514940", "username": "aylinnicol2017", "displayName": "Ana Ruth", "avatarUrl": "https://s.pinimg.com/images/user/default_140.png", "verified": false, "url": "https://www.pinterest.com/aylinnicol2017/" }, "stats": { "views": null, "likes": 6, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://i.pinimg.com/originals/d1/86/97/d186970df154c451b60870f554d5b199.jpg", "thumbnailUrl": null, "width": 1024, "height": 1536, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "kind": "story", "title": null, "link": "https://onelink.shein.com/59/67fgcof3713i?ismg_ol=8uVRn795nnD_01_KOC-C", "domain": "onelink.shein.com", "board": { "id": "1019080290621863005", "name": "Cosas para comprar", "url": "https://www.pinterest.com/aylinnicol2017/cosas-para-comprar/" }, "commentsId": "4012442934663022528", "openable": false, "dominantColor": "#755b49", "altText": "a woman holding a cup of coffee in her hands", "commentsDisabled": false } }, { "id": "e1_AfqPShzKVJTzlGpjMZLxjnxBFxUKjb13z7lEGTn55WV3oUmnRP9Z2g", "url": "https://www.pinterest.com/pin/e1_AfqPShzKVJTzlGpjMZLxjnxBFxUKjb13z7lEGTn55WV3oUmnRP9Z2g/", "text": null, "createdAt": "2026-11-17T11:36:51.000Z", "author": { "id": "1104789489748392668", "username": "preview_mokacoffeepot_com", "displayName": "Pinterest Preview mokacoffeepot_com", "avatarUrl": "https://s.pinimg.com/images/user/default_140.png", "verified": false, "url": "https://www.pinterest.com/preview_mokacoffeepot_com/" }, "stats": { "views": null, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://i.pinimg.com/originals/fb/25/b2/fb25b28693600235d70475f9c8ff529e.png", "thumbnailUrl": null, "width": 1080, "height": 1920, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "kind": "image", "title": "Chocolate Peanut Butter Iced Coffee", "link": "https://www.mokacoffeepot.com/chocolate-peanut-butter-iced-coffee/", "domain": "mokacoffeepot.com", "board": { "id": "1104789421031119466", "name": "Inspo", "url": "https://www.pinterest.com/preview_mokacoffeepot_com/_inspo/" }, "commentsId": null, "openable": false, "dominantColor": "#d2c2b7", "altText": "two glasses of chocolate peanut butter iced coffee with whipped cream on top and the text overlay reads, chocolate peanut butter iced coffee", "commentsDisabled": false } } ], "pagination": { "nextCursor": "Y2JVSG81V2sxcmNHRlpWM1J5VFVad1YxWllaR3hpVmtZMldWVlZNVlV4U25Sak0yUlhVa1ZLVkZWdE1WZFNhelZYVm0xb1RrMXNTbEJYYkdONFlXMVdWMVZ1VGxaaVNFSnlWRlZvVTJWV1pISlhhM1JYVm10V05sVldVbE5YUjBwWlVXeFNXbUpHVlRGV2JGcHlaVzFHUms5V1RsTldNMDR6Vm1wSmQyVkdXWGxTYkdScFUwVmFiMVZxU2pSaFJsWnlXa1JTYTFKdFVsbFpNRlUxWVVaYWRHVkdiRmRpUmtwUVYxWmtTMVl4V25GV2JGWk9VakZLVlZkV1VrSk5WVFZ6Vm01U1RsWnJTbGhVVldSNlpERlplRmR0ZEZOaGVsWlhWR3hhVjFVeVNs…", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/pinterest/search": { "get": { "tags": [ "Pinterest" ], "summary": "Pins matching a query, about 25 a page.", "description": "Pinterest gives search results encrypted ids (`e1_…`), which `/post` cannot open; their\ncomments are read by `ext.commentsId`. 1 credit a page.", "operationId": "pinterestSearch", "parameters": [ { "name": "query", "in": "query", "description": "What to search for.", "required": true, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_PinterestPost" }, "example": { "data": [ { "id": "e1_AfqPShy3WPDLBnGwaUF0Xhx8bap5Jv-tnSTZHBbS_D5DAYfDEpj8jA", "url": "https://www.pinterest.com/pin/e1_AfqPShy3WPDLBnGwaUF0Xhx8bap5Jv-tnSTZHBbS_D5DAYfDEpj8jA/", "text": null, "createdAt": "2026-11-17T03:13:11.000Z", "author": { "id": "1019080359339514940", "username": "aylinnicol2017", "displayName": "Ana Ruth", "avatarUrl": "https://s.pinimg.com/images/user/default_140.png", "verified": false, "url": "https://www.pinterest.com/aylinnicol2017/" }, "stats": { "views": null, "likes": 6, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://i.pinimg.com/originals/d1/86/97/d186970df154c451b60870f554d5b199.jpg", "thumbnailUrl": null, "width": 1024, "height": 1536, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "kind": "story", "title": null, "link": "https://onelink.shein.com/59/67fgcof3713i?ismg_ol=8uVRn795nnD_01_KOC-C", "domain": "onelink.shein.com", "board": { "id": "1019080290621863005", "name": "Cosas para comprar", "url": "https://www.pinterest.com/aylinnicol2017/cosas-para-comprar/" }, "commentsId": "4012442934663022528", "openable": false, "dominantColor": "#755b49", "altText": "a woman holding a cup of coffee in her hands", "commentsDisabled": false } }, { "id": "e1_AfqPShzKVJTzlGpjMZLxjnxBFxUKjb13z7lEGTn55WV3oUmnRP9Z2g", "url": "https://www.pinterest.com/pin/e1_AfqPShzKVJTzlGpjMZLxjnxBFxUKjb13z7lEGTn55WV3oUmnRP9Z2g/", "text": null, "createdAt": "2026-11-17T11:36:51.000Z", "author": { "id": "1104789489748392668", "username": "preview_mokacoffeepot_com", "displayName": "Pinterest Preview mokacoffeepot_com", "avatarUrl": "https://s.pinimg.com/images/user/default_140.png", "verified": false, "url": "https://www.pinterest.com/preview_mokacoffeepot_com/" }, "stats": { "views": null, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://i.pinimg.com/originals/fb/25/b2/fb25b28693600235d70475f9c8ff529e.png", "thumbnailUrl": null, "width": 1080, "height": 1920, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "kind": "image", "title": "Chocolate Peanut Butter Iced Coffee", "link": "https://www.mokacoffeepot.com/chocolate-peanut-butter-iced-coffee/", "domain": "mokacoffeepot.com", "board": { "id": "1104789421031119466", "name": "Inspo", "url": "https://www.pinterest.com/preview_mokacoffeepot_com/_inspo/" }, "commentsId": null, "openable": false, "dominantColor": "#d2c2b7", "altText": "two glasses of chocolate peanut butter iced coffee with whipped cream on top and the text overlay reads, chocolate peanut butter iced coffee", "commentsDisabled": false } } ], "pagination": { "nextCursor": "Y2JVSG81V2sxcmNHRlpWM1J5VFVad1YxWllaR3hpVmtZMldWVlZNVlV4U25Sak0yUlhVa1ZLVkZWdE1WZFNhelZYVm0xb1RrMXNTbEJYYkdONFlXMVdWMVZ1VGxaaVNFSnlWRlZvVTJWV1pISlhhM1JYVm10V05sVldVbE5YUjBwWlVXeFNXbUpHVlRGV2JGcHlaVzFHUms5V1RsTldNMDR6Vm1wSmQyVkdXWGxTYkdScFUwVmFiMVZxU2pSaFJsWnlXa1JTYTFKdFVsbFpNRlUxWVVaYWRHVkdiRmRpUmtwUVYxWmtTMVl4V25GV2JGWk9VakZLVlZkV1VrSk5WVFZ6Vm01U1RsWnJTbGhVVldSNlpERlplRmR0ZEZOaGVsWlhWR3hhVjFVeVNs…", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.pinterest.search({ query: \"coffee\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.pinterest.search(query=\"coffee\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/pinterest/search \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"query=coffee\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_PinterestPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/PinterestPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "PinterestPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "kind", "openable", "commentsDisabled" ], "properties": { "altText": { "type": [ "string", "null" ], "description": "The description for screen readers." }, "board": { "oneOf": [ { "$ref": "#/components/schemas/PinterestBoardRef", "description": "The board it was saved to." }, { "type": "null" } ] }, "commentsDisabled": { "type": "boolean", "description": "Whether comments are turned off." }, "commentsId": { "type": [ "string", "null" ], "description": "What `/v1/pinterest/post/comments` takes as `commentsId`: the id of the pin's\ncomments, which every pin has, encrypted ones included." }, "domain": { "type": [ "string", "null" ] }, "dominantColor": { "type": [ "string", "null" ], "description": "The image's main colour (`#133b66`)." }, "kind": { "$ref": "#/components/schemas/PinterestPinKind" }, "link": { "type": [ "string", "null" ], "description": "The page the pin links to, and its host." }, "openable": { "type": "boolean", "description": "Whether `/v1/pinterest/post` can open it. Pinterest gives most pins in search and\non others' boards an encrypted id (`e1_…`) that it does not open for a visitor." }, "title": { "type": [ "string", "null" ], "description": "The pin's title (`text` is its description)." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A pin: an image, a video, a carousel or an Idea pin." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "PinterestPinKind": { "type": "string", "description": "What a pin is.", "enum": [ "image", "video", "carousel", "story" ] }, "PinterestBoardRef": { "type": "object", "description": "A board as a pin names it.", "required": [ "id", "name" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "url": { "type": [ "string", "null" ] } } }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Topic Posts (/docs/api-reference/pinterest/topic-posts) A topic's top pins, about 20. `GET https://api.socialapi.sh/v1/pinterest/topic/posts` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.pinterest.topicPosts({ id: "939226065359" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.pinterest.topic_posts(id="939226065359") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/pinterest/topic/posts \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "id=939226065359" ``` **Response** ```json { "data": [ { "id": "e1_AfqPShyA9EPC4atJNOOxtggSFunLC85PdDFz5CRAhYk7L6GCojmB", "url": "https://www.pinterest.com/pin/e1_AfqPShyA9EPC4atJNOOxtggSFunLC85PdDFz5CRAhYk7L6GCojmB/", "text": null, "createdAt": null, "author": null, "stats": { "views": null, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://i.pinimg.com/originals/4d/3f/f2/4d3ff29617ffbe87d39a2a1eaca80e3d.jpg", "thumbnailUrl": null, "width": 2108, "height": 2810, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "kind": "image", "title": null, "link": null, "domain": null, "board": null, "commentsId": null, "openable": false, "dominantColor": "#67655f", "altText": null, "commentsDisabled": false } }, { "id": "e1_AfqPShyCHtEsGNVkCjwVyfADK6bRJAjxuGBx0e7fo_YQnF9j-2MD", "url": "https://www.pinterest.com/pin/e1_AfqPShyCHtEsGNVkCjwVyfADK6bRJAjxuGBx0e7fo_YQnF9j-2MD/", "text": null, "createdAt": null, "author": null, "stats": { "views": null, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://i.pinimg.com/originals/1d/7f/f6/1d7ff68258e996fc36f893604c1ea111.png", "thumbnailUrl": null, "width": 768, "height": 1376, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "kind": "image", "title": null, "link": null, "domain": null, "board": null, "commentsId": null, "openable": false, "dominantColor": "#8f857b", "altText": null, "commentsDisabled": false } } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/pinterest/topic/posts": { "get": { "tags": [ "Pinterest" ], "summary": "A topic's top pins, about 20.", "description": "One page. 1 credit.", "operationId": "pinterestTopicPosts", "parameters": [ { "name": "url", "in": "query", "description": "The topic's Ideas page (`https://www.pinterest.com/ideas/coffee-shop/939226065359/`).", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The topic's id, instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_PinterestPost" }, "example": { "data": [ { "id": "e1_AfqPShyA9EPC4atJNOOxtggSFunLC85PdDFz5CRAhYk7L6GCojmB", "url": "https://www.pinterest.com/pin/e1_AfqPShyA9EPC4atJNOOxtggSFunLC85PdDFz5CRAhYk7L6GCojmB/", "text": null, "createdAt": null, "author": null, "stats": { "views": null, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://i.pinimg.com/originals/4d/3f/f2/4d3ff29617ffbe87d39a2a1eaca80e3d.jpg", "thumbnailUrl": null, "width": 2108, "height": 2810, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "kind": "image", "title": null, "link": null, "domain": null, "board": null, "commentsId": null, "openable": false, "dominantColor": "#67655f", "altText": null, "commentsDisabled": false } }, { "id": "e1_AfqPShyCHtEsGNVkCjwVyfADK6bRJAjxuGBx0e7fo_YQnF9j-2MD", "url": "https://www.pinterest.com/pin/e1_AfqPShyCHtEsGNVkCjwVyfADK6bRJAjxuGBx0e7fo_YQnF9j-2MD/", "text": null, "createdAt": null, "author": null, "stats": { "views": null, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://i.pinimg.com/originals/1d/7f/f6/1d7ff68258e996fc36f893604c1ea111.png", "thumbnailUrl": null, "width": 768, "height": 1376, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "kind": "image", "title": null, "link": null, "domain": null, "board": null, "commentsId": null, "openable": false, "dominantColor": "#8f857b", "altText": null, "commentsDisabled": false } } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.pinterest.topicPosts({ id: \"939226065359\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.pinterest.topic_posts(id=\"939226065359\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/pinterest/topic/posts \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"id=939226065359\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_PinterestPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/PinterestPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "PinterestPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "kind", "openable", "commentsDisabled" ], "properties": { "altText": { "type": [ "string", "null" ], "description": "The description for screen readers." }, "board": { "oneOf": [ { "$ref": "#/components/schemas/PinterestBoardRef", "description": "The board it was saved to." }, { "type": "null" } ] }, "commentsDisabled": { "type": "boolean", "description": "Whether comments are turned off." }, "commentsId": { "type": [ "string", "null" ], "description": "What `/v1/pinterest/post/comments` takes as `commentsId`: the id of the pin's\ncomments, which every pin has, encrypted ones included." }, "domain": { "type": [ "string", "null" ] }, "dominantColor": { "type": [ "string", "null" ], "description": "The image's main colour (`#133b66`)." }, "kind": { "$ref": "#/components/schemas/PinterestPinKind" }, "link": { "type": [ "string", "null" ], "description": "The page the pin links to, and its host." }, "openable": { "type": "boolean", "description": "Whether `/v1/pinterest/post` can open it. Pinterest gives most pins in search and\non others' boards an encrypted id (`e1_…`) that it does not open for a visitor." }, "title": { "type": [ "string", "null" ], "description": "The pin's title (`text` is its description)." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A pin: an image, a video, a carousel or an Idea pin." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "PinterestPinKind": { "type": "string", "description": "What a pin is.", "enum": [ "image", "video", "carousel", "story" ] }, "PinterestBoardRef": { "type": "object", "description": "A board as a pin names it.", "required": [ "id", "name" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "url": { "type": [ "string", "null" ] } } }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Topic (/docs/api-reference/pinterest/topic) A topic's Ideas page with its followers and searches. `GET https://api.socialapi.sh/v1/pinterest/topic` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.pinterest.topic({ url: "https://www.pinterest.com/ideas/coffee-shop/939226065359/" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.pinterest.topic(url="https://www.pinterest.com/ideas/coffee-shop/939226065359/").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/pinterest/topic \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://www.pinterest.com/ideas/coffee-shop/939226065359/" ``` **Response** ```json { "data": { "id": "939226065359", "name": "coffee shop", "description": null, "url": "https://www.pinterest.com/ideas/coffee-shop/939226065359/", "posts": null, "views": null, "ext": { "followers": 151044, "searches": 753809, "trendingSearches": [], "related": [ "Cozy Coffee Shop", "Home Cafe", "Cafe Shop" ] } } } ``` **OpenAPI** ```json { "paths": { "/v1/pinterest/topic": { "get": { "tags": [ "Pinterest" ], "summary": "A topic's Ideas page with its followers and searches.", "description": "Name, description, followers, Pinterest's search count, what people search under it\nand related topics. 1 credit.", "operationId": "pinterestTopic", "parameters": [ { "name": "url", "in": "query", "description": "The topic's Ideas page (`https://www.pinterest.com/ideas/coffee-shop/939226065359/`).", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The topic's id, instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_PinterestTopic" }, "example": { "data": { "id": "939226065359", "name": "coffee shop", "description": null, "url": "https://www.pinterest.com/ideas/coffee-shop/939226065359/", "posts": null, "views": null, "ext": { "followers": 151044, "searches": 753809, "trendingSearches": [], "related": [ "Cozy Coffee Shop", "Home Cafe", "Cafe Shop" ] } } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.pinterest.topic({ url: \"https://www.pinterest.com/ideas/coffee-shop/939226065359/\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.pinterest.topic(url=\"https://www.pinterest.com/ideas/coffee-shop/939226065359/\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/pinterest/topic \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://www.pinterest.com/ideas/coffee-shop/939226065359/\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_PinterestTopic": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/PinterestTopic" } } }, "PinterestTopic": { "allOf": [ { "type": "object", "description": "A hashtag.", "required": [ "id", "name", "url", "ext" ], "properties": { "description": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "trendingSearches", "related" ], "properties": { "followers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "related": { "type": "array", "items": { "type": "string" }, "description": "Topics Pinterest relates to it." }, "searches": { "type": [ "integer", "null" ], "format": "int64", "description": "Pinterest's count of searches for it.", "minimum": 0 }, "trendingSearches": { "type": "array", "items": { "type": "string" }, "description": "What people search for under it now." } } }, { "type": "object", "description": "What only this platform has." } ] }, "id": { "type": "string" }, "name": { "type": "string", "description": "Without `#`." }, "posts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "url": { "type": "string" }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, { "type": "object", "description": "A topic: an Ideas page." } ] } } } } ``` # Trending (/docs/api-reference/pinterest/trending) What a country searches for on Pinterest Trends. `GET https://api.socialapi.sh/v1/pinterest/trending` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.pinterest.trending({ country: "us", type: "growing" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.pinterest.trending(country="us", type="growing") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/pinterest/trending \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "country=us" \ --data-urlencode "type=growing" ``` **Response** ```json { "data": [ { "term": "the body netflix 2026", "rank": 1, "searches": 65, "weeklyChange": 1, "monthlyChange": 100.01, "yearlyChange": 100.01, "seasonality": 0.32600528 }, { "term": "pirate token", "rank": 2, "searches": 57, "weeklyChange": 0.1, "monthlyChange": 100.01, "yearlyChange": 100.01, "seasonality": 0.32215738 } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/pinterest/trending": { "get": { "tags": [ "Pinterest" ], "summary": "What a country searches for on Pinterest Trends.", "description": "The 50 terms growing fastest, or the month's, the year's or the season's most searched,\neach with its change over the week, month and year. Pinterest updates them daily.\n10 credits.", "operationId": "pinterestTrending", "parameters": [ { "name": "country", "in": "query", "description": "The country, as a two-letter code (`us`, the default). Pinterest Trends covers the\nUS, Canada, most of Europe, Latin America and Australia; it pairs the UK with\nIreland and Australia with New Zealand.", "required": false, "schema": { "type": "string" } }, { "name": "type", "in": "query", "description": "`growing` (the default), `monthly`, `yearly` or `seasonal`.", "required": false, "schema": { "type": "string", "description": "The list of Pinterest Trends.", "enum": [ "growing", "monthly", "yearly", "seasonal" ] } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_PinterestTrend" }, "example": { "data": [ { "term": "the body netflix 2026", "rank": 1, "searches": 65, "weeklyChange": 1, "monthlyChange": 100.01, "yearlyChange": 100.01, "seasonality": 0.32600528 }, { "term": "pirate token", "rank": 2, "searches": 57, "weeklyChange": 0.1, "monthlyChange": 100.01, "yearlyChange": 100.01, "seasonality": 0.32215738 } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.pinterest.trending({ country: \"us\", type: \"growing\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.pinterest.trending(country=\"us\", type=\"growing\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/pinterest/trending \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"country=us\" \\\n --data-urlencode \"type=growing\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_PinterestTrend": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/PinterestTrend" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "PinterestTrend": { "type": "object", "description": "A term in Pinterest Trends.", "required": [ "term", "rank" ], "properties": { "monthlyChange": { "type": [ "number", "null" ], "format": "double" }, "rank": { "type": "integer", "format": "int32", "description": "Its place in the list, from 1.", "minimum": 0 }, "searches": { "type": [ "integer", "null" ], "format": "int64", "description": "Pinterest's index of its searches, relative to the list's others (not a count).", "minimum": 0 }, "seasonality": { "type": [ "number", "null" ], "format": "double", "description": "How seasonal it is, 0 to 1." }, "term": { "type": "string" }, "weeklyChange": { "type": [ "number", "null" ], "format": "double", "description": "Change in searches against the week, month and year before, in percent." }, "yearlyChange": { "type": [ "number", "null" ], "format": "double" } } } } } } ``` # Url (/docs/api-reference/pinterest/url) How many times a web page was saved to Pinterest. `GET https://api.socialapi.sh/v1/pinterest/url` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.pinterest.url({ url: "https://www.nasa.gov/" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.pinterest.url(url="https://www.nasa.gov/").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/pinterest/url \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://www.nasa.gov/" ``` **Response** ```json { "data": { "url": "https://www.nasa.gov/", "saves": 29625 } } ``` **OpenAPI** ```json { "paths": { "/v1/pinterest/url": { "get": { "tags": [ "Pinterest" ], "summary": "How many times a web page was saved to Pinterest.", "description": "Any page's address. 1 credit.", "operationId": "pinterestUrl", "parameters": [ { "name": "url", "in": "query", "description": "The page's address (`https://www.nasa.gov/`).", "required": true, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_PinterestUrlSaves" }, "example": { "data": { "url": "https://www.nasa.gov/", "saves": 29625 } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.pinterest.url({ url: \"https://www.nasa.gov/\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.pinterest.url(url=\"https://www.nasa.gov/\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/pinterest/url \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://www.nasa.gov/\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_PinterestUrlSaves": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/PinterestUrlSaves" } } }, "PinterestUrlSaves": { "type": "object", "description": "How often an outside page was saved to Pinterest.", "required": [ "url", "saves" ], "properties": { "saves": { "type": "integer", "format": "int64", "minimum": 0 }, "url": { "type": "string" } } } } } } ``` # Reddit API (/docs/api-reference/reddit) Every Reddit endpoint, by group. Each is a `GET` under `/v1/reddit`. ## Quick Reference [#quick-reference] | Property | Value | | --- | --- | | Base path | `/v1/reddit` | | Endpoints | 17 | | Credits | See Below | | Guide | [Reddit](/docs/reddit) | ## Accounts [#accounts] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/reddit/profile`](/docs/api-reference/reddit/profile) | A profile with its karma and trophies. | 1 | | [`GET /v1/reddit/profile/comments`](/docs/api-reference/reddit/profile-comments) | An account's comments, newest first, 25 a page. | 2 | | [`GET /v1/reddit/profile/posts`](/docs/api-reference/reddit/profile-posts) | An account's posts, newest first, 25 a page. | 1 | ## Communities [#communities] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/reddit/subreddit`](/docs/api-reference/reddit/subreddit) | A community with its members, rules and weekly visitors. | 1 | | [`GET /v1/reddit/subreddit/posts`](/docs/api-reference/reddit/subreddit-posts) | A community's posts, 25 a page. | 1 | | [`GET /v1/reddit/subreddit/search`](/docs/api-reference/reddit/subreddit-search) | Posts in one community matching a query, about 7 a page. | 1 | ## Posts [#posts] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/reddit/post`](/docs/api-reference/reddit/post) | One post with its score, comment count and media. | 1 | | [`GET /v1/reddit/post/comments`](/docs/api-reference/reddit/post-comments) | A post's comments with their replies, a page at a time. | 5 | | [`GET /v1/reddit/post/comment/replies`](/docs/api-reference/reddit/post-comment-replies) | A comment's replies, 10 a page. | 1 | | [`GET /v1/reddit/post/transcript`](/docs/api-reference/reddit/post-transcript) | A video post's captions as text. | 10 | ## Discovery [#discovery] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/reddit/search`](/docs/api-reference/reddit/search) | Posts matching a query across Reddit, about 7 a page. | 1 | | [`GET /v1/reddit/search/comments`](/docs/api-reference/reddit/search-comments) | Comments matching a query across Reddit, about 9 a page. | 1 | | [`GET /v1/reddit/search/media`](/docs/api-reference/reddit/search-media) | Image and video posts matching a query, about 7 a page. | 1 | | [`GET /v1/reddit/search/subreddits`](/docs/api-reference/reddit/search-subreddits) | Communities matching a query, 25 a page. | 1 | | [`GET /v1/reddit/search/users`](/docs/api-reference/reddit/search-users) | Accounts matching a name, the first 25. | 1 | | [`GET /v1/reddit/trending`](/docs/api-reference/reddit/trending) | What is hot on Reddit now, 25 a page. | 1 | | [`GET /v1/reddit/trending/searches`](/docs/api-reference/reddit/trending-searches) | The searches Reddit shows as trending now. | 1 | ## Example Request [#example-request] Every Reddit endpoint is called this way: its path, and what to read as query parameters. **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.reddit.profile({ handle: "spez" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.reddit.profile(handle="spez").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/reddit/profile \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=spez" ``` **Response** ```json { "data": { "id": "1w72", "username": "spez", "displayName": null, "bio": "Reddit CEO", "avatarUrl": "https://styles.redditmedia.com/t5_3k30p/styles/profileIcon_uj015iwx9s7g1.png?width=256&height=256&crop=256:256,smart&s=aa819b0964f6e3019e769d1cc8ede7318c3869a3", "url": "https://www.reddit.com/user/spez/", "verified": true, "private": false, "followers": null, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": "2005-06-06T04:00:00.000Z", "ext": { "karma": { "total": 941417, "post": 184793, "comment": 756624, "awardee": 0, "awarder": 0 }, "employee": true, "moderator": true, "premium": true, "suspended": false, "bannerUrl": "https://b.thumbs.redditmedia.com/KWeEpVxXOGLoloMbM0IxGt9EiKPXizpwFgcSeWqtpZM.png", "trophies": [ { "name": "15-Year Club", "iconUrl": "https://www.redditstatic.com/awards2/15_year_club-70.png", "grantedAt": "2026-06-06T04:00:00.000Z" }, { "name": "Second", "iconUrl": "https://www.redditstatic.com/awards2/second_participant-70.png", "grantedAt": "2021-04-08T03:50:00.000Z" }, { "name": "Inciteful Link", "iconUrl": "https://www.redditstatic.com/awards2/inciteful_link-70.png", "grantedAt": "2021-03-25T08:28:08.000Z" } ] } } } ``` ## Errors [#errors] A call that fails costs nothing. See [Errors](/docs/errors) for every code. # Post Comment Replies (/docs/api-reference/reddit/post-comment-replies) A comment's replies, 10 a page. `GET https://api.socialapi.sh/v1/reddit/post/comment/replies` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.reddit.postCommentReplies({ url: "https://www.reddit.com/r/AskReddit/comments/1y53ynl/comment/19t5xa8ukwu80/" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.reddit.post_comment_replies(url="https://www.reddit.com/r/AskReddit/comments/1y53ynl/comment/19t5xa8ukwu80/") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/reddit/post/comment/replies \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://www.reddit.com/r/AskReddit/comments/1y53ynl/comment/19t5xa8ukwu80/" ``` **Response** ```json { "data": [ { "id": "19t5xuz1xfkzp", "postId": "1y53ynl", "parentId": "19t5xa8ukwu80", "text": "If it's this easy for a Senator who hasn't even taken office yet, how difficult is it for foreign intelligence professionals?", "createdAt": "2026-11-25T10:36:10.200Z", "author": { "id": "", "username": "_SCHULTZY_", "displayName": null, "avatarUrl": "https://preview.redd.it/snoovatar/avatars/c95e41fc-c8bd-4cdf-aa4b-bb73980623d4-headshot.png?width=64&height=64&crop=smart&auto=webp&s=f9a69626a96f1177d6e2cb9d955adee8b5424229", "verified": false, "url": "https://www.reddit.com/user/_SCHULTZY_/" }, "likes": 327, "replies": null, "ext": { "url": "https://www.reddit.com/r/AskReddit/comments/1y53ynl/comment/19t5xuz1xfkzp/", "depth": 1, "score": 327, "byPoster": false, "removed": false, "stickied": false, "subreddit": null, "postTitle": null, "awards": null } }, { "id": "19t5y252d42yp", "postId": "1y53ynl", "parentId": "19t5xuz1xfkzp", "text": "And he didn't even offer any cash....... Imagine the potential if they offered trump 5% of the total savings...", "createdAt": "2026-11-25T10:40:38.009Z", "author": { "id": "", "username": "Revenant690", "displayName": null, "avatarUrl": "https://styles.redditmedia.com/t5_dgd1r/styles/profileIcon_snoo-nftv2_bmZ0X2VpcDE1NToxMzdfNDY2YTMzMDg4N2JkZjYyZDUzZjk2OGVhODI0NzkzMTUwZjA3NzYyZV8yNjA5Mjk_rare_9b23364a-784d-4545-9734-8aab9471ba89-headshot.png?width=64&height=64&frame=1&auto=webp&crop=64%3A64%2Csmart&s=493c26774520cf8e1fe91d94371206e60d546a30", "verified": false, "url": "https://www.reddit.com/user/Revenant690/" }, "likes": 82, "replies": null, "ext": { "url": "https://www.reddit.com/r/AskReddit/comments/1y53ynl/comment/19t5y252d42yp/", "depth": 2, "score": 82, "byPoster": false, "removed": false, "stickied": false, "subreddit": null, "postTitle": null, "awards": null } } ], "pagination": { "nextCursor": "L3N2Yy9zaHJlZGRpdC9tb3JlLWNvbW1lbnRzL0Fza1JlZGRpdC90M18xeTUzeW5sP3NvcnQ9VE9QJnN0YXJ0aW5nRGVwdGg9MSZjb21tZW50UG9zaXRpb25PZmZzZXQ9NCZjb21tZW50UGFyZW50UG9zaXRpb25zPTAKWTI5dGJXVnVkSFJ5WldVNk0yVm1Zek0yT1Rrc09qb3dPbVY0T2l4WVVrY2tSV3RDTDBRNktERTZWM044Wm50NUxVSmdURlVwSm1COEtWSWpNZz09", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/reddit/post/comment/replies": { "get": { "tags": [ "Reddit" ], "summary": "A comment's replies, 10 a page.", "description": "By the comment's link (its `ext.url`), with their own replies. 1 credit a page.", "operationId": "redditPostCommentReplies", "parameters": [ { "name": "url", "in": "query", "description": "The comment's link (its `ext.url`:\n`https://www.reddit.com/r/AskReddit/comments/1y4hcb5/comment/19t4kwq1qez37/`).", "required": true, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_RedditComment" }, "example": { "data": [ { "id": "19t5xuz1xfkzp", "postId": "1y53ynl", "parentId": "19t5xa8ukwu80", "text": "If it's this easy for a Senator who hasn't even taken office yet, how difficult is it for foreign intelligence professionals?", "createdAt": "2026-11-25T10:36:10.200Z", "author": { "id": "", "username": "_SCHULTZY_", "displayName": null, "avatarUrl": "https://preview.redd.it/snoovatar/avatars/c95e41fc-c8bd-4cdf-aa4b-bb73980623d4-headshot.png?width=64&height=64&crop=smart&auto=webp&s=f9a69626a96f1177d6e2cb9d955adee8b5424229", "verified": false, "url": "https://www.reddit.com/user/_SCHULTZY_/" }, "likes": 327, "replies": null, "ext": { "url": "https://www.reddit.com/r/AskReddit/comments/1y53ynl/comment/19t5xuz1xfkzp/", "depth": 1, "score": 327, "byPoster": false, "removed": false, "stickied": false, "subreddit": null, "postTitle": null, "awards": null } }, { "id": "19t5y252d42yp", "postId": "1y53ynl", "parentId": "19t5xuz1xfkzp", "text": "And he didn't even offer any cash....... Imagine the potential if they offered trump 5% of the total savings...", "createdAt": "2026-11-25T10:40:38.009Z", "author": { "id": "", "username": "Revenant690", "displayName": null, "avatarUrl": "https://styles.redditmedia.com/t5_dgd1r/styles/profileIcon_snoo-nftv2_bmZ0X2VpcDE1NToxMzdfNDY2YTMzMDg4N2JkZjYyZDUzZjk2OGVhODI0NzkzMTUwZjA3NzYyZV8yNjA5Mjk_rare_9b23364a-784d-4545-9734-8aab9471ba89-headshot.png?width=64&height=64&frame=1&auto=webp&crop=64%3A64%2Csmart&s=493c26774520cf8e1fe91d94371206e60d546a30", "verified": false, "url": "https://www.reddit.com/user/Revenant690/" }, "likes": 82, "replies": null, "ext": { "url": "https://www.reddit.com/r/AskReddit/comments/1y53ynl/comment/19t5y252d42yp/", "depth": 2, "score": 82, "byPoster": false, "removed": false, "stickied": false, "subreddit": null, "postTitle": null, "awards": null } } ], "pagination": { "nextCursor": "L3N2Yy9zaHJlZGRpdC9tb3JlLWNvbW1lbnRzL0Fza1JlZGRpdC90M18xeTUzeW5sP3NvcnQ9VE9QJnN0YXJ0aW5nRGVwdGg9MSZjb21tZW50UG9zaXRpb25PZmZzZXQ9NCZjb21tZW50UGFyZW50UG9zaXRpb25zPTAKWTI5dGJXVnVkSFJ5WldVNk0yVm1Zek0yT1Rrc09qb3dPbVY0T2l4WVVrY2tSV3RDTDBRNktERTZWM044Wm50NUxVSmdURlVwSm1COEtWSWpNZz09", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.reddit.postCommentReplies({ url: \"https://www.reddit.com/r/AskReddit/comments/1y53ynl/comment/19t5xa8ukwu80/\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.reddit.post_comment_replies(url=\"https://www.reddit.com/r/AskReddit/comments/1y53ynl/comment/19t5xa8ukwu80/\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/reddit/post/comment/replies \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://www.reddit.com/r/AskReddit/comments/1y53ynl/comment/19t5xa8ukwu80/\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_RedditComment": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/RedditComment" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "RedditComment": { "allOf": [ { "type": "object", "description": "A comment or a reply.", "required": [ "id", "postId", "text", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "byPoster", "removed", "stickied" ], "properties": { "awards": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "byPoster": { "type": "boolean", "description": "Written by the post's author." }, "depth": { "type": [ "integer", "null" ], "format": "int32", "description": "How deep in its thread: 0 answers the post.", "minimum": 0 }, "postTitle": { "type": [ "string", "null" ] }, "removed": { "type": "boolean", "description": "Removed by a moderator, or deleted by its author: its text is Reddit's notice." }, "score": { "type": [ "integer", "null" ], "format": "int64", "description": "Upvotes less downvotes (`likes` is the same figure, when not negative)." }, "stickied": { "type": "boolean" }, "subreddit": { "type": [ "string", "null" ], "description": "The community, and the post it is on (on an account's comments and search)." }, "url": { "type": [ "string", "null" ], "description": "Its link (`…/comment//`): what `/v1/reddit/post/comment/replies` takes." } } }, { "type": "object", "description": "What only this platform has." } ] }, "id": { "type": "string" }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "parentId": { "type": [ "string", "null" ], "description": "The comment this replies to; absent on a top-level comment." }, "postId": { "type": "string" }, "replies": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "text": { "type": "string" } } }, { "type": "object", "description": "A comment, or a reply." } ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Post Comments (/docs/api-reference/reddit/post-comments) A post's comments with their replies, a page at a time. `GET https://api.socialapi.sh/v1/reddit/post/comments` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.reddit.postComments({ url: "https://www.reddit.com/r/AskReddit/comments/1y53ynl/donald_trump_just_called_senatorelect_abdul/", sort: "top" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.reddit.post_comments(url="https://www.reddit.com/r/AskReddit/comments/1y53ynl/donald_trump_just_called_senatorelect_abdul/", sort="top") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/reddit/post/comments \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://www.reddit.com/r/AskReddit/comments/1y53ynl/donald_trump_just_called_senatorelect_abdul/" \ --data-urlencode "sort=top" ``` **Response** ```json { "data": [ { "id": "19t5xa8ukwu80", "postId": "1y53ynl", "parentId": null, "text": "Appealing to his ego is ridiculously easy.", "createdAt": "2026-11-25T10:23:15.661Z", "author": { "id": "", "username": "skywalker777", "displayName": null, "avatarUrl": "https://www.redditstatic.com/avatars/defaults/v2/avatar_default_6.png", "verified": false, "url": "https://www.reddit.com/user/skywalker777/" }, "likes": 1066, "replies": null, "ext": { "url": "https://www.reddit.com/r/AskReddit/comments/1y53ynl/comment/19t5xa8ukwu80/", "depth": 0, "score": 1066, "byPoster": false, "removed": false, "stickied": false, "subreddit": null, "postTitle": null, "awards": null } }, { "id": "19t5xuz1xfkzp", "postId": "1y53ynl", "parentId": "19t5xa8ukwu80", "text": "If it's this easy for a Senator who hasn't even taken office yet, how difficult is it for foreign intelligence professionals?", "createdAt": "2026-11-25T10:36:10.200Z", "author": { "id": "", "username": "_SCHULTZY_", "displayName": null, "avatarUrl": "https://preview.redd.it/snoovatar/avatars/c95e41fc-c8bd-4cdf-aa4b-bb73980623d4-headshot.png?width=64&height=64&crop=smart&auto=webp&s=f9a69626a96f1177d6e2cb9d955adee8b5424229", "verified": false, "url": "https://www.reddit.com/user/_SCHULTZY_/" }, "likes": 327, "replies": null, "ext": { "url": "https://www.reddit.com/r/AskReddit/comments/1y53ynl/comment/19t5xuz1xfkzp/", "depth": 1, "score": 327, "byPoster": false, "removed": false, "stickied": false, "subreddit": null, "postTitle": null, "awards": null } } ], "pagination": { "nextCursor": "L3N2Yy9zaHJlZGRpdC9tb3JlLWNvbW1lbnRzL0Fza1JlZGRpdC90M18xeTUzeW5sP3NvcnQ9dG9wJnRvcC1sZXZlbD0xJmNvbW1lbnRzLXJlbWFpbmluZz03NSZjb21tZW50UG9zaXRpb25PZmZzZXQ9OQpZMjl0YldWdWRIUnlaV1U2WkRCbE1tTTNaallzT2pvd09tVjRPaXhZVWtVcWFtUkZlRkk2ZEhRaWZqcFhjemQ2WDBaZ1hUZ2tSMUU5UXlWY1YxSkVmV0pqVFhWSFlGdzRSVmtwWFhNaGJtRW9OM1ZyTDM1Nkl6UnliU01yV3c9PQ", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/reddit/post/comments": { "get": { "tags": [ "Reddit" ], "summary": "A post's comments with their replies, a page at a time.", "description": "About 25 top-level comments a first page (10 a next), each with its replies a few\nlevels deep, `parentId` naming the comment answered; sorted `best`, `top`, `new`,\n`old`, `controversial` or `qa`. 5 credits a page.", "operationId": "redditPostComments", "parameters": [ { "name": "url", "in": "query", "description": "The post's link.", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The post's id, instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "sort", "in": "query", "description": "`best` (the default), `top`, `new`, `old`, `controversial` or `qa`.", "required": false, "schema": { "type": "string", "description": "The order of a post's comments.", "enum": [ "best", "top", "new", "old", "controversial", "qa" ] } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_RedditComment" }, "example": { "data": [ { "id": "19t5xa8ukwu80", "postId": "1y53ynl", "parentId": null, "text": "Appealing to his ego is ridiculously easy.", "createdAt": "2026-11-25T10:23:15.661Z", "author": { "id": "", "username": "skywalker777", "displayName": null, "avatarUrl": "https://www.redditstatic.com/avatars/defaults/v2/avatar_default_6.png", "verified": false, "url": "https://www.reddit.com/user/skywalker777/" }, "likes": 1066, "replies": null, "ext": { "url": "https://www.reddit.com/r/AskReddit/comments/1y53ynl/comment/19t5xa8ukwu80/", "depth": 0, "score": 1066, "byPoster": false, "removed": false, "stickied": false, "subreddit": null, "postTitle": null, "awards": null } }, { "id": "19t5xuz1xfkzp", "postId": "1y53ynl", "parentId": "19t5xa8ukwu80", "text": "If it's this easy for a Senator who hasn't even taken office yet, how difficult is it for foreign intelligence professionals?", "createdAt": "2026-11-25T10:36:10.200Z", "author": { "id": "", "username": "_SCHULTZY_", "displayName": null, "avatarUrl": "https://preview.redd.it/snoovatar/avatars/c95e41fc-c8bd-4cdf-aa4b-bb73980623d4-headshot.png?width=64&height=64&crop=smart&auto=webp&s=f9a69626a96f1177d6e2cb9d955adee8b5424229", "verified": false, "url": "https://www.reddit.com/user/_SCHULTZY_/" }, "likes": 327, "replies": null, "ext": { "url": "https://www.reddit.com/r/AskReddit/comments/1y53ynl/comment/19t5xuz1xfkzp/", "depth": 1, "score": 327, "byPoster": false, "removed": false, "stickied": false, "subreddit": null, "postTitle": null, "awards": null } } ], "pagination": { "nextCursor": "L3N2Yy9zaHJlZGRpdC9tb3JlLWNvbW1lbnRzL0Fza1JlZGRpdC90M18xeTUzeW5sP3NvcnQ9dG9wJnRvcC1sZXZlbD0xJmNvbW1lbnRzLXJlbWFpbmluZz03NSZjb21tZW50UG9zaXRpb25PZmZzZXQ9OQpZMjl0YldWdWRIUnlaV1U2WkRCbE1tTTNaallzT2pvd09tVjRPaXhZVWtVcWFtUkZlRkk2ZEhRaWZqcFhjemQ2WDBaZ1hUZ2tSMUU5UXlWY1YxSkVmV0pqVFhWSFlGdzRSVmtwWFhNaGJtRW9OM1ZyTDM1Nkl6UnliU01yV3c9PQ", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.reddit.postComments({ url: \"https://www.reddit.com/r/AskReddit/comments/1y53ynl/donald_trump_just_called_senatorelect_abdul/\", sort: \"top\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.reddit.post_comments(url=\"https://www.reddit.com/r/AskReddit/comments/1y53ynl/donald_trump_just_called_senatorelect_abdul/\", sort=\"top\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/reddit/post/comments \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://www.reddit.com/r/AskReddit/comments/1y53ynl/donald_trump_just_called_senatorelect_abdul/\" \\\n --data-urlencode \"sort=top\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_RedditComment": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/RedditComment" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "RedditComment": { "allOf": [ { "type": "object", "description": "A comment or a reply.", "required": [ "id", "postId", "text", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "byPoster", "removed", "stickied" ], "properties": { "awards": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "byPoster": { "type": "boolean", "description": "Written by the post's author." }, "depth": { "type": [ "integer", "null" ], "format": "int32", "description": "How deep in its thread: 0 answers the post.", "minimum": 0 }, "postTitle": { "type": [ "string", "null" ] }, "removed": { "type": "boolean", "description": "Removed by a moderator, or deleted by its author: its text is Reddit's notice." }, "score": { "type": [ "integer", "null" ], "format": "int64", "description": "Upvotes less downvotes (`likes` is the same figure, when not negative)." }, "stickied": { "type": "boolean" }, "subreddit": { "type": [ "string", "null" ], "description": "The community, and the post it is on (on an account's comments and search)." }, "url": { "type": [ "string", "null" ], "description": "Its link (`…/comment//`): what `/v1/reddit/post/comment/replies` takes." } } }, { "type": "object", "description": "What only this platform has." } ] }, "id": { "type": "string" }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "parentId": { "type": [ "string", "null" ], "description": "The comment this replies to; absent on a top-level comment." }, "postId": { "type": "string" }, "replies": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "text": { "type": "string" } } }, { "type": "object", "description": "A comment, or a reply." } ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Post Transcript (/docs/api-reference/reddit/post-transcript) A video post's captions as text. `GET https://api.socialapi.sh/v1/reddit/post/transcript` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.reddit.postTranscript({ url: "https://www.reddit.com/r/nextfuckinglevel/comments/1y0hc8e/nearly_30_years_later_this_world_record_still/" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.reddit.post_transcript(url="https://www.reddit.com/r/nextfuckinglevel/comments/1y0hc8e/nearly_30_years_later_this_world_record_still/").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/reddit/post/transcript \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://www.reddit.com/r/nextfuckinglevel/comments/1y0hc8e/nearly_30_years_later_this_world_record_still/" ``` **Response** ```json { "data": { "postId": "1y0hc8e", "language": "en", "text": "Here he goes again.\nOh, another big jump! We can't believe it! It's almost this world record of the\nworld record!\nEdwards at the moment, isn't it differently? One point three again, so\nI'd like to win to see out over the limit earlier in the year. It's all\nhappening right, and it really matches. It'll take you a minute time again.", "cues": [ { "startSeconds": 0, "endSeconds": 4, "text": "Here he goes again." }, { "startSeconds": 7.76, "endSeconds": 16.2, "text": "Oh, another big jump! We can't believe it! It's almost this world record of the" }, { "startSeconds": 16.2, "endSeconds": 16.88, "text": "world record!" } ] } } ``` **OpenAPI** ```json { "paths": { "/v1/reddit/post/transcript": { "get": { "tags": [ "Reddit" ], "summary": "A video post's captions as text.", "description": "Reddit's own caption track, as timed lines and as plain text, for videos Reddit\ncaptioned. 10 credits.", "operationId": "redditPostTranscript", "parameters": [ { "name": "url", "in": "query", "description": "The post's link (`https://www.reddit.com/r/AskReddit/comments/1y4hcb5/…`), or a\n`redd.it` one.", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The post's id (`1y4hcb5`), instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_RedditTranscript" }, "example": { "data": { "postId": "1y0hc8e", "language": "en", "text": "Here he goes again.\nOh, another big jump! We can't believe it! It's almost this world record of the\nworld record!\nEdwards at the moment, isn't it differently? One point three again, so\nI'd like to win to see out over the limit earlier in the year. It's all\nhappening right, and it really matches. It'll take you a minute time again.", "cues": [ { "startSeconds": 0, "endSeconds": 4, "text": "Here he goes again." }, { "startSeconds": 7.76, "endSeconds": 16.2, "text": "Oh, another big jump! We can't believe it! It's almost this world record of the" }, { "startSeconds": 16.2, "endSeconds": 16.88, "text": "world record!" } ] } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.reddit.postTranscript({ url: \"https://www.reddit.com/r/nextfuckinglevel/comments/1y0hc8e/nearly_30_years_later_this_world_record_still/\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.reddit.post_transcript(url=\"https://www.reddit.com/r/nextfuckinglevel/comments/1y0hc8e/nearly_30_years_later_this_world_record_still/\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/reddit/post/transcript \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://www.reddit.com/r/nextfuckinglevel/comments/1y0hc8e/nearly_30_years_later_this_world_record_still/\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_RedditTranscript": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/RedditTranscript" } } }, "RedditTranscript": { "type": "object", "description": "A video post's captions as text.", "required": [ "postId", "text", "cues" ], "properties": { "cues": { "type": "array", "items": { "$ref": "#/components/schemas/RedditCue" } }, "language": { "type": [ "string", "null" ] }, "postId": { "type": "string" }, "text": { "type": "string", "description": "The captions as plain text, one line a cue." } } }, "RedditCue": { "type": "object", "required": [ "startSeconds", "endSeconds", "text" ], "properties": { "endSeconds": { "type": "number", "format": "double" }, "startSeconds": { "type": "number", "format": "double" }, "text": { "type": "string" } } } } } } ``` # Post (/docs/api-reference/reddit/post) One post with its score, comment count and media. `GET https://api.socialapi.sh/v1/reddit/post` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.reddit.post({ url: "https://www.reddit.com/r/AskReddit/comments/1y53ynl/donald_trump_just_called_senatorelect_abdul/" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.reddit.post(url="https://www.reddit.com/r/AskReddit/comments/1y53ynl/donald_trump_just_called_senatorelect_abdul/").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/reddit/post \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://www.reddit.com/r/AskReddit/comments/1y53ynl/donald_trump_just_called_senatorelect_abdul/" ``` **Response** ```json { "data": { "id": "1y53ynl", "url": "https://www.reddit.com/r/AskReddit/comments/1y53ynl/donald_trump_just_called_senatorelect_abdul/", "text": null, "createdAt": "2026-11-25T10:21:39.000Z", "author": { "id": "g2ee64y4", "username": "Sad_Artist8183", "displayName": null, "avatarUrl": null, "verified": false, "url": "https://www.reddit.com/user/Sad_Artist8183/" }, "stats": { "views": null, "likes": 615, "comments": 343, "shares": null, "saves": null, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "title": "Donald Trump just called Senator-elect Abdul El-Sayed a “smart guy” and said “maybe there’s some place in the middle” on a universal “Trumpcare” plan. Americans, what are your thoughts?", "kind": "text", "subreddit": "AskReddit", "score": 615, "upvoteRatio": 0.87, "link": null, "domain": null, "flair": null, "nsfw": false, "spoiler": false, "locked": false, "stickied": false, "crossposts": 0, "crosspostOf": null, "awards": 0, "editedAt": null, "snippet": null } } } ``` **OpenAPI** ```json { "paths": { "/v1/reddit/post": { "get": { "tags": [ "Reddit" ], "summary": "One post with its score, comment count and media.", "description": "Title, text, author, community, score, upvote ratio, comments, flair, media (its\nvideo, gallery or image), the post it crossposts and its link. 1 credit.", "operationId": "redditPost", "parameters": [ { "name": "url", "in": "query", "description": "The post's link (`https://www.reddit.com/r/AskReddit/comments/1y4hcb5/…`), or a\n`redd.it` one.", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The post's id (`1y4hcb5`), instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_RedditPost" }, "example": { "data": { "id": "1y53ynl", "url": "https://www.reddit.com/r/AskReddit/comments/1y53ynl/donald_trump_just_called_senatorelect_abdul/", "text": null, "createdAt": "2026-11-25T10:21:39.000Z", "author": { "id": "g2ee64y4", "username": "Sad_Artist8183", "displayName": null, "avatarUrl": null, "verified": false, "url": "https://www.reddit.com/user/Sad_Artist8183/" }, "stats": { "views": null, "likes": 615, "comments": 343, "shares": null, "saves": null, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "title": "Donald Trump just called Senator-elect Abdul El-Sayed a “smart guy” and said “maybe there’s some place in the middle” on a universal “Trumpcare” plan. Americans, what are your thoughts?", "kind": "text", "subreddit": "AskReddit", "score": 615, "upvoteRatio": 0.87, "link": null, "domain": null, "flair": null, "nsfw": false, "spoiler": false, "locked": false, "stickied": false, "crossposts": 0, "crosspostOf": null, "awards": 0, "editedAt": null, "snippet": null } } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.reddit.post({ url: \"https://www.reddit.com/r/AskReddit/comments/1y53ynl/donald_trump_just_called_senatorelect_abdul/\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.reddit.post(url=\"https://www.reddit.com/r/AskReddit/comments/1y53ynl/donald_trump_just_called_senatorelect_abdul/\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/reddit/post \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://www.reddit.com/r/AskReddit/comments/1y53ynl/donald_trump_just_called_senatorelect_abdul/\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_RedditPost": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/RedditPost" } } }, "RedditPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "title", "kind", "nsfw", "spoiler", "locked", "stickied" ], "properties": { "awards": { "type": [ "integer", "null" ], "format": "int64", "description": "Awards it was given.", "minimum": 0 }, "crosspostOf": { "oneOf": [ { "$ref": "#/components/schemas/RedditPostRef", "description": "The post it shares, when it is a crosspost." }, { "type": "null" } ] }, "crossposts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "domain": { "type": [ "string", "null" ] }, "editedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "When it was last edited." }, { "type": "null" } ] }, "flair": { "type": [ "string", "null" ] }, "kind": { "$ref": "#/components/schemas/RedditPostKind" }, "link": { "type": [ "string", "null" ], "description": "The link it shares, and its site." }, "locked": { "type": "boolean", "description": "Closed to new comments." }, "nsfw": { "type": "boolean", "description": "Not safe for work." }, "score": { "type": [ "integer", "null" ], "format": "int64", "description": "Upvotes less downvotes (`stats.likes` is the same figure)." }, "snippet": { "type": [ "string", "null" ], "description": "What a search matched in it (a comment's words), on search results." }, "spoiler": { "type": "boolean" }, "stickied": { "type": "boolean", "description": "Pinned to the top of its community." }, "subreddit": { "type": [ "string", "null" ], "description": "The community, without `r/`." }, "title": { "type": "string" }, "upvoteRatio": { "type": [ "number", "null" ], "format": "double", "description": "The share of votes that are upvotes, 0 to 1." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A post: text, a link, an image, a gallery, a video or a poll." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "RedditPostKind": { "type": "string", "description": "What a post is.", "enum": [ "text", "link", "image", "gallery", "video", "poll" ] }, "Timestamp": { "type": "string", "format": "date-time" }, "RedditPostRef": { "type": "object", "description": "The post a crosspost shares.", "required": [ "id" ], "properties": { "id": { "type": "string" }, "subreddit": { "type": [ "string", "null" ] }, "title": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] } } }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Profile Comments (/docs/api-reference/reddit/profile-comments) An account's comments, newest first, 25 a page. `GET https://api.socialapi.sh/v1/reddit/profile/comments` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.reddit.profileComments({ handle: "spez" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.reddit.profile_comments(handle="spez") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/reddit/profile/comments \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=spez" ``` **Response** ```json { "data": [ { "id": "19ruo33ofgh8i", "postId": "1xiupuc", "parentId": "19rui7whi24p1", "text": "Pretty simple. For people who are already coming to Reddit every week, we have to give them a reason to come back everyday. If you come for sports and entertainment, or food and fashion, or new and trends, or something fun and funny, can you find it simply once you’re here. If the answer is yes, well, then you’re probably going to come back. If the answer is no, you might not.\n\nWe’ve got a lot we’…", "createdAt": "2026-10-29T22:42:06.000Z", "author": { "id": "1w72", "username": "spez", "displayName": null, "avatarUrl": null, "verified": false, "url": "https://www.reddit.com/user/spez/" }, "likes": null, "replies": null, "ext": { "url": "https://www.reddit.com/r/RDDT/comments/1xiupuc/reddit_announces_q326_earnings_plus_ama/19ruo33ofgh8i/", "depth": null, "score": -5, "byPoster": false, "removed": false, "stickied": false, "subreddit": "RDDT", "postTitle": "Reddit Announces Q3’26 Earnings (plus AMA!)", "awards": 0 } }, { "id": "19ruo2bw7d6ps", "postId": "1xiupuc", "parentId": "19ruhds72jakk", "text": "At a high level, however people want to communicate on the internet, they should be able to do so on Reddit.\n\nWe’ve continually evolved over the years, from just links to text to images (becoming a home for early memes and GIFs) to video and now some audio and beyond.\n\nWe’ve seen progress with some of the new video formats that we’ve been testing this year. Video creation, video consumption and ch…", "createdAt": "2026-10-29T22:41:37.000Z", "author": { "id": "1w72", "username": "spez", "displayName": null, "avatarUrl": null, "verified": false, "url": "https://www.reddit.com/user/spez/" }, "likes": null, "replies": null, "ext": { "url": "https://www.reddit.com/r/RDDT/comments/1xiupuc/reddit_announces_q326_earnings_plus_ama/19ruo2bw7d6ps/", "depth": null, "score": -8, "byPoster": false, "removed": false, "stickied": false, "subreddit": "RDDT", "postTitle": "Reddit Announces Q3’26 Earnings (plus AMA!)", "awards": 0 } } ], "pagination": { "nextCursor": "t1_optfyql", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/reddit/profile/comments": { "get": { "tags": [ "Reddit" ], "summary": "An account's comments, newest first, 25 a page.", "description": "Each with its score and the post it is on. 2 credits a comment returned (a full page\n50; an account with none costs nothing).", "operationId": "redditProfileComments", "parameters": [ { "name": "handle", "in": "query", "description": "The username, with or without `u/`.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "The profile's link, instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "sort", "in": "query", "description": "`new` (the default), `hot`, `top` or `controversial`.", "required": false, "schema": { "type": "string", "description": "The order of an account's posts or comments.", "enum": [ "new", "hot", "top", "controversial" ] } }, { "name": "time", "in": "query", "description": "For `top` and `controversial`: `hour`, `day`, `week`, `month`, `year` or `all`\n(the default).", "required": false, "schema": { "type": "string", "description": "How far back `top` and `controversial` look.", "enum": [ "hour", "day", "week", "month", "year", "all" ] } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_RedditComment" }, "example": { "data": [ { "id": "19ruo33ofgh8i", "postId": "1xiupuc", "parentId": "19rui7whi24p1", "text": "Pretty simple. For people who are already coming to Reddit every week, we have to give them a reason to come back everyday. If you come for sports and entertainment, or food and fashion, or new and trends, or something fun and funny, can you find it simply once you’re here. If the answer is yes, well, then you’re probably going to come back. If the answer is no, you might not.\n\nWe’ve got a lot we’…", "createdAt": "2026-10-29T22:42:06.000Z", "author": { "id": "1w72", "username": "spez", "displayName": null, "avatarUrl": null, "verified": false, "url": "https://www.reddit.com/user/spez/" }, "likes": null, "replies": null, "ext": { "url": "https://www.reddit.com/r/RDDT/comments/1xiupuc/reddit_announces_q326_earnings_plus_ama/19ruo33ofgh8i/", "depth": null, "score": -5, "byPoster": false, "removed": false, "stickied": false, "subreddit": "RDDT", "postTitle": "Reddit Announces Q3’26 Earnings (plus AMA!)", "awards": 0 } }, { "id": "19ruo2bw7d6ps", "postId": "1xiupuc", "parentId": "19ruhds72jakk", "text": "At a high level, however people want to communicate on the internet, they should be able to do so on Reddit.\n\nWe’ve continually evolved over the years, from just links to text to images (becoming a home for early memes and GIFs) to video and now some audio and beyond.\n\nWe’ve seen progress with some of the new video formats that we’ve been testing this year. Video creation, video consumption and ch…", "createdAt": "2026-10-29T22:41:37.000Z", "author": { "id": "1w72", "username": "spez", "displayName": null, "avatarUrl": null, "verified": false, "url": "https://www.reddit.com/user/spez/" }, "likes": null, "replies": null, "ext": { "url": "https://www.reddit.com/r/RDDT/comments/1xiupuc/reddit_announces_q326_earnings_plus_ama/19ruo2bw7d6ps/", "depth": null, "score": -8, "byPoster": false, "removed": false, "stickied": false, "subreddit": "RDDT", "postTitle": "Reddit Announces Q3’26 Earnings (plus AMA!)", "awards": 0 } } ], "pagination": { "nextCursor": "t1_optfyql", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.reddit.profileComments({ handle: \"spez\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.reddit.profile_comments(handle=\"spez\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/reddit/profile/comments \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=spez\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_RedditComment": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/RedditComment" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "RedditComment": { "allOf": [ { "type": "object", "description": "A comment or a reply.", "required": [ "id", "postId", "text", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "byPoster", "removed", "stickied" ], "properties": { "awards": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "byPoster": { "type": "boolean", "description": "Written by the post's author." }, "depth": { "type": [ "integer", "null" ], "format": "int32", "description": "How deep in its thread: 0 answers the post.", "minimum": 0 }, "postTitle": { "type": [ "string", "null" ] }, "removed": { "type": "boolean", "description": "Removed by a moderator, or deleted by its author: its text is Reddit's notice." }, "score": { "type": [ "integer", "null" ], "format": "int64", "description": "Upvotes less downvotes (`likes` is the same figure, when not negative)." }, "stickied": { "type": "boolean" }, "subreddit": { "type": [ "string", "null" ], "description": "The community, and the post it is on (on an account's comments and search)." }, "url": { "type": [ "string", "null" ], "description": "Its link (`…/comment//`): what `/v1/reddit/post/comment/replies` takes." } } }, { "type": "object", "description": "What only this platform has." } ] }, "id": { "type": "string" }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "parentId": { "type": [ "string", "null" ], "description": "The comment this replies to; absent on a top-level comment." }, "postId": { "type": "string" }, "replies": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "text": { "type": "string" } } }, { "type": "object", "description": "A comment, or a reply." } ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Profile Posts (/docs/api-reference/reddit/profile-posts) An account's posts, newest first, 25 a page. `GET https://api.socialapi.sh/v1/reddit/profile/posts` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.reddit.profilePosts({ handle: "GallowBoob", sort: "top" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.reddit.profile_posts(handle="GallowBoob", sort="top") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/reddit/profile/posts \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=GallowBoob" \ --data-urlencode "sort=top" ``` **Response** ```json { "data": [ { "id": "fgghrs", "url": "https://www.reddit.com/user/GallowBoob/comments/fgghrs/everything_in_balance_except_karma/", "text": null, "createdAt": "2020-03-10T16:27:45.000Z", "author": { "id": "iqsg6", "username": "GallowBoob", "displayName": null, "avatarUrl": null, "verified": false, "url": "https://www.reddit.com/user/GallowBoob/" }, "stats": { "views": null, "likes": 7951, "comments": 66, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://preview.redd.it/41i4qishgvl41.jpg?auto=webp&s=0f8bda1a9109f0ff36c9f5a3ac998ea4426aef13", "thumbnailUrl": null, "width": 828, "height": 862, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "title": "‪Everything in balance.‬ ‪Except karma ⬆️‬⬆️⬆️", "kind": "image", "subreddit": "u_GallowBoob", "score": 7951, "upvoteRatio": 0.94, "link": null, "domain": "i.redd.it", "flair": null, "nsfw": false, "spoiler": false, "locked": true, "stickied": true, "crossposts": 6, "crosspostOf": null, "awards": 0, "editedAt": null, "snippet": null } }, { "id": "gh5c5i", "url": "https://www.reddit.com/r/nextfuckinglevel/comments/gh5c5i/this_man_jogged_2_miles_through_his_neighborhood/", "text": null, "createdAt": "2020-05-10T17:13:40.000Z", "author": { "id": "iqsg6", "username": "GallowBoob", "displayName": null, "avatarUrl": null, "verified": false, "url": "https://www.reddit.com/user/GallowBoob/" }, "stats": { "views": null, "likes": 271569, "comments": 10328, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://v.redd.it/hxxifx1a0zx41/DASH_720?source=fallback", "thumbnailUrl": "https://external-preview.redd.it/a643-QGL2QOJX_lQAVMc_5XZj5Nc-v10gwC0muubDLI.png?format=pjpg&auto=webp&s=9bb46929121c6890fcb7448d043c5869a3e1c5de", "width": 404, "height": 720, "durationSeconds": 15 } ], "hashtags": [], "mentions": [], "ext": { "title": "This man jogged 2 miles through his neighborhood carrying a TV in his hands to prove that “looking like a suspect” who committed a robbery isn’t a good enough excuse for the murder of Ahmaud Arbery. Neighbors waived hello to him as he jogged.", "kind": "video", "subreddit": "nextfuckinglevel", "score": 271569, "upvoteRatio": 0.95, "link": null, "domain": "v.redd.it", "flair": "⬆️TOP POST ⬆️", "nsfw": false, "spoiler": false, "locked": true, "stickied": false, "crossposts": 57, "crosspostOf": null, "awards": 0, "editedAt": null, "snippet": null } } ], "pagination": { "nextCursor": "t3_79ad1b", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/reddit/profile/posts": { "get": { "tags": [ "Reddit" ], "summary": "An account's posts, newest first, 25 a page.", "description": "With their scores, comment counts and media; sorted `new`, `hot`, `top` or\n`controversial`. 1 credit a page.", "operationId": "redditProfilePosts", "parameters": [ { "name": "handle", "in": "query", "description": "The username, with or without `u/`.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "The profile's link, instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "sort", "in": "query", "description": "`new` (the default), `hot`, `top` or `controversial`.", "required": false, "schema": { "type": "string", "description": "The order of an account's posts or comments.", "enum": [ "new", "hot", "top", "controversial" ] } }, { "name": "time", "in": "query", "description": "For `top` and `controversial`: `hour`, `day`, `week`, `month`, `year` or `all`\n(the default).", "required": false, "schema": { "type": "string", "description": "How far back `top` and `controversial` look.", "enum": [ "hour", "day", "week", "month", "year", "all" ] } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_RedditPost" }, "example": { "data": [ { "id": "fgghrs", "url": "https://www.reddit.com/user/GallowBoob/comments/fgghrs/everything_in_balance_except_karma/", "text": null, "createdAt": "2020-03-10T16:27:45.000Z", "author": { "id": "iqsg6", "username": "GallowBoob", "displayName": null, "avatarUrl": null, "verified": false, "url": "https://www.reddit.com/user/GallowBoob/" }, "stats": { "views": null, "likes": 7951, "comments": 66, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://preview.redd.it/41i4qishgvl41.jpg?auto=webp&s=0f8bda1a9109f0ff36c9f5a3ac998ea4426aef13", "thumbnailUrl": null, "width": 828, "height": 862, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "title": "‪Everything in balance.‬ ‪Except karma ⬆️‬⬆️⬆️", "kind": "image", "subreddit": "u_GallowBoob", "score": 7951, "upvoteRatio": 0.94, "link": null, "domain": "i.redd.it", "flair": null, "nsfw": false, "spoiler": false, "locked": true, "stickied": true, "crossposts": 6, "crosspostOf": null, "awards": 0, "editedAt": null, "snippet": null } }, { "id": "gh5c5i", "url": "https://www.reddit.com/r/nextfuckinglevel/comments/gh5c5i/this_man_jogged_2_miles_through_his_neighborhood/", "text": null, "createdAt": "2020-05-10T17:13:40.000Z", "author": { "id": "iqsg6", "username": "GallowBoob", "displayName": null, "avatarUrl": null, "verified": false, "url": "https://www.reddit.com/user/GallowBoob/" }, "stats": { "views": null, "likes": 271569, "comments": 10328, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://v.redd.it/hxxifx1a0zx41/DASH_720?source=fallback", "thumbnailUrl": "https://external-preview.redd.it/a643-QGL2QOJX_lQAVMc_5XZj5Nc-v10gwC0muubDLI.png?format=pjpg&auto=webp&s=9bb46929121c6890fcb7448d043c5869a3e1c5de", "width": 404, "height": 720, "durationSeconds": 15 } ], "hashtags": [], "mentions": [], "ext": { "title": "This man jogged 2 miles through his neighborhood carrying a TV in his hands to prove that “looking like a suspect” who committed a robbery isn’t a good enough excuse for the murder of Ahmaud Arbery. Neighbors waived hello to him as he jogged.", "kind": "video", "subreddit": "nextfuckinglevel", "score": 271569, "upvoteRatio": 0.95, "link": null, "domain": "v.redd.it", "flair": "⬆️TOP POST ⬆️", "nsfw": false, "spoiler": false, "locked": true, "stickied": false, "crossposts": 57, "crosspostOf": null, "awards": 0, "editedAt": null, "snippet": null } } ], "pagination": { "nextCursor": "t3_79ad1b", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.reddit.profilePosts({ handle: \"GallowBoob\", sort: \"top\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.reddit.profile_posts(handle=\"GallowBoob\", sort=\"top\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/reddit/profile/posts \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=GallowBoob\" \\\n --data-urlencode \"sort=top\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_RedditPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/RedditPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "RedditPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "title", "kind", "nsfw", "spoiler", "locked", "stickied" ], "properties": { "awards": { "type": [ "integer", "null" ], "format": "int64", "description": "Awards it was given.", "minimum": 0 }, "crosspostOf": { "oneOf": [ { "$ref": "#/components/schemas/RedditPostRef", "description": "The post it shares, when it is a crosspost." }, { "type": "null" } ] }, "crossposts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "domain": { "type": [ "string", "null" ] }, "editedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "When it was last edited." }, { "type": "null" } ] }, "flair": { "type": [ "string", "null" ] }, "kind": { "$ref": "#/components/schemas/RedditPostKind" }, "link": { "type": [ "string", "null" ], "description": "The link it shares, and its site." }, "locked": { "type": "boolean", "description": "Closed to new comments." }, "nsfw": { "type": "boolean", "description": "Not safe for work." }, "score": { "type": [ "integer", "null" ], "format": "int64", "description": "Upvotes less downvotes (`stats.likes` is the same figure)." }, "snippet": { "type": [ "string", "null" ], "description": "What a search matched in it (a comment's words), on search results." }, "spoiler": { "type": "boolean" }, "stickied": { "type": "boolean", "description": "Pinned to the top of its community." }, "subreddit": { "type": [ "string", "null" ], "description": "The community, without `r/`." }, "title": { "type": "string" }, "upvoteRatio": { "type": [ "number", "null" ], "format": "double", "description": "The share of votes that are upvotes, 0 to 1." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A post: text, a link, an image, a gallery, a video or a poll." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "RedditPostKind": { "type": "string", "description": "What a post is.", "enum": [ "text", "link", "image", "gallery", "video", "poll" ] }, "Timestamp": { "type": "string", "format": "date-time" }, "RedditPostRef": { "type": "object", "description": "The post a crosspost shares.", "required": [ "id" ], "properties": { "id": { "type": "string" }, "subreddit": { "type": [ "string", "null" ] }, "title": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] } } }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Profile (/docs/api-reference/reddit/profile) A profile with its karma and trophies. `GET https://api.socialapi.sh/v1/reddit/profile` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.reddit.profile({ handle: "spez" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.reddit.profile(handle="spez").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/reddit/profile \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=spez" ``` **Response** ```json { "data": { "id": "1w72", "username": "spez", "displayName": null, "bio": "Reddit CEO", "avatarUrl": "https://styles.redditmedia.com/t5_3k30p/styles/profileIcon_uj015iwx9s7g1.png?width=256&height=256&crop=256:256,smart&s=aa819b0964f6e3019e769d1cc8ede7318c3869a3", "url": "https://www.reddit.com/user/spez/", "verified": true, "private": false, "followers": null, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": "2005-06-06T04:00:00.000Z", "ext": { "karma": { "total": 941417, "post": 184793, "comment": 756624, "awardee": 0, "awarder": 0 }, "employee": true, "moderator": true, "premium": true, "suspended": false, "bannerUrl": "https://b.thumbs.redditmedia.com/KWeEpVxXOGLoloMbM0IxGt9EiKPXizpwFgcSeWqtpZM.png", "trophies": [ { "name": "15-Year Club", "iconUrl": "https://www.redditstatic.com/awards2/15_year_club-70.png", "grantedAt": "2026-06-06T04:00:00.000Z" }, { "name": "Second", "iconUrl": "https://www.redditstatic.com/awards2/second_participant-70.png", "grantedAt": "2021-04-08T03:50:00.000Z" }, { "name": "Inciteful Link", "iconUrl": "https://www.redditstatic.com/awards2/inciteful_link-70.png", "grantedAt": "2021-03-25T08:28:08.000Z" } ] } } } ``` **OpenAPI** ```json { "paths": { "/v1/reddit/profile": { "get": { "tags": [ "Reddit" ], "summary": "A profile with its karma and trophies.", "description": "Name, bio, avatar, karma (from posts, comments and awards), when it joined, whether it\nis a Reddit employee or a moderator, and its trophies. 1 credit.", "operationId": "redditProfile", "parameters": [ { "name": "handle", "in": "query", "description": "The username, with or without `u/`.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "The profile's link (`https://www.reddit.com/user/spez`), instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_RedditProfile" }, "example": { "data": { "id": "1w72", "username": "spez", "displayName": null, "bio": "Reddit CEO", "avatarUrl": "https://styles.redditmedia.com/t5_3k30p/styles/profileIcon_uj015iwx9s7g1.png?width=256&height=256&crop=256:256,smart&s=aa819b0964f6e3019e769d1cc8ede7318c3869a3", "url": "https://www.reddit.com/user/spez/", "verified": true, "private": false, "followers": null, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": "2005-06-06T04:00:00.000Z", "ext": { "karma": { "total": 941417, "post": 184793, "comment": 756624, "awardee": 0, "awarder": 0 }, "employee": true, "moderator": true, "premium": true, "suspended": false, "bannerUrl": "https://b.thumbs.redditmedia.com/KWeEpVxXOGLoloMbM0IxGt9EiKPXizpwFgcSeWqtpZM.png", "trophies": [ { "name": "15-Year Club", "iconUrl": "https://www.redditstatic.com/awards2/15_year_club-70.png", "grantedAt": "2026-06-06T04:00:00.000Z" }, { "name": "Second", "iconUrl": "https://www.redditstatic.com/awards2/second_participant-70.png", "grantedAt": "2021-04-08T03:50:00.000Z" }, { "name": "Inciteful Link", "iconUrl": "https://www.redditstatic.com/awards2/inciteful_link-70.png", "grantedAt": "2021-03-25T08:28:08.000Z" } ] } } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.reddit.profile({ handle: \"spez\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.reddit.profile(handle=\"spez\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/reddit/profile \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=spez\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_RedditProfile": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/RedditProfile" } } }, "RedditProfile": { "allOf": [ { "type": "object", "description": "An account.", "required": [ "id", "username", "url", "verified", "private", "ext" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "bio": { "type": [ "string", "null" ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "displayName": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "karma", "employee", "moderator", "premium", "suspended", "trophies" ], "properties": { "bannerUrl": { "type": [ "string", "null" ] }, "employee": { "type": "boolean", "description": "A Reddit employee." }, "karma": { "$ref": "#/components/schemas/RedditKarma" }, "moderator": { "type": "boolean", "description": "Moderates a community." }, "premium": { "type": "boolean", "description": "Has Reddit Premium." }, "suspended": { "type": "boolean", "description": "Suspended, on an account in a list: Reddit shows nothing else of it. A suspended\naccount asked for by its name is refused instead (`410 SUSPENDED`)." }, "trophies": { "type": "array", "items": { "$ref": "#/components/schemas/RedditTrophy" }, "description": "Its trophies (on `/profile` only)." } } }, { "type": "object", "description": "What only this platform has." } ] }, "externalUrl": { "type": [ "string", "null" ], "description": "The link in the bio." }, "followers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "following": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "id": { "type": "string", "description": "The platform's id for the account." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "description": "Likes the account's posts received in total.", "minimum": 0 }, "posts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "private": { "type": "boolean" }, "url": { "type": "string", "description": "The profile's page." }, "username": { "type": "string", "description": "The handle, without `@`." }, "verified": { "type": "boolean" } } }, { "type": "object", "description": "A Reddit account." } ] }, "RedditTrophy": { "type": "object", "description": "A trophy on an account's profile.", "required": [ "name" ], "properties": { "grantedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "iconUrl": { "type": [ "string", "null" ] }, "name": { "type": "string" } } }, "Timestamp": { "type": "string", "format": "date-time" }, "RedditKarma": { "type": "object", "description": "An account's karma, as its profile splits it.", "properties": { "awardee": { "type": [ "integer", "null" ], "format": "int64", "description": "From awards it was given, and gave.", "minimum": 0 }, "awarder": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "comment": { "type": [ "integer", "null" ], "format": "int64", "description": "From its comments.", "minimum": 0 }, "post": { "type": [ "integer", "null" ], "format": "int64", "description": "From its posts.", "minimum": 0 }, "total": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } } } } } ``` # Search Comments (/docs/api-reference/reddit/search-comments) Comments matching a query across Reddit, about 9 a page. `GET https://api.socialapi.sh/v1/reddit/search/comments` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.reddit.searchComments({ query: "espresso machine" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.reddit.search_comments(query="espresso machine") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/reddit/search/comments \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "query=espresso machine" ``` **Response** ```json { "data": [ { "id": "19syv7bmabsjk", "postId": "1y1rk4q", "parentId": "19syntvx06v5x", "text": "Haha, when I was a teenager working at McDonald's they roughly showed me the drive thru coffee machine and left me to it. An older \"automatic\" espresso machine where you would sit a takeaway cup, press the button for the coffee that had been ordered, and it would do a shot of coffee and some shitty frothed milk. Easy as!!\n\nSomebody ordered a long black, I pressed the long black button. The cup was…", "createdAt": "2026-11-21T07:55:16.078Z", "author": { "id": "", "username": "Euphorbiatch", "displayName": null, "avatarUrl": null, "verified": false, "url": "https://www.reddit.com/user/Euphorbiatch/" }, "likes": 2607, "replies": null, "ext": { "url": "https://www.reddit.com/r/mildlyinfuriating/comments/1y1rk4q/i_asked_for_a_iced_coffee_with_only_cream_and/19syv7bmabsjk/", "depth": null, "score": 2607, "byPoster": false, "removed": false, "stickied": false, "subreddit": "mildlyinfuriating", "postTitle": "I asked for a iced coffee with only cream and this is what they handed me", "awards": null } }, { "id": "19t1g61oo5xxg", "postId": "1y31bj7", "parentId": null, "text": "Dodgers are going to be seeing some very sleepy faces and sagging lids without the espresso machine next year …:/", "createdAt": "2026-11-22T22:06:40.814Z", "author": { "id": "", "username": "Idwant2baliar", "displayName": null, "avatarUrl": null, "verified": false, "url": "https://www.reddit.com/user/Idwant2baliar/" }, "likes": 1092, "replies": null, "ext": { "url": "https://www.reddit.com/r/baseball/comments/1y31bj7/passan_breaking_twotime_cy_young_award_winner/19t1g61oo5xxg/", "depth": null, "score": 1092, "byPoster": false, "removed": false, "stickied": false, "subreddit": "baseball", "postTitle": "[Passan] BREAKING: Two-time Cy Young Award winner Tarik Skubal and the New York Mets are in agreement on a nine-year, $450 million contract, sources tell ESPN. The deal includes a $45 million signing bonus, no opt-outs and a no-trade clause.", "awards": null } } ], "pagination": { "nextCursor": "L3N2Yy9zaHJlZGRpdC9zZWFyY2gvP3E9ZXNwcmVzc28rbWFjaGluZSZ0eXBlPWNvbW1lbnRzJnNvcnQ9cmVsZXZhbmNlJnQ9YWxsJmN1cnNvcj1leUpqWVc1a2FXUmhkR1Z6WDNKbGRIVnlibVZrSWpvaWUxd2ljMlZqZEdsdmJsOHhYM0JwY0dWc2FXNWxYekJmWjJ4dlltRnNYMjF2WkdsbWFXVnljMXdpT2x3aU1Wd2lMRndpYzJWamRHbHZibDh4WDNCcGNHVnNhVzVsWHpGZmJHOWpZV3hmYlc5a2FXWnBaWEp6WENJNlhDSXhYQ0lzWENKelpXTjBhVzl1WHpKZmNHbHdaV3hwYm1WZk1WOWpiMjF0Wlc1MFgzTmxZWEpqYUZ3aU9sd2lN…", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/reddit/search/comments": { "get": { "tags": [ "Reddit" ], "summary": "Comments matching a query across Reddit, about 9 a page.", "description": "Each with its score and the post it is on. 1 credit a page.", "operationId": "redditSearchComments", "parameters": [ { "name": "query", "in": "query", "description": "What to search for.", "required": true, "schema": { "type": "string" } }, { "name": "sort", "in": "query", "description": "`relevance` (the default), `hot`, `top`, `new` or `comments`.", "required": false, "schema": { "type": "string", "description": "The order of search results.", "enum": [ "relevance", "hot", "top", "new", "comments" ] } }, { "name": "time", "in": "query", "description": "`hour`, `day`, `week`, `month`, `year` or `all` (the default).", "required": false, "schema": { "type": "string", "description": "How far back `top` and `controversial` look.", "enum": [ "hour", "day", "week", "month", "year", "all" ] } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_RedditComment" }, "example": { "data": [ { "id": "19syv7bmabsjk", "postId": "1y1rk4q", "parentId": "19syntvx06v5x", "text": "Haha, when I was a teenager working at McDonald's they roughly showed me the drive thru coffee machine and left me to it. An older \"automatic\" espresso machine where you would sit a takeaway cup, press the button for the coffee that had been ordered, and it would do a shot of coffee and some shitty frothed milk. Easy as!!\n\nSomebody ordered a long black, I pressed the long black button. The cup was…", "createdAt": "2026-11-21T07:55:16.078Z", "author": { "id": "", "username": "Euphorbiatch", "displayName": null, "avatarUrl": null, "verified": false, "url": "https://www.reddit.com/user/Euphorbiatch/" }, "likes": 2607, "replies": null, "ext": { "url": "https://www.reddit.com/r/mildlyinfuriating/comments/1y1rk4q/i_asked_for_a_iced_coffee_with_only_cream_and/19syv7bmabsjk/", "depth": null, "score": 2607, "byPoster": false, "removed": false, "stickied": false, "subreddit": "mildlyinfuriating", "postTitle": "I asked for a iced coffee with only cream and this is what they handed me", "awards": null } }, { "id": "19t1g61oo5xxg", "postId": "1y31bj7", "parentId": null, "text": "Dodgers are going to be seeing some very sleepy faces and sagging lids without the espresso machine next year …:/", "createdAt": "2026-11-22T22:06:40.814Z", "author": { "id": "", "username": "Idwant2baliar", "displayName": null, "avatarUrl": null, "verified": false, "url": "https://www.reddit.com/user/Idwant2baliar/" }, "likes": 1092, "replies": null, "ext": { "url": "https://www.reddit.com/r/baseball/comments/1y31bj7/passan_breaking_twotime_cy_young_award_winner/19t1g61oo5xxg/", "depth": null, "score": 1092, "byPoster": false, "removed": false, "stickied": false, "subreddit": "baseball", "postTitle": "[Passan] BREAKING: Two-time Cy Young Award winner Tarik Skubal and the New York Mets are in agreement on a nine-year, $450 million contract, sources tell ESPN. The deal includes a $45 million signing bonus, no opt-outs and a no-trade clause.", "awards": null } } ], "pagination": { "nextCursor": "L3N2Yy9zaHJlZGRpdC9zZWFyY2gvP3E9ZXNwcmVzc28rbWFjaGluZSZ0eXBlPWNvbW1lbnRzJnNvcnQ9cmVsZXZhbmNlJnQ9YWxsJmN1cnNvcj1leUpqWVc1a2FXUmhkR1Z6WDNKbGRIVnlibVZrSWpvaWUxd2ljMlZqZEdsdmJsOHhYM0JwY0dWc2FXNWxYekJmWjJ4dlltRnNYMjF2WkdsbWFXVnljMXdpT2x3aU1Wd2lMRndpYzJWamRHbHZibDh4WDNCcGNHVnNhVzVsWHpGZmJHOWpZV3hmYlc5a2FXWnBaWEp6WENJNlhDSXhYQ0lzWENKelpXTjBhVzl1WHpKZmNHbHdaV3hwYm1WZk1WOWpiMjF0Wlc1MFgzTmxZWEpqYUZ3aU9sd2lN…", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.reddit.searchComments({ query: \"espresso machine\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.reddit.search_comments(query=\"espresso machine\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/reddit/search/comments \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"query=espresso machine\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_RedditComment": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/RedditComment" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "RedditComment": { "allOf": [ { "type": "object", "description": "A comment or a reply.", "required": [ "id", "postId", "text", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "byPoster", "removed", "stickied" ], "properties": { "awards": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "byPoster": { "type": "boolean", "description": "Written by the post's author." }, "depth": { "type": [ "integer", "null" ], "format": "int32", "description": "How deep in its thread: 0 answers the post.", "minimum": 0 }, "postTitle": { "type": [ "string", "null" ] }, "removed": { "type": "boolean", "description": "Removed by a moderator, or deleted by its author: its text is Reddit's notice." }, "score": { "type": [ "integer", "null" ], "format": "int64", "description": "Upvotes less downvotes (`likes` is the same figure, when not negative)." }, "stickied": { "type": "boolean" }, "subreddit": { "type": [ "string", "null" ], "description": "The community, and the post it is on (on an account's comments and search)." }, "url": { "type": [ "string", "null" ], "description": "Its link (`…/comment//`): what `/v1/reddit/post/comment/replies` takes." } } }, { "type": "object", "description": "What only this platform has." } ] }, "id": { "type": "string" }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "parentId": { "type": [ "string", "null" ], "description": "The comment this replies to; absent on a top-level comment." }, "postId": { "type": "string" }, "replies": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "text": { "type": "string" } } }, { "type": "object", "description": "A comment, or a reply." } ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Search Media (/docs/api-reference/reddit/search-media) Image and video posts matching a query, about 7 a page. `GET https://api.socialapi.sh/v1/reddit/search/media` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.reddit.searchMedia({ query: "espresso" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.reddit.search_media(query="espresso") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/reddit/search/media \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "query=espresso" ``` **Response** ```json { "data": [ { "id": "1xoogji", "url": "https://www.reddit.com/r/espresso/comments/1xoogji/finally_happy_with_a_home_espresso_setup_under_600/", "text": null, "createdAt": null, "author": { "id": "1w5q10h42h", "username": "Tall_Lie_7683", "displayName": null, "avatarUrl": null, "verified": false, "url": "https://www.reddit.com/user/Tall_Lie_7683/" }, "stats": { "views": null, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "title": "Finally happy with a home espresso setup. (Under $600)", "kind": "text", "subreddit": "espresso", "score": null, "upvoteRatio": null, "link": null, "domain": null, "flair": null, "nsfw": false, "spoiler": false, "locked": false, "stickied": false, "crossposts": null, "crosspostOf": null, "awards": null, "editedAt": null, "snippet": null } }, { "id": "upk2me", "url": "https://www.reddit.com/r/espresso/comments/upk2me/respresso_starter_pack/", "text": null, "createdAt": null, "author": { "id": "76nqkhwa", "username": "Icy_Ad4208", "displayName": null, "avatarUrl": null, "verified": false, "url": "https://www.reddit.com/user/Icy_Ad4208/" }, "stats": { "views": null, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "title": "r/Espresso starter pack", "kind": "text", "subreddit": "espresso", "score": null, "upvoteRatio": null, "link": null, "domain": null, "flair": null, "nsfw": false, "spoiler": false, "locked": false, "stickied": false, "crossposts": null, "crosspostOf": null, "awards": null, "editedAt": null, "snippet": null } } ], "pagination": { "nextCursor": "L3N2Yy9zaHJlZGRpdC9zZWFyY2gvP3E9ZXNwcmVzc28mdHlwZT1tZWRpYSZzb3J0PXJlbGV2YW5jZSZ0PWFsbCZjdXJzb3I9ZXlKallXNWthV1JoZEdWelgzSmxkSFZ5Ym1Wa0lqb2llMXdpYzJWamRHbHZibDh4WDNCcGNHVnNhVzVsWHpCZloyeHZZbUZzWDIxdlpHbG1hV1Z5YzF3aU9sd2lNVndpTEZ3aWMyVmpkR2x2Ymw4eFgzQnBjR1ZzYVc1bFh6RmZiRzlqWVd4ZmJXOWthV1pwWlhKelhDSTZYQ0l5WENJc1hDSnpaV04wYVc5dVh6SmZjR2x3Wld4cGJtVmZNbDl3YjNOMFgzTmxZWEpqYUZ3aU9sd2lOMXdpZlNJc0ltVjRjR1Z5…", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/reddit/search/media": { "get": { "tags": [ "Reddit" ], "summary": "Image and video posts matching a query, about 7 a page.", "description": "1 credit a page.", "operationId": "redditSearchMedia", "parameters": [ { "name": "query", "in": "query", "description": "What to search for.", "required": true, "schema": { "type": "string" } }, { "name": "sort", "in": "query", "description": "`relevance` (the default), `hot`, `top`, `new` or `comments`.", "required": false, "schema": { "type": "string", "description": "The order of search results.", "enum": [ "relevance", "hot", "top", "new", "comments" ] } }, { "name": "time", "in": "query", "description": "`hour`, `day`, `week`, `month`, `year` or `all` (the default).", "required": false, "schema": { "type": "string", "description": "How far back `top` and `controversial` look.", "enum": [ "hour", "day", "week", "month", "year", "all" ] } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_RedditPost" }, "example": { "data": [ { "id": "1xoogji", "url": "https://www.reddit.com/r/espresso/comments/1xoogji/finally_happy_with_a_home_espresso_setup_under_600/", "text": null, "createdAt": null, "author": { "id": "1w5q10h42h", "username": "Tall_Lie_7683", "displayName": null, "avatarUrl": null, "verified": false, "url": "https://www.reddit.com/user/Tall_Lie_7683/" }, "stats": { "views": null, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "title": "Finally happy with a home espresso setup. (Under $600)", "kind": "text", "subreddit": "espresso", "score": null, "upvoteRatio": null, "link": null, "domain": null, "flair": null, "nsfw": false, "spoiler": false, "locked": false, "stickied": false, "crossposts": null, "crosspostOf": null, "awards": null, "editedAt": null, "snippet": null } }, { "id": "upk2me", "url": "https://www.reddit.com/r/espresso/comments/upk2me/respresso_starter_pack/", "text": null, "createdAt": null, "author": { "id": "76nqkhwa", "username": "Icy_Ad4208", "displayName": null, "avatarUrl": null, "verified": false, "url": "https://www.reddit.com/user/Icy_Ad4208/" }, "stats": { "views": null, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "title": "r/Espresso starter pack", "kind": "text", "subreddit": "espresso", "score": null, "upvoteRatio": null, "link": null, "domain": null, "flair": null, "nsfw": false, "spoiler": false, "locked": false, "stickied": false, "crossposts": null, "crosspostOf": null, "awards": null, "editedAt": null, "snippet": null } } ], "pagination": { "nextCursor": "L3N2Yy9zaHJlZGRpdC9zZWFyY2gvP3E9ZXNwcmVzc28mdHlwZT1tZWRpYSZzb3J0PXJlbGV2YW5jZSZ0PWFsbCZjdXJzb3I9ZXlKallXNWthV1JoZEdWelgzSmxkSFZ5Ym1Wa0lqb2llMXdpYzJWamRHbHZibDh4WDNCcGNHVnNhVzVsWHpCZloyeHZZbUZzWDIxdlpHbG1hV1Z5YzF3aU9sd2lNVndpTEZ3aWMyVmpkR2x2Ymw4eFgzQnBjR1ZzYVc1bFh6RmZiRzlqWVd4ZmJXOWthV1pwWlhKelhDSTZYQ0l5WENJc1hDSnpaV04wYVc5dVh6SmZjR2x3Wld4cGJtVmZNbDl3YjNOMFgzTmxZWEpqYUZ3aU9sd2lOMXdpZlNJc0ltVjRjR1Z5…", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.reddit.searchMedia({ query: \"espresso\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.reddit.search_media(query=\"espresso\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/reddit/search/media \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"query=espresso\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_RedditPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/RedditPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "RedditPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "title", "kind", "nsfw", "spoiler", "locked", "stickied" ], "properties": { "awards": { "type": [ "integer", "null" ], "format": "int64", "description": "Awards it was given.", "minimum": 0 }, "crosspostOf": { "oneOf": [ { "$ref": "#/components/schemas/RedditPostRef", "description": "The post it shares, when it is a crosspost." }, { "type": "null" } ] }, "crossposts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "domain": { "type": [ "string", "null" ] }, "editedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "When it was last edited." }, { "type": "null" } ] }, "flair": { "type": [ "string", "null" ] }, "kind": { "$ref": "#/components/schemas/RedditPostKind" }, "link": { "type": [ "string", "null" ], "description": "The link it shares, and its site." }, "locked": { "type": "boolean", "description": "Closed to new comments." }, "nsfw": { "type": "boolean", "description": "Not safe for work." }, "score": { "type": [ "integer", "null" ], "format": "int64", "description": "Upvotes less downvotes (`stats.likes` is the same figure)." }, "snippet": { "type": [ "string", "null" ], "description": "What a search matched in it (a comment's words), on search results." }, "spoiler": { "type": "boolean" }, "stickied": { "type": "boolean", "description": "Pinned to the top of its community." }, "subreddit": { "type": [ "string", "null" ], "description": "The community, without `r/`." }, "title": { "type": "string" }, "upvoteRatio": { "type": [ "number", "null" ], "format": "double", "description": "The share of votes that are upvotes, 0 to 1." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A post: text, a link, an image, a gallery, a video or a poll." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "RedditPostKind": { "type": "string", "description": "What a post is.", "enum": [ "text", "link", "image", "gallery", "video", "poll" ] }, "Timestamp": { "type": "string", "format": "date-time" }, "RedditPostRef": { "type": "object", "description": "The post a crosspost shares.", "required": [ "id" ], "properties": { "id": { "type": "string" }, "subreddit": { "type": [ "string", "null" ] }, "title": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] } } }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Search Subreddits (/docs/api-reference/reddit/search-subreddits) Communities matching a query, 25 a page. `GET https://api.socialapi.sh/v1/reddit/search/subreddits` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.reddit.searchSubreddits({ query: "coffee" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.reddit.search_subreddits(query="coffee") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/reddit/search/subreddits \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "query=coffee" ``` **Response** ```json { "data": [ { "id": "2qhze", "name": "Coffee", "title": "Coffee", "description": "/r/Coffee is back - for now - and talking about itself, in addition to coffee.", "url": "https://www.reddit.com/r/Coffee/", "iconUrl": "https://styles.redditmedia.com/t5_2qhze/styles/communityIcon_81fbf117t1411.png?width=256&s=a1eeb15bf142101ddb104de271f81ba440b4268d", "bannerUrl": null, "subscribers": 2478698, "weeklyVisitors": null, "weeklyContributions": null, "createdAt": "2008-05-15T13:10:38.000Z", "kind": "public", "nsfw": false, "language": "en", "category": "Lifestyles", "rules": [] }, { "id": "2rqoi", "name": "espresso", "title": "espresso: strong, potent coffee news for strong, potent coffee lovers.", "description": "The place to discuss the beans, brewing, and tools used to make the style of coffee known as \"espresso\", and all the forms it takes.\n\nNew to espresso? Check out our \"Brewing Basics\" guide and Frequently Asked Questions in our wiki and linked in the sidebar!", "url": "https://www.reddit.com/r/espresso/", "iconUrl": "https://styles.redditmedia.com/t5_2rqoi/styles/communityIcon_2ecjqa4s2m6e1.jpg?width=256&s=4590126d26a69d6d1ab420184ac192f8374995a3", "bannerUrl": "https://styles.redditmedia.com/t5_2rqoi/styles/bannerBackgroundImage_d5r3nasb287e1.png?width=4000&s=39961eac494ad3e46909d40f8c050240b557a258", "subscribers": 1055620, "weeklyVisitors": null, "weeklyContributions": null, "createdAt": "2010-05-08T20:02:16.000Z", "kind": "public", "nsfw": false, "language": "en", "category": null, "rules": [] } ], "pagination": { "nextCursor": "t5_2uzk5", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/reddit/search/subreddits": { "get": { "tags": [ "Reddit" ], "summary": "Communities matching a query, 25 a page.", "description": "With their members and descriptions. 1 credit a page.", "operationId": "redditSearchSubreddits", "parameters": [ { "name": "query", "in": "query", "description": "A name or a word to search for.", "required": true, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_RedditSubreddit" }, "example": { "data": [ { "id": "2qhze", "name": "Coffee", "title": "Coffee", "description": "/r/Coffee is back - for now - and talking about itself, in addition to coffee.", "url": "https://www.reddit.com/r/Coffee/", "iconUrl": "https://styles.redditmedia.com/t5_2qhze/styles/communityIcon_81fbf117t1411.png?width=256&s=a1eeb15bf142101ddb104de271f81ba440b4268d", "bannerUrl": null, "subscribers": 2478698, "weeklyVisitors": null, "weeklyContributions": null, "createdAt": "2008-05-15T13:10:38.000Z", "kind": "public", "nsfw": false, "language": "en", "category": "Lifestyles", "rules": [] }, { "id": "2rqoi", "name": "espresso", "title": "espresso: strong, potent coffee news for strong, potent coffee lovers.", "description": "The place to discuss the beans, brewing, and tools used to make the style of coffee known as \"espresso\", and all the forms it takes.\n\nNew to espresso? Check out our \"Brewing Basics\" guide and Frequently Asked Questions in our wiki and linked in the sidebar!", "url": "https://www.reddit.com/r/espresso/", "iconUrl": "https://styles.redditmedia.com/t5_2rqoi/styles/communityIcon_2ecjqa4s2m6e1.jpg?width=256&s=4590126d26a69d6d1ab420184ac192f8374995a3", "bannerUrl": "https://styles.redditmedia.com/t5_2rqoi/styles/bannerBackgroundImage_d5r3nasb287e1.png?width=4000&s=39961eac494ad3e46909d40f8c050240b557a258", "subscribers": 1055620, "weeklyVisitors": null, "weeklyContributions": null, "createdAt": "2010-05-08T20:02:16.000Z", "kind": "public", "nsfw": false, "language": "en", "category": null, "rules": [] } ], "pagination": { "nextCursor": "t5_2uzk5", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.reddit.searchSubreddits({ query: \"coffee\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.reddit.search_subreddits(query=\"coffee\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/reddit/search/subreddits \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"query=coffee\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_RedditSubreddit": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/RedditSubreddit" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "RedditSubreddit": { "type": "object", "description": "A community (a subreddit).", "required": [ "id", "name", "url", "nsfw", "rules" ], "properties": { "bannerUrl": { "type": [ "string", "null" ] }, "category": { "type": [ "string", "null" ], "description": "Reddit's category for advertisers." }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "description": { "type": [ "string", "null" ] }, "iconUrl": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "kind": { "type": [ "string", "null" ], "description": "`public`, `restricted` (anyone reads, approved people post) or another of Reddit's." }, "language": { "type": [ "string", "null" ], "description": "Its language, as it states it." }, "name": { "type": "string", "description": "Its name, without `r/`." }, "nsfw": { "type": "boolean" }, "rules": { "type": "array", "items": { "$ref": "#/components/schemas/RedditRule" }, "description": "Its rules (on `/subreddit` only)." }, "subscribers": { "type": [ "integer", "null" ], "format": "int64", "description": "Members.", "minimum": 0 }, "title": { "type": [ "string", "null" ] }, "url": { "type": "string" }, "weeklyContributions": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "weeklyVisitors": { "type": [ "integer", "null" ], "format": "int64", "description": "Visitors and contributions over the last week (on `/subreddit` only).", "minimum": 0 } } }, "RedditRule": { "type": "object", "description": "A community's rule.", "required": [ "title" ], "properties": { "appliesTo": { "type": [ "string", "null" ], "description": "What it applies to: `link` (posts), `comment` or `all`." }, "description": { "type": [ "string", "null" ] }, "title": { "type": "string" } } }, "Timestamp": { "type": "string", "format": "date-time" } } } } ``` # Search Users (/docs/api-reference/reddit/search-users) Accounts matching a name, the first 25. `GET https://api.socialapi.sh/v1/reddit/search/users` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.reddit.searchUsers({ query: "coffee" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.reddit.search_users(query="coffee") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/reddit/search/users \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "query=coffee" ``` **Response** ```json { "data": [ { "id": "q8hp", "username": "coffee", "displayName": null, "bio": null, "avatarUrl": "https://www.redditstatic.com/avatars/defaults/v2/avatar_default_5.png", "url": "https://www.reddit.com/user/coffee/", "verified": true, "private": false, "followers": null, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": "2006-11-09T18:27:32.000Z", "ext": { "karma": { "total": null, "post": 1, "comment": 0, "awardee": null, "awarder": null }, "employee": false, "moderator": false, "premium": false, "suspended": false, "bannerUrl": null, "trophies": [] } }, { "id": "mts3u7m", "username": "coffeechap", "displayName": "Owner of Paris B-sides Tours", "bio": "French, long-time Parisian, in his 40s.\n\nProfessional flaneur, more interested in the other side of the postcard.\n\nCity guide organizing tours through my own website https://parisbsides.com", "avatarUrl": "https://i.redd.it/snoovatar/avatars/a4398a02-cc21-4b0e-a1ed-c0cccb75bb44.png", "url": "https://www.reddit.com/user/coffeechap/", "verified": true, "private": false, "followers": null, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": "2017-12-02T04:40:58.000Z", "ext": { "karma": { "total": null, "post": 1557, "comment": 21699, "awardee": null, "awarder": null }, "employee": false, "moderator": true, "premium": false, "suspended": false, "bannerUrl": "https://styles.redditmedia.com/t5_4ee6u/styles/profileBanner_dx67rbgk0s571.jpg?width=1280&height=384&crop=1280:384,smart&s=24cdcd45e395eae64bd2e96d1a074b179d68c2a6", "trophies": [] } } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/reddit/search/users": { "get": { "tags": [ "Reddit" ], "summary": "Accounts matching a name, the first 25.", "description": "With their karma. 1 credit.", "operationId": "redditSearchUsers", "parameters": [ { "name": "query", "in": "query", "description": "A name to search for.", "required": true, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_RedditProfile" }, "example": { "data": [ { "id": "q8hp", "username": "coffee", "displayName": null, "bio": null, "avatarUrl": "https://www.redditstatic.com/avatars/defaults/v2/avatar_default_5.png", "url": "https://www.reddit.com/user/coffee/", "verified": true, "private": false, "followers": null, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": "2006-11-09T18:27:32.000Z", "ext": { "karma": { "total": null, "post": 1, "comment": 0, "awardee": null, "awarder": null }, "employee": false, "moderator": false, "premium": false, "suspended": false, "bannerUrl": null, "trophies": [] } }, { "id": "mts3u7m", "username": "coffeechap", "displayName": "Owner of Paris B-sides Tours", "bio": "French, long-time Parisian, in his 40s.\n\nProfessional flaneur, more interested in the other side of the postcard.\n\nCity guide organizing tours through my own website https://parisbsides.com", "avatarUrl": "https://i.redd.it/snoovatar/avatars/a4398a02-cc21-4b0e-a1ed-c0cccb75bb44.png", "url": "https://www.reddit.com/user/coffeechap/", "verified": true, "private": false, "followers": null, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": "2017-12-02T04:40:58.000Z", "ext": { "karma": { "total": null, "post": 1557, "comment": 21699, "awardee": null, "awarder": null }, "employee": false, "moderator": true, "premium": false, "suspended": false, "bannerUrl": "https://styles.redditmedia.com/t5_4ee6u/styles/profileBanner_dx67rbgk0s571.jpg?width=1280&height=384&crop=1280:384,smart&s=24cdcd45e395eae64bd2e96d1a074b179d68c2a6", "trophies": [] } } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.reddit.searchUsers({ query: \"coffee\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.reddit.search_users(query=\"coffee\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/reddit/search/users \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"query=coffee\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_RedditProfile": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/RedditProfile" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "RedditProfile": { "allOf": [ { "type": "object", "description": "An account.", "required": [ "id", "username", "url", "verified", "private", "ext" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "bio": { "type": [ "string", "null" ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "displayName": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "karma", "employee", "moderator", "premium", "suspended", "trophies" ], "properties": { "bannerUrl": { "type": [ "string", "null" ] }, "employee": { "type": "boolean", "description": "A Reddit employee." }, "karma": { "$ref": "#/components/schemas/RedditKarma" }, "moderator": { "type": "boolean", "description": "Moderates a community." }, "premium": { "type": "boolean", "description": "Has Reddit Premium." }, "suspended": { "type": "boolean", "description": "Suspended, on an account in a list: Reddit shows nothing else of it. A suspended\naccount asked for by its name is refused instead (`410 SUSPENDED`)." }, "trophies": { "type": "array", "items": { "$ref": "#/components/schemas/RedditTrophy" }, "description": "Its trophies (on `/profile` only)." } } }, { "type": "object", "description": "What only this platform has." } ] }, "externalUrl": { "type": [ "string", "null" ], "description": "The link in the bio." }, "followers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "following": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "id": { "type": "string", "description": "The platform's id for the account." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "description": "Likes the account's posts received in total.", "minimum": 0 }, "posts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "private": { "type": "boolean" }, "url": { "type": "string", "description": "The profile's page." }, "username": { "type": "string", "description": "The handle, without `@`." }, "verified": { "type": "boolean" } } }, { "type": "object", "description": "A Reddit account." } ] }, "RedditTrophy": { "type": "object", "description": "A trophy on an account's profile.", "required": [ "name" ], "properties": { "grantedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "iconUrl": { "type": [ "string", "null" ] }, "name": { "type": "string" } } }, "Timestamp": { "type": "string", "format": "date-time" }, "RedditKarma": { "type": "object", "description": "An account's karma, as its profile splits it.", "properties": { "awardee": { "type": [ "integer", "null" ], "format": "int64", "description": "From awards it was given, and gave.", "minimum": 0 }, "awarder": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "comment": { "type": [ "integer", "null" ], "format": "int64", "description": "From its comments.", "minimum": 0 }, "post": { "type": [ "integer", "null" ], "format": "int64", "description": "From its posts.", "minimum": 0 }, "total": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } } } } } ``` # Search (/docs/api-reference/reddit/search) Posts matching a query across Reddit, about 7 a page. `GET https://api.socialapi.sh/v1/reddit/search` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.reddit.search({ query: "espresso machine" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.reddit.search(query="espresso machine") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/reddit/search \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "query=espresso machine" ``` **Response** ```json { "data": [ { "id": "1y3d5i6", "url": "https://www.reddit.com/r/espresso/comments/1y3d5i6/for_those_who_bought_an_espresso_machine_for_home/", "text": null, "createdAt": "2026-11-23T08:34:30.864Z", "author": { "id": "bhs5jlpnu", "username": "Blue_Diam0nd_", "displayName": null, "avatarUrl": null, "verified": false, "url": "https://www.reddit.com/user/Blue_Diam0nd_/" }, "stats": { "views": null, "likes": 447, "comments": 853, "shares": null, "saves": null, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "title": "For those who bought an espresso machine for home, was it worth it?", "kind": "text", "subreddit": "espresso", "score": 447, "upvoteRatio": null, "link": null, "domain": null, "flair": null, "nsfw": false, "spoiler": false, "locked": false, "stickied": false, "crossposts": null, "crosspostOf": null, "awards": null, "editedAt": null, "snippet": "my wife now says it’s one of the best investments we ever made." } }, { "id": "1w58kht", "url": "https://www.reddit.com/r/JamesHoffmann/comments/1w58kht/best_espresso_machine_to_buy_right_now_in_2026/", "text": null, "createdAt": "2026-09-02T12:12:09.305Z", "author": { "id": "29793w0s96", "username": "Crystalline_Due", "displayName": null, "avatarUrl": null, "verified": false, "url": "https://www.reddit.com/user/Crystalline_Due/" }, "stats": { "views": null, "likes": 0, "comments": 62, "shares": null, "saves": null, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "title": "Best Espresso Machine To Buy Right Now In 2026? (Price and Taste)", "kind": "text", "subreddit": "JamesHoffmann", "score": 0, "upvoteRatio": null, "link": null, "domain": null, "flair": null, "nsfw": false, "spoiler": false, "locked": false, "stickied": false, "crossposts": null, "crosspostOf": null, "awards": null, "editedAt": null, "snippet": "Grinder more important than espresso machine. Beans and water more important than either (arguably!)" } } ], "pagination": { "nextCursor": "L3N2Yy9zaHJlZGRpdC9zZWFyY2gvP3E9ZXNwcmVzc28rbWFjaGluZSZ0eXBlPXBvc3RzJnNvcnQ9cmVsZXZhbmNlJnQ9YWxsJmN1cnNvcj1leUpqWVc1a2FXUmhkR1Z6WDNKbGRIVnlibVZrSWpvaWUxd2ljMlZqZEdsdmJsOHhYM0JwY0dWc2FXNWxYekJmWjJ4dlltRnNYMjF2WkdsbWFXVnljMXdpT2x3aU1Wd2lMRndpYzJWamRHbHZibDh4WDNCcGNHVnNhVzVsWHpGZmJHOWpZV3hmYlc5a2FXWnBaWEp6WENJNlhDSXlYQ0lzWENKelpXTjBhVzl1WHpKZmNHbHdaV3hwYm1WZk1UQmZjWFZsY25sZmMzVm5aMlZ6ZEdsdmJuTmNJanBj…", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/reddit/search": { "get": { "tags": [ "Reddit" ], "summary": "Posts matching a query across Reddit, about 7 a page.", "description": "With their scores, comment counts and the words matched. 1 credit a page.", "operationId": "redditSearch", "parameters": [ { "name": "query", "in": "query", "description": "What to search for.", "required": true, "schema": { "type": "string" } }, { "name": "sort", "in": "query", "description": "`relevance` (the default), `hot`, `top`, `new` or `comments`.", "required": false, "schema": { "type": "string", "description": "The order of search results.", "enum": [ "relevance", "hot", "top", "new", "comments" ] } }, { "name": "time", "in": "query", "description": "`hour`, `day`, `week`, `month`, `year` or `all` (the default).", "required": false, "schema": { "type": "string", "description": "How far back `top` and `controversial` look.", "enum": [ "hour", "day", "week", "month", "year", "all" ] } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_RedditPost" }, "example": { "data": [ { "id": "1y3d5i6", "url": "https://www.reddit.com/r/espresso/comments/1y3d5i6/for_those_who_bought_an_espresso_machine_for_home/", "text": null, "createdAt": "2026-11-23T08:34:30.864Z", "author": { "id": "bhs5jlpnu", "username": "Blue_Diam0nd_", "displayName": null, "avatarUrl": null, "verified": false, "url": "https://www.reddit.com/user/Blue_Diam0nd_/" }, "stats": { "views": null, "likes": 447, "comments": 853, "shares": null, "saves": null, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "title": "For those who bought an espresso machine for home, was it worth it?", "kind": "text", "subreddit": "espresso", "score": 447, "upvoteRatio": null, "link": null, "domain": null, "flair": null, "nsfw": false, "spoiler": false, "locked": false, "stickied": false, "crossposts": null, "crosspostOf": null, "awards": null, "editedAt": null, "snippet": "my wife now says it’s one of the best investments we ever made." } }, { "id": "1w58kht", "url": "https://www.reddit.com/r/JamesHoffmann/comments/1w58kht/best_espresso_machine_to_buy_right_now_in_2026/", "text": null, "createdAt": "2026-09-02T12:12:09.305Z", "author": { "id": "29793w0s96", "username": "Crystalline_Due", "displayName": null, "avatarUrl": null, "verified": false, "url": "https://www.reddit.com/user/Crystalline_Due/" }, "stats": { "views": null, "likes": 0, "comments": 62, "shares": null, "saves": null, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "title": "Best Espresso Machine To Buy Right Now In 2026? (Price and Taste)", "kind": "text", "subreddit": "JamesHoffmann", "score": 0, "upvoteRatio": null, "link": null, "domain": null, "flair": null, "nsfw": false, "spoiler": false, "locked": false, "stickied": false, "crossposts": null, "crosspostOf": null, "awards": null, "editedAt": null, "snippet": "Grinder more important than espresso machine. Beans and water more important than either (arguably!)" } } ], "pagination": { "nextCursor": "L3N2Yy9zaHJlZGRpdC9zZWFyY2gvP3E9ZXNwcmVzc28rbWFjaGluZSZ0eXBlPXBvc3RzJnNvcnQ9cmVsZXZhbmNlJnQ9YWxsJmN1cnNvcj1leUpqWVc1a2FXUmhkR1Z6WDNKbGRIVnlibVZrSWpvaWUxd2ljMlZqZEdsdmJsOHhYM0JwY0dWc2FXNWxYekJmWjJ4dlltRnNYMjF2WkdsbWFXVnljMXdpT2x3aU1Wd2lMRndpYzJWamRHbHZibDh4WDNCcGNHVnNhVzVsWHpGZmJHOWpZV3hmYlc5a2FXWnBaWEp6WENJNlhDSXlYQ0lzWENKelpXTjBhVzl1WHpKZmNHbHdaV3hwYm1WZk1UQmZjWFZsY25sZmMzVm5aMlZ6ZEdsdmJuTmNJanBj…", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.reddit.search({ query: \"espresso machine\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.reddit.search(query=\"espresso machine\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/reddit/search \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"query=espresso machine\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_RedditPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/RedditPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "RedditPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "title", "kind", "nsfw", "spoiler", "locked", "stickied" ], "properties": { "awards": { "type": [ "integer", "null" ], "format": "int64", "description": "Awards it was given.", "minimum": 0 }, "crosspostOf": { "oneOf": [ { "$ref": "#/components/schemas/RedditPostRef", "description": "The post it shares, when it is a crosspost." }, { "type": "null" } ] }, "crossposts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "domain": { "type": [ "string", "null" ] }, "editedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "When it was last edited." }, { "type": "null" } ] }, "flair": { "type": [ "string", "null" ] }, "kind": { "$ref": "#/components/schemas/RedditPostKind" }, "link": { "type": [ "string", "null" ], "description": "The link it shares, and its site." }, "locked": { "type": "boolean", "description": "Closed to new comments." }, "nsfw": { "type": "boolean", "description": "Not safe for work." }, "score": { "type": [ "integer", "null" ], "format": "int64", "description": "Upvotes less downvotes (`stats.likes` is the same figure)." }, "snippet": { "type": [ "string", "null" ], "description": "What a search matched in it (a comment's words), on search results." }, "spoiler": { "type": "boolean" }, "stickied": { "type": "boolean", "description": "Pinned to the top of its community." }, "subreddit": { "type": [ "string", "null" ], "description": "The community, without `r/`." }, "title": { "type": "string" }, "upvoteRatio": { "type": [ "number", "null" ], "format": "double", "description": "The share of votes that are upvotes, 0 to 1." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A post: text, a link, an image, a gallery, a video or a poll." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "RedditPostKind": { "type": "string", "description": "What a post is.", "enum": [ "text", "link", "image", "gallery", "video", "poll" ] }, "Timestamp": { "type": "string", "format": "date-time" }, "RedditPostRef": { "type": "object", "description": "The post a crosspost shares.", "required": [ "id" ], "properties": { "id": { "type": "string" }, "subreddit": { "type": [ "string", "null" ] }, "title": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] } } }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Subreddit Posts (/docs/api-reference/reddit/subreddit-posts) A community's posts, 25 a page. `GET https://api.socialapi.sh/v1/reddit/subreddit/posts` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.reddit.subredditPosts({ name: "AskReddit", sort: "hot" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.reddit.subreddit_posts(name="AskReddit", sort="hot") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/reddit/subreddit/posts \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "name=AskReddit" \ --data-urlencode "sort=hot" ``` **Response** ```json { "data": [ { "id": "1y53ynl", "url": "https://www.reddit.com/r/AskReddit/comments/1y53ynl/donald_trump_just_called_senatorelect_abdul/", "text": null, "createdAt": "2026-11-25T10:21:39.000Z", "author": { "id": "g2ee64y4", "username": "Sad_Artist8183", "displayName": null, "avatarUrl": null, "verified": false, "url": "https://www.reddit.com/user/Sad_Artist8183/" }, "stats": { "views": null, "likes": 612, "comments": 343, "shares": null, "saves": null, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "title": "Donald Trump just called Senator-elect Abdul El-Sayed a “smart guy” and said “maybe there’s some place in the middle” on a universal “Trumpcare” plan. Americans, what are your thoughts?", "kind": "text", "subreddit": "AskReddit", "score": 612, "upvoteRatio": 0.87, "link": null, "domain": null, "flair": null, "nsfw": false, "spoiler": false, "locked": false, "stickied": false, "crossposts": 0, "crosspostOf": null, "awards": 0, "editedAt": null, "snippet": null } }, { "id": "1y4ueub", "url": "https://www.reddit.com/r/AskReddit/comments/1y4ueub/people_in_their_60s_what_did_you_assume_youd_have/", "text": null, "createdAt": "2026-11-25T01:13:32.000Z", "author": { "id": "u6ozh", "username": "freedone23", "displayName": null, "avatarUrl": null, "verified": false, "url": "https://www.reddit.com/user/freedone23/" }, "stats": { "views": null, "likes": 2082, "comments": 650, "shares": null, "saves": null, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "title": "People in their 60s, what did you assume you'd have \"plenty of time\" for that you didn't?", "kind": "text", "subreddit": "AskReddit", "score": 2082, "upvoteRatio": 0.94, "link": null, "domain": null, "flair": null, "nsfw": false, "spoiler": false, "locked": false, "stickied": false, "crossposts": 1, "crosspostOf": null, "awards": 0, "editedAt": null, "snippet": null } } ], "pagination": { "nextCursor": "t3_1y4srpq", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/reddit/subreddit/posts": { "get": { "tags": [ "Reddit" ], "summary": "A community's posts, 25 a page.", "description": "Sorted `hot`, `new`, `top`, `rising` or `controversial`. The `new` feed carries titles,\nscores and comment counts but no text or media (read a post with `/post`). 1 credit a\npage.", "operationId": "redditSubredditPosts", "parameters": [ { "name": "name", "in": "query", "description": "The community's name, with or without `r/`.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "Its link, instead of `name`.", "required": false, "schema": { "type": "string" } }, { "name": "sort", "in": "query", "description": "`hot` (the default), `new`, `top`, `rising` or `controversial`.", "required": false, "schema": { "type": "string", "description": "The order of a community's posts.", "enum": [ "hot", "new", "top", "rising", "controversial" ] } }, { "name": "time", "in": "query", "description": "For `top` and `controversial`: `hour`, `day`, `week`, `month`, `year` or `all`\n(the default).", "required": false, "schema": { "type": "string", "description": "How far back `top` and `controversial` look.", "enum": [ "hour", "day", "week", "month", "year", "all" ] } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_RedditPost" }, "example": { "data": [ { "id": "1y53ynl", "url": "https://www.reddit.com/r/AskReddit/comments/1y53ynl/donald_trump_just_called_senatorelect_abdul/", "text": null, "createdAt": "2026-11-25T10:21:39.000Z", "author": { "id": "g2ee64y4", "username": "Sad_Artist8183", "displayName": null, "avatarUrl": null, "verified": false, "url": "https://www.reddit.com/user/Sad_Artist8183/" }, "stats": { "views": null, "likes": 612, "comments": 343, "shares": null, "saves": null, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "title": "Donald Trump just called Senator-elect Abdul El-Sayed a “smart guy” and said “maybe there’s some place in the middle” on a universal “Trumpcare” plan. Americans, what are your thoughts?", "kind": "text", "subreddit": "AskReddit", "score": 612, "upvoteRatio": 0.87, "link": null, "domain": null, "flair": null, "nsfw": false, "spoiler": false, "locked": false, "stickied": false, "crossposts": 0, "crosspostOf": null, "awards": 0, "editedAt": null, "snippet": null } }, { "id": "1y4ueub", "url": "https://www.reddit.com/r/AskReddit/comments/1y4ueub/people_in_their_60s_what_did_you_assume_youd_have/", "text": null, "createdAt": "2026-11-25T01:13:32.000Z", "author": { "id": "u6ozh", "username": "freedone23", "displayName": null, "avatarUrl": null, "verified": false, "url": "https://www.reddit.com/user/freedone23/" }, "stats": { "views": null, "likes": 2082, "comments": 650, "shares": null, "saves": null, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "title": "People in their 60s, what did you assume you'd have \"plenty of time\" for that you didn't?", "kind": "text", "subreddit": "AskReddit", "score": 2082, "upvoteRatio": 0.94, "link": null, "domain": null, "flair": null, "nsfw": false, "spoiler": false, "locked": false, "stickied": false, "crossposts": 1, "crosspostOf": null, "awards": 0, "editedAt": null, "snippet": null } } ], "pagination": { "nextCursor": "t3_1y4srpq", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.reddit.subredditPosts({ name: \"AskReddit\", sort: \"hot\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.reddit.subreddit_posts(name=\"AskReddit\", sort=\"hot\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/reddit/subreddit/posts \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"name=AskReddit\" \\\n --data-urlencode \"sort=hot\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_RedditPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/RedditPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "RedditPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "title", "kind", "nsfw", "spoiler", "locked", "stickied" ], "properties": { "awards": { "type": [ "integer", "null" ], "format": "int64", "description": "Awards it was given.", "minimum": 0 }, "crosspostOf": { "oneOf": [ { "$ref": "#/components/schemas/RedditPostRef", "description": "The post it shares, when it is a crosspost." }, { "type": "null" } ] }, "crossposts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "domain": { "type": [ "string", "null" ] }, "editedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "When it was last edited." }, { "type": "null" } ] }, "flair": { "type": [ "string", "null" ] }, "kind": { "$ref": "#/components/schemas/RedditPostKind" }, "link": { "type": [ "string", "null" ], "description": "The link it shares, and its site." }, "locked": { "type": "boolean", "description": "Closed to new comments." }, "nsfw": { "type": "boolean", "description": "Not safe for work." }, "score": { "type": [ "integer", "null" ], "format": "int64", "description": "Upvotes less downvotes (`stats.likes` is the same figure)." }, "snippet": { "type": [ "string", "null" ], "description": "What a search matched in it (a comment's words), on search results." }, "spoiler": { "type": "boolean" }, "stickied": { "type": "boolean", "description": "Pinned to the top of its community." }, "subreddit": { "type": [ "string", "null" ], "description": "The community, without `r/`." }, "title": { "type": "string" }, "upvoteRatio": { "type": [ "number", "null" ], "format": "double", "description": "The share of votes that are upvotes, 0 to 1." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A post: text, a link, an image, a gallery, a video or a poll." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "RedditPostKind": { "type": "string", "description": "What a post is.", "enum": [ "text", "link", "image", "gallery", "video", "poll" ] }, "Timestamp": { "type": "string", "format": "date-time" }, "RedditPostRef": { "type": "object", "description": "The post a crosspost shares.", "required": [ "id" ], "properties": { "id": { "type": "string" }, "subreddit": { "type": [ "string", "null" ] }, "title": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] } } }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Subreddit Search (/docs/api-reference/reddit/subreddit-search) Posts in one community matching a query, about 7 a page. `GET https://api.socialapi.sh/v1/reddit/subreddit/search` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.reddit.subredditSearch({ name: "Coffee", query: "espresso" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.reddit.subreddit_search(name="Coffee", query="espresso") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/reddit/subreddit/search \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "name=Coffee" \ --data-urlencode "query=espresso" ``` **Response** ```json { "data": [ { "id": "ue7pc", "url": "https://www.reddit.com/r/Coffee/comments/ue7pc/wife_trying_espresso_for_the_first_time/", "text": null, "createdAt": "2012-05-31T18:09:05.636Z", "author": { "id": "4ospk", "username": "snick88", "displayName": null, "avatarUrl": null, "verified": false, "url": "https://www.reddit.com/user/snick88/" }, "stats": { "views": null, "likes": 614, "comments": 107, "shares": null, "saves": null, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "title": "Wife trying espresso for the first time", "kind": "text", "subreddit": "Coffee", "score": 614, "upvoteRatio": null, "link": null, "domain": null, "flair": null, "nsfw": false, "spoiler": false, "locked": false, "stickied": false, "crossposts": null, "crosspostOf": null, "awards": null, "editedAt": null, "snippet": null } }, { "id": "zft81c", "url": "https://www.reddit.com/r/Coffee/comments/zft81c/unpopular_opinion_espresso_is_overrated_and_it_is/", "text": null, "createdAt": "2022-12-08T08:24:30.471Z", "author": { "id": "a2u1qsx7", "username": "ee_72020", "displayName": null, "avatarUrl": null, "verified": false, "url": "https://www.reddit.com/user/ee_72020/" }, "stats": { "views": null, "likes": 24, "comments": 55, "shares": null, "saves": null, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "title": "Unpopular opinion: espresso is overrated and it is absolutely the worst way to brew light and medium roasts", "kind": "text", "subreddit": "Coffee", "score": 24, "upvoteRatio": null, "link": null, "domain": null, "flair": null, "nsfw": false, "spoiler": false, "locked": false, "stickied": false, "crossposts": null, "crosspostOf": null, "awards": null, "editedAt": null, "snippet": null } } ], "pagination": { "nextCursor": "L3N2Yy9zaHJlZGRpdC9yL0NvZmZlZS9zZWFyY2gvP3E9ZXNwcmVzc28mdHlwZT1wb3N0cyZzb3J0PXJlbGV2YW5jZSZ0PWFsbCZjdXJzb3I9ZXlKallXNWthV1JoZEdWelgzSmxkSFZ5Ym1Wa0lqb2llMXdpYzJWamRHbHZibDh4WDNCcGNHVnNhVzVsWHpCZloyeHZZbUZzWDIxdlpHbG1hV1Z5YzF3aU9sd2lNVndpTEZ3aWMyVmpkR2x2Ymw4eFgzQnBjR1ZzYVc1bFh6RmZiRzlqWVd4ZmJXOWthV1pwWlhKelhDSTZYQ0l5WENJc1hDSnpaV04wYVc5dVh6SmZjR2x3Wld4cGJtVmZOMTl6WTI5d1pWOXpkMmwwWTJobGNsd2lPbHdpTUZ3…", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/reddit/subreddit/search": { "get": { "tags": [ "Reddit" ], "summary": "Posts in one community matching a query, about 7 a page.", "description": "With their scores and comment counts. 1 credit a page.", "operationId": "redditSubredditSearch", "parameters": [ { "name": "name", "in": "query", "description": "The community's name, with or without `r/`.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "Its link, instead of `name`.", "required": false, "schema": { "type": "string" } }, { "name": "query", "in": "query", "description": "What to search for.", "required": true, "schema": { "type": "string" } }, { "name": "sort", "in": "query", "description": "`relevance` (the default), `hot`, `top`, `new` or `comments`.", "required": false, "schema": { "type": "string", "description": "The order of search results.", "enum": [ "relevance", "hot", "top", "new", "comments" ] } }, { "name": "time", "in": "query", "description": "`hour`, `day`, `week`, `month`, `year` or `all` (the default).", "required": false, "schema": { "type": "string", "description": "How far back `top` and `controversial` look.", "enum": [ "hour", "day", "week", "month", "year", "all" ] } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_RedditPost" }, "example": { "data": [ { "id": "ue7pc", "url": "https://www.reddit.com/r/Coffee/comments/ue7pc/wife_trying_espresso_for_the_first_time/", "text": null, "createdAt": "2012-05-31T18:09:05.636Z", "author": { "id": "4ospk", "username": "snick88", "displayName": null, "avatarUrl": null, "verified": false, "url": "https://www.reddit.com/user/snick88/" }, "stats": { "views": null, "likes": 614, "comments": 107, "shares": null, "saves": null, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "title": "Wife trying espresso for the first time", "kind": "text", "subreddit": "Coffee", "score": 614, "upvoteRatio": null, "link": null, "domain": null, "flair": null, "nsfw": false, "spoiler": false, "locked": false, "stickied": false, "crossposts": null, "crosspostOf": null, "awards": null, "editedAt": null, "snippet": null } }, { "id": "zft81c", "url": "https://www.reddit.com/r/Coffee/comments/zft81c/unpopular_opinion_espresso_is_overrated_and_it_is/", "text": null, "createdAt": "2022-12-08T08:24:30.471Z", "author": { "id": "a2u1qsx7", "username": "ee_72020", "displayName": null, "avatarUrl": null, "verified": false, "url": "https://www.reddit.com/user/ee_72020/" }, "stats": { "views": null, "likes": 24, "comments": 55, "shares": null, "saves": null, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "title": "Unpopular opinion: espresso is overrated and it is absolutely the worst way to brew light and medium roasts", "kind": "text", "subreddit": "Coffee", "score": 24, "upvoteRatio": null, "link": null, "domain": null, "flair": null, "nsfw": false, "spoiler": false, "locked": false, "stickied": false, "crossposts": null, "crosspostOf": null, "awards": null, "editedAt": null, "snippet": null } } ], "pagination": { "nextCursor": "L3N2Yy9zaHJlZGRpdC9yL0NvZmZlZS9zZWFyY2gvP3E9ZXNwcmVzc28mdHlwZT1wb3N0cyZzb3J0PXJlbGV2YW5jZSZ0PWFsbCZjdXJzb3I9ZXlKallXNWthV1JoZEdWelgzSmxkSFZ5Ym1Wa0lqb2llMXdpYzJWamRHbHZibDh4WDNCcGNHVnNhVzVsWHpCZloyeHZZbUZzWDIxdlpHbG1hV1Z5YzF3aU9sd2lNVndpTEZ3aWMyVmpkR2x2Ymw4eFgzQnBjR1ZzYVc1bFh6RmZiRzlqWVd4ZmJXOWthV1pwWlhKelhDSTZYQ0l5WENJc1hDSnpaV04wYVc5dVh6SmZjR2x3Wld4cGJtVmZOMTl6WTI5d1pWOXpkMmwwWTJobGNsd2lPbHdpTUZ3…", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.reddit.subredditSearch({ name: \"Coffee\", query: \"espresso\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.reddit.subreddit_search(name=\"Coffee\", query=\"espresso\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/reddit/subreddit/search \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"name=Coffee\" \\\n --data-urlencode \"query=espresso\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_RedditPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/RedditPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "RedditPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "title", "kind", "nsfw", "spoiler", "locked", "stickied" ], "properties": { "awards": { "type": [ "integer", "null" ], "format": "int64", "description": "Awards it was given.", "minimum": 0 }, "crosspostOf": { "oneOf": [ { "$ref": "#/components/schemas/RedditPostRef", "description": "The post it shares, when it is a crosspost." }, { "type": "null" } ] }, "crossposts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "domain": { "type": [ "string", "null" ] }, "editedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "When it was last edited." }, { "type": "null" } ] }, "flair": { "type": [ "string", "null" ] }, "kind": { "$ref": "#/components/schemas/RedditPostKind" }, "link": { "type": [ "string", "null" ], "description": "The link it shares, and its site." }, "locked": { "type": "boolean", "description": "Closed to new comments." }, "nsfw": { "type": "boolean", "description": "Not safe for work." }, "score": { "type": [ "integer", "null" ], "format": "int64", "description": "Upvotes less downvotes (`stats.likes` is the same figure)." }, "snippet": { "type": [ "string", "null" ], "description": "What a search matched in it (a comment's words), on search results." }, "spoiler": { "type": "boolean" }, "stickied": { "type": "boolean", "description": "Pinned to the top of its community." }, "subreddit": { "type": [ "string", "null" ], "description": "The community, without `r/`." }, "title": { "type": "string" }, "upvoteRatio": { "type": [ "number", "null" ], "format": "double", "description": "The share of votes that are upvotes, 0 to 1." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A post: text, a link, an image, a gallery, a video or a poll." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "RedditPostKind": { "type": "string", "description": "What a post is.", "enum": [ "text", "link", "image", "gallery", "video", "poll" ] }, "Timestamp": { "type": "string", "format": "date-time" }, "RedditPostRef": { "type": "object", "description": "The post a crosspost shares.", "required": [ "id" ], "properties": { "id": { "type": "string" }, "subreddit": { "type": [ "string", "null" ] }, "title": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] } } }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Subreddit (/docs/api-reference/reddit/subreddit) A community with its members, rules and weekly visitors. `GET https://api.socialapi.sh/v1/reddit/subreddit` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.reddit.subreddit({ name: "AskReddit" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.reddit.subreddit(name="AskReddit").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/reddit/subreddit \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "name=AskReddit" ``` **Response** ```json { "data": { "id": "2qh1i", "name": "AskReddit", "title": "Ask Reddit...", "description": "r/AskReddit is the place to ask and answer thought-provoking questions.", "url": "https://www.reddit.com/r/AskReddit/", "iconUrl": "https://styles.redditmedia.com/t5_2qh1i/styles/communityIcon_p6kb2m6b185b1.png?width=256&s=c28b9f038c305e139b62739f2133d7b776582696", "bannerUrl": "https://styles.redditmedia.com/t5_2qh1i/styles/bannerBackgroundImage_fs33xogq946f1.png?width=4000&s=460f7387ea96fb4707fad8acaa81643df40f19a9", "subscribers": 60238961, "weeklyVisitors": 13756269, "weeklyContributions": 1050330, "createdAt": "2008-01-25T03:52:15.000Z", "kind": "public", "nsfw": false, "language": "es", "category": "Lifestyles", "rules": [ { "title": "Rule 1 - Questions must be clear and direct and may not use the body textbox", "description": "* All questions must be clear, written in English, and conclude with a question mark\n* All context in the title must be ***necessary to understanding the question***; do not give “example answers” in the post title (i.e. “Other than your mom, \\_\\_\\_\\_\\_\\_?”)\n* No text in the text box - any additional info from you must be added as a comment to your post\n\n[The full rule can be viewed here](https://…", "appliesTo": "link" }, { "title": "Rule 2 - No personal or professional advice requests", "description": "* Askreddit is NOT your personal or professional advice platform\n\n* Do not makes posts asking for professional advice - medical, legal, financial, or otherwise\n\n* All posts asking for advice must be generic and not specific to your situation alone\n\n* Do not use first person pronouns\n\n* No crowdsourcing naming or purchasing decisions\n\n[The full rule can be viewed here](https://www.reddit.com/r/AskR…", "appliesTo": "link" }, { "title": "Rule 3 - Open ended questions only", "description": "* Post must be an open-ended discussion question\n\n* Title must not be phrased to allow a simple yes/no answer\n\n* No questions that have definite answers\n\n* Question must not be a poll or survey\n\n* No “Either/Or” type questions\n\n* Do not ask for NSFW links\n\n* Do not specify a length (eg \"in three words...\") or make your post into a game\n\n[The full rule can be viewed here](https://www.reddit.com/r/A…", "appliesTo": "link" } ] } } ``` **OpenAPI** ```json { "paths": { "/v1/reddit/subreddit": { "get": { "tags": [ "Reddit" ], "summary": "A community with its members, rules and weekly visitors.", "description": "Title, description, members, visitors and contributions over the last week, when it was\nmade, its type, language and rules. 1 credit.", "operationId": "redditSubreddit", "parameters": [ { "name": "name", "in": "query", "description": "The community's name, with or without `r/`.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "Its link (`https://www.reddit.com/r/AskReddit/`), instead of `name`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_RedditSubreddit" }, "example": { "data": { "id": "2qh1i", "name": "AskReddit", "title": "Ask Reddit...", "description": "r/AskReddit is the place to ask and answer thought-provoking questions.", "url": "https://www.reddit.com/r/AskReddit/", "iconUrl": "https://styles.redditmedia.com/t5_2qh1i/styles/communityIcon_p6kb2m6b185b1.png?width=256&s=c28b9f038c305e139b62739f2133d7b776582696", "bannerUrl": "https://styles.redditmedia.com/t5_2qh1i/styles/bannerBackgroundImage_fs33xogq946f1.png?width=4000&s=460f7387ea96fb4707fad8acaa81643df40f19a9", "subscribers": 60238961, "weeklyVisitors": 13756269, "weeklyContributions": 1050330, "createdAt": "2008-01-25T03:52:15.000Z", "kind": "public", "nsfw": false, "language": "es", "category": "Lifestyles", "rules": [ { "title": "Rule 1 - Questions must be clear and direct and may not use the body textbox", "description": "* All questions must be clear, written in English, and conclude with a question mark\n* All context in the title must be ***necessary to understanding the question***; do not give “example answers” in the post title (i.e. “Other than your mom, \\_\\_\\_\\_\\_\\_?”)\n* No text in the text box - any additional info from you must be added as a comment to your post\n\n[The full rule can be viewed here](https://…", "appliesTo": "link" }, { "title": "Rule 2 - No personal or professional advice requests", "description": "* Askreddit is NOT your personal or professional advice platform\n\n* Do not makes posts asking for professional advice - medical, legal, financial, or otherwise\n\n* All posts asking for advice must be generic and not specific to your situation alone\n\n* Do not use first person pronouns\n\n* No crowdsourcing naming or purchasing decisions\n\n[The full rule can be viewed here](https://www.reddit.com/r/AskR…", "appliesTo": "link" }, { "title": "Rule 3 - Open ended questions only", "description": "* Post must be an open-ended discussion question\n\n* Title must not be phrased to allow a simple yes/no answer\n\n* No questions that have definite answers\n\n* Question must not be a poll or survey\n\n* No “Either/Or” type questions\n\n* Do not ask for NSFW links\n\n* Do not specify a length (eg \"in three words...\") or make your post into a game\n\n[The full rule can be viewed here](https://www.reddit.com/r/A…", "appliesTo": "link" } ] } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.reddit.subreddit({ name: \"AskReddit\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.reddit.subreddit(name=\"AskReddit\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/reddit/subreddit \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"name=AskReddit\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_RedditSubreddit": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/RedditSubreddit" } } }, "RedditSubreddit": { "type": "object", "description": "A community (a subreddit).", "required": [ "id", "name", "url", "nsfw", "rules" ], "properties": { "bannerUrl": { "type": [ "string", "null" ] }, "category": { "type": [ "string", "null" ], "description": "Reddit's category for advertisers." }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "description": { "type": [ "string", "null" ] }, "iconUrl": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "kind": { "type": [ "string", "null" ], "description": "`public`, `restricted` (anyone reads, approved people post) or another of Reddit's." }, "language": { "type": [ "string", "null" ], "description": "Its language, as it states it." }, "name": { "type": "string", "description": "Its name, without `r/`." }, "nsfw": { "type": "boolean" }, "rules": { "type": "array", "items": { "$ref": "#/components/schemas/RedditRule" }, "description": "Its rules (on `/subreddit` only)." }, "subscribers": { "type": [ "integer", "null" ], "format": "int64", "description": "Members.", "minimum": 0 }, "title": { "type": [ "string", "null" ] }, "url": { "type": "string" }, "weeklyContributions": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "weeklyVisitors": { "type": [ "integer", "null" ], "format": "int64", "description": "Visitors and contributions over the last week (on `/subreddit` only).", "minimum": 0 } } }, "RedditRule": { "type": "object", "description": "A community's rule.", "required": [ "title" ], "properties": { "appliesTo": { "type": [ "string", "null" ], "description": "What it applies to: `link` (posts), `comment` or `all`." }, "description": { "type": [ "string", "null" ] }, "title": { "type": "string" } } }, "Timestamp": { "type": "string", "format": "date-time" } } } } ``` # Trending Searches (/docs/api-reference/reddit/trending-searches) The searches Reddit shows as trending now. `GET https://api.socialapi.sh/v1/reddit/trending/searches` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.reddit.trendingSearches(); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.reddit.trending_searches() ``` **cURL** ```bash curl https://api.socialapi.sh/v1/reddit/trending/searches \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" ``` **Response** ```json { "data": [ { "text": "Don Toliver NITROUS Release December 4" }, { "text": "Lee Fryer Denies Rape Charges" } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/reddit/trending/searches": { "get": { "tags": [ "Reddit" ], "summary": "The searches Reddit shows as trending now.", "description": "About 5, as its search box lists them. 1 credit.", "operationId": "redditTrendingSearches", "parameters": [ { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_Suggestion" }, "example": { "data": [ { "text": "Don Toliver NITROUS Release December 4" }, { "text": "Lee Fryer Denies Rape Charges" } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.reddit.trendingSearches();" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.reddit.trending_searches()" }, { "lang": "bash", "label": "cURL", "source": "curl https://api.socialapi.sh/v1/reddit/trending/searches \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_Suggestion": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Suggestion" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "Suggestion": { "type": "object", "description": "A search suggestion.", "required": [ "text" ], "properties": { "text": { "type": "string" } } } } } } ``` # Trending (/docs/api-reference/reddit/trending) What is hot on Reddit now, 25 a page. `GET https://api.socialapi.sh/v1/reddit/trending` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.reddit.trending(); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.reddit.trending() ``` **cURL** ```bash curl https://api.socialapi.sh/v1/reddit/trending \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" ``` **Response** ```json { "data": [ { "id": "1y534j8", "url": "https://www.reddit.com/r/unitedkingdom/comments/1y534j8/cornwall_christmas_market_cancels_all_bookings/", "text": null, "createdAt": "2026-11-25T09:28:20.000Z", "author": { "id": "5cznv", "username": "pajamakitten", "displayName": null, "avatarUrl": null, "verified": false, "url": "https://www.reddit.com/user/pajamakitten/" }, "stats": { "views": null, "likes": 596, "comments": 183, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://external-preview.redd.it/Co7XrLvEAeTz__51JqWHKQUHdMyolbOXyDx48FweNqQ.png?auto=webp&s=ebb84473caccafe5114465e1a65b4398d3dbf2b2", "thumbnailUrl": null, "width": 1200, "height": 675, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "title": "Cornwall Christmas market cancels all bookings after AI backlash", "kind": "link", "subreddit": "unitedkingdom", "score": 596, "upvoteRatio": 0.98, "link": "https://www.bbc.co.uk/news/articles/cm0qjglj3ejlo", "domain": "bbc.co.uk", "flair": null, "nsfw": false, "spoiler": false, "locked": false, "stickied": false, "crossposts": 1, "crosspostOf": null, "awards": 0, "editedAt": null, "snippet": null } }, { "id": "1y511s7", "url": "https://www.reddit.com/r/unitedkingdom/comments/1y511s7/household_energy_prices_to_rise_by_26_in_january/", "text": null, "createdAt": "2026-11-25T07:13:00.000Z", "author": { "id": "2mnppr3vuu", "username": "AgilityEnjoyer", "displayName": null, "avatarUrl": null, "verified": false, "url": "https://www.reddit.com/user/AgilityEnjoyer/" }, "stats": { "views": null, "likes": 313, "comments": 467, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://external-preview.redd.it/AKWiBRYqYi8iTfHMCP2eajM74YHmdo-dfxUYCyZ2SvU.jpeg?auto=webp&s=38c353e888ba6fed9d588917d6abb8c34fed195c", "thumbnailUrl": null, "width": 1200, "height": 675, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "title": "Household energy prices to rise by 26% in January as new price cap confirmed", "kind": "link", "subreddit": "unitedkingdom", "score": 313, "upvoteRatio": 0.94, "link": "https://www.bbc.co.uk/news/articles/cm20qnq33e90o", "domain": "bbc.co.uk", "flair": null, "nsfw": false, "spoiler": false, "locked": false, "stickied": false, "crossposts": 0, "crosspostOf": null, "awards": 0, "editedAt": null, "snippet": null } } ], "pagination": { "nextCursor": "t3_1y509bk", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/reddit/trending": { "get": { "tags": [ "Reddit" ], "summary": "What is hot on Reddit now, 25 a page.", "description": "The posts of `r/popular`, with their scores and media. 1 credit a page.", "operationId": "redditTrending", "parameters": [ { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_RedditPost" }, "example": { "data": [ { "id": "1y534j8", "url": "https://www.reddit.com/r/unitedkingdom/comments/1y534j8/cornwall_christmas_market_cancels_all_bookings/", "text": null, "createdAt": "2026-11-25T09:28:20.000Z", "author": { "id": "5cznv", "username": "pajamakitten", "displayName": null, "avatarUrl": null, "verified": false, "url": "https://www.reddit.com/user/pajamakitten/" }, "stats": { "views": null, "likes": 596, "comments": 183, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://external-preview.redd.it/Co7XrLvEAeTz__51JqWHKQUHdMyolbOXyDx48FweNqQ.png?auto=webp&s=ebb84473caccafe5114465e1a65b4398d3dbf2b2", "thumbnailUrl": null, "width": 1200, "height": 675, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "title": "Cornwall Christmas market cancels all bookings after AI backlash", "kind": "link", "subreddit": "unitedkingdom", "score": 596, "upvoteRatio": 0.98, "link": "https://www.bbc.co.uk/news/articles/cm0qjglj3ejlo", "domain": "bbc.co.uk", "flair": null, "nsfw": false, "spoiler": false, "locked": false, "stickied": false, "crossposts": 1, "crosspostOf": null, "awards": 0, "editedAt": null, "snippet": null } }, { "id": "1y511s7", "url": "https://www.reddit.com/r/unitedkingdom/comments/1y511s7/household_energy_prices_to_rise_by_26_in_january/", "text": null, "createdAt": "2026-11-25T07:13:00.000Z", "author": { "id": "2mnppr3vuu", "username": "AgilityEnjoyer", "displayName": null, "avatarUrl": null, "verified": false, "url": "https://www.reddit.com/user/AgilityEnjoyer/" }, "stats": { "views": null, "likes": 313, "comments": 467, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://external-preview.redd.it/AKWiBRYqYi8iTfHMCP2eajM74YHmdo-dfxUYCyZ2SvU.jpeg?auto=webp&s=38c353e888ba6fed9d588917d6abb8c34fed195c", "thumbnailUrl": null, "width": 1200, "height": 675, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "title": "Household energy prices to rise by 26% in January as new price cap confirmed", "kind": "link", "subreddit": "unitedkingdom", "score": 313, "upvoteRatio": 0.94, "link": "https://www.bbc.co.uk/news/articles/cm20qnq33e90o", "domain": "bbc.co.uk", "flair": null, "nsfw": false, "spoiler": false, "locked": false, "stickied": false, "crossposts": 0, "crosspostOf": null, "awards": 0, "editedAt": null, "snippet": null } } ], "pagination": { "nextCursor": "t3_1y509bk", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.reddit.trending();" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.reddit.trending()" }, { "lang": "bash", "label": "cURL", "source": "curl https://api.socialapi.sh/v1/reddit/trending \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_RedditPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/RedditPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "RedditPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "title", "kind", "nsfw", "spoiler", "locked", "stickied" ], "properties": { "awards": { "type": [ "integer", "null" ], "format": "int64", "description": "Awards it was given.", "minimum": 0 }, "crosspostOf": { "oneOf": [ { "$ref": "#/components/schemas/RedditPostRef", "description": "The post it shares, when it is a crosspost." }, { "type": "null" } ] }, "crossposts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "domain": { "type": [ "string", "null" ] }, "editedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "When it was last edited." }, { "type": "null" } ] }, "flair": { "type": [ "string", "null" ] }, "kind": { "$ref": "#/components/schemas/RedditPostKind" }, "link": { "type": [ "string", "null" ], "description": "The link it shares, and its site." }, "locked": { "type": "boolean", "description": "Closed to new comments." }, "nsfw": { "type": "boolean", "description": "Not safe for work." }, "score": { "type": [ "integer", "null" ], "format": "int64", "description": "Upvotes less downvotes (`stats.likes` is the same figure)." }, "snippet": { "type": [ "string", "null" ], "description": "What a search matched in it (a comment's words), on search results." }, "spoiler": { "type": "boolean" }, "stickied": { "type": "boolean", "description": "Pinned to the top of its community." }, "subreddit": { "type": [ "string", "null" ], "description": "The community, without `r/`." }, "title": { "type": "string" }, "upvoteRatio": { "type": [ "number", "null" ], "format": "double", "description": "The share of votes that are upvotes, 0 to 1." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A post: text, a link, an image, a gallery, a video or a poll." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "RedditPostKind": { "type": "string", "description": "What a post is.", "enum": [ "text", "link", "image", "gallery", "video", "poll" ] }, "Timestamp": { "type": "string", "format": "date-time" }, "RedditPostRef": { "type": "object", "description": "The post a crosspost shares.", "required": [ "id" ], "properties": { "id": { "type": "string" }, "subreddit": { "type": [ "string", "null" ] }, "title": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] } } }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Telegram API (/docs/api-reference/telegram) Every Telegram endpoint, by group. Each is a `GET` under `/v1/telegram`. ## Quick Reference [#quick-reference] | Property | Value | | --- | --- | | Base path | `/v1/telegram` | | Endpoints | 6 | | Credits | 1 a call | | Guide | [Telegram](/docs/telegram) | ## Accounts [#accounts] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/telegram/profile`](/docs/api-reference/telegram/profile) | A channel, group, account or bot with its counts. | 1 | | [`GET /v1/telegram/profile/posts`](/docs/api-reference/telegram/profile-posts) | A channel's posts, newest first. | 1 | | [`GET /v1/telegram/profile/search`](/docs/api-reference/telegram/profile-search) | A search inside a channel, newest first. | 1 | | [`GET /v1/telegram/invite`](/docs/api-reference/telegram/invite) | What an invite link opens. | 1 | ## Posts [#posts] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/telegram/post`](/docs/api-reference/telegram/post) | One channel post or group message. | 1 | | [`GET /v1/telegram/post/comments`](/docs/api-reference/telegram/post-comments) | A post's comments, newest first. | 1 | ## Example Request [#example-request] Every Telegram endpoint is called this way: its path, and what to read as query parameters. **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.telegram.profile({ handle: "durov" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.telegram.profile(handle="durov").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/telegram/profile \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=durov" ``` **Response** ```json { "data": { "id": "durov", "username": "durov", "displayName": "Pavel Durov", "bio": "Founder/CEO/Owner of Telegram.\n\nFounder of TON/Gram.\n\nHalf-part troll.", "avatarUrl": "https://cdn4.telesco.pe/file/hP1ROci3RQKSNiu0EqKtHT5U_iI_Jm-E7UrJ9lbUzyu6QI_qMAaKFwsVjzz49Sdy_ZR-18Ft4p7oI__K_XxnxDuQg_nn2dDVt4LT7kqv93S7jMBPAcoh_jubhlQGSekmhXOaYWT-Y6n3ZFghrHSd0ACzcmJb4lreWP4RvCfBKWRK2ivBsagTBrZe4lrXobwh4Ukti7XlIoRQduwiGjHrQoW0TRpcvKq3KINvKqmKvAmiAlWb-072JjjclzFbFL9otA3RHqetfL3fHXLTUWwp3yFy4zhTQezX_iYheYVQ3RqiV8JyGB9pPmjh7EmwJxyJ_BDy3pZCVZA4U21uBq8mbw.jpg", "url": "https://t.me/durov", "verified": true, "private": false, "followers": 9853398, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": null, "ext": { "kind": "channel", "online": null, "monthlyUsers": null, "channelId": "1006503122", "photos": 106, "videos": 47, "files": null, "links": 204, "previewable": true } } } ``` ## Errors [#errors] A call that fails costs nothing. See [Errors](/docs/errors) for every code. # Invite (/docs/api-reference/telegram/invite) What an invite link opens. `GET https://api.socialapi.sh/v1/telegram/invite` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.telegram.invite({ url: "https://t.me/+7UP-kIAXiZ9lOWJi" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.telegram.invite(url="https://t.me/+7UP-kIAXiZ9lOWJi").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/telegram/invite \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://t.me/+7UP-kIAXiZ9lOWJi" ``` **Response** ```json { "data": { "code": "7UP-kIAXiZ9lOWJi", "url": "https://t.me/+7UP-kIAXiZ9lOWJi", "kind": "channel", "title": "Mash Money", "description": "Деньги любят тишину. А мы нет\n\nРекламные вопросики: @advert_newsmedia\nЧат с привкусом золота: @mash_money_mash\n\nРегистрация в перечне РКН: https://www.gosuslugi.ru/snet/69f2107023d658df75abd6ec", "avatarUrl": "https://cdn4.telesco.pe/file/WUtT_15DfMIny9LT2LRTiT2fJ-rsO70mqbLcwQhVXs_NElDa1JixSWspwvrYXxWcbjYYfdw-6--pzLXZnXoG2ZwA6hhjUAt5fWKw2CQKKPJrZhmoWrF3-7dRRIHEH3UpmVgVdH0HC3_-1EVLdZoDbwrDBU3EoeyKZim7fr_O66t5g8qy0edIBKj0TyXdQADp6iNpIVDiX2_x_UdWNj0gE3rPP1aEJuze3Rlu0WB-KFQv4k33oJjJn1wz4ouYV3pwGdl8I2-XToXjYQlUoagLajZ2pkM9Y2HJiTXS1lNfjONS_LcIjjh5jn5GWMLnDd9_q_ucGi-0yzlY-rK_XIx88Q.jpg", "verified": false, "members": 21751, "online": null } } ``` **OpenAPI** ```json { "paths": { "/v1/telegram/invite": { "get": { "tags": [ "Telegram" ], "summary": "What an invite link opens.", "description": "The private channel or group a `t.me/+…` link opens: its title, description, picture,\ncheckmark, and its subscribers or members. Its posts are for its members. 1 credit.", "operationId": "telegramInvite", "parameters": [ { "name": "url", "in": "query", "description": "The invite's link (`https://t.me/+7UP-kIAXiZ9lOWJi`).", "required": false, "schema": { "type": "string" } }, { "name": "code", "in": "query", "description": "What the link ends with (`7UP-kIAXiZ9lOWJi`), instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_TelegramInvite" }, "example": { "data": { "code": "7UP-kIAXiZ9lOWJi", "url": "https://t.me/+7UP-kIAXiZ9lOWJi", "kind": "channel", "title": "Mash Money", "description": "Деньги любят тишину. А мы нет\n\nРекламные вопросики: @advert_newsmedia\nЧат с привкусом золота: @mash_money_mash\n\nРегистрация в перечне РКН: https://www.gosuslugi.ru/snet/69f2107023d658df75abd6ec", "avatarUrl": "https://cdn4.telesco.pe/file/WUtT_15DfMIny9LT2LRTiT2fJ-rsO70mqbLcwQhVXs_NElDa1JixSWspwvrYXxWcbjYYfdw-6--pzLXZnXoG2ZwA6hhjUAt5fWKw2CQKKPJrZhmoWrF3-7dRRIHEH3UpmVgVdH0HC3_-1EVLdZoDbwrDBU3EoeyKZim7fr_O66t5g8qy0edIBKj0TyXdQADp6iNpIVDiX2_x_UdWNj0gE3rPP1aEJuze3Rlu0WB-KFQv4k33oJjJn1wz4ouYV3pwGdl8I2-XToXjYQlUoagLajZ2pkM9Y2HJiTXS1lNfjONS_LcIjjh5jn5GWMLnDd9_q_ucGi-0yzlY-rK_XIx88Q.jpg", "verified": false, "members": 21751, "online": null } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.telegram.invite({ url: \"https://t.me/+7UP-kIAXiZ9lOWJi\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.telegram.invite(url=\"https://t.me/+7UP-kIAXiZ9lOWJi\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/telegram/invite \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://t.me/+7UP-kIAXiZ9lOWJi\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_TelegramInvite": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/TelegramInvite" } } }, "TelegramInvite": { "type": "object", "description": "What an invite opens: a private channel or group, as its invite's page shows it.", "required": [ "code", "url", "kind", "title", "verified" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "code": { "type": "string" }, "description": { "type": [ "string", "null" ] }, "kind": { "$ref": "#/components/schemas/TelegramKind", "description": "`channel` or `group`." }, "members": { "type": [ "integer", "null" ], "format": "int64", "description": "Its subscribers or members.", "minimum": 0 }, "online": { "type": [ "integer", "null" ], "format": "int64", "description": "A group's members online now.", "minimum": 0 }, "title": { "type": "string" }, "url": { "type": "string" }, "verified": { "type": "boolean" } } }, "TelegramKind": { "type": "string", "description": "What a name is.", "enum": [ "channel", "group", "user", "bot" ] } } } } ``` # Post Comments (/docs/api-reference/telegram/post-comments) A post's comments, newest first. `GET https://api.socialapi.sh/v1/telegram/post/comments` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.telegram.postComments({ url: "https://t.me/tginfo/4448" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.telegram.post_comments(url="https://t.me/tginfo/4448") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/telegram/post/comments \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://t.me/tginfo/4448" ``` **Response** ```json { "data": [ { "id": "1838819", "postId": "tginfo/4448", "parentId": null, "text": "Интересно, сколько еще RCE эксплоитов для tg должно быть опубликовано (их уже в первые дни несколько), чтобы дали возможность эту олимпиадо-генераторную баг машину отключить хотя бы через дебаг?", "createdAt": "2026-11-13T15:39:11.000Z", "author": { "id": "JohnDoeInitiative", "username": "JohnDoeInitiative", "displayName": "John Doe", "avatarUrl": "https://cdn4.telesco.pe/file/hgt-r-snIdskOlR5DNuXmhp9Emoy97n-UOWKVAUj0OUdCFyosu_O_gEgqJ7gwHlwlV0Y2k4wedyKgvjRTW6h7WtTw3wsVgCZqmMcyeKPfsBNfhCoTS2wsayBSHxdtQq-qrCFVXh1xe566ZQA1K8Op00zqpdGV0YVwDR52E_2WVWRaqgMC8YyNICrMfeyIkBlslXZ438fJEW47hCWscsxlbSyRe9c3TXrC_BkCgkNuDpFSK1egWQcmYHJ5x2yiSgrYrjDhcgryKnmdFngKFyC5x-wmuIbtJ8GOBeu2KoShr4g9-YIHmM_94QFdavWtD2QtdkjWNaXvGnbJhliQ5JVcA.jpg", "verified": false, "url": "https://t.me/JohnDoeInitiative" }, "likes": null, "replies": null, "ext": { "url": "https://t.me/tginfo/4448?comment=1838819", "authorName": "John Doe", "media": [], "reactions": [], "edited": true } }, { "id": "1838795", "postId": "tginfo/4448", "parentId": null, "text": "Ну что, с первыми эксплоитами...", "createdAt": "2026-11-12T16:41:15.000Z", "author": { "id": "JohnDoeInitiative", "username": "JohnDoeInitiative", "displayName": "John Doe", "avatarUrl": "https://cdn4.telesco.pe/file/hgt-r-snIdskOlR5DNuXmhp9Emoy97n-UOWKVAUj0OUdCFyosu_O_gEgqJ7gwHlwlV0Y2k4wedyKgvjRTW6h7WtTw3wsVgCZqmMcyeKPfsBNfhCoTS2wsayBSHxdtQq-qrCFVXh1xe566ZQA1K8Op00zqpdGV0YVwDR52E_2WVWRaqgMC8YyNICrMfeyIkBlslXZ438fJEW47hCWscsxlbSyRe9c3TXrC_BkCgkNuDpFSK1egWQcmYHJ5x2yiSgrYrjDhcgryKnmdFngKFyC5x-wmuIbtJ8GOBeu2KoShr4g9-YIHmM_94QFdavWtD2QtdkjWNaXvGnbJhliQ5JVcA.jpg", "verified": false, "url": "https://t.me/JohnDoeInitiative" }, "likes": null, "replies": null, "ext": { "url": "https://t.me/tginfo/4448?comment=1838795", "authorName": "John Doe", "media": [], "reactions": [], "edited": false } } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/telegram/post/comments": { "get": { "tags": [ "Telegram" ], "summary": "A post's comments, newest first.", "description": "A channel post's comments (its linked group's replies), or the thread a group message\nis in: the newest 100, then 50 a page, each with its sender, media and reactions, and\nthe comment it answers (`parentId`). A post without comments answers an empty list.\n1 credit a page.", "operationId": "telegramPostComments", "parameters": [ { "name": "url", "in": "query", "description": "The message's link (`https://t.me/durov/574`).", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The message as its chat's name and number (`durov/574`), instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_TelegramComment" }, "example": { "data": [ { "id": "1838819", "postId": "tginfo/4448", "parentId": null, "text": "Интересно, сколько еще RCE эксплоитов для tg должно быть опубликовано (их уже в первые дни несколько), чтобы дали возможность эту олимпиадо-генераторную баг машину отключить хотя бы через дебаг?", "createdAt": "2026-11-13T15:39:11.000Z", "author": { "id": "JohnDoeInitiative", "username": "JohnDoeInitiative", "displayName": "John Doe", "avatarUrl": "https://cdn4.telesco.pe/file/hgt-r-snIdskOlR5DNuXmhp9Emoy97n-UOWKVAUj0OUdCFyosu_O_gEgqJ7gwHlwlV0Y2k4wedyKgvjRTW6h7WtTw3wsVgCZqmMcyeKPfsBNfhCoTS2wsayBSHxdtQq-qrCFVXh1xe566ZQA1K8Op00zqpdGV0YVwDR52E_2WVWRaqgMC8YyNICrMfeyIkBlslXZ438fJEW47hCWscsxlbSyRe9c3TXrC_BkCgkNuDpFSK1egWQcmYHJ5x2yiSgrYrjDhcgryKnmdFngKFyC5x-wmuIbtJ8GOBeu2KoShr4g9-YIHmM_94QFdavWtD2QtdkjWNaXvGnbJhliQ5JVcA.jpg", "verified": false, "url": "https://t.me/JohnDoeInitiative" }, "likes": null, "replies": null, "ext": { "url": "https://t.me/tginfo/4448?comment=1838819", "authorName": "John Doe", "media": [], "reactions": [], "edited": true } }, { "id": "1838795", "postId": "tginfo/4448", "parentId": null, "text": "Ну что, с первыми эксплоитами...", "createdAt": "2026-11-12T16:41:15.000Z", "author": { "id": "JohnDoeInitiative", "username": "JohnDoeInitiative", "displayName": "John Doe", "avatarUrl": "https://cdn4.telesco.pe/file/hgt-r-snIdskOlR5DNuXmhp9Emoy97n-UOWKVAUj0OUdCFyosu_O_gEgqJ7gwHlwlV0Y2k4wedyKgvjRTW6h7WtTw3wsVgCZqmMcyeKPfsBNfhCoTS2wsayBSHxdtQq-qrCFVXh1xe566ZQA1K8Op00zqpdGV0YVwDR52E_2WVWRaqgMC8YyNICrMfeyIkBlslXZ438fJEW47hCWscsxlbSyRe9c3TXrC_BkCgkNuDpFSK1egWQcmYHJ5x2yiSgrYrjDhcgryKnmdFngKFyC5x-wmuIbtJ8GOBeu2KoShr4g9-YIHmM_94QFdavWtD2QtdkjWNaXvGnbJhliQ5JVcA.jpg", "verified": false, "url": "https://t.me/JohnDoeInitiative" }, "likes": null, "replies": null, "ext": { "url": "https://t.me/tginfo/4448?comment=1838795", "authorName": "John Doe", "media": [], "reactions": [], "edited": false } } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.telegram.postComments({ url: \"https://t.me/tginfo/4448\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.telegram.post_comments(url=\"https://t.me/tginfo/4448\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/telegram/post/comments \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://t.me/tginfo/4448\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_TelegramComment": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/TelegramComment" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "TelegramComment": { "allOf": [ { "type": "object", "description": "A comment or a reply.", "required": [ "id", "postId", "text", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "url", "media", "reactions", "edited" ], "properties": { "authorName": { "type": [ "string", "null" ], "description": "Its author's name as shown (one without a public name has no `author`, only this)." }, "edited": { "type": "boolean" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "reactions": { "type": "array", "items": { "$ref": "#/components/schemas/TelegramReaction" } }, "url": { "type": "string", "description": "The comment's own link." } } }, { "type": "object", "description": "What only this platform has." } ] }, "id": { "type": "string" }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "parentId": { "type": [ "string", "null" ], "description": "The comment this replies to; absent on a top-level comment." }, "postId": { "type": "string" }, "replies": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "text": { "type": "string" } } }, { "type": "object", "description": "A comment on a channel post, or a reply to a group message." } ] }, "TelegramReaction": { "type": "object", "description": "An emoji reaction, and how many gave it (rounded past 1,000).", "required": [ "count" ], "properties": { "count": { "type": "integer", "format": "int64", "minimum": 0 }, "customEmojiId": { "type": [ "string", "null" ], "description": "A custom emoji's id, when it is one." }, "emoji": { "type": [ "string", "null" ], "description": "The emoji, when it is a standard one Telegram draws." } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Post (/docs/api-reference/telegram/post) One channel post or group message. `GET https://api.socialapi.sh/v1/telegram/post` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.telegram.post({ url: "https://t.me/durov/574" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.telegram.post(url="https://t.me/durov/574").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/telegram/post \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://t.me/durov/574" ``` **Response** ```json { "data": { "id": "durov/574", "url": "https://t.me/durov/574", "text": "Telegram gifts are the only NFTs still alive.\n\n📈 They are up 2.5x since issuance 1–2 years ago, despite crypto winter.\n\nThis week, P2P gift trading on Telegram moved on-chain:\n\n— Sales & offers run on smart contracts.\n\n— Grams go instantly to sellers' wallets.\n\n— Fees cut from 10% to 2% 🎉", "createdAt": "2026-11-26T15:26:13.000Z", "author": { "id": "durov", "username": "durov", "displayName": "Pavel Durov", "avatarUrl": "https://cdn4.telesco.pe/file/W46-gekaU28l8Ss0QXl0rJ56iEci59GbWVgLp3H4YcQL7g-L8989ny1R95iP6y0sbrQ4qb-Jmohxw0B3uuDhxWSXeZlFYStrC--ZXpepobwj_dAqWbUtIRoPTJcbFM5u66xKGj2HmEABlgmA52CKBWGDv8GgxGHohqghyMvG5qTLJL2WyKDibOgNXQad6PwMbQZ7Vbsrq2-eh6kOPMu0iuPKfa8ymnXsNhYwkaolpktFpSHxTD3SZfCZXGC8u-r5Q3GupbeebKjibSlA9lhBwnOdHfz2cWrn0X3Y2_9dJhqpI59Ngg7c8pGeE_PL2FL9i1trxhuGeclrvpXfgYXriQ.jpg", "verified": false, "url": "https://t.me/durov" }, "stats": { "views": 606000, "likes": 26880, "comments": null, "shares": null, "saves": null, "engagementRate": 0.0444 }, "media": [], "hashtags": [], "mentions": [], "ext": { "channelId": "1006503122", "authorName": "Pavel Durov", "viewsShown": "606K", "reactions": [ { "emoji": null, "customEmojiId": "5373223594484587136", "count": 16200 }, { "emoji": null, "customEmojiId": "5399847211989246390", "count": 6240 }, { "emoji": null, "customEmojiId": "5334575279731909928", "count": 4440 } ], "stars": 6730, "edited": false, "signature": "Pavel Durov", "forwardedFrom": null, "replyTo": null, "linkPreview": null, "links": [], "mediaHidden": false } } } ``` **OpenAPI** ```json { "paths": { "/v1/telegram/post": { "get": { "tags": [ "Telegram" ], "summary": "One channel post or group message.", "description": "As a channel's posts list it: text, media, link preview, forward, reply, views and\nreactions. A group's message names its sender and has no views. 1 credit.", "operationId": "telegramPost", "parameters": [ { "name": "url", "in": "query", "description": "The message's link (`https://t.me/durov/574`).", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The message as its chat's name and number (`durov/574`), instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_TelegramPost" }, "example": { "data": { "id": "durov/574", "url": "https://t.me/durov/574", "text": "Telegram gifts are the only NFTs still alive.\n\n📈 They are up 2.5x since issuance 1–2 years ago, despite crypto winter.\n\nThis week, P2P gift trading on Telegram moved on-chain:\n\n— Sales & offers run on smart contracts.\n\n— Grams go instantly to sellers' wallets.\n\n— Fees cut from 10% to 2% 🎉", "createdAt": "2026-11-26T15:26:13.000Z", "author": { "id": "durov", "username": "durov", "displayName": "Pavel Durov", "avatarUrl": "https://cdn4.telesco.pe/file/W46-gekaU28l8Ss0QXl0rJ56iEci59GbWVgLp3H4YcQL7g-L8989ny1R95iP6y0sbrQ4qb-Jmohxw0B3uuDhxWSXeZlFYStrC--ZXpepobwj_dAqWbUtIRoPTJcbFM5u66xKGj2HmEABlgmA52CKBWGDv8GgxGHohqghyMvG5qTLJL2WyKDibOgNXQad6PwMbQZ7Vbsrq2-eh6kOPMu0iuPKfa8ymnXsNhYwkaolpktFpSHxTD3SZfCZXGC8u-r5Q3GupbeebKjibSlA9lhBwnOdHfz2cWrn0X3Y2_9dJhqpI59Ngg7c8pGeE_PL2FL9i1trxhuGeclrvpXfgYXriQ.jpg", "verified": false, "url": "https://t.me/durov" }, "stats": { "views": 606000, "likes": 26880, "comments": null, "shares": null, "saves": null, "engagementRate": 0.0444 }, "media": [], "hashtags": [], "mentions": [], "ext": { "channelId": "1006503122", "authorName": "Pavel Durov", "viewsShown": "606K", "reactions": [ { "emoji": null, "customEmojiId": "5373223594484587136", "count": 16200 }, { "emoji": null, "customEmojiId": "5399847211989246390", "count": 6240 }, { "emoji": null, "customEmojiId": "5334575279731909928", "count": 4440 } ], "stars": 6730, "edited": false, "signature": "Pavel Durov", "forwardedFrom": null, "replyTo": null, "linkPreview": null, "links": [], "mediaHidden": false } } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.telegram.post({ url: \"https://t.me/durov/574\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.telegram.post(url=\"https://t.me/durov/574\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/telegram/post \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://t.me/durov/574\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_TelegramPost": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/TelegramPost" } } }, "TelegramPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "reactions", "edited", "links", "mediaHidden" ], "properties": { "authorName": { "type": [ "string", "null" ], "description": "Its author's name as shown: the channel's, or a group member's (one without a\npublic name has no `author`, only this)." }, "channelId": { "type": [ "string", "null" ], "description": "The channel's numeric id, as Telegram's apps name it." }, "edited": { "type": "boolean", "description": "Edited after it was posted." }, "forwardedFrom": { "oneOf": [ { "$ref": "#/components/schemas/TelegramForward" }, { "type": "null" } ] }, "linkPreview": { "oneOf": [ { "$ref": "#/components/schemas/TelegramLinkPreview" }, { "type": "null" } ] }, "links": { "type": "array", "items": { "type": "string" }, "description": "The links in its text, in full." }, "mediaHidden": { "type": "boolean", "description": "Media Telegram does not show on the web (too large): open the post in Telegram." }, "reactions": { "type": "array", "items": { "$ref": "#/components/schemas/TelegramReaction" }, "description": "Each reaction, in Telegram's order; `stats.likes` is their sum." }, "replyTo": { "oneOf": [ { "$ref": "#/components/schemas/TelegramReplyRef" }, { "type": "null" } ] }, "signature": { "type": [ "string", "null" ], "description": "Its author's name, where a channel signs its posts." }, "stars": { "type": [ "integer", "null" ], "format": "int64", "description": "Stars paid as reactions.", "minimum": 0 }, "viewsShown": { "type": [ "string", "null" ], "description": "Its views as Telegram shows them, rounded past 1,000 (`596K`); `stats.views`." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A channel post or a group message." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "TelegramReplyRef": { "type": "object", "description": "The message a message answers.", "properties": { "author": { "type": [ "string", "null" ], "description": "Its author's name as shown." }, "postId": { "type": [ "string", "null" ], "description": "Its id as `/v1/telegram/post` takes it (`durov/553`), when the reply links it." }, "text": { "type": [ "string", "null" ], "description": "The start of its text, as shown." } } }, "TelegramReaction": { "type": "object", "description": "An emoji reaction, and how many gave it (rounded past 1,000).", "required": [ "count" ], "properties": { "count": { "type": "integer", "format": "int64", "minimum": 0 }, "customEmojiId": { "type": [ "string", "null" ], "description": "A custom emoji's id, when it is one." }, "emoji": { "type": [ "string", "null" ], "description": "The emoji, when it is a standard one Telegram draws." } } }, "TelegramLinkPreview": { "type": "object", "description": "A link's preview, as Telegram draws it under a post.", "required": [ "url" ], "properties": { "description": { "type": [ "string", "null" ] }, "imageUrl": { "type": [ "string", "null" ] }, "siteName": { "type": [ "string", "null" ] }, "title": { "type": [ "string", "null" ] }, "url": { "type": "string" } } }, "TelegramForward": { "type": "object", "description": "Where a forwarded post came from.", "properties": { "name": { "type": [ "string", "null" ], "description": "Its name as shown; empty when the sender hides it." }, "url": { "type": [ "string", "null" ], "description": "Its link: the original post, or the channel." } } }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Profile Posts (/docs/api-reference/telegram/profile-posts) A channel's posts, newest first. `GET https://api.socialapi.sh/v1/telegram/profile/posts` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.telegram.profilePosts({ handle: "durov" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.telegram.profile_posts(handle="durov") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/telegram/profile/posts \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=durov" ``` **Response** ```json { "data": [ { "id": "durov/574", "url": "https://t.me/durov/574", "text": "Telegram gifts are the only NFTs still alive.\n\n📈 They are up 2.5x since issuance 1–2 years ago, despite crypto winter.\n\nThis week, P2P gift trading on Telegram moved on-chain:\n\n— Sales & offers run on smart contracts.\n\n— Grams go instantly to sellers' wallets.\n\n— Fees cut from 10% to 2% 🎉", "createdAt": "2026-11-26T15:26:13.000Z", "author": { "id": "durov", "username": "durov", "displayName": "Pavel Durov", "avatarUrl": "https://cdn4.telesco.pe/file/W46-gekaU28l8Ss0QXl0rJ56iEci59GbWVgLp3H4YcQL7g-L8989ny1R95iP6y0sbrQ4qb-Jmohxw0B3uuDhxWSXeZlFYStrC--ZXpepobwj_dAqWbUtIRoPTJcbFM5u66xKGj2HmEABlgmA52CKBWGDv8GgxGHohqghyMvG5qTLJL2WyKDibOgNXQad6PwMbQZ7Vbsrq2-eh6kOPMu0iuPKfa8ymnXsNhYwkaolpktFpSHxTD3SZfCZXGC8u-r5Q3GupbeebKjibSlA9lhBwnOdHfz2cWrn0X3Y2_9dJhqpI59Ngg7c8pGeE_PL2FL9i1trxhuGeclrvpXfgYXriQ.jpg", "verified": false, "url": "https://t.me/durov" }, "stats": { "views": 606000, "likes": 26880, "comments": null, "shares": null, "saves": null, "engagementRate": 0.0444 }, "media": [], "hashtags": [], "mentions": [], "ext": { "channelId": "1006503122", "authorName": "Pavel Durov", "viewsShown": "606K", "reactions": [ { "emoji": null, "customEmojiId": "5373223594484587136", "count": 16200 }, { "emoji": null, "customEmojiId": "5399847211989246390", "count": 6240 }, { "emoji": null, "customEmojiId": "5334575279731909928", "count": 4440 } ], "stars": 6730, "edited": false, "signature": "Pavel Durov", "forwardedFrom": null, "replyTo": null, "linkPreview": null, "links": [], "mediaHidden": false } }, { "id": "durov/573", "url": "https://t.me/durov/573", "text": "💰 He actually paid $1,000,000 in Grams for @liar.\n\nhttps://fragment.com/username/liar\n\nI'd say he's trustworthy, but I don't want to damage his new brand.", "createdAt": "2026-11-25T12:56:51.000Z", "author": { "id": "durov", "username": "durov", "displayName": "Pavel Durov", "avatarUrl": "https://cdn4.telesco.pe/file/W46-gekaU28l8Ss0QXl0rJ56iEci59GbWVgLp3H4YcQL7g-L8989ny1R95iP6y0sbrQ4qb-Jmohxw0B3uuDhxWSXeZlFYStrC--ZXpepobwj_dAqWbUtIRoPTJcbFM5u66xKGj2HmEABlgmA52CKBWGDv8GgxGHohqghyMvG5qTLJL2WyKDibOgNXQad6PwMbQZ7Vbsrq2-eh6kOPMu0iuPKfa8ymnXsNhYwkaolpktFpSHxTD3SZfCZXGC8u-r5Q3GupbeebKjibSlA9lhBwnOdHfz2cWrn0X3Y2_9dJhqpI59Ngg7c8pGeE_PL2FL9i1trxhuGeclrvpXfgYXriQ.jpg", "verified": false, "url": "https://t.me/durov" }, "stats": { "views": 912000, "likes": 28690, "comments": null, "shares": null, "saves": null, "engagementRate": 0.0315 }, "media": [], "hashtags": [], "mentions": [ "liar" ], "ext": { "channelId": "1006503122", "authorName": "Pavel Durov", "viewsShown": "912K", "reactions": [ { "emoji": null, "customEmojiId": "5334575279731909928", "count": 16600 }, { "emoji": null, "customEmojiId": "5373223594484587136", "count": 7050 }, { "emoji": null, "customEmojiId": "5399847211989246390", "count": 5040 } ], "stars": 2520, "edited": false, "signature": "Pavel Durov", "forwardedFrom": null, "replyTo": { "postId": "durov/572", "author": "Pavel Durov", "text": "Someone offered me $1M for the @liar username on Telegram. I want to believe the money is real. But it's hard to trust a man who wants to be known as @liar 🤔" }, "linkPreview": { "url": "https://fragment.com/username/liar", "siteName": "Fragment Auctions", "title": "Buy @liar", "description": "An auction to get the Telegram username @liar is in progress.", "imageUrl": "https://cdn4.telesco.pe/file/CDfE6ADf0qPI6hdlxVvGzZ_kKxyeX_1GMwdO5GwawW1QtsOpIw1kLT5iGBk6DTgSUyhSKPbnYfVpwQ-IBnRwmB3hQ48ny4YPV3ujHq6C7GDul3t3nYtA_C2K5BHbdxtZpoaOZKR07agB4Kv2y4ceQIWwBqRdsMaKtWDqPlFe7nJ9rwQirQe0Yd0IDT_DvZYKSLp80k2LLkBOOFvgVWgHRNB_zIFWo7mVLUGya1w7hHeOkM0nKZihM7o0FEJJGqUA9uciWLLF7aH4dNCPawBIVR14Ehz0XZzuYxtL81Qczst4lkOgoej__Xl8MFLferOBZ5vRFXZdiilY9Djxwf_xhA.jpg" }, "links": [ "https://t.me/liar", "https://fragment.com/username/liar" ], "mediaHidden": false } } ], "pagination": { "nextCursor": "554", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/telegram/profile/posts": { "get": { "tags": [ "Telegram" ], "summary": "A channel's posts, newest first.", "description": "20 a page, back to its first post: text with its links, photos, videos with their\nfiles, stickers, link previews, forwards and replies, views and reactions (rounded past\n1,000, as Telegram shows them). A group's messages are read one at a time, with\n`/v1/telegram/post`. 1 credit a page.", "operationId": "telegramProfilePosts", "parameters": [ { "name": "handle", "in": "query", "description": "The channel's name (`durov`), with or without `@`.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "Its link (`https://t.me/durov`), instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_TelegramPost" }, "example": { "data": [ { "id": "durov/574", "url": "https://t.me/durov/574", "text": "Telegram gifts are the only NFTs still alive.\n\n📈 They are up 2.5x since issuance 1–2 years ago, despite crypto winter.\n\nThis week, P2P gift trading on Telegram moved on-chain:\n\n— Sales & offers run on smart contracts.\n\n— Grams go instantly to sellers' wallets.\n\n— Fees cut from 10% to 2% 🎉", "createdAt": "2026-11-26T15:26:13.000Z", "author": { "id": "durov", "username": "durov", "displayName": "Pavel Durov", "avatarUrl": "https://cdn4.telesco.pe/file/W46-gekaU28l8Ss0QXl0rJ56iEci59GbWVgLp3H4YcQL7g-L8989ny1R95iP6y0sbrQ4qb-Jmohxw0B3uuDhxWSXeZlFYStrC--ZXpepobwj_dAqWbUtIRoPTJcbFM5u66xKGj2HmEABlgmA52CKBWGDv8GgxGHohqghyMvG5qTLJL2WyKDibOgNXQad6PwMbQZ7Vbsrq2-eh6kOPMu0iuPKfa8ymnXsNhYwkaolpktFpSHxTD3SZfCZXGC8u-r5Q3GupbeebKjibSlA9lhBwnOdHfz2cWrn0X3Y2_9dJhqpI59Ngg7c8pGeE_PL2FL9i1trxhuGeclrvpXfgYXriQ.jpg", "verified": false, "url": "https://t.me/durov" }, "stats": { "views": 606000, "likes": 26880, "comments": null, "shares": null, "saves": null, "engagementRate": 0.0444 }, "media": [], "hashtags": [], "mentions": [], "ext": { "channelId": "1006503122", "authorName": "Pavel Durov", "viewsShown": "606K", "reactions": [ { "emoji": null, "customEmojiId": "5373223594484587136", "count": 16200 }, { "emoji": null, "customEmojiId": "5399847211989246390", "count": 6240 }, { "emoji": null, "customEmojiId": "5334575279731909928", "count": 4440 } ], "stars": 6730, "edited": false, "signature": "Pavel Durov", "forwardedFrom": null, "replyTo": null, "linkPreview": null, "links": [], "mediaHidden": false } }, { "id": "durov/573", "url": "https://t.me/durov/573", "text": "💰 He actually paid $1,000,000 in Grams for @liar.\n\nhttps://fragment.com/username/liar\n\nI'd say he's trustworthy, but I don't want to damage his new brand.", "createdAt": "2026-11-25T12:56:51.000Z", "author": { "id": "durov", "username": "durov", "displayName": "Pavel Durov", "avatarUrl": "https://cdn4.telesco.pe/file/W46-gekaU28l8Ss0QXl0rJ56iEci59GbWVgLp3H4YcQL7g-L8989ny1R95iP6y0sbrQ4qb-Jmohxw0B3uuDhxWSXeZlFYStrC--ZXpepobwj_dAqWbUtIRoPTJcbFM5u66xKGj2HmEABlgmA52CKBWGDv8GgxGHohqghyMvG5qTLJL2WyKDibOgNXQad6PwMbQZ7Vbsrq2-eh6kOPMu0iuPKfa8ymnXsNhYwkaolpktFpSHxTD3SZfCZXGC8u-r5Q3GupbeebKjibSlA9lhBwnOdHfz2cWrn0X3Y2_9dJhqpI59Ngg7c8pGeE_PL2FL9i1trxhuGeclrvpXfgYXriQ.jpg", "verified": false, "url": "https://t.me/durov" }, "stats": { "views": 912000, "likes": 28690, "comments": null, "shares": null, "saves": null, "engagementRate": 0.0315 }, "media": [], "hashtags": [], "mentions": [ "liar" ], "ext": { "channelId": "1006503122", "authorName": "Pavel Durov", "viewsShown": "912K", "reactions": [ { "emoji": null, "customEmojiId": "5334575279731909928", "count": 16600 }, { "emoji": null, "customEmojiId": "5373223594484587136", "count": 7050 }, { "emoji": null, "customEmojiId": "5399847211989246390", "count": 5040 } ], "stars": 2520, "edited": false, "signature": "Pavel Durov", "forwardedFrom": null, "replyTo": { "postId": "durov/572", "author": "Pavel Durov", "text": "Someone offered me $1M for the @liar username on Telegram. I want to believe the money is real. But it's hard to trust a man who wants to be known as @liar 🤔" }, "linkPreview": { "url": "https://fragment.com/username/liar", "siteName": "Fragment Auctions", "title": "Buy @liar", "description": "An auction to get the Telegram username @liar is in progress.", "imageUrl": "https://cdn4.telesco.pe/file/CDfE6ADf0qPI6hdlxVvGzZ_kKxyeX_1GMwdO5GwawW1QtsOpIw1kLT5iGBk6DTgSUyhSKPbnYfVpwQ-IBnRwmB3hQ48ny4YPV3ujHq6C7GDul3t3nYtA_C2K5BHbdxtZpoaOZKR07agB4Kv2y4ceQIWwBqRdsMaKtWDqPlFe7nJ9rwQirQe0Yd0IDT_DvZYKSLp80k2LLkBOOFvgVWgHRNB_zIFWo7mVLUGya1w7hHeOkM0nKZihM7o0FEJJGqUA9uciWLLF7aH4dNCPawBIVR14Ehz0XZzuYxtL81Qczst4lkOgoej__Xl8MFLferOBZ5vRFXZdiilY9Djxwf_xhA.jpg" }, "links": [ "https://t.me/liar", "https://fragment.com/username/liar" ], "mediaHidden": false } } ], "pagination": { "nextCursor": "554", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.telegram.profilePosts({ handle: \"durov\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.telegram.profile_posts(handle=\"durov\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/telegram/profile/posts \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=durov\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_TelegramPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/TelegramPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "TelegramPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "reactions", "edited", "links", "mediaHidden" ], "properties": { "authorName": { "type": [ "string", "null" ], "description": "Its author's name as shown: the channel's, or a group member's (one without a\npublic name has no `author`, only this)." }, "channelId": { "type": [ "string", "null" ], "description": "The channel's numeric id, as Telegram's apps name it." }, "edited": { "type": "boolean", "description": "Edited after it was posted." }, "forwardedFrom": { "oneOf": [ { "$ref": "#/components/schemas/TelegramForward" }, { "type": "null" } ] }, "linkPreview": { "oneOf": [ { "$ref": "#/components/schemas/TelegramLinkPreview" }, { "type": "null" } ] }, "links": { "type": "array", "items": { "type": "string" }, "description": "The links in its text, in full." }, "mediaHidden": { "type": "boolean", "description": "Media Telegram does not show on the web (too large): open the post in Telegram." }, "reactions": { "type": "array", "items": { "$ref": "#/components/schemas/TelegramReaction" }, "description": "Each reaction, in Telegram's order; `stats.likes` is their sum." }, "replyTo": { "oneOf": [ { "$ref": "#/components/schemas/TelegramReplyRef" }, { "type": "null" } ] }, "signature": { "type": [ "string", "null" ], "description": "Its author's name, where a channel signs its posts." }, "stars": { "type": [ "integer", "null" ], "format": "int64", "description": "Stars paid as reactions.", "minimum": 0 }, "viewsShown": { "type": [ "string", "null" ], "description": "Its views as Telegram shows them, rounded past 1,000 (`596K`); `stats.views`." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A channel post or a group message." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "TelegramReplyRef": { "type": "object", "description": "The message a message answers.", "properties": { "author": { "type": [ "string", "null" ], "description": "Its author's name as shown." }, "postId": { "type": [ "string", "null" ], "description": "Its id as `/v1/telegram/post` takes it (`durov/553`), when the reply links it." }, "text": { "type": [ "string", "null" ], "description": "The start of its text, as shown." } } }, "TelegramReaction": { "type": "object", "description": "An emoji reaction, and how many gave it (rounded past 1,000).", "required": [ "count" ], "properties": { "count": { "type": "integer", "format": "int64", "minimum": 0 }, "customEmojiId": { "type": [ "string", "null" ], "description": "A custom emoji's id, when it is one." }, "emoji": { "type": [ "string", "null" ], "description": "The emoji, when it is a standard one Telegram draws." } } }, "TelegramLinkPreview": { "type": "object", "description": "A link's preview, as Telegram draws it under a post.", "required": [ "url" ], "properties": { "description": { "type": [ "string", "null" ] }, "imageUrl": { "type": [ "string", "null" ] }, "siteName": { "type": [ "string", "null" ] }, "title": { "type": [ "string", "null" ] }, "url": { "type": "string" } } }, "TelegramForward": { "type": "object", "description": "Where a forwarded post came from.", "properties": { "name": { "type": [ "string", "null" ], "description": "Its name as shown; empty when the sender hides it." }, "url": { "type": [ "string", "null" ], "description": "Its link: the original post, or the channel." } } }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Profile Search (/docs/api-reference/telegram/profile-search) A search inside a channel, newest first. `GET https://api.socialapi.sh/v1/telegram/profile/search` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.telegram.profileSearch({ handle: "durov", query: "gifts" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.telegram.profile_search(handle="durov", query="gifts") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/telegram/profile/search \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=durov" \ --data-urlencode "query=gifts" ``` **Response** ```json { "data": [ { "id": "durov/574", "url": "https://t.me/durov/574", "text": "Telegram gifts are the only NFTs still alive.\n\n📈 They are up 2.5x since issuance 1–2 years ago, despite crypto winter.\n\nThis week, P2P gift trading on Telegram moved on-chain:\n\n— Sales & offers run on smart contracts.\n\n— Grams go instantly to sellers' wallets.\n\n— Fees cut from 10% to 2% 🎉", "createdAt": "2026-11-26T15:26:13.000Z", "author": { "id": "durov", "username": "durov", "displayName": "Pavel Durov", "avatarUrl": "https://cdn4.telesco.pe/file/W46-gekaU28l8Ss0QXl0rJ56iEci59GbWVgLp3H4YcQL7g-L8989ny1R95iP6y0sbrQ4qb-Jmohxw0B3uuDhxWSXeZlFYStrC--ZXpepobwj_dAqWbUtIRoPTJcbFM5u66xKGj2HmEABlgmA52CKBWGDv8GgxGHohqghyMvG5qTLJL2WyKDibOgNXQad6PwMbQZ7Vbsrq2-eh6kOPMu0iuPKfa8ymnXsNhYwkaolpktFpSHxTD3SZfCZXGC8u-r5Q3GupbeebKjibSlA9lhBwnOdHfz2cWrn0X3Y2_9dJhqpI59Ngg7c8pGeE_PL2FL9i1trxhuGeclrvpXfgYXriQ.jpg", "verified": false, "url": "https://t.me/durov" }, "stats": { "views": 607000, "likes": 26880, "comments": null, "shares": null, "saves": null, "engagementRate": 0.0443 }, "media": [], "hashtags": [], "mentions": [], "ext": { "channelId": "1006503122", "authorName": "Pavel Durov", "viewsShown": "607K", "reactions": [ { "emoji": null, "customEmojiId": "5373223594484587136", "count": 16200 }, { "emoji": null, "customEmojiId": "5399847211989246390", "count": 6240 }, { "emoji": null, "customEmojiId": "5334575279731909928", "count": 4440 } ], "stars": 6730, "edited": false, "signature": "Pavel Durov", "forwardedFrom": null, "replyTo": null, "linkPreview": null, "links": [], "mediaHidden": false } }, { "id": "durov/545", "url": "https://t.me/durov/545", "text": "A high-school student just made $20,000 from a Telegram Gift.\n\nJonathan He, an IOI gold medalist ranked #7 in the world, sold his Algorithm Cup — an NFT we gave to the top young coders this month — for 💎 15,000 Grams.\n\nHappy for him. It's a meaningful sum for someone still in school, and I suspect a small fraction of what he'll go on to build.\n\n20 years ago, $20K was enough for me to launch my fi…", "createdAt": "2026-08-30T09:10:19.000Z", "author": { "id": "durov", "username": "durov", "displayName": "Pavel Durov", "avatarUrl": "https://cdn4.telesco.pe/file/W46-gekaU28l8Ss0QXl0rJ56iEci59GbWVgLp3H4YcQL7g-L8989ny1R95iP6y0sbrQ4qb-Jmohxw0B3uuDhxWSXeZlFYStrC--ZXpepobwj_dAqWbUtIRoPTJcbFM5u66xKGj2HmEABlgmA52CKBWGDv8GgxGHohqghyMvG5qTLJL2WyKDibOgNXQad6PwMbQZ7Vbsrq2-eh6kOPMu0iuPKfa8ymnXsNhYwkaolpktFpSHxTD3SZfCZXGC8u-r5Q3GupbeebKjibSlA9lhBwnOdHfz2cWrn0X3Y2_9dJhqpI59Ngg7c8pGeE_PL2FL9i1trxhuGeclrvpXfgYXriQ.jpg", "verified": false, "url": "https://t.me/durov" }, "stats": { "views": 3880000, "likes": 67400, "comments": null, "shares": null, "saves": null, "engagementRate": 0.0174 }, "media": [], "hashtags": [ "7" ], "mentions": [], "ext": { "channelId": "1006503122", "authorName": "Pavel Durov", "viewsShown": "3.88M", "reactions": [ { "emoji": null, "customEmojiId": "5399847211989246390", "count": 44200 }, { "emoji": null, "customEmojiId": "5373223594484587136", "count": 13000 }, { "emoji": null, "customEmojiId": "5936157098181135162", "count": 10200 } ], "stars": 4680, "edited": true, "signature": "Pavel Durov", "forwardedFrom": null, "replyTo": null, "linkPreview": null, "links": [ "https://stats.ioinformatics.org/people/9089", "https://t.me/nft/algorithmcup-7", "https://t.me/durov/540" ], "mediaHidden": false } } ], "pagination": { "nextCursor": "401", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/telegram/profile/search": { "get": { "tags": [ "Telegram" ], "summary": "A search inside a channel, newest first.", "description": "Telegram's own search of one channel's posts, 20 a page: the posts with every word of\n`query`, or a `#hashtag`'s. 1 credit a page, cached 2 minutes.", "operationId": "telegramProfileSearch", "parameters": [ { "name": "handle", "in": "query", "description": "The channel's name (`durov`), with or without `@`.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "Its link (`https://t.me/durov`), instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "query", "in": "query", "description": "What to search for: words, or a `#hashtag`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_TelegramPost" }, "example": { "data": [ { "id": "durov/574", "url": "https://t.me/durov/574", "text": "Telegram gifts are the only NFTs still alive.\n\n📈 They are up 2.5x since issuance 1–2 years ago, despite crypto winter.\n\nThis week, P2P gift trading on Telegram moved on-chain:\n\n— Sales & offers run on smart contracts.\n\n— Grams go instantly to sellers' wallets.\n\n— Fees cut from 10% to 2% 🎉", "createdAt": "2026-11-26T15:26:13.000Z", "author": { "id": "durov", "username": "durov", "displayName": "Pavel Durov", "avatarUrl": "https://cdn4.telesco.pe/file/W46-gekaU28l8Ss0QXl0rJ56iEci59GbWVgLp3H4YcQL7g-L8989ny1R95iP6y0sbrQ4qb-Jmohxw0B3uuDhxWSXeZlFYStrC--ZXpepobwj_dAqWbUtIRoPTJcbFM5u66xKGj2HmEABlgmA52CKBWGDv8GgxGHohqghyMvG5qTLJL2WyKDibOgNXQad6PwMbQZ7Vbsrq2-eh6kOPMu0iuPKfa8ymnXsNhYwkaolpktFpSHxTD3SZfCZXGC8u-r5Q3GupbeebKjibSlA9lhBwnOdHfz2cWrn0X3Y2_9dJhqpI59Ngg7c8pGeE_PL2FL9i1trxhuGeclrvpXfgYXriQ.jpg", "verified": false, "url": "https://t.me/durov" }, "stats": { "views": 607000, "likes": 26880, "comments": null, "shares": null, "saves": null, "engagementRate": 0.0443 }, "media": [], "hashtags": [], "mentions": [], "ext": { "channelId": "1006503122", "authorName": "Pavel Durov", "viewsShown": "607K", "reactions": [ { "emoji": null, "customEmojiId": "5373223594484587136", "count": 16200 }, { "emoji": null, "customEmojiId": "5399847211989246390", "count": 6240 }, { "emoji": null, "customEmojiId": "5334575279731909928", "count": 4440 } ], "stars": 6730, "edited": false, "signature": "Pavel Durov", "forwardedFrom": null, "replyTo": null, "linkPreview": null, "links": [], "mediaHidden": false } }, { "id": "durov/545", "url": "https://t.me/durov/545", "text": "A high-school student just made $20,000 from a Telegram Gift.\n\nJonathan He, an IOI gold medalist ranked #7 in the world, sold his Algorithm Cup — an NFT we gave to the top young coders this month — for 💎 15,000 Grams.\n\nHappy for him. It's a meaningful sum for someone still in school, and I suspect a small fraction of what he'll go on to build.\n\n20 years ago, $20K was enough for me to launch my fi…", "createdAt": "2026-08-30T09:10:19.000Z", "author": { "id": "durov", "username": "durov", "displayName": "Pavel Durov", "avatarUrl": "https://cdn4.telesco.pe/file/W46-gekaU28l8Ss0QXl0rJ56iEci59GbWVgLp3H4YcQL7g-L8989ny1R95iP6y0sbrQ4qb-Jmohxw0B3uuDhxWSXeZlFYStrC--ZXpepobwj_dAqWbUtIRoPTJcbFM5u66xKGj2HmEABlgmA52CKBWGDv8GgxGHohqghyMvG5qTLJL2WyKDibOgNXQad6PwMbQZ7Vbsrq2-eh6kOPMu0iuPKfa8ymnXsNhYwkaolpktFpSHxTD3SZfCZXGC8u-r5Q3GupbeebKjibSlA9lhBwnOdHfz2cWrn0X3Y2_9dJhqpI59Ngg7c8pGeE_PL2FL9i1trxhuGeclrvpXfgYXriQ.jpg", "verified": false, "url": "https://t.me/durov" }, "stats": { "views": 3880000, "likes": 67400, "comments": null, "shares": null, "saves": null, "engagementRate": 0.0174 }, "media": [], "hashtags": [ "7" ], "mentions": [], "ext": { "channelId": "1006503122", "authorName": "Pavel Durov", "viewsShown": "3.88M", "reactions": [ { "emoji": null, "customEmojiId": "5399847211989246390", "count": 44200 }, { "emoji": null, "customEmojiId": "5373223594484587136", "count": 13000 }, { "emoji": null, "customEmojiId": "5936157098181135162", "count": 10200 } ], "stars": 4680, "edited": true, "signature": "Pavel Durov", "forwardedFrom": null, "replyTo": null, "linkPreview": null, "links": [ "https://stats.ioinformatics.org/people/9089", "https://t.me/nft/algorithmcup-7", "https://t.me/durov/540" ], "mediaHidden": false } } ], "pagination": { "nextCursor": "401", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.telegram.profileSearch({ handle: \"durov\", query: \"gifts\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.telegram.profile_search(handle=\"durov\", query=\"gifts\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/telegram/profile/search \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=durov\" \\\n --data-urlencode \"query=gifts\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_TelegramPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/TelegramPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "TelegramPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "reactions", "edited", "links", "mediaHidden" ], "properties": { "authorName": { "type": [ "string", "null" ], "description": "Its author's name as shown: the channel's, or a group member's (one without a\npublic name has no `author`, only this)." }, "channelId": { "type": [ "string", "null" ], "description": "The channel's numeric id, as Telegram's apps name it." }, "edited": { "type": "boolean", "description": "Edited after it was posted." }, "forwardedFrom": { "oneOf": [ { "$ref": "#/components/schemas/TelegramForward" }, { "type": "null" } ] }, "linkPreview": { "oneOf": [ { "$ref": "#/components/schemas/TelegramLinkPreview" }, { "type": "null" } ] }, "links": { "type": "array", "items": { "type": "string" }, "description": "The links in its text, in full." }, "mediaHidden": { "type": "boolean", "description": "Media Telegram does not show on the web (too large): open the post in Telegram." }, "reactions": { "type": "array", "items": { "$ref": "#/components/schemas/TelegramReaction" }, "description": "Each reaction, in Telegram's order; `stats.likes` is their sum." }, "replyTo": { "oneOf": [ { "$ref": "#/components/schemas/TelegramReplyRef" }, { "type": "null" } ] }, "signature": { "type": [ "string", "null" ], "description": "Its author's name, where a channel signs its posts." }, "stars": { "type": [ "integer", "null" ], "format": "int64", "description": "Stars paid as reactions.", "minimum": 0 }, "viewsShown": { "type": [ "string", "null" ], "description": "Its views as Telegram shows them, rounded past 1,000 (`596K`); `stats.views`." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A channel post or a group message." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "TelegramReplyRef": { "type": "object", "description": "The message a message answers.", "properties": { "author": { "type": [ "string", "null" ], "description": "Its author's name as shown." }, "postId": { "type": [ "string", "null" ], "description": "Its id as `/v1/telegram/post` takes it (`durov/553`), when the reply links it." }, "text": { "type": [ "string", "null" ], "description": "The start of its text, as shown." } } }, "TelegramReaction": { "type": "object", "description": "An emoji reaction, and how many gave it (rounded past 1,000).", "required": [ "count" ], "properties": { "count": { "type": "integer", "format": "int64", "minimum": 0 }, "customEmojiId": { "type": [ "string", "null" ], "description": "A custom emoji's id, when it is one." }, "emoji": { "type": [ "string", "null" ], "description": "The emoji, when it is a standard one Telegram draws." } } }, "TelegramLinkPreview": { "type": "object", "description": "A link's preview, as Telegram draws it under a post.", "required": [ "url" ], "properties": { "description": { "type": [ "string", "null" ] }, "imageUrl": { "type": [ "string", "null" ] }, "siteName": { "type": [ "string", "null" ] }, "title": { "type": [ "string", "null" ] }, "url": { "type": "string" } } }, "TelegramForward": { "type": "object", "description": "Where a forwarded post came from.", "properties": { "name": { "type": [ "string", "null" ], "description": "Its name as shown; empty when the sender hides it." }, "url": { "type": [ "string", "null" ], "description": "Its link: the original post, or the channel." } } }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Profile (/docs/api-reference/telegram/profile) A channel, group, account or bot with its counts. `GET https://api.socialapi.sh/v1/telegram/profile` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.telegram.profile({ handle: "durov" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.telegram.profile(handle="durov").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/telegram/profile \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=durov" ``` **Response** ```json { "data": { "id": "durov", "username": "durov", "displayName": "Pavel Durov", "bio": "Founder/CEO/Owner of Telegram.\n\nFounder of TON/Gram.\n\nHalf-part troll.", "avatarUrl": "https://cdn4.telesco.pe/file/hP1ROci3RQKSNiu0EqKtHT5U_iI_Jm-E7UrJ9lbUzyu6QI_qMAaKFwsVjzz49Sdy_ZR-18Ft4p7oI__K_XxnxDuQg_nn2dDVt4LT7kqv93S7jMBPAcoh_jubhlQGSekmhXOaYWT-Y6n3ZFghrHSd0ACzcmJb4lreWP4RvCfBKWRK2ivBsagTBrZe4lrXobwh4Ukti7XlIoRQduwiGjHrQoW0TRpcvKq3KINvKqmKvAmiAlWb-072JjjclzFbFL9otA3RHqetfL3fHXLTUWwp3yFy4zhTQezX_iYheYVQ3RqiV8JyGB9pPmjh7EmwJxyJ_BDy3pZCVZA4U21uBq8mbw.jpg", "url": "https://t.me/durov", "verified": true, "private": false, "followers": 9853398, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": null, "ext": { "kind": "channel", "online": null, "monthlyUsers": null, "channelId": "1006503122", "photos": 106, "videos": 47, "files": null, "links": 204, "previewable": true } } } ``` **OpenAPI** ```json { "paths": { "/v1/telegram/profile": { "get": { "tags": [ "Telegram" ], "summary": "A channel, group, account or bot with its counts.", "description": "Its title, description, picture, checkmark and what it is (`ext.kind`); a channel's\nsubscribers (exact) and its photo, video, file and link counts, a group's members and\nthose online, a bot's monthly users. 1 credit.", "operationId": "telegramProfile", "parameters": [ { "name": "handle", "in": "query", "description": "The channel's, group's, person's or bot's name (`durov`), with or without `@`.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "Its link (`https://t.me/durov`), instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_TelegramProfile" }, "example": { "data": { "id": "durov", "username": "durov", "displayName": "Pavel Durov", "bio": "Founder/CEO/Owner of Telegram.\n\nFounder of TON/Gram.\n\nHalf-part troll.", "avatarUrl": "https://cdn4.telesco.pe/file/hP1ROci3RQKSNiu0EqKtHT5U_iI_Jm-E7UrJ9lbUzyu6QI_qMAaKFwsVjzz49Sdy_ZR-18Ft4p7oI__K_XxnxDuQg_nn2dDVt4LT7kqv93S7jMBPAcoh_jubhlQGSekmhXOaYWT-Y6n3ZFghrHSd0ACzcmJb4lreWP4RvCfBKWRK2ivBsagTBrZe4lrXobwh4Ukti7XlIoRQduwiGjHrQoW0TRpcvKq3KINvKqmKvAmiAlWb-072JjjclzFbFL9otA3RHqetfL3fHXLTUWwp3yFy4zhTQezX_iYheYVQ3RqiV8JyGB9pPmjh7EmwJxyJ_BDy3pZCVZA4U21uBq8mbw.jpg", "url": "https://t.me/durov", "verified": true, "private": false, "followers": 9853398, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": null, "ext": { "kind": "channel", "online": null, "monthlyUsers": null, "channelId": "1006503122", "photos": 106, "videos": 47, "files": null, "links": 204, "previewable": true } } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.telegram.profile({ handle: \"durov\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.telegram.profile(handle=\"durov\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/telegram/profile \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=durov\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_TelegramProfile": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/TelegramProfile" } } }, "TelegramProfile": { "allOf": [ { "type": "object", "description": "An account.", "required": [ "id", "username", "url", "verified", "private", "ext" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "bio": { "type": [ "string", "null" ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "displayName": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "kind", "previewable" ], "properties": { "channelId": { "type": [ "string", "null" ], "description": "The channel's numeric id, when its posts show it." }, "files": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/TelegramKind", "description": "A channel, a group, a person or a bot." }, "links": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "monthlyUsers": { "type": [ "integer", "null" ], "format": "int64", "description": "A bot's users over the last month.", "minimum": 0 }, "online": { "type": [ "integer", "null" ], "format": "int64", "description": "A group's members online now.", "minimum": 0 }, "photos": { "type": [ "integer", "null" ], "format": "int64", "description": "A channel's photos, videos, files and links, as Telegram counts them (rounded\npast 1,000: `1.2K`).", "minimum": 0 }, "previewable": { "type": "boolean", "description": "Whether its posts can be read (`/v1/telegram/profile/posts`): a channel with a\npublic preview." }, "videos": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, { "type": "object", "description": "What only this platform has." } ] }, "externalUrl": { "type": [ "string", "null" ], "description": "The link in the bio." }, "followers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "following": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "id": { "type": "string", "description": "The platform's id for the account." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "description": "Likes the account's posts received in total.", "minimum": 0 }, "posts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "private": { "type": "boolean" }, "url": { "type": "string", "description": "The profile's page." }, "username": { "type": "string", "description": "The handle, without `@`." }, "verified": { "type": "boolean" } } }, { "type": "object", "description": "A Telegram channel, group, person or bot." } ] }, "TelegramKind": { "type": "string", "description": "What a name is.", "enum": [ "channel", "group", "user", "bot" ] }, "Timestamp": { "type": "string", "format": "date-time" } } } } ``` # Threads API (/docs/api-reference/threads) Every Threads endpoint, by group. Each is a `GET` under `/v1/threads`. ## Quick Reference [#quick-reference] | Property | Value | | --- | --- | | Base path | `/v1/threads` | | Endpoints | 10 | | Credits | 1 a call | | Guide | [Threads](/docs/threads) | ## Accounts [#accounts] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/threads/profile`](/docs/api-reference/threads/profile) | A profile with its follower count. | 1 | | [`GET /v1/threads/profile/media`](/docs/api-reference/threads/profile-media) | An account's threads with photos or videos, 25 a page. | 1 | | [`GET /v1/threads/profile/posts`](/docs/api-reference/threads/profile-posts) | An account's threads, newest first, 25 a page. | 1 | | [`GET /v1/threads/profile/replies`](/docs/api-reference/threads/profile-replies) | An account's replies to other threads, 25 a page. | 1 | | [`GET /v1/threads/profile/reposts`](/docs/api-reference/threads/profile-reposts) | Other people's threads an account reposted. | 1 | ## Posts [#posts] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/threads/post`](/docs/api-reference/threads/post) | One thread with its counts, media and links. | 1 | | [`GET /v1/threads/post/comments`](/docs/api-reference/threads/post-comments) | A thread's replies, top or latest first. | 1 | ## Discovery [#discovery] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/threads/search`](/docs/api-reference/threads/search) | Threads matching a query, top or latest first. | 1 | | [`GET /v1/threads/search/users`](/docs/api-reference/threads/search-users) | Accounts matching a name, the first 10. | 1 | | [`GET /v1/threads/trending`](/docs/api-reference/threads/trending) | The feed Threads gives a visitor now. | 1 | ## Example Request [#example-request] Every Threads endpoint is called this way: its path, and what to read as query parameters. **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.threads.profile({ handle: "zuck" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.threads.profile(handle="zuck").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/threads/profile \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=zuck" ``` **Response** ```json { "data": { "id": "63055343223", "username": "zuck", "displayName": "Mark Zuckerberg", "bio": "Mostly superintelligence and MMA takes", "avatarUrl": "https://scontent-nrt6-1.cdninstagram.com/v/t51.82787-19/825322135_17989325280103224_1252773933700107438_n.jpg?stp=dst-jpg_s640x640_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby4xMDgwLmMyIn0&_nc_ht=scontent-nrt6-1.cdninstagram.com&_nc_cat=100&_nc_oc=Q6cZ2gEbJAaY4VAfsA-SdUiOuyyefB_PaDbIjArtHdBA5E9_oz8s23mkKO8K36do2sY94fk&_nc_ohc=TcNBs21yW1gQ7kNvwHHOsMz&_nc_gid=3utomVOdhJVr5GxFQLdxgQ&edm=AAZTMJEBAAAA&ccb=7-5&_nc_ct=RQAsPBUCFQIAAAA&oh=00_AQQ7XHzV0_X-JdqIiVqvgiHTaON1Otu3q1X6WoaBBg9WbA&oe=6B0BE5EB&_nc_sid=49cb7f", "url": "https://www.threads.com/@zuck", "verified": true, "private": false, "followers": 5783862, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": null, "ext": { "bioLinks": [], "interests": [ "AI Threads", "UFC Threads", "AI" ] } } } ``` ## Errors [#errors] A call that fails costs nothing. See [Errors](/docs/errors) for every code. # Post Comments (/docs/api-reference/threads/post-comments) A thread's replies, top or latest first. `GET https://api.socialapi.sh/v1/threads/post/comments` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.threads.postComments({ url: "https://www.threads.com/@zuck/post/DgHQuRJm8lC", sort: "top" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.threads.post_comments(url="https://www.threads.com/@zuck/post/DgHQuRJm8lC", sort="top") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/threads/post/comments \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://www.threads.com/@zuck/post/DgHQuRJm8lC" \ --data-urlencode "sort=top" ``` **Response** ```json { "data": [ { "id": "4037270842639302636", "postId": "4037269139215862082", "parentId": null, "text": "I want that little Muse charm. Looks fun.", "createdAt": "2026-11-24T06:03:30.000Z", "author": { "id": "78370986187", "username": "james7701666", "displayName": "James Brumley", "avatarUrl": "https://scontent-yyz1-1.cdninstagram.com/v/t51.82787-19/581923183_17845273539610188_5248258036130407773_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_cat=107&_nc_map=urlgen_bucketless&ig_cache_key=GG9xryJMhj_GLmY-AF1lJJ3gjtVIbmNDAQAB1501500j-ccb7-5&ccb=7-5&_nc_sid=43db74&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLnd3dy4xNTAuQzMifQ%3D%3D&_nc_ohc=6oyGoT_ipTEQ7kNvwH8Rp-2&_nc_oc=Ado5mbdyyYjkAdC-wRm96KICNalXkd5QBwIa81Sw3krwXpI-dAuNom4dcCioxZVVP70&_nc_zt=24&_nc_ht=scontent-yyz1-1.cdninstagram.com&_nc_gid=q9mLvBf58xPrImV5PAAOjA&_nc_ss=79389&_nc_ct=RQosPBUCFQIAAAA&oh=00_AQRquKZXS_cZDqtdnX-MaPyWKzZU6Pj4sI6NcOcSV7kWtQ&oe=6B0BD806", "verified": false, "url": "https://www.threads.com/@james7701666" }, "likes": 1, "replies": 0, "ext": { "code": "DgHRHDljr_s", "url": "https://www.threads.com/@james7701666/post/DgHRHDljr_s", "reposts": 0, "quotes": 0, "media": [] } }, { "id": "4037274870219893209", "postId": "4037269139215862082", "parentId": null, "text": "What about Pearl jam and a White Christmas", "createdAt": "2026-11-24T06:11:30.000Z", "author": { "id": "42058877131", "username": "chrisjohnkline2", "displayName": "Christopher Kline", "avatarUrl": "https://scontent-yyz1-1.cdninstagram.com/v/t51.82787-19/834721450_18092214524405132_6769221998411170798_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_cat=109&_nc_map=urlgen_bucketless&ig_cache_key=GKrWwDGMZe3zxUZAAO7DDu2KG-FdbmNDAQAB1501500j-ccb7-5&ccb=7-5&_nc_sid=43db74&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLnd3dy4xNTAuQzMifQ%3D%3D&_nc_ohc=R85rWg16gBwQ7kNvwG98yo8&_nc_oc=AdrRaXKmj4svZPNpwAvkNBr226eeoLzWnwnCCFJJMyvhrvep2NMvH9SYKtQuuQDwQAI&_nc_zt=24&_nc_ht=scontent-yyz1-1.cdninstagram.com&_nc_gid=q9mLvBf58xPrImV5PAAOjA&_nc_ss=79389&_nc_ct=RQosPBUCFQIAAAA&oh=00_AQRTgdIfli-_J3yKG2xK3NJZAerFUWQYGcu19PdkoyvL9g&oe=6B0BC713", "verified": false, "url": "https://www.threads.com/@chrisjohnkline2" }, "likes": 2, "replies": 0, "ext": { "code": "DgHSBqkEWnZ", "url": "https://www.threads.com/@chrisjohnkline2/post/DgHSBqkEWnZ", "reposts": 0, "quotes": 0, "media": [] } } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/threads/post/comments": { "get": { "tags": [ "Threads" ], "summary": "A thread's replies, top or latest first.", "description": "The first 15 or so, all Threads shows a visitor (no next page). 1 credit.", "operationId": "threadsPostComments", "parameters": [ { "name": "url", "in": "query", "description": "The post's link.", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The post's id, instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "sort", "in": "query", "description": "`top` (the default) or `recent`.", "required": false, "schema": { "type": "string", "description": "The order a list comes in.", "enum": [ "top", "recent" ] } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_ThreadsComment" }, "example": { "data": [ { "id": "4037270842639302636", "postId": "4037269139215862082", "parentId": null, "text": "I want that little Muse charm. Looks fun.", "createdAt": "2026-11-24T06:03:30.000Z", "author": { "id": "78370986187", "username": "james7701666", "displayName": "James Brumley", "avatarUrl": "https://scontent-yyz1-1.cdninstagram.com/v/t51.82787-19/581923183_17845273539610188_5248258036130407773_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_cat=107&_nc_map=urlgen_bucketless&ig_cache_key=GG9xryJMhj_GLmY-AF1lJJ3gjtVIbmNDAQAB1501500j-ccb7-5&ccb=7-5&_nc_sid=43db74&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLnd3dy4xNTAuQzMifQ%3D%3D&_nc_ohc=6oyGoT_ipTEQ7kNvwH8Rp-2&_nc_oc=Ado5mbdyyYjkAdC-wRm96KICNalXkd5QBwIa81Sw3krwXpI-dAuNom4dcCioxZVVP70&_nc_zt=24&_nc_ht=scontent-yyz1-1.cdninstagram.com&_nc_gid=q9mLvBf58xPrImV5PAAOjA&_nc_ss=79389&_nc_ct=RQosPBUCFQIAAAA&oh=00_AQRquKZXS_cZDqtdnX-MaPyWKzZU6Pj4sI6NcOcSV7kWtQ&oe=6B0BD806", "verified": false, "url": "https://www.threads.com/@james7701666" }, "likes": 1, "replies": 0, "ext": { "code": "DgHRHDljr_s", "url": "https://www.threads.com/@james7701666/post/DgHRHDljr_s", "reposts": 0, "quotes": 0, "media": [] } }, { "id": "4037274870219893209", "postId": "4037269139215862082", "parentId": null, "text": "What about Pearl jam and a White Christmas", "createdAt": "2026-11-24T06:11:30.000Z", "author": { "id": "42058877131", "username": "chrisjohnkline2", "displayName": "Christopher Kline", "avatarUrl": "https://scontent-yyz1-1.cdninstagram.com/v/t51.82787-19/834721450_18092214524405132_6769221998411170798_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_cat=109&_nc_map=urlgen_bucketless&ig_cache_key=GKrWwDGMZe3zxUZAAO7DDu2KG-FdbmNDAQAB1501500j-ccb7-5&ccb=7-5&_nc_sid=43db74&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLnd3dy4xNTAuQzMifQ%3D%3D&_nc_ohc=R85rWg16gBwQ7kNvwG98yo8&_nc_oc=AdrRaXKmj4svZPNpwAvkNBr226eeoLzWnwnCCFJJMyvhrvep2NMvH9SYKtQuuQDwQAI&_nc_zt=24&_nc_ht=scontent-yyz1-1.cdninstagram.com&_nc_gid=q9mLvBf58xPrImV5PAAOjA&_nc_ss=79389&_nc_ct=RQosPBUCFQIAAAA&oh=00_AQRTgdIfli-_J3yKG2xK3NJZAerFUWQYGcu19PdkoyvL9g&oe=6B0BC713", "verified": false, "url": "https://www.threads.com/@chrisjohnkline2" }, "likes": 2, "replies": 0, "ext": { "code": "DgHSBqkEWnZ", "url": "https://www.threads.com/@chrisjohnkline2/post/DgHSBqkEWnZ", "reposts": 0, "quotes": 0, "media": [] } } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.threads.postComments({ url: \"https://www.threads.com/@zuck/post/DgHQuRJm8lC\", sort: \"top\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.threads.post_comments(url=\"https://www.threads.com/@zuck/post/DgHQuRJm8lC\", sort=\"top\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/threads/post/comments \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://www.threads.com/@zuck/post/DgHQuRJm8lC\" \\\n --data-urlencode \"sort=top\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_ThreadsComment": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/ThreadsComment" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "ThreadsComment": { "allOf": [ { "type": "object", "description": "A comment or a reply.", "required": [ "id", "postId", "text", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "description": "A reply is a post of its own on Threads: what the comment schema has no room for.", "required": [ "code", "url", "media" ], "properties": { "code": { "type": "string", "description": "The code in its link; read its own replies with `/v1/threads/post/comments`." }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" }, "description": "Photos or videos in it." }, "quotes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "reposts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "url": { "type": "string" } } }, { "type": "object", "description": "What only this platform has." } ] }, "id": { "type": "string" }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "parentId": { "type": [ "string", "null" ], "description": "The comment this replies to; absent on a top-level comment." }, "postId": { "type": "string" }, "replies": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "text": { "type": "string" } } }, { "type": "object", "description": "A reply to a thread." } ] }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Post (/docs/api-reference/threads/post) One thread with its counts, media and links. `GET https://api.socialapi.sh/v1/threads/post` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.threads.post({ url: "https://www.threads.com/@zuck/post/DgHQuRJm8lC" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.threads.post(url="https://www.threads.com/@zuck/post/DgHQuRJm8lC").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/threads/post \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://www.threads.com/@zuck/post/DgHQuRJm8lC" ``` **Response** ```json { "data": { "id": "4037269139215862082", "url": "https://www.threads.com/@zuck/post/DgHQuRJm8lC", "text": "We've even trained it on a new way to pronounce \"aluminium\". Give it a try today.", "createdAt": "2026-11-24T06:00:07.000Z", "author": { "id": "63055343223", "username": "zuck", "displayName": "Mark Zuckerberg", "avatarUrl": "https://scontent-nrt6-1.cdninstagram.com/v/t51.82787-19/825322135_17989325280103224_1252773933700107438_n.jpg?stp=dst-jpg_s150x150_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby4xMDgwLmMyIn0&_nc_ht=scontent-nrt6-1.cdninstagram.com&_nc_cat=100&_nc_oc=Q6cZ2gHjrkXcWRr3EjaJ1l1RiL3MKwAkPhafPD1JH_JiyMNVsF5wg0tQ6-SnLOI2BHn5Dnc&_nc_ohc=TcNBs21yW1gQ7kNvwHHOsMz&_nc_gid=Q3faSCx1d2f-Rr2MEp68KQ&edm=AMNnE2YBAAAA&ccb=7-5&_nc_ct=RQAsPBUCFQIAAAA&oh=00_AQRpnfwFdHSZhDfgCW3EOT8Kyjl4rlowYYzi56Qrm7vuKA&oe=6B0BE5EB&_nc_sid=9bc633", "verified": true, "url": "https://www.threads.com/@zuck" }, "stats": { "views": null, "likes": 678, "comments": 102, "shares": 9, "saves": null, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "code": "DgHQuRJm8lC", "kind": "text", "reposts": 19, "quotes": 4, "isReply": false, "replyTo": null, "quoted": { "id": "3982006822555211399", "code": "DdC7huHldaH", "username": "tomtalksai", "text": "@zuck - when might we get a chance to try it in the UK?", "url": "https://www.threads.com/@tomtalksai/post/DdC7huHldaH" }, "link": null, "topic": "Muse", "pinned": false, "continued": false, "repostedAt": null, "language": "en", "paidPartnership": false, "altText": null } } } ``` **OpenAPI** ```json { "paths": { "/v1/threads/post": { "get": { "tags": [ "Threads" ], "summary": "One thread with its counts, media and links.", "description": "Text, author, time, like, reply, repost, quote and share counts, media, the post it\nquotes or answers and a link's preview. Views are not shown to a visitor. 1 credit.", "operationId": "threadsPost", "parameters": [ { "name": "url", "in": "query", "description": "The post's link (`https://www.threads.com/@zuck/post/DgHQuRJm8lC`).", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The post's id, instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_ThreadsPost" }, "example": { "data": { "id": "4037269139215862082", "url": "https://www.threads.com/@zuck/post/DgHQuRJm8lC", "text": "We've even trained it on a new way to pronounce \"aluminium\". Give it a try today.", "createdAt": "2026-11-24T06:00:07.000Z", "author": { "id": "63055343223", "username": "zuck", "displayName": "Mark Zuckerberg", "avatarUrl": "https://scontent-nrt6-1.cdninstagram.com/v/t51.82787-19/825322135_17989325280103224_1252773933700107438_n.jpg?stp=dst-jpg_s150x150_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby4xMDgwLmMyIn0&_nc_ht=scontent-nrt6-1.cdninstagram.com&_nc_cat=100&_nc_oc=Q6cZ2gHjrkXcWRr3EjaJ1l1RiL3MKwAkPhafPD1JH_JiyMNVsF5wg0tQ6-SnLOI2BHn5Dnc&_nc_ohc=TcNBs21yW1gQ7kNvwHHOsMz&_nc_gid=Q3faSCx1d2f-Rr2MEp68KQ&edm=AMNnE2YBAAAA&ccb=7-5&_nc_ct=RQAsPBUCFQIAAAA&oh=00_AQRpnfwFdHSZhDfgCW3EOT8Kyjl4rlowYYzi56Qrm7vuKA&oe=6B0BE5EB&_nc_sid=9bc633", "verified": true, "url": "https://www.threads.com/@zuck" }, "stats": { "views": null, "likes": 678, "comments": 102, "shares": 9, "saves": null, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "code": "DgHQuRJm8lC", "kind": "text", "reposts": 19, "quotes": 4, "isReply": false, "replyTo": null, "quoted": { "id": "3982006822555211399", "code": "DdC7huHldaH", "username": "tomtalksai", "text": "@zuck - when might we get a chance to try it in the UK?", "url": "https://www.threads.com/@tomtalksai/post/DdC7huHldaH" }, "link": null, "topic": "Muse", "pinned": false, "continued": false, "repostedAt": null, "language": "en", "paidPartnership": false, "altText": null } } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.threads.post({ url: \"https://www.threads.com/@zuck/post/DgHQuRJm8lC\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.threads.post(url=\"https://www.threads.com/@zuck/post/DgHQuRJm8lC\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/threads/post \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://www.threads.com/@zuck/post/DgHQuRJm8lC\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_ThreadsPost": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/ThreadsPost" } } }, "ThreadsPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "code", "kind", "isReply", "pinned", "continued", "paidPartnership" ], "properties": { "altText": { "type": [ "string", "null" ], "description": "Threads' description of the image, for screen readers." }, "code": { "type": "string", "description": "The code in its link (`threads.com/@user/post/`)." }, "continued": { "type": "boolean", "description": "Whether its author continued it with posts of their own (a thread of several)." }, "isReply": { "type": "boolean", "description": "Whether it is a reply, and to what: the post it answers when the list carried it,\nelse at least whose post." }, "kind": { "$ref": "#/components/schemas/ThreadsPostKind" }, "language": { "type": [ "string", "null" ], "description": "Its text's language, as Threads detected it." }, "link": { "oneOf": [ { "$ref": "#/components/schemas/ThreadsLinkPreview", "description": "The link it shares, as its preview shows it." }, { "type": "null" } ] }, "paidPartnership": { "type": "boolean", "description": "A paid partnership." }, "pinned": { "type": "boolean", "description": "Pinned to its author's profile." }, "quoted": { "oneOf": [ { "$ref": "#/components/schemas/ThreadsPostRef", "description": "The post it quotes." }, { "type": "null" } ] }, "quotes": { "type": [ "integer", "null" ], "format": "int64", "description": "Posts quoting it.", "minimum": 0 }, "replyTo": { "oneOf": [ { "$ref": "#/components/schemas/ThreadsPostRef" }, { "type": "null" } ] }, "repostedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "When the account reposted it, on a profile's reposts." }, { "type": "null" } ] }, "reposts": { "type": [ "integer", "null" ], "format": "int64", "description": "Reposts of it.", "minimum": 0 }, "topic": { "type": [ "string", "null" ], "description": "The topic tag it is posted under." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A thread: text, a photo, a video or a carousel." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "Timestamp": { "type": "string", "format": "date-time" }, "ThreadsPostRef": { "type": "object", "description": "Another post, as a post names it.", "properties": { "code": { "type": [ "string", "null" ] }, "id": { "type": [ "string", "null" ], "description": "Its id, when the answer carries the post itself." }, "text": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "username": { "type": [ "string", "null" ] } } }, "ThreadsLinkPreview": { "type": "object", "required": [ "url" ], "properties": { "displayUrl": { "type": [ "string", "null" ], "description": "The host as shown (`nytimes.com`)." }, "title": { "type": [ "string", "null" ] }, "url": { "type": "string" } } }, "ThreadsPostKind": { "type": "string", "description": "What a thread is.", "enum": [ "text", "photo", "video", "carousel" ] }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Profile Media (/docs/api-reference/threads/profile-media) An account's threads with photos or videos, 25 a page. `GET https://api.socialapi.sh/v1/threads/profile/media` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.threads.profileMedia({ handle: "zuck" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.threads.profile_media(handle="zuck") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/threads/profile/media \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=zuck" ``` **Response** ```json { "data": [ { "id": "4026926512892651125", "url": "https://www.threads.com/@zuck/post/DfihFPxkaZ1", "text": "Pavlova with Muse helping on our quest to go beyond beginner baking recipes!", "createdAt": "2026-11-09T23:31:10.000Z", "author": { "id": "63055343223", "username": "zuck", "displayName": "Mark Zuckerberg", "avatarUrl": "https://scontent-yyz1-1.cdninstagram.com/v/t51.82787-19/825322135_17989325280103224_1252773933700107438_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_cat=107&_nc_map=urlgen_bucketless&ig_cache_key=GJdqMTE4yxEvMuk-AK5MEFZBv2IRbmNDAQAB1501500j-ccb7-5&ccb=7-5&_nc_sid=43db74&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLnd3dy4xMDgwLkMzIn0%3D&_nc_ohc=G9T_hLzpN_wQ7kNvwGk2in7&_nc_oc=AdpkG-VJ31LhfHjmF0FZ15RN7Heg61hCLODKkHzC6mifnHmiEakptBIjBiGLlp-Ic28&_nc_zt=24&_nc_ht=scontent-yyz1-1.cdninstagram.com&_nc_gid=nHX6x3roo7xPYWdAbCoAIA&_nc_ss=79389&_nc_ct=RQosPBUCFQIAAAA&oh=00_AQR4lU8dPqc_VcgBdFPHFptxBvnEjUaEDOak2rkXowwi_g&oe=6B0BE5EB", "verified": true, "url": "https://www.threads.com/@zuck" }, "stats": { "views": null, "likes": 1586, "comments": 311, "shares": 39, "saves": null, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://scontent-yyz1-1.cdninstagram.com/v/t51.82787-15/900924821_17996711844103224_7104678187536730142_n.webp?_nc_cat=111&_nc_map=urlgen_bucketless&ig_cache_key=NDAyNjkyNjIwMTgxMjk5ODA1NQ%3D%3D.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNBUk9VU0VMX0lURU0ueHBpZHMuMjAwMC5zZHIucmVndWxhcl9waG90by5DMyJ9&_nc_ohc=D2pCoZsJmYwQ7kNvwGs-3Ix&_nc_oc=AdrBCaP24eyPL3AtwNxhmBLGjY7t3UtMeXJOhSgmkkfQy_fCDXePeS0OfUxVoXXGcgA&_nc_zt=23&_nc_ht=scontent-yyz1-1.cdninstagram.com&_nc_gid=nHX6x3roo7xPYWdAbCoAIA&_nc_ss=79389&_nc_ct=RQosPBUIFQIlBAAAAA&oh=00_AQQ5YUGM8brHfEgMfmp6Al5-tgmzkhN4XIUSj_nZ4ezTYA&oe=6B0BE931", "thumbnailUrl": null, "width": 2000, "height": 1500, "durationSeconds": null }, { "kind": "image", "url": "https://scontent-yyz1-1.cdninstagram.com/v/t51.82787-15/892848361_17996711835103224_1250660252252209231_n.webp?_nc_cat=101&_nc_map=urlgen_bucketless&ig_cache_key=NDAyNjkyNjIwMTIxNzM4MDM1MA%3D%3D.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNBUk9VU0VMX0lURU0ueHBpZHMuMjAwMC5zZHIucmVndWxhcl9waG90by5DMyJ9&_nc_ohc=vqE-m6w8UdoQ7kNvwG0Zkh8&_nc_oc=Adpb78X5YGyrsJhVdFBcXuRM3NXkzwYCSuIauTyqQvcUPXIvvjiX73HbRQpBT5GCb1w&_nc_zt=23&_nc_ht=scontent-yyz1-1.cdninstagram.com&_nc_gid=nHX6x3roo7xPYWdAbCoAIA&_nc_ss=79389&_nc_ct=RQosPBUIFQIlBAAAAA&oh=00_AQRsmEM6qxAEdHUIBzKcmCb-U0X0K_qN_Da16VCDIe_6YA&oe=6B0BF415", "thumbnailUrl": null, "width": 2000, "height": 1500, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "code": "DfihFPxkaZ1", "kind": "carousel", "reposts": 56, "quotes": 10, "isReply": false, "replyTo": null, "quoted": null, "link": null, "topic": "bakingthreads", "pinned": false, "continued": false, "repostedAt": null, "language": "en", "paidPartnership": false, "altText": null } }, { "id": "4024588638696309702", "url": "https://www.threads.com/@zuck/post/DfaNgswkQPG", "text": "Using our new spaces feature on Muse to build a tool for my smoker. Give Muse a prompt and it can help build whatever you want to keep track of.\n\nThe Pit Viper's vent controller has Bluetooth now, so Muse tracks the temp for me throughout the day.", "createdAt": "2026-11-06T18:06:14.000Z", "author": { "id": "63055343223", "username": "zuck", "displayName": "Mark Zuckerberg", "avatarUrl": "https://scontent-yyz1-1.cdninstagram.com/v/t51.82787-19/825322135_17989325280103224_1252773933700107438_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_cat=107&_nc_map=urlgen_bucketless&ig_cache_key=GJdqMTE4yxEvMuk-AK5MEFZBv2IRbmNDAQAB1501500j-ccb7-5&ccb=7-5&_nc_sid=43db74&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLnd3dy4xMDgwLkMzIn0%3D&_nc_ohc=G9T_hLzpN_wQ7kNvwGk2in7&_nc_oc=AdpkG-VJ31LhfHjmF0FZ15RN7Heg61hCLODKkHzC6mifnHmiEakptBIjBiGLlp-Ic28&_nc_zt=24&_nc_ht=scontent-yyz1-1.cdninstagram.com&_nc_gid=nHX6x3roo7xPYWdAbCoAIA&_nc_ss=79389&_nc_ct=RQosPBUCFQIAAAA&oh=00_AQR4lU8dPqc_VcgBdFPHFptxBvnEjUaEDOak2rkXowwi_g&oe=6B0BE5EB", "verified": true, "url": "https://www.threads.com/@zuck" }, "stats": { "views": null, "likes": 2485, "comments": 583, "shares": 125, "saves": null, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://scontent-yyz1-1.cdninstagram.com/v/t51.82787-15/885671063_17996255874103224_4387771183586852277_n.webp?_nc_cat=100&_nc_map=urlgen_bucketless&ig_cache_key=NDAyNDU4ODE5NDc1Nzg2NjY4MQ%3D%3D.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNBUk9VU0VMX0lURU0ueHBpZHMuMTYzOS5zZHIucmVndWxhcl9waG90by5DMyJ9&_nc_ohc=gyE1HpWgcKoQ7kNvwGBbiIM&_nc_oc=AdqJreBlBju064RayePyIQ_d1zQRxcs2ST6vOVtwhQTLrgSj3C3LZKufIdJ51Ut-Knk&_nc_zt=23&_nc_ht=scontent-yyz1-1.cdninstagram.com&_nc_gid=nHX6x3roo7xPYWdAbCoAIA&_nc_ss=79389&_nc_ct=RQosPBUIFQIlBAAAAA&oh=00_AQSGIiVN3waEw7OIH5eLA5CWQw8nbt-BinT_iMrNT4Rb8Q&oe=6B0BD9A0", "thumbnailUrl": null, "width": 1639, "height": 2048, "durationSeconds": null }, { "kind": "image", "url": "https://scontent-yyz1-1.cdninstagram.com/v/t51.82787-15/892323556_17996255865103224_2046473187771648446_n.webp?_nc_cat=111&_nc_map=urlgen_bucketless&ig_cache_key=NDAyNDU4ODE5MjMwODUyNjcxNA%3D%3D.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNBUk9VU0VMX0lURU0ueHBpZHMuOTQ2LnNkci5yZWd1bGFyX3Bob3RvLkMzIn0%3D&_nc_ohc=iDaxPgkO3o0Q7kNvwGCNdQf&_nc_oc=Adolp_oV3IajaFMm4YxJ1ZFvo93JgbjUqqZ6gr8MRWoSPG29St9t2TZxuBrXfEpLm8U&_nc_zt=23&_nc_ht=scontent-yyz1-1.cdninstagram.com&_nc_gid=nHX6x3roo7xPYWdAbCoAIA&_nc_ss=79389&_nc_ct=RQosPBUIFQIlBAAAAA&oh=00_AQT2Fe96FXPj9zBEuT_80cxbi0ol_bFCYmy5BHDZN6KMqQ&oe=6B0BF1FF", "thumbnailUrl": null, "width": 946, "height": 1856, "durationSeconds": null }, { "kind": "video", "url": "https://scontent-yyz1-1.cdninstagram.com/o1/v/t16/f2/m84/AQNSqsRJ_lsT8oJHCaTlZHIaksG19beD-59EBfSVWMK9vHYgnqkikjqiwzuM-MA7rlgdKqq9JjAD2uU0OAY6pu-HmjoSllcdJGT9b70.mp4?_nc_cat=100&_nc_sid=5e9851&_nc_ht=scontent-yyz1-1.cdninstagram.com&_nc_ohc=CcCC-JYPszIQ7kNvwFZs8EY&efg=eyJ2ZW5jb2RlX3RhZyI6Inhwdl9wcm9ncmVzc2l2ZS5JTlNUQUdSQU0uQ0FST1VTRUxfSVRFTS5DMy43MjAuZGFzaF9iYXNlbGluZV8xX3YxIiwieHB2X2Fzc2V0X2lkIjoxNzk5NjI1NTkxMzEwMzIyNCwiYXNzZXRfYWdlX2RheXMiOjE4LCJ2aV91c2VjYXNlX2lkIjoxMDE2NCwiZHVyYXRpb25fcyI6MTUsInVybGdlbl9zb3VyY2UiOiJ3d3cifQ%3D%3D&ccb=17-1&vs=8972b13d9c10bf04&_nc_vs=HBksFQIYTGlnX2JhY2tmaWxsX3RpbWVsaW5lX3ZvZC9CN0MxQzI2RTQ5RjA0NDlEQjNFOEQ3MUI1MDRGQjY5Rl92aWRlb19kYXNoaW5pdC5tcDQVAALIARIAFQIYUWlnX3hwdl9wbGFjZW1lbnRfcGVybWFuZW50X3YyLzAwOTgzMEZBQzM3QjQ4NzA4NjA0QTE5QjQwREUxQzYwX2F1ZGlvX2Rhc2hpbml0Lm1wNBUCAsgBEgAoABgAGwOIB3VzZV9vaWwBMRJwcm9ncmVzc2l2ZV9yZWNpcGUBMRJjb3B5X3NhbXBsZV9ncm91cHMBMRUAACbwveaP-9_3PxUCKAJDMywXQC-dsi0OVgQYEmRhc2hfYmFzZWxpbmVfMV92MREAde4HZeieAQA&_nc_gid=nHX6x3roo7xPYWdAbCoAIA&_nc_ss=79389&_nc_map=urlgen_bucketless&_nc_zt=28&_nc_enc=UrrCQMKkPKs38kOStij5GFTDOba5fhLM8nSdpb7GRJ8SR0FVKQMLRfPmdANnF4gg6C80b-9QNKGF5xM23jzih0vD68XdyMToI-2moZgFuBWb42ezYl_jKr1UesU&oh=00_AQTLcaoyjU70F5zLJY3zKUAImetHJxULxdPS-TVH1jfgmQ&oe=6B07E4F4", "thumbnailUrl": "https://scontent-yyz1-1.cdninstagram.com/v/t51.71878-15/887643420_1555586052997554_5274946353777127977_n.jpg?stp=dst-jpg_e15_tt6&_nc_cat=106&_nc_map=urlgen_bucketless&ig_cache_key=NDAyNDU4ODIyMjgwNTk0OTk4MA%3D%3D.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNBUk9VU0VMX0lURU0ueHBpZHMuNjQwLnNkci52aWRlb19maXJzdF9mcmFtZV90aHVtYm5haWwuQzMifQ%3D%3D&_nc_ohc=LLLoRqOT6IYQ7kNvwGKCO5d&_nc_oc=Adqo9FYDesc8jIF4XL46Jwv9HwJ3fyp61Fmrb1VudJc_X6BmFY4vgytS_7RWipRZ3NM&_nc_zt=23&_nc_ht=scontent-yyz1-1.cdninstagram.com&_nc_gid=nHX6x3roo7xPYWdAbCoAIA&_nc_ss=79389&_nc_ct=RQosPBUIFQolBAAAAA&oh=00_AQQIOKcuaEH4l9Z3QkBVE0_XDH7puiP-2lMLgzP6ZWbSWg&oe=6B0BE537", "width": 1080, "height": 1350, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "code": "DfaNgswkQPG", "kind": "carousel", "reposts": 115, "quotes": 33, "isReply": false, "replyTo": null, "quoted": null, "link": null, "topic": "techthreads", "pinned": false, "continued": false, "repostedAt": null, "language": "en", "paidPartnership": false, "altText": null } } ], "pagination": { "nextCursor": "AQHTrC_lFhN_bPmj5IMVnu3e0l2ycrpV9-b2TR-z_fU4od6oE3Tr7vlTA65ameqd_XttbV9GmmtTIckhi_tCh5T4jQ", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/threads/profile/media": { "get": { "tags": [ "Threads" ], "summary": "An account's threads with photos or videos, 25 a page.", "description": "1 credit a page.", "operationId": "threadsProfileMedia", "parameters": [ { "name": "handle", "in": "query", "description": "The username, with or without `@`.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "The profile's link, instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_ThreadsPost" }, "example": { "data": [ { "id": "4026926512892651125", "url": "https://www.threads.com/@zuck/post/DfihFPxkaZ1", "text": "Pavlova with Muse helping on our quest to go beyond beginner baking recipes!", "createdAt": "2026-11-09T23:31:10.000Z", "author": { "id": "63055343223", "username": "zuck", "displayName": "Mark Zuckerberg", "avatarUrl": "https://scontent-yyz1-1.cdninstagram.com/v/t51.82787-19/825322135_17989325280103224_1252773933700107438_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_cat=107&_nc_map=urlgen_bucketless&ig_cache_key=GJdqMTE4yxEvMuk-AK5MEFZBv2IRbmNDAQAB1501500j-ccb7-5&ccb=7-5&_nc_sid=43db74&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLnd3dy4xMDgwLkMzIn0%3D&_nc_ohc=G9T_hLzpN_wQ7kNvwGk2in7&_nc_oc=AdpkG-VJ31LhfHjmF0FZ15RN7Heg61hCLODKkHzC6mifnHmiEakptBIjBiGLlp-Ic28&_nc_zt=24&_nc_ht=scontent-yyz1-1.cdninstagram.com&_nc_gid=nHX6x3roo7xPYWdAbCoAIA&_nc_ss=79389&_nc_ct=RQosPBUCFQIAAAA&oh=00_AQR4lU8dPqc_VcgBdFPHFptxBvnEjUaEDOak2rkXowwi_g&oe=6B0BE5EB", "verified": true, "url": "https://www.threads.com/@zuck" }, "stats": { "views": null, "likes": 1586, "comments": 311, "shares": 39, "saves": null, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://scontent-yyz1-1.cdninstagram.com/v/t51.82787-15/900924821_17996711844103224_7104678187536730142_n.webp?_nc_cat=111&_nc_map=urlgen_bucketless&ig_cache_key=NDAyNjkyNjIwMTgxMjk5ODA1NQ%3D%3D.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNBUk9VU0VMX0lURU0ueHBpZHMuMjAwMC5zZHIucmVndWxhcl9waG90by5DMyJ9&_nc_ohc=D2pCoZsJmYwQ7kNvwGs-3Ix&_nc_oc=AdrBCaP24eyPL3AtwNxhmBLGjY7t3UtMeXJOhSgmkkfQy_fCDXePeS0OfUxVoXXGcgA&_nc_zt=23&_nc_ht=scontent-yyz1-1.cdninstagram.com&_nc_gid=nHX6x3roo7xPYWdAbCoAIA&_nc_ss=79389&_nc_ct=RQosPBUIFQIlBAAAAA&oh=00_AQQ5YUGM8brHfEgMfmp6Al5-tgmzkhN4XIUSj_nZ4ezTYA&oe=6B0BE931", "thumbnailUrl": null, "width": 2000, "height": 1500, "durationSeconds": null }, { "kind": "image", "url": "https://scontent-yyz1-1.cdninstagram.com/v/t51.82787-15/892848361_17996711835103224_1250660252252209231_n.webp?_nc_cat=101&_nc_map=urlgen_bucketless&ig_cache_key=NDAyNjkyNjIwMTIxNzM4MDM1MA%3D%3D.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNBUk9VU0VMX0lURU0ueHBpZHMuMjAwMC5zZHIucmVndWxhcl9waG90by5DMyJ9&_nc_ohc=vqE-m6w8UdoQ7kNvwG0Zkh8&_nc_oc=Adpb78X5YGyrsJhVdFBcXuRM3NXkzwYCSuIauTyqQvcUPXIvvjiX73HbRQpBT5GCb1w&_nc_zt=23&_nc_ht=scontent-yyz1-1.cdninstagram.com&_nc_gid=nHX6x3roo7xPYWdAbCoAIA&_nc_ss=79389&_nc_ct=RQosPBUIFQIlBAAAAA&oh=00_AQRsmEM6qxAEdHUIBzKcmCb-U0X0K_qN_Da16VCDIe_6YA&oe=6B0BF415", "thumbnailUrl": null, "width": 2000, "height": 1500, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "code": "DfihFPxkaZ1", "kind": "carousel", "reposts": 56, "quotes": 10, "isReply": false, "replyTo": null, "quoted": null, "link": null, "topic": "bakingthreads", "pinned": false, "continued": false, "repostedAt": null, "language": "en", "paidPartnership": false, "altText": null } }, { "id": "4024588638696309702", "url": "https://www.threads.com/@zuck/post/DfaNgswkQPG", "text": "Using our new spaces feature on Muse to build a tool for my smoker. Give Muse a prompt and it can help build whatever you want to keep track of.\n\nThe Pit Viper's vent controller has Bluetooth now, so Muse tracks the temp for me throughout the day.", "createdAt": "2026-11-06T18:06:14.000Z", "author": { "id": "63055343223", "username": "zuck", "displayName": "Mark Zuckerberg", "avatarUrl": "https://scontent-yyz1-1.cdninstagram.com/v/t51.82787-19/825322135_17989325280103224_1252773933700107438_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_cat=107&_nc_map=urlgen_bucketless&ig_cache_key=GJdqMTE4yxEvMuk-AK5MEFZBv2IRbmNDAQAB1501500j-ccb7-5&ccb=7-5&_nc_sid=43db74&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLnd3dy4xMDgwLkMzIn0%3D&_nc_ohc=G9T_hLzpN_wQ7kNvwGk2in7&_nc_oc=AdpkG-VJ31LhfHjmF0FZ15RN7Heg61hCLODKkHzC6mifnHmiEakptBIjBiGLlp-Ic28&_nc_zt=24&_nc_ht=scontent-yyz1-1.cdninstagram.com&_nc_gid=nHX6x3roo7xPYWdAbCoAIA&_nc_ss=79389&_nc_ct=RQosPBUCFQIAAAA&oh=00_AQR4lU8dPqc_VcgBdFPHFptxBvnEjUaEDOak2rkXowwi_g&oe=6B0BE5EB", "verified": true, "url": "https://www.threads.com/@zuck" }, "stats": { "views": null, "likes": 2485, "comments": 583, "shares": 125, "saves": null, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://scontent-yyz1-1.cdninstagram.com/v/t51.82787-15/885671063_17996255874103224_4387771183586852277_n.webp?_nc_cat=100&_nc_map=urlgen_bucketless&ig_cache_key=NDAyNDU4ODE5NDc1Nzg2NjY4MQ%3D%3D.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNBUk9VU0VMX0lURU0ueHBpZHMuMTYzOS5zZHIucmVndWxhcl9waG90by5DMyJ9&_nc_ohc=gyE1HpWgcKoQ7kNvwGBbiIM&_nc_oc=AdqJreBlBju064RayePyIQ_d1zQRxcs2ST6vOVtwhQTLrgSj3C3LZKufIdJ51Ut-Knk&_nc_zt=23&_nc_ht=scontent-yyz1-1.cdninstagram.com&_nc_gid=nHX6x3roo7xPYWdAbCoAIA&_nc_ss=79389&_nc_ct=RQosPBUIFQIlBAAAAA&oh=00_AQSGIiVN3waEw7OIH5eLA5CWQw8nbt-BinT_iMrNT4Rb8Q&oe=6B0BD9A0", "thumbnailUrl": null, "width": 1639, "height": 2048, "durationSeconds": null }, { "kind": "image", "url": "https://scontent-yyz1-1.cdninstagram.com/v/t51.82787-15/892323556_17996255865103224_2046473187771648446_n.webp?_nc_cat=111&_nc_map=urlgen_bucketless&ig_cache_key=NDAyNDU4ODE5MjMwODUyNjcxNA%3D%3D.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNBUk9VU0VMX0lURU0ueHBpZHMuOTQ2LnNkci5yZWd1bGFyX3Bob3RvLkMzIn0%3D&_nc_ohc=iDaxPgkO3o0Q7kNvwGCNdQf&_nc_oc=Adolp_oV3IajaFMm4YxJ1ZFvo93JgbjUqqZ6gr8MRWoSPG29St9t2TZxuBrXfEpLm8U&_nc_zt=23&_nc_ht=scontent-yyz1-1.cdninstagram.com&_nc_gid=nHX6x3roo7xPYWdAbCoAIA&_nc_ss=79389&_nc_ct=RQosPBUIFQIlBAAAAA&oh=00_AQT2Fe96FXPj9zBEuT_80cxbi0ol_bFCYmy5BHDZN6KMqQ&oe=6B0BF1FF", "thumbnailUrl": null, "width": 946, "height": 1856, "durationSeconds": null }, { "kind": "video", "url": "https://scontent-yyz1-1.cdninstagram.com/o1/v/t16/f2/m84/AQNSqsRJ_lsT8oJHCaTlZHIaksG19beD-59EBfSVWMK9vHYgnqkikjqiwzuM-MA7rlgdKqq9JjAD2uU0OAY6pu-HmjoSllcdJGT9b70.mp4?_nc_cat=100&_nc_sid=5e9851&_nc_ht=scontent-yyz1-1.cdninstagram.com&_nc_ohc=CcCC-JYPszIQ7kNvwFZs8EY&efg=eyJ2ZW5jb2RlX3RhZyI6Inhwdl9wcm9ncmVzc2l2ZS5JTlNUQUdSQU0uQ0FST1VTRUxfSVRFTS5DMy43MjAuZGFzaF9iYXNlbGluZV8xX3YxIiwieHB2X2Fzc2V0X2lkIjoxNzk5NjI1NTkxMzEwMzIyNCwiYXNzZXRfYWdlX2RheXMiOjE4LCJ2aV91c2VjYXNlX2lkIjoxMDE2NCwiZHVyYXRpb25fcyI6MTUsInVybGdlbl9zb3VyY2UiOiJ3d3cifQ%3D%3D&ccb=17-1&vs=8972b13d9c10bf04&_nc_vs=HBksFQIYTGlnX2JhY2tmaWxsX3RpbWVsaW5lX3ZvZC9CN0MxQzI2RTQ5RjA0NDlEQjNFOEQ3MUI1MDRGQjY5Rl92aWRlb19kYXNoaW5pdC5tcDQVAALIARIAFQIYUWlnX3hwdl9wbGFjZW1lbnRfcGVybWFuZW50X3YyLzAwOTgzMEZBQzM3QjQ4NzA4NjA0QTE5QjQwREUxQzYwX2F1ZGlvX2Rhc2hpbml0Lm1wNBUCAsgBEgAoABgAGwOIB3VzZV9vaWwBMRJwcm9ncmVzc2l2ZV9yZWNpcGUBMRJjb3B5X3NhbXBsZV9ncm91cHMBMRUAACbwveaP-9_3PxUCKAJDMywXQC-dsi0OVgQYEmRhc2hfYmFzZWxpbmVfMV92MREAde4HZeieAQA&_nc_gid=nHX6x3roo7xPYWdAbCoAIA&_nc_ss=79389&_nc_map=urlgen_bucketless&_nc_zt=28&_nc_enc=UrrCQMKkPKs38kOStij5GFTDOba5fhLM8nSdpb7GRJ8SR0FVKQMLRfPmdANnF4gg6C80b-9QNKGF5xM23jzih0vD68XdyMToI-2moZgFuBWb42ezYl_jKr1UesU&oh=00_AQTLcaoyjU70F5zLJY3zKUAImetHJxULxdPS-TVH1jfgmQ&oe=6B07E4F4", "thumbnailUrl": "https://scontent-yyz1-1.cdninstagram.com/v/t51.71878-15/887643420_1555586052997554_5274946353777127977_n.jpg?stp=dst-jpg_e15_tt6&_nc_cat=106&_nc_map=urlgen_bucketless&ig_cache_key=NDAyNDU4ODIyMjgwNTk0OTk4MA%3D%3D.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNBUk9VU0VMX0lURU0ueHBpZHMuNjQwLnNkci52aWRlb19maXJzdF9mcmFtZV90aHVtYm5haWwuQzMifQ%3D%3D&_nc_ohc=LLLoRqOT6IYQ7kNvwGKCO5d&_nc_oc=Adqo9FYDesc8jIF4XL46Jwv9HwJ3fyp61Fmrb1VudJc_X6BmFY4vgytS_7RWipRZ3NM&_nc_zt=23&_nc_ht=scontent-yyz1-1.cdninstagram.com&_nc_gid=nHX6x3roo7xPYWdAbCoAIA&_nc_ss=79389&_nc_ct=RQosPBUIFQolBAAAAA&oh=00_AQQIOKcuaEH4l9Z3QkBVE0_XDH7puiP-2lMLgzP6ZWbSWg&oe=6B0BE537", "width": 1080, "height": 1350, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "code": "DfaNgswkQPG", "kind": "carousel", "reposts": 115, "quotes": 33, "isReply": false, "replyTo": null, "quoted": null, "link": null, "topic": "techthreads", "pinned": false, "continued": false, "repostedAt": null, "language": "en", "paidPartnership": false, "altText": null } } ], "pagination": { "nextCursor": "AQHTrC_lFhN_bPmj5IMVnu3e0l2ycrpV9-b2TR-z_fU4od6oE3Tr7vlTA65ameqd_XttbV9GmmtTIckhi_tCh5T4jQ", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.threads.profileMedia({ handle: \"zuck\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.threads.profile_media(handle=\"zuck\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/threads/profile/media \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=zuck\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_ThreadsPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/ThreadsPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "ThreadsPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "code", "kind", "isReply", "pinned", "continued", "paidPartnership" ], "properties": { "altText": { "type": [ "string", "null" ], "description": "Threads' description of the image, for screen readers." }, "code": { "type": "string", "description": "The code in its link (`threads.com/@user/post/`)." }, "continued": { "type": "boolean", "description": "Whether its author continued it with posts of their own (a thread of several)." }, "isReply": { "type": "boolean", "description": "Whether it is a reply, and to what: the post it answers when the list carried it,\nelse at least whose post." }, "kind": { "$ref": "#/components/schemas/ThreadsPostKind" }, "language": { "type": [ "string", "null" ], "description": "Its text's language, as Threads detected it." }, "link": { "oneOf": [ { "$ref": "#/components/schemas/ThreadsLinkPreview", "description": "The link it shares, as its preview shows it." }, { "type": "null" } ] }, "paidPartnership": { "type": "boolean", "description": "A paid partnership." }, "pinned": { "type": "boolean", "description": "Pinned to its author's profile." }, "quoted": { "oneOf": [ { "$ref": "#/components/schemas/ThreadsPostRef", "description": "The post it quotes." }, { "type": "null" } ] }, "quotes": { "type": [ "integer", "null" ], "format": "int64", "description": "Posts quoting it.", "minimum": 0 }, "replyTo": { "oneOf": [ { "$ref": "#/components/schemas/ThreadsPostRef" }, { "type": "null" } ] }, "repostedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "When the account reposted it, on a profile's reposts." }, { "type": "null" } ] }, "reposts": { "type": [ "integer", "null" ], "format": "int64", "description": "Reposts of it.", "minimum": 0 }, "topic": { "type": [ "string", "null" ], "description": "The topic tag it is posted under." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A thread: text, a photo, a video or a carousel." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "Timestamp": { "type": "string", "format": "date-time" }, "ThreadsPostRef": { "type": "object", "description": "Another post, as a post names it.", "properties": { "code": { "type": [ "string", "null" ] }, "id": { "type": [ "string", "null" ], "description": "Its id, when the answer carries the post itself." }, "text": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "username": { "type": [ "string", "null" ] } } }, "ThreadsLinkPreview": { "type": "object", "required": [ "url" ], "properties": { "displayUrl": { "type": [ "string", "null" ], "description": "The host as shown (`nytimes.com`)." }, "title": { "type": [ "string", "null" ] }, "url": { "type": "string" } } }, "ThreadsPostKind": { "type": "string", "description": "What a thread is.", "enum": [ "text", "photo", "video", "carousel" ] }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Profile Posts (/docs/api-reference/threads/profile-posts) An account's threads, newest first, 25 a page. `GET https://api.socialapi.sh/v1/threads/profile/posts` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.threads.profilePosts({ handle: "zuck" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.threads.profile_posts(handle="zuck") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/threads/profile/posts \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=zuck" ``` **Response** ```json { "data": [ { "id": "4037269139215862082", "url": "https://www.threads.com/@zuck/post/DgHQuRJm8lC", "text": "We've even trained it on a new way to pronounce \"aluminium\". Give it a try today.", "createdAt": "2026-11-24T06:00:07.000Z", "author": { "id": "63055343223", "username": "zuck", "displayName": "Mark Zuckerberg", "avatarUrl": "https://scontent-nrt6-1.cdninstagram.com/v/t51.82787-19/825322135_17989325280103224_1252773933700107438_n.jpg?stp=dst-jpg_s150x150_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby4xMDgwLmMyIn0&_nc_ht=scontent-nrt6-1.cdninstagram.com&_nc_cat=100&_nc_oc=Q6cZ2gHOeLcYN4f1sTs26itKP3FzQ80TrS_7Vakk12vUOlqQnIIwip2M6_3LhWToiDX-uco&_nc_ohc=TcNBs21yW1gQ7kNvwHHOsMz&_nc_gid=RVvXAqinE9vA4ObdgjiwuQ&edm=AAGeoI8BAAAA&ccb=7-5&_nc_ct=RQAsPBUCFQIAAAA&oh=00_AQQ-j9A3X7iBBlrbiP9ZAozNmV0IxEpdHzeffNK4C3VfpA&oe=6B0BE5EB&_nc_sid=b0e1a0", "verified": true, "url": "https://www.threads.com/@zuck" }, "stats": { "views": null, "likes": 678, "comments": 102, "shares": 9, "saves": null, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "code": "DgHQuRJm8lC", "kind": "text", "reposts": 19, "quotes": 4, "isReply": false, "replyTo": null, "quoted": { "id": "3982006822555211399", "code": "DdC7huHldaH", "username": "tomtalksai", "text": "@zuck - when might we get a chance to try it in the UK?", "url": "https://www.threads.com/@tomtalksai/post/DdC7huHldaH" }, "link": null, "topic": "Muse", "pinned": false, "continued": false, "repostedAt": null, "language": "en", "paidPartnership": false, "altText": null } }, { "id": "4035505062717562973", "url": "https://www.threads.com/@zuck/post/DgA_nk4kiBd", "text": "Top things I did today:\n1. Fixed roof\n2. Installed drywall\n3. Jet skied with a dog\n4. Pet Arugula", "createdAt": "2026-11-21T19:35:13.000Z", "author": { "id": "63055343223", "username": "zuck", "displayName": "Mark Zuckerberg", "avatarUrl": "https://scontent-nrt6-1.cdninstagram.com/v/t51.82787-19/825322135_17989325280103224_1252773933700107438_n.jpg?stp=dst-jpg_s150x150_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby4xMDgwLmMyIn0&_nc_ht=scontent-nrt6-1.cdninstagram.com&_nc_cat=100&_nc_oc=Q6cZ2gHOeLcYN4f1sTs26itKP3FzQ80TrS_7Vakk12vUOlqQnIIwip2M6_3LhWToiDX-uco&_nc_ohc=TcNBs21yW1gQ7kNvwHHOsMz&_nc_gid=RVvXAqinE9vA4ObdgjiwuQ&edm=AAGeoI8BAAAA&ccb=7-5&_nc_ct=RQAsPBUCFQIAAAA&oh=00_AQQ-j9A3X7iBBlrbiP9ZAozNmV0IxEpdHzeffNK4C3VfpA&oe=6B0BE5EB&_nc_sid=b0e1a0", "verified": true, "url": "https://www.threads.com/@zuck" }, "stats": { "views": null, "likes": 59689, "comments": 444, "shares": 193, "saves": null, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "code": "DgA_nk4kiBd", "kind": "text", "reposts": 554, "quotes": 37, "isReply": false, "replyTo": null, "quoted": null, "link": null, "topic": "gta6", "pinned": false, "continued": false, "repostedAt": null, "language": "en", "paidPartnership": false, "altText": null } } ], "pagination": { "nextCursor": "QVFDTWpvZmFVQjJfYW9qLWxUTTBrdF9sbG9FNHU2SkdRTElKaEN3VTVqWUpLUHp2QVRDMU9jaEt4VC1QbldGblhiTjVmTzByRVZKSHowTG1SdEc3UEFGeQ==", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/threads/profile/posts": { "get": { "tags": [ "Threads" ], "summary": "An account's threads, newest first, 25 a page.", "description": "With their likes, replies, reposts, quotes and shares. Pinned ones come first of all.\n1 credit a page.", "operationId": "threadsProfilePosts", "parameters": [ { "name": "handle", "in": "query", "description": "The username, with or without `@`.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "The profile's link, instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_ThreadsPost" }, "example": { "data": [ { "id": "4037269139215862082", "url": "https://www.threads.com/@zuck/post/DgHQuRJm8lC", "text": "We've even trained it on a new way to pronounce \"aluminium\". Give it a try today.", "createdAt": "2026-11-24T06:00:07.000Z", "author": { "id": "63055343223", "username": "zuck", "displayName": "Mark Zuckerberg", "avatarUrl": "https://scontent-nrt6-1.cdninstagram.com/v/t51.82787-19/825322135_17989325280103224_1252773933700107438_n.jpg?stp=dst-jpg_s150x150_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby4xMDgwLmMyIn0&_nc_ht=scontent-nrt6-1.cdninstagram.com&_nc_cat=100&_nc_oc=Q6cZ2gHOeLcYN4f1sTs26itKP3FzQ80TrS_7Vakk12vUOlqQnIIwip2M6_3LhWToiDX-uco&_nc_ohc=TcNBs21yW1gQ7kNvwHHOsMz&_nc_gid=RVvXAqinE9vA4ObdgjiwuQ&edm=AAGeoI8BAAAA&ccb=7-5&_nc_ct=RQAsPBUCFQIAAAA&oh=00_AQQ-j9A3X7iBBlrbiP9ZAozNmV0IxEpdHzeffNK4C3VfpA&oe=6B0BE5EB&_nc_sid=b0e1a0", "verified": true, "url": "https://www.threads.com/@zuck" }, "stats": { "views": null, "likes": 678, "comments": 102, "shares": 9, "saves": null, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "code": "DgHQuRJm8lC", "kind": "text", "reposts": 19, "quotes": 4, "isReply": false, "replyTo": null, "quoted": { "id": "3982006822555211399", "code": "DdC7huHldaH", "username": "tomtalksai", "text": "@zuck - when might we get a chance to try it in the UK?", "url": "https://www.threads.com/@tomtalksai/post/DdC7huHldaH" }, "link": null, "topic": "Muse", "pinned": false, "continued": false, "repostedAt": null, "language": "en", "paidPartnership": false, "altText": null } }, { "id": "4035505062717562973", "url": "https://www.threads.com/@zuck/post/DgA_nk4kiBd", "text": "Top things I did today:\n1. Fixed roof\n2. Installed drywall\n3. Jet skied with a dog\n4. Pet Arugula", "createdAt": "2026-11-21T19:35:13.000Z", "author": { "id": "63055343223", "username": "zuck", "displayName": "Mark Zuckerberg", "avatarUrl": "https://scontent-nrt6-1.cdninstagram.com/v/t51.82787-19/825322135_17989325280103224_1252773933700107438_n.jpg?stp=dst-jpg_s150x150_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby4xMDgwLmMyIn0&_nc_ht=scontent-nrt6-1.cdninstagram.com&_nc_cat=100&_nc_oc=Q6cZ2gHOeLcYN4f1sTs26itKP3FzQ80TrS_7Vakk12vUOlqQnIIwip2M6_3LhWToiDX-uco&_nc_ohc=TcNBs21yW1gQ7kNvwHHOsMz&_nc_gid=RVvXAqinE9vA4ObdgjiwuQ&edm=AAGeoI8BAAAA&ccb=7-5&_nc_ct=RQAsPBUCFQIAAAA&oh=00_AQQ-j9A3X7iBBlrbiP9ZAozNmV0IxEpdHzeffNK4C3VfpA&oe=6B0BE5EB&_nc_sid=b0e1a0", "verified": true, "url": "https://www.threads.com/@zuck" }, "stats": { "views": null, "likes": 59689, "comments": 444, "shares": 193, "saves": null, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "code": "DgA_nk4kiBd", "kind": "text", "reposts": 554, "quotes": 37, "isReply": false, "replyTo": null, "quoted": null, "link": null, "topic": "gta6", "pinned": false, "continued": false, "repostedAt": null, "language": "en", "paidPartnership": false, "altText": null } } ], "pagination": { "nextCursor": "QVFDTWpvZmFVQjJfYW9qLWxUTTBrdF9sbG9FNHU2SkdRTElKaEN3VTVqWUpLUHp2QVRDMU9jaEt4VC1QbldGblhiTjVmTzByRVZKSHowTG1SdEc3UEFGeQ==", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.threads.profilePosts({ handle: \"zuck\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.threads.profile_posts(handle=\"zuck\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/threads/profile/posts \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=zuck\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_ThreadsPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/ThreadsPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "ThreadsPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "code", "kind", "isReply", "pinned", "continued", "paidPartnership" ], "properties": { "altText": { "type": [ "string", "null" ], "description": "Threads' description of the image, for screen readers." }, "code": { "type": "string", "description": "The code in its link (`threads.com/@user/post/`)." }, "continued": { "type": "boolean", "description": "Whether its author continued it with posts of their own (a thread of several)." }, "isReply": { "type": "boolean", "description": "Whether it is a reply, and to what: the post it answers when the list carried it,\nelse at least whose post." }, "kind": { "$ref": "#/components/schemas/ThreadsPostKind" }, "language": { "type": [ "string", "null" ], "description": "Its text's language, as Threads detected it." }, "link": { "oneOf": [ { "$ref": "#/components/schemas/ThreadsLinkPreview", "description": "The link it shares, as its preview shows it." }, { "type": "null" } ] }, "paidPartnership": { "type": "boolean", "description": "A paid partnership." }, "pinned": { "type": "boolean", "description": "Pinned to its author's profile." }, "quoted": { "oneOf": [ { "$ref": "#/components/schemas/ThreadsPostRef", "description": "The post it quotes." }, { "type": "null" } ] }, "quotes": { "type": [ "integer", "null" ], "format": "int64", "description": "Posts quoting it.", "minimum": 0 }, "replyTo": { "oneOf": [ { "$ref": "#/components/schemas/ThreadsPostRef" }, { "type": "null" } ] }, "repostedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "When the account reposted it, on a profile's reposts." }, { "type": "null" } ] }, "reposts": { "type": [ "integer", "null" ], "format": "int64", "description": "Reposts of it.", "minimum": 0 }, "topic": { "type": [ "string", "null" ], "description": "The topic tag it is posted under." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A thread: text, a photo, a video or a carousel." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "Timestamp": { "type": "string", "format": "date-time" }, "ThreadsPostRef": { "type": "object", "description": "Another post, as a post names it.", "properties": { "code": { "type": [ "string", "null" ] }, "id": { "type": [ "string", "null" ], "description": "Its id, when the answer carries the post itself." }, "text": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "username": { "type": [ "string", "null" ] } } }, "ThreadsLinkPreview": { "type": "object", "required": [ "url" ], "properties": { "displayUrl": { "type": [ "string", "null" ], "description": "The host as shown (`nytimes.com`)." }, "title": { "type": [ "string", "null" ] }, "url": { "type": "string" } } }, "ThreadsPostKind": { "type": "string", "description": "What a thread is.", "enum": [ "text", "photo", "video", "carousel" ] }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Profile Replies (/docs/api-reference/threads/profile-replies) An account's replies to other threads, 25 a page. `GET https://api.socialapi.sh/v1/threads/profile/replies` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.threads.profileReplies({ handle: "zuck" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.threads.profile_replies(handle="zuck") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/threads/profile/replies \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=zuck" ``` **Response** ```json { "data": [ { "id": "4037269927040341294", "url": "https://www.threads.com/@zuck/post/DgHQ5u3m1Uu", "text": "The wait is over 🇬🇧", "createdAt": "2026-11-24T06:01:41.000Z", "author": { "id": "63055343223", "username": "zuck", "displayName": "Mark Zuckerberg", "avatarUrl": "https://scontent-yyz1-1.cdninstagram.com/v/t51.82787-19/825322135_17989325280103224_1252773933700107438_n.jpg?stp=dst-jpg_s150x150_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby4xMDgwLmMyIn0&_nc_ht=scontent-yyz1-1.cdninstagram.com&_nc_cat=1&_nc_oc=Q6cZ2gFXOVT9dX7qfpwJSgoZaY8RrJx0dowaP3AlZvb19L291hIG8o54in0fnRE4Ml94kEk&_nc_ohc=TcNBs21yW1gQ7kNvwEwCyYF&_nc_gid=0O_vcns20REaNxzqQmYCww&edm=ABytkVIBAAAA&ccb=7-5&_nc_ct=RQAsPBUCFQIAAAA&oh=00_AQTTecEgg6GLVATIkkMM4x-qqPNFIMsjoWcb4SFVngKB-g&oe=6B0BE5EB&_nc_sid=14c75f", "verified": true, "url": "https://www.threads.com/@zuck" }, "stats": { "views": null, "likes": 16, "comments": 2, "shares": 1, "saves": null, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "code": "DgHQ5u3m1Uu", "kind": "text", "reposts": 0, "quotes": 0, "isReply": true, "replyTo": { "id": "3983056061808895467", "code": "DdGqGKUleXr", "username": "iamtravelr", "text": "Excited for this, hope to get in the UK soon", "url": "https://www.threads.com/@iamtravelr/post/DdGqGKUleXr" }, "quoted": null, "link": null, "topic": null, "pinned": false, "continued": false, "repostedAt": null, "language": "en", "paidPartnership": false, "altText": null } }, { "id": "3960495719916521600", "url": "https://www.threads.com/@zuck/post/Db2gd-oFEiA", "text": "Always fun when you visit 🙏", "createdAt": "2026-08-10T07:45:02.000Z", "author": { "id": "63055343223", "username": "zuck", "displayName": "Mark Zuckerberg", "avatarUrl": "https://scontent-yyz1-1.cdninstagram.com/v/t51.82787-19/825322135_17989325280103224_1252773933700107438_n.jpg?stp=dst-jpg_s150x150_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby4xMDgwLmMyIn0&_nc_ht=scontent-yyz1-1.cdninstagram.com&_nc_cat=1&_nc_oc=Q6cZ2gFXOVT9dX7qfpwJSgoZaY8RrJx0dowaP3AlZvb19L291hIG8o54in0fnRE4Ml94kEk&_nc_ohc=TcNBs21yW1gQ7kNvwEwCyYF&_nc_gid=0O_vcns20REaNxzqQmYCww&edm=ABytkVIBAAAA&ccb=7-5&_nc_ct=RQAsPBUCFQIAAAA&oh=00_AQTTecEgg6GLVATIkkMM4x-qqPNFIMsjoWcb4SFVngKB-g&oe=6B0BE5EB&_nc_sid=14c75f", "verified": true, "url": "https://www.threads.com/@zuck" }, "stats": { "views": null, "likes": 508, "comments": 67, "shares": 1, "saves": null, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "code": "Db2gd-oFEiA", "kind": "text", "reposts": 22, "quotes": 5, "isReply": true, "replyTo": { "id": "3960325666659545064", "code": "Db15zYMGq_o", "username": "merab.dvalishvili", "text": "Always fun sparring with Mark 🦾⚔️", "url": "https://www.threads.com/@merab.dvalishvili/post/Db15zYMGq_o" }, "quoted": null, "link": null, "topic": null, "pinned": false, "continued": false, "repostedAt": null, "language": "en", "paidPartnership": false, "altText": null } } ], "pagination": { "nextCursor": "QVFDZXA0QkljemVPMEdDLXNLZFVlR04tQl9jbmdfTXdnaW56bnc4QjRGX2szWTA3QVFUcmxpVTdDdGdBLTBoazZ3THVCOWxGTjZTZXlCYm1RTFZoMWliZg==", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/threads/profile/replies": { "get": { "tags": [ "Threads" ], "summary": "An account's replies to other threads, 25 a page.", "description": "Each with the post it answers, in `ext.replyTo`. 1 credit a page.", "operationId": "threadsProfileReplies", "parameters": [ { "name": "handle", "in": "query", "description": "The username, with or without `@`.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "The profile's link, instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_ThreadsPost" }, "example": { "data": [ { "id": "4037269927040341294", "url": "https://www.threads.com/@zuck/post/DgHQ5u3m1Uu", "text": "The wait is over 🇬🇧", "createdAt": "2026-11-24T06:01:41.000Z", "author": { "id": "63055343223", "username": "zuck", "displayName": "Mark Zuckerberg", "avatarUrl": "https://scontent-yyz1-1.cdninstagram.com/v/t51.82787-19/825322135_17989325280103224_1252773933700107438_n.jpg?stp=dst-jpg_s150x150_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby4xMDgwLmMyIn0&_nc_ht=scontent-yyz1-1.cdninstagram.com&_nc_cat=1&_nc_oc=Q6cZ2gFXOVT9dX7qfpwJSgoZaY8RrJx0dowaP3AlZvb19L291hIG8o54in0fnRE4Ml94kEk&_nc_ohc=TcNBs21yW1gQ7kNvwEwCyYF&_nc_gid=0O_vcns20REaNxzqQmYCww&edm=ABytkVIBAAAA&ccb=7-5&_nc_ct=RQAsPBUCFQIAAAA&oh=00_AQTTecEgg6GLVATIkkMM4x-qqPNFIMsjoWcb4SFVngKB-g&oe=6B0BE5EB&_nc_sid=14c75f", "verified": true, "url": "https://www.threads.com/@zuck" }, "stats": { "views": null, "likes": 16, "comments": 2, "shares": 1, "saves": null, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "code": "DgHQ5u3m1Uu", "kind": "text", "reposts": 0, "quotes": 0, "isReply": true, "replyTo": { "id": "3983056061808895467", "code": "DdGqGKUleXr", "username": "iamtravelr", "text": "Excited for this, hope to get in the UK soon", "url": "https://www.threads.com/@iamtravelr/post/DdGqGKUleXr" }, "quoted": null, "link": null, "topic": null, "pinned": false, "continued": false, "repostedAt": null, "language": "en", "paidPartnership": false, "altText": null } }, { "id": "3960495719916521600", "url": "https://www.threads.com/@zuck/post/Db2gd-oFEiA", "text": "Always fun when you visit 🙏", "createdAt": "2026-08-10T07:45:02.000Z", "author": { "id": "63055343223", "username": "zuck", "displayName": "Mark Zuckerberg", "avatarUrl": "https://scontent-yyz1-1.cdninstagram.com/v/t51.82787-19/825322135_17989325280103224_1252773933700107438_n.jpg?stp=dst-jpg_s150x150_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby4xMDgwLmMyIn0&_nc_ht=scontent-yyz1-1.cdninstagram.com&_nc_cat=1&_nc_oc=Q6cZ2gFXOVT9dX7qfpwJSgoZaY8RrJx0dowaP3AlZvb19L291hIG8o54in0fnRE4Ml94kEk&_nc_ohc=TcNBs21yW1gQ7kNvwEwCyYF&_nc_gid=0O_vcns20REaNxzqQmYCww&edm=ABytkVIBAAAA&ccb=7-5&_nc_ct=RQAsPBUCFQIAAAA&oh=00_AQTTecEgg6GLVATIkkMM4x-qqPNFIMsjoWcb4SFVngKB-g&oe=6B0BE5EB&_nc_sid=14c75f", "verified": true, "url": "https://www.threads.com/@zuck" }, "stats": { "views": null, "likes": 508, "comments": 67, "shares": 1, "saves": null, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "code": "Db2gd-oFEiA", "kind": "text", "reposts": 22, "quotes": 5, "isReply": true, "replyTo": { "id": "3960325666659545064", "code": "Db15zYMGq_o", "username": "merab.dvalishvili", "text": "Always fun sparring with Mark 🦾⚔️", "url": "https://www.threads.com/@merab.dvalishvili/post/Db15zYMGq_o" }, "quoted": null, "link": null, "topic": null, "pinned": false, "continued": false, "repostedAt": null, "language": "en", "paidPartnership": false, "altText": null } } ], "pagination": { "nextCursor": "QVFDZXA0QkljemVPMEdDLXNLZFVlR04tQl9jbmdfTXdnaW56bnc4QjRGX2szWTA3QVFUcmxpVTdDdGdBLTBoazZ3THVCOWxGTjZTZXlCYm1RTFZoMWliZg==", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.threads.profileReplies({ handle: \"zuck\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.threads.profile_replies(handle=\"zuck\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/threads/profile/replies \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=zuck\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_ThreadsPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/ThreadsPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "ThreadsPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "code", "kind", "isReply", "pinned", "continued", "paidPartnership" ], "properties": { "altText": { "type": [ "string", "null" ], "description": "Threads' description of the image, for screen readers." }, "code": { "type": "string", "description": "The code in its link (`threads.com/@user/post/`)." }, "continued": { "type": "boolean", "description": "Whether its author continued it with posts of their own (a thread of several)." }, "isReply": { "type": "boolean", "description": "Whether it is a reply, and to what: the post it answers when the list carried it,\nelse at least whose post." }, "kind": { "$ref": "#/components/schemas/ThreadsPostKind" }, "language": { "type": [ "string", "null" ], "description": "Its text's language, as Threads detected it." }, "link": { "oneOf": [ { "$ref": "#/components/schemas/ThreadsLinkPreview", "description": "The link it shares, as its preview shows it." }, { "type": "null" } ] }, "paidPartnership": { "type": "boolean", "description": "A paid partnership." }, "pinned": { "type": "boolean", "description": "Pinned to its author's profile." }, "quoted": { "oneOf": [ { "$ref": "#/components/schemas/ThreadsPostRef", "description": "The post it quotes." }, { "type": "null" } ] }, "quotes": { "type": [ "integer", "null" ], "format": "int64", "description": "Posts quoting it.", "minimum": 0 }, "replyTo": { "oneOf": [ { "$ref": "#/components/schemas/ThreadsPostRef" }, { "type": "null" } ] }, "repostedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "When the account reposted it, on a profile's reposts." }, { "type": "null" } ] }, "reposts": { "type": [ "integer", "null" ], "format": "int64", "description": "Reposts of it.", "minimum": 0 }, "topic": { "type": [ "string", "null" ], "description": "The topic tag it is posted under." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A thread: text, a photo, a video or a carousel." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "Timestamp": { "type": "string", "format": "date-time" }, "ThreadsPostRef": { "type": "object", "description": "Another post, as a post names it.", "properties": { "code": { "type": [ "string", "null" ] }, "id": { "type": [ "string", "null" ], "description": "Its id, when the answer carries the post itself." }, "text": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "username": { "type": [ "string", "null" ] } } }, "ThreadsLinkPreview": { "type": "object", "required": [ "url" ], "properties": { "displayUrl": { "type": [ "string", "null" ], "description": "The host as shown (`nytimes.com`)." }, "title": { "type": [ "string", "null" ] }, "url": { "type": "string" } } }, "ThreadsPostKind": { "type": "string", "description": "What a thread is.", "enum": [ "text", "photo", "video", "carousel" ] }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Profile Reposts (/docs/api-reference/threads/profile-reposts) Other people's threads an account reposted. `GET https://api.socialapi.sh/v1/threads/profile/reposts` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.threads.profileReposts({ handle: "zuck" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.threads.profile_reposts(handle="zuck") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/threads/profile/reposts \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=zuck" ``` **Response** ```json { "data": [ { "id": "3947513500025400936", "url": "https://www.threads.com/@meta/post/DbIYp0LEq5o", "text": "We believe the future will have fewer barriers and more breakthroughs, but no matter what changes, people will be at the heart of everything we do.", "createdAt": "2026-07-23T09:59:18.000Z", "author": { "id": "63053551787", "username": "meta", "displayName": "Meta", "avatarUrl": "https://scontent-nrt6-1.cdninstagram.com/v/t51.82787-19/551871521_17926195818103788_5244672897793476443_n.jpg?stp=dst-jpg_s150x150_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby4xMDgwLmMyIn0&_nc_ht=scontent-nrt6-1.cdninstagram.com&_nc_cat=100&_nc_oc=Q6cZ2gFgIt3CapfLYnnCR7CT7SLrWqOyvUjzvWfDYKzFiT3goVWzy7niLNHy9v_gsLwlQFo&_nc_ohc=vXzSg35YPOkQ7kNvwGVJtV7&_nc_gid=yWi6c9bypWkaqzm6-o7XLA&edm=AGa1-tIBAAAA&ccb=7-5&_nc_ct=RQAsPBUCFQIAAAA&oh=00_AQRLBH5LDgeMFYZd6og0j9SUoVqZX83FULwsSBrZ88sfoQ&oe=6B0BE494&_nc_sid=8d2ebb", "verified": true, "url": "https://www.threads.com/@meta" }, "stats": { "views": null, "likes": 1093, "comments": 395, "shares": 98, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://scontent-nrt1-2.cdninstagram.com/o1/v/t2/f2/m367/AQOX14kG2PiPSGpL3GmaQIHyW9tZglBct3eP34dkW9Qp_7yQIJyp3a6kt62HT5epXUjXhMy3m29R87BiGp1PSyksUezjoO3EchAj7rTpuw.mp4?_nc_cat=104&_nc_sid=8bf8fe&_nc_ht=scontent-nrt1-2.cdninstagram.com&_nc_ohc=IE5by4hWpasQ7kNvwF9vGWn&efg=eyJ2ZW5jb2RlX3RhZyI6Inhwdl9wcm9ncmVzc2l2ZS5JTlNUQUdSQU0uRkVFRC5DMy43MjAucHJvZ3Jlc3NpdmVfaDI2NC1iYXNpYy1nZW4yXzcyMHAiLCJ4cHZfYXNzZXRfaWQiOjE3OTc5NTg4ODQ2MTAzNzg4LCJhc3NldF9hZ2VfZGF5cyI6MTI0LCJ2aV91c2VjYXNlX2lkIjoxMDE2NCwiZHVyYXRpb25fcyI6NjAsInVybGdlbl9zb3VyY2UiOiJ3d3cifQ%3D%3D&ccb=17-1&_nc_gid=yWi6c9bypWkaqzm6-o7XLA&_nc_ss=7a30f&_nc_map=urlgen_bucketless&_nc_zt=28&_nc_enc=UlkxrtzfwEV0lFJJSYZl4P5dTI0MKzCddNc4hhaBUn1xayx4BG1cBdr0zsFBicDL4O16GngICO0IoK1goU7RRcDzOYO3B9_2z31QojKvwhb-ym9FgkcWJN6sEac&oh=00_AQS7X9kGNvlsuf00yYn3Wd1zK7LskgPpUQRXyeT9jY4BXA&oe=6B0BEBE2", "thumbnailUrl": "https://scontent-nrt6-1.cdninstagram.com/v/t51.71878-15/755264155_1045518824870715_6445061358203977155_n.jpg?stp=dst-jpg_e15_tt6&_nc_cat=107&_nc_map=urlgen_bucketless&ig_cache_key=Mzk0NzUxMzUwMDAyNTQwMDkzNg%3D%3D.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkZFRUQueHBpZHMuNjQwLnNkci52aWRlb19kZWZhdWx0X2NvdmVyX2ZyYW1lLkMzIn0%3D&_nc_ohc=t4va1jBGxuIQ7kNvwEh5VpY&_nc_oc=AdovsMM2LgsO1H3wBCl4ynLK7FPtqnoG84rjKLUCVssS_2fGV3fhvHR5aMXI3ubpfLY&_nc_ad=z-m&_nc_cid=0&_nc_zt=23&_nc_ht=scontent-nrt6-1.cdninstagram.com&_nc_gid=yWi6c9bypWkaqzm6-o7XLA&_nc_ss=7a30f&_nc_ct=RQosPBUIFQQlBAAAAA&oh=00_AQQKAmBtFG_RzN35ki0PJ8ZP_B_n0_DMnjvJzxFkGqCP8A&oe=6B0BF33D", "width": 1080, "height": 1920, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "code": "DbIYp0LEq5o", "kind": "video", "reposts": 115, "quotes": 30, "isReply": false, "replyTo": null, "quoted": null, "link": null, "topic": null, "pinned": false, "continued": false, "repostedAt": "2026-07-23T10:01:40.000Z", "language": "en", "paidPartnership": false, "altText": null } } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/threads/profile/reposts": { "get": { "tags": [ "Threads" ], "summary": "Other people's threads an account reposted.", "description": "With when, in `ext.repostedAt`. 1 credit a page.", "operationId": "threadsProfileReposts", "parameters": [ { "name": "handle", "in": "query", "description": "The username, with or without `@`.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "The profile's link, instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_ThreadsPost" }, "example": { "data": [ { "id": "3947513500025400936", "url": "https://www.threads.com/@meta/post/DbIYp0LEq5o", "text": "We believe the future will have fewer barriers and more breakthroughs, but no matter what changes, people will be at the heart of everything we do.", "createdAt": "2026-07-23T09:59:18.000Z", "author": { "id": "63053551787", "username": "meta", "displayName": "Meta", "avatarUrl": "https://scontent-nrt6-1.cdninstagram.com/v/t51.82787-19/551871521_17926195818103788_5244672897793476443_n.jpg?stp=dst-jpg_s150x150_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby4xMDgwLmMyIn0&_nc_ht=scontent-nrt6-1.cdninstagram.com&_nc_cat=100&_nc_oc=Q6cZ2gFgIt3CapfLYnnCR7CT7SLrWqOyvUjzvWfDYKzFiT3goVWzy7niLNHy9v_gsLwlQFo&_nc_ohc=vXzSg35YPOkQ7kNvwGVJtV7&_nc_gid=yWi6c9bypWkaqzm6-o7XLA&edm=AGa1-tIBAAAA&ccb=7-5&_nc_ct=RQAsPBUCFQIAAAA&oh=00_AQRLBH5LDgeMFYZd6og0j9SUoVqZX83FULwsSBrZ88sfoQ&oe=6B0BE494&_nc_sid=8d2ebb", "verified": true, "url": "https://www.threads.com/@meta" }, "stats": { "views": null, "likes": 1093, "comments": 395, "shares": 98, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://scontent-nrt1-2.cdninstagram.com/o1/v/t2/f2/m367/AQOX14kG2PiPSGpL3GmaQIHyW9tZglBct3eP34dkW9Qp_7yQIJyp3a6kt62HT5epXUjXhMy3m29R87BiGp1PSyksUezjoO3EchAj7rTpuw.mp4?_nc_cat=104&_nc_sid=8bf8fe&_nc_ht=scontent-nrt1-2.cdninstagram.com&_nc_ohc=IE5by4hWpasQ7kNvwF9vGWn&efg=eyJ2ZW5jb2RlX3RhZyI6Inhwdl9wcm9ncmVzc2l2ZS5JTlNUQUdSQU0uRkVFRC5DMy43MjAucHJvZ3Jlc3NpdmVfaDI2NC1iYXNpYy1nZW4yXzcyMHAiLCJ4cHZfYXNzZXRfaWQiOjE3OTc5NTg4ODQ2MTAzNzg4LCJhc3NldF9hZ2VfZGF5cyI6MTI0LCJ2aV91c2VjYXNlX2lkIjoxMDE2NCwiZHVyYXRpb25fcyI6NjAsInVybGdlbl9zb3VyY2UiOiJ3d3cifQ%3D%3D&ccb=17-1&_nc_gid=yWi6c9bypWkaqzm6-o7XLA&_nc_ss=7a30f&_nc_map=urlgen_bucketless&_nc_zt=28&_nc_enc=UlkxrtzfwEV0lFJJSYZl4P5dTI0MKzCddNc4hhaBUn1xayx4BG1cBdr0zsFBicDL4O16GngICO0IoK1goU7RRcDzOYO3B9_2z31QojKvwhb-ym9FgkcWJN6sEac&oh=00_AQS7X9kGNvlsuf00yYn3Wd1zK7LskgPpUQRXyeT9jY4BXA&oe=6B0BEBE2", "thumbnailUrl": "https://scontent-nrt6-1.cdninstagram.com/v/t51.71878-15/755264155_1045518824870715_6445061358203977155_n.jpg?stp=dst-jpg_e15_tt6&_nc_cat=107&_nc_map=urlgen_bucketless&ig_cache_key=Mzk0NzUxMzUwMDAyNTQwMDkzNg%3D%3D.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkZFRUQueHBpZHMuNjQwLnNkci52aWRlb19kZWZhdWx0X2NvdmVyX2ZyYW1lLkMzIn0%3D&_nc_ohc=t4va1jBGxuIQ7kNvwEh5VpY&_nc_oc=AdovsMM2LgsO1H3wBCl4ynLK7FPtqnoG84rjKLUCVssS_2fGV3fhvHR5aMXI3ubpfLY&_nc_ad=z-m&_nc_cid=0&_nc_zt=23&_nc_ht=scontent-nrt6-1.cdninstagram.com&_nc_gid=yWi6c9bypWkaqzm6-o7XLA&_nc_ss=7a30f&_nc_ct=RQosPBUIFQQlBAAAAA&oh=00_AQQKAmBtFG_RzN35ki0PJ8ZP_B_n0_DMnjvJzxFkGqCP8A&oe=6B0BF33D", "width": 1080, "height": 1920, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "code": "DbIYp0LEq5o", "kind": "video", "reposts": 115, "quotes": 30, "isReply": false, "replyTo": null, "quoted": null, "link": null, "topic": null, "pinned": false, "continued": false, "repostedAt": "2026-07-23T10:01:40.000Z", "language": "en", "paidPartnership": false, "altText": null } } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.threads.profileReposts({ handle: \"zuck\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.threads.profile_reposts(handle=\"zuck\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/threads/profile/reposts \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=zuck\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_ThreadsPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/ThreadsPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "ThreadsPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "code", "kind", "isReply", "pinned", "continued", "paidPartnership" ], "properties": { "altText": { "type": [ "string", "null" ], "description": "Threads' description of the image, for screen readers." }, "code": { "type": "string", "description": "The code in its link (`threads.com/@user/post/`)." }, "continued": { "type": "boolean", "description": "Whether its author continued it with posts of their own (a thread of several)." }, "isReply": { "type": "boolean", "description": "Whether it is a reply, and to what: the post it answers when the list carried it,\nelse at least whose post." }, "kind": { "$ref": "#/components/schemas/ThreadsPostKind" }, "language": { "type": [ "string", "null" ], "description": "Its text's language, as Threads detected it." }, "link": { "oneOf": [ { "$ref": "#/components/schemas/ThreadsLinkPreview", "description": "The link it shares, as its preview shows it." }, { "type": "null" } ] }, "paidPartnership": { "type": "boolean", "description": "A paid partnership." }, "pinned": { "type": "boolean", "description": "Pinned to its author's profile." }, "quoted": { "oneOf": [ { "$ref": "#/components/schemas/ThreadsPostRef", "description": "The post it quotes." }, { "type": "null" } ] }, "quotes": { "type": [ "integer", "null" ], "format": "int64", "description": "Posts quoting it.", "minimum": 0 }, "replyTo": { "oneOf": [ { "$ref": "#/components/schemas/ThreadsPostRef" }, { "type": "null" } ] }, "repostedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "When the account reposted it, on a profile's reposts." }, { "type": "null" } ] }, "reposts": { "type": [ "integer", "null" ], "format": "int64", "description": "Reposts of it.", "minimum": 0 }, "topic": { "type": [ "string", "null" ], "description": "The topic tag it is posted under." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A thread: text, a photo, a video or a carousel." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "Timestamp": { "type": "string", "format": "date-time" }, "ThreadsPostRef": { "type": "object", "description": "Another post, as a post names it.", "properties": { "code": { "type": [ "string", "null" ] }, "id": { "type": [ "string", "null" ], "description": "Its id, when the answer carries the post itself." }, "text": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "username": { "type": [ "string", "null" ] } } }, "ThreadsLinkPreview": { "type": "object", "required": [ "url" ], "properties": { "displayUrl": { "type": [ "string", "null" ], "description": "The host as shown (`nytimes.com`)." }, "title": { "type": [ "string", "null" ] }, "url": { "type": "string" } } }, "ThreadsPostKind": { "type": "string", "description": "What a thread is.", "enum": [ "text", "photo", "video", "carousel" ] }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Profile (/docs/api-reference/threads/profile) A profile with its follower count. `GET https://api.socialapi.sh/v1/threads/profile` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.threads.profile({ handle: "zuck" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.threads.profile(handle="zuck").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/threads/profile \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=zuck" ``` **Response** ```json { "data": { "id": "63055343223", "username": "zuck", "displayName": "Mark Zuckerberg", "bio": "Mostly superintelligence and MMA takes", "avatarUrl": "https://scontent-nrt6-1.cdninstagram.com/v/t51.82787-19/825322135_17989325280103224_1252773933700107438_n.jpg?stp=dst-jpg_s640x640_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby4xMDgwLmMyIn0&_nc_ht=scontent-nrt6-1.cdninstagram.com&_nc_cat=100&_nc_oc=Q6cZ2gEbJAaY4VAfsA-SdUiOuyyefB_PaDbIjArtHdBA5E9_oz8s23mkKO8K36do2sY94fk&_nc_ohc=TcNBs21yW1gQ7kNvwHHOsMz&_nc_gid=3utomVOdhJVr5GxFQLdxgQ&edm=AAZTMJEBAAAA&ccb=7-5&_nc_ct=RQAsPBUCFQIAAAA&oh=00_AQQ7XHzV0_X-JdqIiVqvgiHTaON1Otu3q1X6WoaBBg9WbA&oe=6B0BE5EB&_nc_sid=49cb7f", "url": "https://www.threads.com/@zuck", "verified": true, "private": false, "followers": 5783862, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": null, "ext": { "bioLinks": [], "interests": [ "AI Threads", "UFC Threads", "AI" ] } } } ``` **OpenAPI** ```json { "paths": { "/v1/threads/profile": { "get": { "tags": [ "Threads" ], "summary": "A profile with its follower count.", "description": "Name, bio and its links, interests, verified, private and the follower count.\n1 credit.", "operationId": "threadsProfile", "parameters": [ { "name": "handle", "in": "query", "description": "The username, with or without `@`.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "The profile's link (`https://www.threads.com/@zuck`), instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_ThreadsProfile" }, "example": { "data": { "id": "63055343223", "username": "zuck", "displayName": "Mark Zuckerberg", "bio": "Mostly superintelligence and MMA takes", "avatarUrl": "https://scontent-nrt6-1.cdninstagram.com/v/t51.82787-19/825322135_17989325280103224_1252773933700107438_n.jpg?stp=dst-jpg_s640x640_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby4xMDgwLmMyIn0&_nc_ht=scontent-nrt6-1.cdninstagram.com&_nc_cat=100&_nc_oc=Q6cZ2gEbJAaY4VAfsA-SdUiOuyyefB_PaDbIjArtHdBA5E9_oz8s23mkKO8K36do2sY94fk&_nc_ohc=TcNBs21yW1gQ7kNvwHHOsMz&_nc_gid=3utomVOdhJVr5GxFQLdxgQ&edm=AAZTMJEBAAAA&ccb=7-5&_nc_ct=RQAsPBUCFQIAAAA&oh=00_AQQ7XHzV0_X-JdqIiVqvgiHTaON1Otu3q1X6WoaBBg9WbA&oe=6B0BE5EB&_nc_sid=49cb7f", "url": "https://www.threads.com/@zuck", "verified": true, "private": false, "followers": 5783862, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": null, "ext": { "bioLinks": [], "interests": [ "AI Threads", "UFC Threads", "AI" ] } } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.threads.profile({ handle: \"zuck\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.threads.profile(handle=\"zuck\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/threads/profile \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=zuck\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_ThreadsProfile": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/ThreadsProfile" } } }, "ThreadsProfile": { "allOf": [ { "type": "object", "description": "An account.", "required": [ "id", "username", "url", "verified", "private", "ext" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "bio": { "type": [ "string", "null" ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "displayName": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "bioLinks", "interests" ], "properties": { "bioLinks": { "type": "array", "items": { "type": "string" }, "description": "Every link in the bio, in order (`externalUrl` is the first)." }, "interests": { "type": "array", "items": { "type": "string" }, "description": "The topics the account lists on its profile." } } }, { "type": "object", "description": "What only this platform has." } ] }, "externalUrl": { "type": [ "string", "null" ], "description": "The link in the bio." }, "followers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "following": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "id": { "type": "string", "description": "The platform's id for the account." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "description": "Likes the account's posts received in total.", "minimum": 0 }, "posts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "private": { "type": "boolean" }, "url": { "type": "string", "description": "The profile's page." }, "username": { "type": "string", "description": "The handle, without `@`." }, "verified": { "type": "boolean" } } }, { "type": "object", "description": "A Threads account." } ] }, "Timestamp": { "type": "string", "format": "date-time" } } } } ``` # Search Users (/docs/api-reference/threads/search-users) Accounts matching a name, the first 10. `GET https://api.socialapi.sh/v1/threads/search/users` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.threads.searchUsers({ query: "coffee" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.threads.search_users(query="coffee") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/threads/search/users \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "query=coffee" ``` **Response** ```json { "data": [ { "id": "70183576958", "username": "abd_coffeeandlife", "displayName": "A BEAUTIFUL DAY COMPANY", "bio": null, "avatarUrl": "https://scontent-nrt1-2.cdninstagram.com/v/t51.2885-19/464276214_570486432040993_1805345661052971785_n.jpg?stp=dst-jpg_s150x150_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby43MDkuYzIifQ&_nc_ht=scontent-nrt1-2.cdninstagram.com&_nc_cat=101&_nc_oc=Q6cZ2gFgsGQetrnORkrUSXucOi5QjolJ5j8nfHeJzGKpuM0V6JvulcMvdQm8SSc5vYcVFmQ&_nc_ohc=T036o6raNXQQ7kNvwF10NwX&_nc_gid=QycRRqZt17oiL0z6fW58eg&edm=AHhEZX8BAAAA&ccb=7-5&_nc_ct=RQAsPBUCFQIAAAA&oh=00_AQQZPvBaKYIAqKd5ik3q-0v4lmWmHgk9CXp1T68uf6Kzrg&oe=6B0BE593&_nc_sid=e8efdc", "url": "https://www.threads.com/@abd_coffeeandlife", "verified": false, "private": false, "followers": null, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": null, "ext": { "bioLinks": [], "interests": [] } }, { "id": "72554974779", "username": "coffee_nor_beer", "displayName": "珈琲苦うぃー", "bio": null, "avatarUrl": "https://scontent-nrt6-1.cdninstagram.com/v/t51.82787-19/765247621_17916353208422780_2010608728711815419_n.jpg?stp=dst-jpg_s150x150_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby44MDIuYzIifQ&_nc_ht=scontent-nrt6-1.cdninstagram.com&_nc_cat=1&_nc_oc=Q6cZ2gFgsGQetrnORkrUSXucOi5QjolJ5j8nfHeJzGKpuM0V6JvulcMvdQm8SSc5vYcVFmQ&_nc_ohc=fG2_s1C8kBYQ7kNvwHXywIA&_nc_gid=QycRRqZt17oiL0z6fW58eg&edm=AHhEZX8BAAAA&ccb=7-5&_nc_ct=RQAsPBUCFQIAAAA&oh=00_AQQ3VEghSt-UQJ1SGJd-eDI2HYYlN3UHHcwbkrzBTQ8eEw&oe=6B0BE3DE&_nc_sid=e8efdc", "url": "https://www.threads.com/@coffee_nor_beer", "verified": false, "private": false, "followers": null, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": null, "ext": { "bioLinks": [], "interests": [] } } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/threads/search/users": { "get": { "tags": [ "Threads" ], "summary": "Accounts matching a name, the first 10.", "description": "Without their counts. 1 credit.", "operationId": "threadsSearchUsers", "parameters": [ { "name": "query", "in": "query", "description": "A name or username to search for.", "required": true, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_ThreadsProfile" }, "example": { "data": [ { "id": "70183576958", "username": "abd_coffeeandlife", "displayName": "A BEAUTIFUL DAY COMPANY", "bio": null, "avatarUrl": "https://scontent-nrt1-2.cdninstagram.com/v/t51.2885-19/464276214_570486432040993_1805345661052971785_n.jpg?stp=dst-jpg_s150x150_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby43MDkuYzIifQ&_nc_ht=scontent-nrt1-2.cdninstagram.com&_nc_cat=101&_nc_oc=Q6cZ2gFgsGQetrnORkrUSXucOi5QjolJ5j8nfHeJzGKpuM0V6JvulcMvdQm8SSc5vYcVFmQ&_nc_ohc=T036o6raNXQQ7kNvwF10NwX&_nc_gid=QycRRqZt17oiL0z6fW58eg&edm=AHhEZX8BAAAA&ccb=7-5&_nc_ct=RQAsPBUCFQIAAAA&oh=00_AQQZPvBaKYIAqKd5ik3q-0v4lmWmHgk9CXp1T68uf6Kzrg&oe=6B0BE593&_nc_sid=e8efdc", "url": "https://www.threads.com/@abd_coffeeandlife", "verified": false, "private": false, "followers": null, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": null, "ext": { "bioLinks": [], "interests": [] } }, { "id": "72554974779", "username": "coffee_nor_beer", "displayName": "珈琲苦うぃー", "bio": null, "avatarUrl": "https://scontent-nrt6-1.cdninstagram.com/v/t51.82787-19/765247621_17916353208422780_2010608728711815419_n.jpg?stp=dst-jpg_s150x150_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby44MDIuYzIifQ&_nc_ht=scontent-nrt6-1.cdninstagram.com&_nc_cat=1&_nc_oc=Q6cZ2gFgsGQetrnORkrUSXucOi5QjolJ5j8nfHeJzGKpuM0V6JvulcMvdQm8SSc5vYcVFmQ&_nc_ohc=fG2_s1C8kBYQ7kNvwHXywIA&_nc_gid=QycRRqZt17oiL0z6fW58eg&edm=AHhEZX8BAAAA&ccb=7-5&_nc_ct=RQAsPBUCFQIAAAA&oh=00_AQQ3VEghSt-UQJ1SGJd-eDI2HYYlN3UHHcwbkrzBTQ8eEw&oe=6B0BE3DE&_nc_sid=e8efdc", "url": "https://www.threads.com/@coffee_nor_beer", "verified": false, "private": false, "followers": null, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": null, "ext": { "bioLinks": [], "interests": [] } } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.threads.searchUsers({ query: \"coffee\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.threads.search_users(query=\"coffee\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/threads/search/users \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"query=coffee\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_ThreadsProfile": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/ThreadsProfile" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "ThreadsProfile": { "allOf": [ { "type": "object", "description": "An account.", "required": [ "id", "username", "url", "verified", "private", "ext" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "bio": { "type": [ "string", "null" ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "displayName": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "bioLinks", "interests" ], "properties": { "bioLinks": { "type": "array", "items": { "type": "string" }, "description": "Every link in the bio, in order (`externalUrl` is the first)." }, "interests": { "type": "array", "items": { "type": "string" }, "description": "The topics the account lists on its profile." } } }, { "type": "object", "description": "What only this platform has." } ] }, "externalUrl": { "type": [ "string", "null" ], "description": "The link in the bio." }, "followers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "following": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "id": { "type": "string", "description": "The platform's id for the account." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "description": "Likes the account's posts received in total.", "minimum": 0 }, "posts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "private": { "type": "boolean" }, "url": { "type": "string", "description": "The profile's page." }, "username": { "type": "string", "description": "The handle, without `@`." }, "verified": { "type": "boolean" } } }, { "type": "object", "description": "A Threads account." } ] }, "Timestamp": { "type": "string", "format": "date-time" } } } } ``` # Search (/docs/api-reference/threads/search) Threads matching a query, top or latest first. `GET https://api.socialapi.sh/v1/threads/search` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.threads.search({ query: "coffee", sort: "top" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.threads.search(query="coffee", sort="top") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/threads/search \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "query=coffee" \ --data-urlencode "sort=top" ``` **Response** ```json { "data": [ { "id": "4037745892547301312", "url": "https://www.threads.com/@jamesarmstrong2753/post/DgI9H8Skw_A", "text": "I have my coffee black with one sugar thankyou beautiful", "createdAt": "2026-11-24T21:47:20.000Z", "author": { "id": "73901034480", "username": "jamesarmstrong2753", "displayName": "James Armstrong", "avatarUrl": "https://scontent-yyz1-1.cdninstagram.com/v/t51.82787-19/829527873_17916648564458481_5333203763895066288_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_cat=109&_nc_map=urlgen_bucketless&ig_cache_key=GEGXcTHxA0DRGKc-ALDevRWRWANKbmNDAQAB1501500j-ccb7-5&ccb=7-5&_nc_sid=43db74&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLnd3dy4xNTAuQzMifQ%3D%3D&_nc_ohc=hkbaPcWd8V4Q7kNvwHUUHxU&_nc_oc=Adr5Azxjtmy7AFPKwdss2FwhWuIb5QhmMGuqu5x8lokUolvN8Qu9N1f4HGrtbnsG2d8&_nc_zt=24&_nc_ht=scontent-yyz1-1.cdninstagram.com&_nc_gid=zFB9D4Dg_hdBYo5R-fmPlQ&_nc_ss=79389&_nc_ct=RQosPBUCFQIAAAA&oh=00_AQQFia1AUgiHfZoMMu85C5Y9u40_1fUvo-MWvN9TFhLQEg&oe=6B0BE416", "verified": false, "url": "https://www.threads.com/@jamesarmstrong2753" }, "stats": { "views": null, "likes": 4, "comments": 0, "shares": null, "saves": null, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "code": "DgI9H8Skw_A", "kind": "text", "reposts": 1, "quotes": 0, "isReply": true, "replyTo": { "id": "4037733930569549316", "code": "DgI6Z31I8YE", "username": "workwifemaya", "text": "coffee run in five. how do you take yours?", "url": "https://www.threads.com/@workwifemaya/post/DgI6Z31I8YE" }, "quoted": null, "link": null, "topic": null, "pinned": false, "continued": false, "repostedAt": null, "language": "en", "paidPartnership": false, "altText": null } }, { "id": "4037761338593056274", "url": "https://www.threads.com/@migs.joe/post/DgJAotipRYS", "text": "Apparently people don't like ICE coffee!!", "createdAt": "2026-11-24T22:18:02.000Z", "author": { "id": "69417262801", "username": "migs.joe", "displayName": "Joe Migs", "avatarUrl": "https://scontent-yyz1-1.cdninstagram.com/v/t51.82787-19/912496160_17957818908318802_2269378701315452396_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_cat=102&_nc_map=urlgen_bucketless&ig_cache_key=GCCWYzZSnPiIisw-AOytvrjnc34fbmNDAQAB1501500j-ccb7-5&ccb=7-5&_nc_sid=43db74&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLnd3dy44OTguQzMifQ%3D%3D&_nc_ohc=exMDrfGKo6wQ7kNvwEBKGze&_nc_oc=AdpxsLX-AA6RP7fHGT9FPYor9mpW40Zn3JLslEYXx4m8VnWfRWguw-QtUfbR8oJH7io&_nc_zt=24&_nc_ht=scontent-yyz1-1.cdninstagram.com&_nc_gid=zFB9D4Dg_hdBYo5R-fmPlQ&_nc_ss=79389&_nc_ct=RQosPBUCFQIAAAA&oh=00_AQQf7g4aHStBg8NCa9UU8tOZBVPt2JufZOQb9njDX8ON4w&oe=6B0BDFAC", "verified": false, "url": "https://www.threads.com/@migs.joe" }, "stats": { "views": null, "likes": 1, "comments": 0, "shares": null, "saves": null, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "code": "DgJAotipRYS", "kind": "text", "reposts": 0, "quotes": 0, "isReply": true, "replyTo": { "id": "4037707163694677618", "code": "DgI0UXPEj5y", "username": "jonsaysstuff", "text": "Update on Latin and ICE-owned Tasa Coffee Roasters in Chicago, Illinois: \nIt's PERMANENTLY closed! You guys don't play! \nI'd be on the lookout for it to be reopened under a new name. \nRemember Pierre and Jackie Marquez for what they are - traitors to our brothers and sisters.", "url": "https://www.threads.com/@jonsaysstuff/post/DgI0UXPEj5y" }, "quoted": null, "link": null, "topic": null, "pinned": false, "continued": false, "repostedAt": null, "language": "en", "paidPartnership": false, "altText": "Hungry So Good GIF by Rice Robot" } } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/threads/search": { "get": { "tags": [ "Threads" ], "summary": "Threads matching a query, top or latest first.", "description": "About 30 top or 20 latest, all Threads shows a visitor (no next page). 1 credit.", "operationId": "threadsSearch", "parameters": [ { "name": "query", "in": "query", "description": "What to search for.", "required": true, "schema": { "type": "string" } }, { "name": "sort", "in": "query", "description": "`top` (the default) or `recent`.", "required": false, "schema": { "type": "string", "description": "The order a list comes in.", "enum": [ "top", "recent" ] } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_ThreadsPost" }, "example": { "data": [ { "id": "4037745892547301312", "url": "https://www.threads.com/@jamesarmstrong2753/post/DgI9H8Skw_A", "text": "I have my coffee black with one sugar thankyou beautiful", "createdAt": "2026-11-24T21:47:20.000Z", "author": { "id": "73901034480", "username": "jamesarmstrong2753", "displayName": "James Armstrong", "avatarUrl": "https://scontent-yyz1-1.cdninstagram.com/v/t51.82787-19/829527873_17916648564458481_5333203763895066288_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_cat=109&_nc_map=urlgen_bucketless&ig_cache_key=GEGXcTHxA0DRGKc-ALDevRWRWANKbmNDAQAB1501500j-ccb7-5&ccb=7-5&_nc_sid=43db74&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLnd3dy4xNTAuQzMifQ%3D%3D&_nc_ohc=hkbaPcWd8V4Q7kNvwHUUHxU&_nc_oc=Adr5Azxjtmy7AFPKwdss2FwhWuIb5QhmMGuqu5x8lokUolvN8Qu9N1f4HGrtbnsG2d8&_nc_zt=24&_nc_ht=scontent-yyz1-1.cdninstagram.com&_nc_gid=zFB9D4Dg_hdBYo5R-fmPlQ&_nc_ss=79389&_nc_ct=RQosPBUCFQIAAAA&oh=00_AQQFia1AUgiHfZoMMu85C5Y9u40_1fUvo-MWvN9TFhLQEg&oe=6B0BE416", "verified": false, "url": "https://www.threads.com/@jamesarmstrong2753" }, "stats": { "views": null, "likes": 4, "comments": 0, "shares": null, "saves": null, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "code": "DgI9H8Skw_A", "kind": "text", "reposts": 1, "quotes": 0, "isReply": true, "replyTo": { "id": "4037733930569549316", "code": "DgI6Z31I8YE", "username": "workwifemaya", "text": "coffee run in five. how do you take yours?", "url": "https://www.threads.com/@workwifemaya/post/DgI6Z31I8YE" }, "quoted": null, "link": null, "topic": null, "pinned": false, "continued": false, "repostedAt": null, "language": "en", "paidPartnership": false, "altText": null } }, { "id": "4037761338593056274", "url": "https://www.threads.com/@migs.joe/post/DgJAotipRYS", "text": "Apparently people don't like ICE coffee!!", "createdAt": "2026-11-24T22:18:02.000Z", "author": { "id": "69417262801", "username": "migs.joe", "displayName": "Joe Migs", "avatarUrl": "https://scontent-yyz1-1.cdninstagram.com/v/t51.82787-19/912496160_17957818908318802_2269378701315452396_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_cat=102&_nc_map=urlgen_bucketless&ig_cache_key=GCCWYzZSnPiIisw-AOytvrjnc34fbmNDAQAB1501500j-ccb7-5&ccb=7-5&_nc_sid=43db74&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLnd3dy44OTguQzMifQ%3D%3D&_nc_ohc=exMDrfGKo6wQ7kNvwEBKGze&_nc_oc=AdpxsLX-AA6RP7fHGT9FPYor9mpW40Zn3JLslEYXx4m8VnWfRWguw-QtUfbR8oJH7io&_nc_zt=24&_nc_ht=scontent-yyz1-1.cdninstagram.com&_nc_gid=zFB9D4Dg_hdBYo5R-fmPlQ&_nc_ss=79389&_nc_ct=RQosPBUCFQIAAAA&oh=00_AQQf7g4aHStBg8NCa9UU8tOZBVPt2JufZOQb9njDX8ON4w&oe=6B0BDFAC", "verified": false, "url": "https://www.threads.com/@migs.joe" }, "stats": { "views": null, "likes": 1, "comments": 0, "shares": null, "saves": null, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "code": "DgJAotipRYS", "kind": "text", "reposts": 0, "quotes": 0, "isReply": true, "replyTo": { "id": "4037707163694677618", "code": "DgI0UXPEj5y", "username": "jonsaysstuff", "text": "Update on Latin and ICE-owned Tasa Coffee Roasters in Chicago, Illinois: \nIt's PERMANENTLY closed! You guys don't play! \nI'd be on the lookout for it to be reopened under a new name. \nRemember Pierre and Jackie Marquez for what they are - traitors to our brothers and sisters.", "url": "https://www.threads.com/@jonsaysstuff/post/DgI0UXPEj5y" }, "quoted": null, "link": null, "topic": null, "pinned": false, "continued": false, "repostedAt": null, "language": "en", "paidPartnership": false, "altText": "Hungry So Good GIF by Rice Robot" } } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.threads.search({ query: \"coffee\", sort: \"top\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.threads.search(query=\"coffee\", sort=\"top\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/threads/search \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"query=coffee\" \\\n --data-urlencode \"sort=top\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_ThreadsPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/ThreadsPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "ThreadsPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "code", "kind", "isReply", "pinned", "continued", "paidPartnership" ], "properties": { "altText": { "type": [ "string", "null" ], "description": "Threads' description of the image, for screen readers." }, "code": { "type": "string", "description": "The code in its link (`threads.com/@user/post/`)." }, "continued": { "type": "boolean", "description": "Whether its author continued it with posts of their own (a thread of several)." }, "isReply": { "type": "boolean", "description": "Whether it is a reply, and to what: the post it answers when the list carried it,\nelse at least whose post." }, "kind": { "$ref": "#/components/schemas/ThreadsPostKind" }, "language": { "type": [ "string", "null" ], "description": "Its text's language, as Threads detected it." }, "link": { "oneOf": [ { "$ref": "#/components/schemas/ThreadsLinkPreview", "description": "The link it shares, as its preview shows it." }, { "type": "null" } ] }, "paidPartnership": { "type": "boolean", "description": "A paid partnership." }, "pinned": { "type": "boolean", "description": "Pinned to its author's profile." }, "quoted": { "oneOf": [ { "$ref": "#/components/schemas/ThreadsPostRef", "description": "The post it quotes." }, { "type": "null" } ] }, "quotes": { "type": [ "integer", "null" ], "format": "int64", "description": "Posts quoting it.", "minimum": 0 }, "replyTo": { "oneOf": [ { "$ref": "#/components/schemas/ThreadsPostRef" }, { "type": "null" } ] }, "repostedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "When the account reposted it, on a profile's reposts." }, { "type": "null" } ] }, "reposts": { "type": [ "integer", "null" ], "format": "int64", "description": "Reposts of it.", "minimum": 0 }, "topic": { "type": [ "string", "null" ], "description": "The topic tag it is posted under." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A thread: text, a photo, a video or a carousel." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "Timestamp": { "type": "string", "format": "date-time" }, "ThreadsPostRef": { "type": "object", "description": "Another post, as a post names it.", "properties": { "code": { "type": [ "string", "null" ] }, "id": { "type": [ "string", "null" ], "description": "Its id, when the answer carries the post itself." }, "text": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "username": { "type": [ "string", "null" ] } } }, "ThreadsLinkPreview": { "type": "object", "required": [ "url" ], "properties": { "displayUrl": { "type": [ "string", "null" ], "description": "The host as shown (`nytimes.com`)." }, "title": { "type": [ "string", "null" ] }, "url": { "type": "string" } } }, "ThreadsPostKind": { "type": "string", "description": "What a thread is.", "enum": [ "text", "photo", "video", "carousel" ] }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Trending (/docs/api-reference/threads/trending) The feed Threads gives a visitor now. `GET https://api.socialapi.sh/v1/threads/trending` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.threads.trending(); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.threads.trending() ``` **cURL** ```bash curl https://api.socialapi.sh/v1/threads/trending \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" ``` **Response** ```json { "data": [ { "id": "4037535815235947409", "url": "https://www.threads.com/@leo_hillier_photography/post/DgINW6jDkuR", "text": "Anne Widdecombe’s estate sale confirms who she was.", "createdAt": "2026-11-24T14:49:57.000Z", "author": { "id": "68110919017", "username": "leo_hillier_photography", "displayName": "Leo Hillier", "avatarUrl": "https://scontent-nrt1-1.cdninstagram.com/v/t51.2885-19/462679647_1051405903234880_2787649124151444946_n.jpg?stp=dst-jpg_s150x150_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby4xMDgwLmMyIn0&_nc_ht=scontent-nrt1-1.cdninstagram.com&_nc_cat=108&_nc_oc=Q6cZ2gHFJYsSTtdEq0F-qncV25dClE0QhWwDzYwOt7-pp4FMRgw7cgw6gMfTzX_aI73Lfbg&_nc_ohc=oAaoYKiHyRUQ7kNvwE2RYLF&_nc_gid=-vKBw5jSoRGSONCTvkXr_g&edm=ACM2rXoBAAAA&ccb=7-5&_nc_ct=RQAsPBUCFQIAAAA&oh=00_AQQeEt7J4On_o9mqbJ_Xa6r7VeBsnVaHg8xoTq1XBPgVUw&oe=6B0BE8DD&_nc_sid=68810c", "verified": false, "url": "https://www.threads.com/@leo_hillier_photography" }, "stats": { "views": null, "likes": 1136, "comments": 131, "shares": null, "saves": null, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "code": "DgINW6jDkuR", "kind": "text", "reposts": 34, "quotes": 0, "isReply": false, "replyTo": null, "quoted": null, "link": null, "topic": "UK Politcs", "pinned": false, "continued": false, "repostedAt": null, "language": "en", "paidPartnership": false, "altText": null } }, { "id": "4037221791304095331", "url": "https://www.threads.com/@madlori/post/DgHF9Q-JZZj", "text": "I just learned that good looking men in Japan are categorized into seven strict sub-categories that are named after...condiments.\n\nNever change, Japan.", "createdAt": "2026-11-24T04:26:03.000Z", "author": { "id": "62929063493", "username": "madlori", "displayName": "Lori", "avatarUrl": "https://scontent-nrt6-1.cdninstagram.com/v/t51.82787-19/684891697_17958341364103494_437393955793584369_n.jpg?stp=dst-jpg_s150x150_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby4xMDgwLmMyIn0&_nc_ht=scontent-nrt6-1.cdninstagram.com&_nc_cat=106&_nc_oc=Q6cZ2gHFJYsSTtdEq0F-qncV25dClE0QhWwDzYwOt7-pp4FMRgw7cgw6gMfTzX_aI73Lfbg&_nc_ohc=TXJWA5nEWj8Q7kNvwHI_74l&_nc_gid=-vKBw5jSoRGSONCTvkXr_g&edm=ACM2rXoBAAAA&ccb=7-5&_nc_ct=RQAsPBUCFQIAAAA&oh=00_AQQ3B8gVMSAGH7H-GdAdmn_6u1F96IsMgFyZogRIXdJORg&oe=6B0BE51F&_nc_sid=68810c", "verified": false, "url": "https://www.threads.com/@madlori" }, "stats": { "views": null, "likes": 339, "comments": 11, "shares": 8, "saves": null, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "code": "DgHF9Q-JZZj", "kind": "text", "reposts": 8, "quotes": 0, "isReply": false, "replyTo": null, "quoted": null, "link": null, "topic": null, "pinned": false, "continued": false, "repostedAt": null, "language": "en", "paidPartnership": false, "altText": null } } ], "pagination": { "nextCursor": "GvYPvuLVkb3PwYhwxL2p2onHyIdwhp7Bybaz5IZwxNDB-fX11Yhwxtms4of1i4dwzJ2KieSVj4hwkIiumZv884Zw0Pimwfjpj4hw1qOQ0Y3AgYdwmsOI4cLe5oZw3I2XkYiyjohwnLi0sdGQuIhwoq7ysNTbmohwpIua0ZT_n4dw8uKL4YThoYhwJtKsvvrBaBQIWQgYABoIOgYZDAA=", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/threads/trending": { "get": { "tags": [ "Threads" ], "summary": "The feed Threads gives a visitor now.", "description": "About 20 threads in all. 1 credit a page.", "operationId": "threadsTrending", "parameters": [ { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_ThreadsPost" }, "example": { "data": [ { "id": "4037535815235947409", "url": "https://www.threads.com/@leo_hillier_photography/post/DgINW6jDkuR", "text": "Anne Widdecombe’s estate sale confirms who she was.", "createdAt": "2026-11-24T14:49:57.000Z", "author": { "id": "68110919017", "username": "leo_hillier_photography", "displayName": "Leo Hillier", "avatarUrl": "https://scontent-nrt1-1.cdninstagram.com/v/t51.2885-19/462679647_1051405903234880_2787649124151444946_n.jpg?stp=dst-jpg_s150x150_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby4xMDgwLmMyIn0&_nc_ht=scontent-nrt1-1.cdninstagram.com&_nc_cat=108&_nc_oc=Q6cZ2gHFJYsSTtdEq0F-qncV25dClE0QhWwDzYwOt7-pp4FMRgw7cgw6gMfTzX_aI73Lfbg&_nc_ohc=oAaoYKiHyRUQ7kNvwE2RYLF&_nc_gid=-vKBw5jSoRGSONCTvkXr_g&edm=ACM2rXoBAAAA&ccb=7-5&_nc_ct=RQAsPBUCFQIAAAA&oh=00_AQQeEt7J4On_o9mqbJ_Xa6r7VeBsnVaHg8xoTq1XBPgVUw&oe=6B0BE8DD&_nc_sid=68810c", "verified": false, "url": "https://www.threads.com/@leo_hillier_photography" }, "stats": { "views": null, "likes": 1136, "comments": 131, "shares": null, "saves": null, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "code": "DgINW6jDkuR", "kind": "text", "reposts": 34, "quotes": 0, "isReply": false, "replyTo": null, "quoted": null, "link": null, "topic": "UK Politcs", "pinned": false, "continued": false, "repostedAt": null, "language": "en", "paidPartnership": false, "altText": null } }, { "id": "4037221791304095331", "url": "https://www.threads.com/@madlori/post/DgHF9Q-JZZj", "text": "I just learned that good looking men in Japan are categorized into seven strict sub-categories that are named after...condiments.\n\nNever change, Japan.", "createdAt": "2026-11-24T04:26:03.000Z", "author": { "id": "62929063493", "username": "madlori", "displayName": "Lori", "avatarUrl": "https://scontent-nrt6-1.cdninstagram.com/v/t51.82787-19/684891697_17958341364103494_437393955793584369_n.jpg?stp=dst-jpg_s150x150_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby4xMDgwLmMyIn0&_nc_ht=scontent-nrt6-1.cdninstagram.com&_nc_cat=106&_nc_oc=Q6cZ2gHFJYsSTtdEq0F-qncV25dClE0QhWwDzYwOt7-pp4FMRgw7cgw6gMfTzX_aI73Lfbg&_nc_ohc=TXJWA5nEWj8Q7kNvwHI_74l&_nc_gid=-vKBw5jSoRGSONCTvkXr_g&edm=ACM2rXoBAAAA&ccb=7-5&_nc_ct=RQAsPBUCFQIAAAA&oh=00_AQQ3B8gVMSAGH7H-GdAdmn_6u1F96IsMgFyZogRIXdJORg&oe=6B0BE51F&_nc_sid=68810c", "verified": false, "url": "https://www.threads.com/@madlori" }, "stats": { "views": null, "likes": 339, "comments": 11, "shares": 8, "saves": null, "engagementRate": null }, "media": [], "hashtags": [], "mentions": [], "ext": { "code": "DgHF9Q-JZZj", "kind": "text", "reposts": 8, "quotes": 0, "isReply": false, "replyTo": null, "quoted": null, "link": null, "topic": null, "pinned": false, "continued": false, "repostedAt": null, "language": "en", "paidPartnership": false, "altText": null } } ], "pagination": { "nextCursor": "GvYPvuLVkb3PwYhwxL2p2onHyIdwhp7Bybaz5IZwxNDB-fX11Yhwxtms4of1i4dwzJ2KieSVj4hwkIiumZv884Zw0Pimwfjpj4hw1qOQ0Y3AgYdwmsOI4cLe5oZw3I2XkYiyjohwnLi0sdGQuIhwoq7ysNTbmohwpIua0ZT_n4dw8uKL4YThoYhwJtKsvvrBaBQIWQgYABoIOgYZDAA=", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.threads.trending();" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.threads.trending()" }, { "lang": "bash", "label": "cURL", "source": "curl https://api.socialapi.sh/v1/threads/trending \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_ThreadsPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/ThreadsPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "ThreadsPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "code", "kind", "isReply", "pinned", "continued", "paidPartnership" ], "properties": { "altText": { "type": [ "string", "null" ], "description": "Threads' description of the image, for screen readers." }, "code": { "type": "string", "description": "The code in its link (`threads.com/@user/post/`)." }, "continued": { "type": "boolean", "description": "Whether its author continued it with posts of their own (a thread of several)." }, "isReply": { "type": "boolean", "description": "Whether it is a reply, and to what: the post it answers when the list carried it,\nelse at least whose post." }, "kind": { "$ref": "#/components/schemas/ThreadsPostKind" }, "language": { "type": [ "string", "null" ], "description": "Its text's language, as Threads detected it." }, "link": { "oneOf": [ { "$ref": "#/components/schemas/ThreadsLinkPreview", "description": "The link it shares, as its preview shows it." }, { "type": "null" } ] }, "paidPartnership": { "type": "boolean", "description": "A paid partnership." }, "pinned": { "type": "boolean", "description": "Pinned to its author's profile." }, "quoted": { "oneOf": [ { "$ref": "#/components/schemas/ThreadsPostRef", "description": "The post it quotes." }, { "type": "null" } ] }, "quotes": { "type": [ "integer", "null" ], "format": "int64", "description": "Posts quoting it.", "minimum": 0 }, "replyTo": { "oneOf": [ { "$ref": "#/components/schemas/ThreadsPostRef" }, { "type": "null" } ] }, "repostedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "When the account reposted it, on a profile's reposts." }, { "type": "null" } ] }, "reposts": { "type": [ "integer", "null" ], "format": "int64", "description": "Reposts of it.", "minimum": 0 }, "topic": { "type": [ "string", "null" ], "description": "The topic tag it is posted under." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A thread: text, a photo, a video or a carousel." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "Timestamp": { "type": "string", "format": "date-time" }, "ThreadsPostRef": { "type": "object", "description": "Another post, as a post names it.", "properties": { "code": { "type": [ "string", "null" ] }, "id": { "type": [ "string", "null" ], "description": "Its id, when the answer carries the post itself." }, "text": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "username": { "type": [ "string", "null" ] } } }, "ThreadsLinkPreview": { "type": "object", "required": [ "url" ], "properties": { "displayUrl": { "type": [ "string", "null" ], "description": "The host as shown (`nytimes.com`)." }, "title": { "type": [ "string", "null" ] }, "url": { "type": "string" } } }, "ThreadsPostKind": { "type": "string", "description": "What a thread is.", "enum": [ "text", "photo", "video", "carousel" ] }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Collection Posts (/docs/api-reference/tiktok/collection-posts) The posts of a public saved collection, 30 a page. `GET https://api.socialapi.sh/v1/tiktok/collection/posts` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.tiktok.collectionPosts({ id: "7394627756635573022" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.tiktok.collection_posts(id="7394627756635573022") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/tiktok/collection/posts \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "id=7394627756635573022" ``` **Response** ```json { "data": [ { "id": "7399631056783035690", "url": "https://www.tiktok.com/@nojo18/video/7399631056783035690", "text": null, "createdAt": "2024-08-05T12:27:54.000Z", "author": { "id": "6791598551904076805", "username": "nojo18", "displayName": "Noah Lyles", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-maliva-avt-0068/16b25128fbffca038bc04db11c0fd800~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=3fd09f88&x-expires=1795730400&x-signature=b0YBYWFFQFpBeomvowb0mzqX%2Fxs%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=my", "verified": true, "url": "https://www.tiktok.com/@nojo18" }, "stats": { "views": 3400000, "likes": 500900, "comments": 3095, "shares": 22600, "saves": 39038, "engagementRate": 0.1549 }, "media": [ { "kind": "video", "url": "https://v16-webapp-prime.tiktok.com/video/tos/alisg/tos-alisg-ve-37c799-sg/oUkVwAAXMSQY8EEmusFfDBgIfxk1VtIbRGDnEE/?a=1988&bti=ODszNWYuMDE6&&bt=1152&ft=-Csk_mK9PD12Nb4GgY-UxxjvXY6e3wv25LcAp&mime_type=video_mp4&rc=ZWg0NTtoZWRpZWY2aWdnaUBpanlydm05cmtmdDMzZzczNEBiYF5eYWBhXy0xMmJfNS4wYSNqLWdqMmQ0XmxgLS1kMS9zcw%3D%3D&expire=1795731896&l=202611250624084F9A79E535EE0A17665E&ply_type=2&policy=2&signature=d2da5ff995ae12a5f33f222a2105560f&tk=tt_chain_token&btag=e00088000", "thumbnailUrl": "https://p16-common-sign.tiktokcdn.com/tos-useast5-p-0068-tx/oYQIDWNuYCYeHwMTg8ffGkBAQLFT0YdJD7qAjS~tplv-tiktokx-origin.image?dr=14575&x-expires=1795730400&x-signature=Qf3SB2JVZVlg2ftMSoVgwsu78f0%3D&t=4d5b0474&ps=13740610&shp=81f88b70&shcp=43f4a2f9&idc=my", "width": 768, "height": 576, "durationSeconds": 48 } ], "hashtags": [], "mentions": [], "ext": { "authorSecUid": "MS4wLjABAAAAH10iXqncdQ9WqgUozawE5UFvRGS_WuS7bqXNwCmYyURFVweqtROjIPuZOB6ctng1", "sound": { "id": "7399631020024285998", "title": "original sound", "artist": "Noah Lyles", "original": true }, "durationSeconds": 48, "reposts": null, "pinned": false, "ad": false, "playlistId": null, "region": null, "language": null, "screenText": [], "subtitles": [ { "language": "eng-US", "format": "webvtt", "source": "ASR" } ] } }, { "id": "7399613114368396574", "url": "https://www.tiktok.com/@nikita.ducarroz/video/7399613114368396574", "text": "Until next time! 🫶🏻 #olympics #paris2024 #olympicgames #bmx #OlympicVillage", "createdAt": "2024-08-05T11:18:48.000Z", "author": { "id": "6765667025392108550", "username": "nikita.ducarroz", "displayName": "Nikita Ducarroz", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-maliva-avt-0068/034acdd1b4d32f87ed37bf9b8ea48185~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=429b63b5&x-expires=1795730400&x-signature=y599xBYm5lv6TGKP2LL4B6uUGUQ%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=my", "verified": false, "url": "https://www.tiktok.com/@nikita.ducarroz" }, "stats": { "views": 152800, "likes": 15700, "comments": 148, "shares": 91, "saves": 540, "engagementRate": 0.1043 }, "media": [ { "kind": "video", "url": "https://v16-webapp-prime.tiktok.com/video/tos/alisg/tos-alisg-ve-37c799-sg/oYCtpyIAqTAiZiFt2rIU3WfOCnBQiACE1QSz8w/?a=1988&bti=ODszNWYuMDE6&&bt=1605&ft=-Csk_mK9PD12Nb4GgY-UxxjvXY6e3wv25LcAp&mime_type=video_mp4&rc=NWZnNzU3ZmQ7Z2Q0aWczO0Bpam5xNnE5cnNldDMzaTczNEA2LWFhMDMtNmExXi4yXjNiYSNgXmlyMmRjNGxgLS1kMTJzcw%3D%3D&expire=1795731858&l=202611250624084F9A79E535EE0A17665E&ply_type=2&policy=2&signature=b97f2699a83db7e2036232d79b0b3a1a&tk=tt_chain_token&btag=e000b0000", "thumbnailUrl": "https://p16-common-sign.tiktokcdn.com/tos-useast8-p-0068-tx2/54ce5365fc8e49c19d91dd07815cd894_1722856730~tplv-tiktokx-origin.image?dr=14575&x-expires=1795730400&x-signature=54j6HimOikZc4YfK0OdCl7yH%2FJQ%3D&t=4d5b0474&ps=13740610&shp=81f88b70&shcp=43f4a2f9&idc=my", "width": 576, "height": 1024, "durationSeconds": 10 } ], "hashtags": [ "olympics", "paris2024", "olympicgames" ], "mentions": [], "ext": { "authorSecUid": "MS4wLjABAAAAV8vrjebD8zqVNPqUJg4slIdqErA77t-Hi-CTHphLQVHp7MhvcHvASPOJ-JZ03Bd3", "sound": { "id": "6714159100260813573", "title": "sad SpongeBob music", "artist": "michael", "original": true }, "durationSeconds": 10, "reposts": null, "pinned": false, "ad": false, "playlistId": "7399001233681550126", "region": null, "language": "en", "screenText": [ "Unfortunately I have left the Olympic Villa." ], "subtitles": [] } } ], "pagination": { "nextCursor": "30", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/tiktok/collection/posts": { "get": { "tags": [ "TikTok" ], "summary": "The posts of a public saved collection, 30 a page.", "description": "1 credit a page.", "operationId": "tiktokCollectionPosts", "parameters": [ { "name": "url", "in": "query", "description": "The public saved collection's link\n(`https://www.tiktok.com/@user/collection/-7311…`).", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The collection's id, instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_TikTokPost" }, "example": { "data": [ { "id": "7399631056783035690", "url": "https://www.tiktok.com/@nojo18/video/7399631056783035690", "text": null, "createdAt": "2024-08-05T12:27:54.000Z", "author": { "id": "6791598551904076805", "username": "nojo18", "displayName": "Noah Lyles", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-maliva-avt-0068/16b25128fbffca038bc04db11c0fd800~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=3fd09f88&x-expires=1795730400&x-signature=b0YBYWFFQFpBeomvowb0mzqX%2Fxs%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=my", "verified": true, "url": "https://www.tiktok.com/@nojo18" }, "stats": { "views": 3400000, "likes": 500900, "comments": 3095, "shares": 22600, "saves": 39038, "engagementRate": 0.1549 }, "media": [ { "kind": "video", "url": "https://v16-webapp-prime.tiktok.com/video/tos/alisg/tos-alisg-ve-37c799-sg/oUkVwAAXMSQY8EEmusFfDBgIfxk1VtIbRGDnEE/?a=1988&bti=ODszNWYuMDE6&&bt=1152&ft=-Csk_mK9PD12Nb4GgY-UxxjvXY6e3wv25LcAp&mime_type=video_mp4&rc=ZWg0NTtoZWRpZWY2aWdnaUBpanlydm05cmtmdDMzZzczNEBiYF5eYWBhXy0xMmJfNS4wYSNqLWdqMmQ0XmxgLS1kMS9zcw%3D%3D&expire=1795731896&l=202611250624084F9A79E535EE0A17665E&ply_type=2&policy=2&signature=d2da5ff995ae12a5f33f222a2105560f&tk=tt_chain_token&btag=e00088000", "thumbnailUrl": "https://p16-common-sign.tiktokcdn.com/tos-useast5-p-0068-tx/oYQIDWNuYCYeHwMTg8ffGkBAQLFT0YdJD7qAjS~tplv-tiktokx-origin.image?dr=14575&x-expires=1795730400&x-signature=Qf3SB2JVZVlg2ftMSoVgwsu78f0%3D&t=4d5b0474&ps=13740610&shp=81f88b70&shcp=43f4a2f9&idc=my", "width": 768, "height": 576, "durationSeconds": 48 } ], "hashtags": [], "mentions": [], "ext": { "authorSecUid": "MS4wLjABAAAAH10iXqncdQ9WqgUozawE5UFvRGS_WuS7bqXNwCmYyURFVweqtROjIPuZOB6ctng1", "sound": { "id": "7399631020024285998", "title": "original sound", "artist": "Noah Lyles", "original": true }, "durationSeconds": 48, "reposts": null, "pinned": false, "ad": false, "playlistId": null, "region": null, "language": null, "screenText": [], "subtitles": [ { "language": "eng-US", "format": "webvtt", "source": "ASR" } ] } }, { "id": "7399613114368396574", "url": "https://www.tiktok.com/@nikita.ducarroz/video/7399613114368396574", "text": "Until next time! 🫶🏻 #olympics #paris2024 #olympicgames #bmx #OlympicVillage", "createdAt": "2024-08-05T11:18:48.000Z", "author": { "id": "6765667025392108550", "username": "nikita.ducarroz", "displayName": "Nikita Ducarroz", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-maliva-avt-0068/034acdd1b4d32f87ed37bf9b8ea48185~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=429b63b5&x-expires=1795730400&x-signature=y599xBYm5lv6TGKP2LL4B6uUGUQ%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=my", "verified": false, "url": "https://www.tiktok.com/@nikita.ducarroz" }, "stats": { "views": 152800, "likes": 15700, "comments": 148, "shares": 91, "saves": 540, "engagementRate": 0.1043 }, "media": [ { "kind": "video", "url": "https://v16-webapp-prime.tiktok.com/video/tos/alisg/tos-alisg-ve-37c799-sg/oYCtpyIAqTAiZiFt2rIU3WfOCnBQiACE1QSz8w/?a=1988&bti=ODszNWYuMDE6&&bt=1605&ft=-Csk_mK9PD12Nb4GgY-UxxjvXY6e3wv25LcAp&mime_type=video_mp4&rc=NWZnNzU3ZmQ7Z2Q0aWczO0Bpam5xNnE5cnNldDMzaTczNEA2LWFhMDMtNmExXi4yXjNiYSNgXmlyMmRjNGxgLS1kMTJzcw%3D%3D&expire=1795731858&l=202611250624084F9A79E535EE0A17665E&ply_type=2&policy=2&signature=b97f2699a83db7e2036232d79b0b3a1a&tk=tt_chain_token&btag=e000b0000", "thumbnailUrl": "https://p16-common-sign.tiktokcdn.com/tos-useast8-p-0068-tx2/54ce5365fc8e49c19d91dd07815cd894_1722856730~tplv-tiktokx-origin.image?dr=14575&x-expires=1795730400&x-signature=54j6HimOikZc4YfK0OdCl7yH%2FJQ%3D&t=4d5b0474&ps=13740610&shp=81f88b70&shcp=43f4a2f9&idc=my", "width": 576, "height": 1024, "durationSeconds": 10 } ], "hashtags": [ "olympics", "paris2024", "olympicgames" ], "mentions": [], "ext": { "authorSecUid": "MS4wLjABAAAAV8vrjebD8zqVNPqUJg4slIdqErA77t-Hi-CTHphLQVHp7MhvcHvASPOJ-JZ03Bd3", "sound": { "id": "6714159100260813573", "title": "sad SpongeBob music", "artist": "michael", "original": true }, "durationSeconds": 10, "reposts": null, "pinned": false, "ad": false, "playlistId": "7399001233681550126", "region": null, "language": "en", "screenText": [ "Unfortunately I have left the Olympic Villa." ], "subtitles": [] } } ], "pagination": { "nextCursor": "30", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.tiktok.collectionPosts({ id: \"7394627756635573022\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.tiktok.collection_posts(id=\"7394627756635573022\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/tiktok/collection/posts \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"id=7394627756635573022\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_TikTokPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/TikTokPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "TikTokPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "pinned", "ad", "screenText", "subtitles" ], "properties": { "ad": { "type": "boolean", "description": "A paid promotion." }, "authorSecUid": { "type": [ "string", "null" ], "description": "The author's secUid." }, "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "language": { "type": [ "string", "null" ], "description": "The caption's language, as TikTok detected it (ISO 639-1)." }, "pinned": { "type": "boolean", "description": "Pinned to the top of its author's profile." }, "playlistId": { "type": [ "string", "null" ], "description": "The playlist it belongs to." }, "region": { "type": [ "string", "null" ], "description": "Where it was posted from (ISO country)." }, "reposts": { "type": [ "integer", "null" ], "format": "int64", "description": "Reposts, where TikTok counts them.", "minimum": 0 }, "screenText": { "type": "array", "items": { "type": "string" }, "description": "Text the author put on the post as stickers, in order, each once; read from the\npost, not from its frames." }, "sound": { "oneOf": [ { "$ref": "#/components/schemas/TikTokSoundRef" }, { "type": "null" } ] }, "subtitles": { "type": "array", "items": { "$ref": "#/components/schemas/TikTokSubtitle" }, "description": "Captions TikTok made or the author uploaded; read one with\n`/v1/tiktok/post/transcript`." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A TikTok post: a video or a photo set." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "TikTokSubtitle": { "type": "object", "required": [ "language", "format", "source" ], "properties": { "format": { "type": "string", "description": "`webvtt`." }, "language": { "type": "string", "description": "`eng-US`, `tur-TR`…" }, "source": { "type": "string", "description": "`ASR` (generated) or `MT` (machine translated); others are the author's." } } }, "TikTokSoundRef": { "type": "object", "description": "The sound a post uses.", "required": [ "id", "title", "original" ], "properties": { "artist": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "original": { "type": "boolean" }, "title": { "type": "string" } } }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Hashtag Posts (/docs/api-reference/tiktok/hashtag-posts) Posts under a hashtag, 30 a page. `GET https://api.socialapi.sh/v1/tiktok/hashtag/posts` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.tiktok.hashtagPosts({ name: "fyp" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.tiktok.hashtag_posts(name="fyp") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/tiktok/hashtag/posts \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "name=fyp" ``` **Response** ```json { "data": [ { "id": "7075778590062988546", "url": "https://www.tiktok.com/@mara.lazeez/video/7075778590062988546", "text": "بسكويت ولا اطيب 🍪😍 #شي_طيب #حلويات #foodie #foodart #cookies #TikTokCookBook #instafood", "createdAt": "2022-03-16T19:14:45.000Z", "author": { "id": "6976937168171336706", "username": "mara.lazeez", "displayName": "Mara Lazeez | مره لذيذ", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-alisg-avt-0068/d9ab3fcc591559c96e84aa66b57731dd~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=6a11a851&x-expires=1795730400&x-signature=ZMuf0E9SPc17IMOgTSXQB1SAg3w%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=my", "verified": true, "url": "https://www.tiktok.com/@mara.lazeez" }, "stats": { "views": 1200000, "likes": 25200, "comments": 297, "shares": 524, "saves": 1416, "engagementRate": 0.0217 }, "media": [ { "kind": "video", "url": "https://v16-webapp-prime.tiktok.com/video/tos/alisg/tos-alisg-pve-0037c001/97f69bb7c2c64a959eeeae341caebe5b/?a=1988&bti=ODszNWYuMDE6&&bt=602&ft=-Csk_mK9PD12NXpGgY-UxO.2SY6e3wv25VcAp&mime_type=video_mp4&rc=M2dnNmU5Z2c1M2k7OTc2PEBpamo1bDs6ZjY2OzMzODczNEBfNjYtNDAzX14xMmIxXmBgYSMyXzVkcjRfYW1gLS1kMS1zcw%3D%3D&expire=1795731757&l=20261125062223923E4BA64DF1ED2F8752&ply_type=2&policy=2&signature=9a5f1eaa836a1ddbb08634f69e952a0d&tk=tt_chain_token&btag=e000b0000", "thumbnailUrl": "https://p19-common-sign.tiktokcdn.com/tos-alisg-p-0037/077d75412fc848f590d1c195471172fa_1647458088~tplv-tiktokx-dmt-logom:tos-alisg-i-0000/1bdb3f59a77e4098ae6c5312abe16cdf.image?dr=14573&x-expires=1795730400&x-signature=DEi7Br4HUwGVRg%2F9HBvhUwhqnbk%3D&t=4d5b0474&ps=13740610&shp=81f88b70&shcp=43f4a2f9&idc=my", "width": 576, "height": 1024, "durationSeconds": 13 } ], "hashtags": [ "شي_طيب", "حلويات", "foodie" ], "mentions": [], "ext": { "authorSecUid": "MS4wLjABAAAA_ykDfR3ZUs3Mp1nMxgLNopQVxjXN54zE9pcZre3DoTUWizd6VayveAVoFnn9mul0", "sound": { "id": "6870193640413612033", "title": "Takke", "artist": "Nassif Zeytoun", "original": false }, "durationSeconds": 13, "reposts": null, "pinned": false, "ad": false, "playlistId": null, "region": null, "language": "ar", "screenText": [ "بسكويت بالمارشمالو 🍪😍", "بسكويت" ], "subtitles": [] } }, { "id": "7059420819948195073", "url": "https://www.tiktok.com/@heraf.wa.holoul/video/7059420819948195073", "text": "مقاس الخصر 😉👖 #حرف_وحلول #lifehack #hack #tips #tricks #fyp #tipsandtricks #homemade #pants", "createdAt": "2022-01-31T17:18:14.000Z", "author": { "id": "7003397820921955330", "username": "heraf.wa.holoul", "displayName": "Heraf wa Holoul | حرف و حلول", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-alisg-avt-0068/074a2df5a25451e763bf80aeaf775280~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=5921aae7&x-expires=1795730400&x-signature=EnrXdz4rUVXQvuys4IukUWWfNwQ%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=my", "verified": false, "url": "https://www.tiktok.com/@heraf.wa.holoul" }, "stats": { "views": 1500000, "likes": 25400, "comments": 262, "shares": 489, "saves": 1310, "engagementRate": 0.0174 }, "media": [ { "kind": "video", "url": "https://v16-webapp-prime.tiktok.com/video/tos/alisg/tos-alisg-pve-0037c001/c512537b1049445a8c69e644b693cd67/?a=1988&bti=ODszNWYuMDE6&&bt=959&ft=-Csk_mK9PD12NXpGgY-UxO.2SY6e3wv25VcAp&mime_type=video_mp4&rc=M2doNzg6OTllZDQ0NmkzZUBpanZyODw6Zjw0OjMzODczNEBeMGAyMGEvNTExXzVgYjNfYSNgczVpcjQwZ3BgLS1kMS1zcw%3D%3D&expire=1795731754&l=20261125062223923E4BA64DF1ED2F8752&ply_type=2&policy=2&signature=1ee4658e17c2b383b56fcbec307e7016&tk=tt_chain_token&btag=e000b0000", "thumbnailUrl": "https://p16-common-sign.tiktokcdn.com/tos-alisg-p-0037/a62a8c275f9f46f5816cbbed2d3b022b~tplv-tiktokx-dmt-logom:tos-alisg-i-0000/276ef60d6c23454783e810a92f3dc686.image?dr=14573&x-expires=1795730400&x-signature=1EWj1W%2Bf%2FCDyXV%2FEgbovoqOgmLQ%3D&t=4d5b0474&ps=13740610&shp=81f88b70&shcp=43f4a2f9&idc=my", "width": 576, "height": 1024, "durationSeconds": 10 } ], "hashtags": [ "حرف_وحلول", "lifehack", "hack" ], "mentions": [], "ext": { "authorSecUid": "MS4wLjABAAAAd1rRWLBsAR9VJiwH1lxAJ2IORYUywi0H8GIOvR_9bhAO081xTU6K-RRdRWbV48NU", "sound": { "id": "6704992801559414786", "title": "Infinity", "artist": "Jaymes Young", "original": false }, "durationSeconds": 10, "reposts": null, "pinned": false, "ad": false, "playlistId": null, "region": null, "language": "ar", "screenText": [ "كيف تعرف مقاس الخصر 👖", "مقاس الخصر" ], "subtitles": [] } } ], "pagination": { "nextCursor": "40", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/tiktok/hashtag/posts": { "get": { "tags": [ "TikTok" ], "summary": "Posts under a hashtag, 30 a page.", "description": "1 credit a page.", "operationId": "tiktokHashtagPosts", "parameters": [ { "name": "name", "in": "query", "description": "The hashtag, with or without `#`.", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "TikTok's id for it, instead of `name`.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "Its page's link, instead of `name`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_TikTokPost" }, "example": { "data": [ { "id": "7075778590062988546", "url": "https://www.tiktok.com/@mara.lazeez/video/7075778590062988546", "text": "بسكويت ولا اطيب 🍪😍 #شي_طيب #حلويات #foodie #foodart #cookies #TikTokCookBook #instafood", "createdAt": "2022-03-16T19:14:45.000Z", "author": { "id": "6976937168171336706", "username": "mara.lazeez", "displayName": "Mara Lazeez | مره لذيذ", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-alisg-avt-0068/d9ab3fcc591559c96e84aa66b57731dd~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=6a11a851&x-expires=1795730400&x-signature=ZMuf0E9SPc17IMOgTSXQB1SAg3w%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=my", "verified": true, "url": "https://www.tiktok.com/@mara.lazeez" }, "stats": { "views": 1200000, "likes": 25200, "comments": 297, "shares": 524, "saves": 1416, "engagementRate": 0.0217 }, "media": [ { "kind": "video", "url": "https://v16-webapp-prime.tiktok.com/video/tos/alisg/tos-alisg-pve-0037c001/97f69bb7c2c64a959eeeae341caebe5b/?a=1988&bti=ODszNWYuMDE6&&bt=602&ft=-Csk_mK9PD12NXpGgY-UxO.2SY6e3wv25VcAp&mime_type=video_mp4&rc=M2dnNmU5Z2c1M2k7OTc2PEBpamo1bDs6ZjY2OzMzODczNEBfNjYtNDAzX14xMmIxXmBgYSMyXzVkcjRfYW1gLS1kMS1zcw%3D%3D&expire=1795731757&l=20261125062223923E4BA64DF1ED2F8752&ply_type=2&policy=2&signature=9a5f1eaa836a1ddbb08634f69e952a0d&tk=tt_chain_token&btag=e000b0000", "thumbnailUrl": "https://p19-common-sign.tiktokcdn.com/tos-alisg-p-0037/077d75412fc848f590d1c195471172fa_1647458088~tplv-tiktokx-dmt-logom:tos-alisg-i-0000/1bdb3f59a77e4098ae6c5312abe16cdf.image?dr=14573&x-expires=1795730400&x-signature=DEi7Br4HUwGVRg%2F9HBvhUwhqnbk%3D&t=4d5b0474&ps=13740610&shp=81f88b70&shcp=43f4a2f9&idc=my", "width": 576, "height": 1024, "durationSeconds": 13 } ], "hashtags": [ "شي_طيب", "حلويات", "foodie" ], "mentions": [], "ext": { "authorSecUid": "MS4wLjABAAAA_ykDfR3ZUs3Mp1nMxgLNopQVxjXN54zE9pcZre3DoTUWizd6VayveAVoFnn9mul0", "sound": { "id": "6870193640413612033", "title": "Takke", "artist": "Nassif Zeytoun", "original": false }, "durationSeconds": 13, "reposts": null, "pinned": false, "ad": false, "playlistId": null, "region": null, "language": "ar", "screenText": [ "بسكويت بالمارشمالو 🍪😍", "بسكويت" ], "subtitles": [] } }, { "id": "7059420819948195073", "url": "https://www.tiktok.com/@heraf.wa.holoul/video/7059420819948195073", "text": "مقاس الخصر 😉👖 #حرف_وحلول #lifehack #hack #tips #tricks #fyp #tipsandtricks #homemade #pants", "createdAt": "2022-01-31T17:18:14.000Z", "author": { "id": "7003397820921955330", "username": "heraf.wa.holoul", "displayName": "Heraf wa Holoul | حرف و حلول", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-alisg-avt-0068/074a2df5a25451e763bf80aeaf775280~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=5921aae7&x-expires=1795730400&x-signature=EnrXdz4rUVXQvuys4IukUWWfNwQ%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=my", "verified": false, "url": "https://www.tiktok.com/@heraf.wa.holoul" }, "stats": { "views": 1500000, "likes": 25400, "comments": 262, "shares": 489, "saves": 1310, "engagementRate": 0.0174 }, "media": [ { "kind": "video", "url": "https://v16-webapp-prime.tiktok.com/video/tos/alisg/tos-alisg-pve-0037c001/c512537b1049445a8c69e644b693cd67/?a=1988&bti=ODszNWYuMDE6&&bt=959&ft=-Csk_mK9PD12NXpGgY-UxO.2SY6e3wv25VcAp&mime_type=video_mp4&rc=M2doNzg6OTllZDQ0NmkzZUBpanZyODw6Zjw0OjMzODczNEBeMGAyMGEvNTExXzVgYjNfYSNgczVpcjQwZ3BgLS1kMS1zcw%3D%3D&expire=1795731754&l=20261125062223923E4BA64DF1ED2F8752&ply_type=2&policy=2&signature=1ee4658e17c2b383b56fcbec307e7016&tk=tt_chain_token&btag=e000b0000", "thumbnailUrl": "https://p16-common-sign.tiktokcdn.com/tos-alisg-p-0037/a62a8c275f9f46f5816cbbed2d3b022b~tplv-tiktokx-dmt-logom:tos-alisg-i-0000/276ef60d6c23454783e810a92f3dc686.image?dr=14573&x-expires=1795730400&x-signature=1EWj1W%2Bf%2FCDyXV%2FEgbovoqOgmLQ%3D&t=4d5b0474&ps=13740610&shp=81f88b70&shcp=43f4a2f9&idc=my", "width": 576, "height": 1024, "durationSeconds": 10 } ], "hashtags": [ "حرف_وحلول", "lifehack", "hack" ], "mentions": [], "ext": { "authorSecUid": "MS4wLjABAAAAd1rRWLBsAR9VJiwH1lxAJ2IORYUywi0H8GIOvR_9bhAO081xTU6K-RRdRWbV48NU", "sound": { "id": "6704992801559414786", "title": "Infinity", "artist": "Jaymes Young", "original": false }, "durationSeconds": 10, "reposts": null, "pinned": false, "ad": false, "playlistId": null, "region": null, "language": "ar", "screenText": [ "كيف تعرف مقاس الخصر 👖", "مقاس الخصر" ], "subtitles": [] } } ], "pagination": { "nextCursor": "40", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.tiktok.hashtagPosts({ name: \"fyp\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.tiktok.hashtag_posts(name=\"fyp\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/tiktok/hashtag/posts \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"name=fyp\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_TikTokPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/TikTokPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "TikTokPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "pinned", "ad", "screenText", "subtitles" ], "properties": { "ad": { "type": "boolean", "description": "A paid promotion." }, "authorSecUid": { "type": [ "string", "null" ], "description": "The author's secUid." }, "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "language": { "type": [ "string", "null" ], "description": "The caption's language, as TikTok detected it (ISO 639-1)." }, "pinned": { "type": "boolean", "description": "Pinned to the top of its author's profile." }, "playlistId": { "type": [ "string", "null" ], "description": "The playlist it belongs to." }, "region": { "type": [ "string", "null" ], "description": "Where it was posted from (ISO country)." }, "reposts": { "type": [ "integer", "null" ], "format": "int64", "description": "Reposts, where TikTok counts them.", "minimum": 0 }, "screenText": { "type": "array", "items": { "type": "string" }, "description": "Text the author put on the post as stickers, in order, each once; read from the\npost, not from its frames." }, "sound": { "oneOf": [ { "$ref": "#/components/schemas/TikTokSoundRef" }, { "type": "null" } ] }, "subtitles": { "type": "array", "items": { "$ref": "#/components/schemas/TikTokSubtitle" }, "description": "Captions TikTok made or the author uploaded; read one with\n`/v1/tiktok/post/transcript`." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A TikTok post: a video or a photo set." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "TikTokSubtitle": { "type": "object", "required": [ "language", "format", "source" ], "properties": { "format": { "type": "string", "description": "`webvtt`." }, "language": { "type": "string", "description": "`eng-US`, `tur-TR`…" }, "source": { "type": "string", "description": "`ASR` (generated) or `MT` (machine translated); others are the author's." } } }, "TikTokSoundRef": { "type": "object", "description": "The sound a post uses.", "required": [ "id", "title", "original" ], "properties": { "artist": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "original": { "type": "boolean" }, "title": { "type": "string" } } }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Hashtag (/docs/api-reference/tiktok/hashtag) A hashtag with its post and view counts. `GET https://api.socialapi.sh/v1/tiktok/hashtag` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.tiktok.hashtag({ name: "fyp" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.tiktok.hashtag(name="fyp").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/tiktok/hashtag \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "name=fyp" ``` **Response** ```json { "data": { "id": "229207", "name": "fyp", "description": null, "url": "https://www.tiktok.com/tag/fyp", "posts": 9557629436, "views": 132490583953866, "ext": { "coverUrl": null, "commerce": false } } } ``` **OpenAPI** ```json { "paths": { "/v1/tiktok/hashtag": { "get": { "tags": [ "TikTok" ], "summary": "A hashtag with its post and view counts.", "description": "Its id, description, and post and view counts. 1 credit.", "operationId": "tiktokHashtag", "parameters": [ { "name": "name", "in": "query", "description": "The hashtag, with or without `#`.", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "TikTok's id for it, instead of `name`.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "Its page's link (`https://www.tiktok.com/tag/fyp`), instead of `name`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_TikTokHashtag" }, "example": { "data": { "id": "229207", "name": "fyp", "description": null, "url": "https://www.tiktok.com/tag/fyp", "posts": 9557629436, "views": 132490583953866, "ext": { "coverUrl": null, "commerce": false } } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.tiktok.hashtag({ name: \"fyp\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.tiktok.hashtag(name=\"fyp\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/tiktok/hashtag \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"name=fyp\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_TikTokHashtag": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/TikTokHashtag" } } }, "TikTokHashtag": { "allOf": [ { "type": "object", "description": "A hashtag.", "required": [ "id", "name", "url", "ext" ], "properties": { "description": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "commerce" ], "properties": { "commerce": { "type": "boolean", "description": "A branded hashtag." }, "coverUrl": { "type": [ "string", "null" ] } } }, { "type": "object", "description": "What only this platform has." } ] }, "id": { "type": "string" }, "name": { "type": "string", "description": "Without `#`." }, "posts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "url": { "type": "string" }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, { "type": "object", "description": "A TikTok hashtag." } ] } } } } ``` # TikTok API (/docs/api-reference/tiktok) Every TikTok endpoint, by group. Each is a `GET` under `/v1/tiktok`. ## Quick Reference [#quick-reference] | Property | Value | | --- | --- | | Base path | `/v1/tiktok` | | Endpoints | 22 | | Credits | See Below | | Guide | [TikTok](/docs/tiktok) | ## Accounts [#accounts] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/tiktok/profile`](/docs/api-reference/tiktok/profile) | A profile with its exact follower and like counts. | 1 | | [`GET /v1/tiktok/profile/followers`](/docs/api-reference/tiktok/profile-followers) | An account's followers, newest first, 30 a page. | 1 | | [`GET /v1/tiktok/profile/following`](/docs/api-reference/tiktok/profile-following) | The accounts an account follows, when it shows them. | 1 | | [`GET /v1/tiktok/profile/liked`](/docs/api-reference/tiktok/profile-liked) | Posts an account liked, when its likes are public. | 1 | | [`GET /v1/tiktok/profile/playlists`](/docs/api-reference/tiktok/profile-playlists) | The playlists an account made. | 1 | | [`GET /v1/tiktok/profile/posts`](/docs/api-reference/tiktok/profile-posts) | An account's posts, newest first, 30 a page. | 1 | | [`GET /v1/tiktok/profile/reposts`](/docs/api-reference/tiktok/profile-reposts) | Other people's posts an account reposted. | 1 | | [`GET /v1/tiktok/live`](/docs/api-reference/tiktok/live) | Whether an account is live, and its room. | 1 | ## Posts [#posts] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/tiktok/playlist/posts`](/docs/api-reference/tiktok/playlist-posts) | The posts of a playlist, 30 a page. | 1 | | [`GET /v1/tiktok/post`](/docs/api-reference/tiktok/post) | One post with its counts, media and sound. | 1 | | [`GET /v1/tiktok/post/comments`](/docs/api-reference/tiktok/post-comments) | A post's top-level comments, 50 a page. | 1 | | [`GET /v1/tiktok/post/comment/replies`](/docs/api-reference/tiktok/post-comment-replies) | The replies to one comment, 50 a page. | 1 | | [`GET /v1/tiktok/post/related`](/docs/api-reference/tiktok/post-related) | Posts TikTok recommends beside one post. | 1 | | [`GET /v1/tiktok/post/transcript`](/docs/api-reference/tiktok/post-transcript) | A post's captions as text with their times. | 10 | ## Discovery [#discovery] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/tiktok/collection/posts`](/docs/api-reference/tiktok/collection-posts) | The posts of a public saved collection, 30 a page. | 1 | | [`GET /v1/tiktok/hashtag`](/docs/api-reference/tiktok/hashtag) | A hashtag with its post and view counts. | 1 | | [`GET /v1/tiktok/hashtag/posts`](/docs/api-reference/tiktok/hashtag-posts) | Posts under a hashtag, 30 a page. | 1 | | [`GET /v1/tiktok/search`](/docs/api-reference/tiktok/search) | Posts matching a query, 30 a page. | 1 | | [`GET /v1/tiktok/search/users`](/docs/api-reference/tiktok/search-users) | Accounts matching a query. | 1 | | [`GET /v1/tiktok/sound`](/docs/api-reference/tiktok/sound) | A sound, and how many posts use it. | 1 | | [`GET /v1/tiktok/sound/posts`](/docs/api-reference/tiktok/sound-posts) | Posts that use a sound, 30 a page. | 1 | | [`GET /v1/tiktok/trending`](/docs/api-reference/tiktok/trending) | What the explore page shows now, by category. | 5 | ## Example Request [#example-request] Every TikTok endpoint is called this way: its path, and what to read as query parameters. **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.tiktok.profile({ handle: "nike" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.tiktok.profile(handle="nike").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/tiktok/profile \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=nike" ``` **Response** ```json { "data": { "id": "208464585232822272", "username": "nike", "displayName": "Nike", "bio": "Just Do It.", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-maliva-avt-0068/e0b0ac7b6ad6447a8e923fd1eb162f2c~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=c73b1f8a&x-expires=1795730400&x-signature=WFCAToitWtbkgo5qXRwrQmcX%2FZY%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=my", "url": "https://www.tiktok.com/@nike", "verified": true, "private": false, "followers": 9440793, "following": 94, "likes": 51312842, "posts": 1131, "externalUrl": "http://empli.fi/niketiktok", "createdAt": null, "ext": { "secUid": "MS4wLjABAAAA_3ndMt8d_tECTdpKgCxcx238tOnQZX-20wqN01aMui5zQ7hsqSdff-jC5qYC-Cl_", "friends": 47, "liked": 0, "category": "Sports, Fitness & Outdoors", "seller": false, "likesPublic": false, "roomId": null } } } ``` ## Errors [#errors] A call that fails costs nothing. See [Errors](/docs/errors) for every code. # Live (/docs/api-reference/tiktok/live) Whether an account is live, and its room. `GET https://api.socialapi.sh/v1/tiktok/live` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.tiktok.live({ handle: "tiktok" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.tiktok.live(handle="tiktok").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/tiktok/live \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=tiktok" ``` **Response** ```json { "data": { "live": false, "roomId": "7711396761125866254", "title": "Giving Season with Food Network", "viewers": null, "startedAt": "2026-11-23T16:00:07.000Z", "coverUrl": "https://p16-common-sign.tiktokcdn.com/tos-maliva-avt-0068/ba67b11de451691939223e9d978e613a~tplv-tiktokx-cropcenter:720:720.webp?dr=14579&refresh_token=54b3fd8d&x-expires=1795730400&x-signature=z1%2BShn%2B8n85qGUVFRn%2BCnB7Gwpg%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=fdd36af4&idc=my", "host": { "id": "107955", "username": "tiktok", "displayName": "TikTok", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-maliva-avt-0068/ba67b11de451691939223e9d978e613a~tplv-tiktokx-cropcenter:1080:1080.webp?dr=14579&refresh_token=a5346d01&x-expires=1795730400&x-signature=KalJhiErhMSNDpaaq4kpkdW3ZW8%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=fdd36af4&idc=my", "verified": true, "url": "https://www.tiktok.com/@tiktok" }, "ext": { "streamId": "3579254828209537974", "entered": 652, "endedAt": null } } } ``` **OpenAPI** ```json { "paths": { "/v1/tiktok/live": { "get": { "tags": [ "TikTok" ], "summary": "Whether an account is live, and its room.", "description": "The room's title, viewers and start. Name the account, or the room with `roomId`; read\nby its id, the room also says how many entered and when it ended. 1 credit.", "operationId": "tiktokLive", "parameters": [ { "name": "handle", "in": "query", "description": "The account's username, with or without `@`.", "required": false, "schema": { "type": "string" } }, { "name": "secUid", "in": "query", "description": "The account's `ext.secUid`, instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "The account's or its live page's link, instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "roomId", "in": "query", "description": "A live room's id (a profile's `ext.roomId`), instead of naming the account.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_TikTokLive" }, "example": { "data": { "live": false, "roomId": "7711396761125866254", "title": "Giving Season with Food Network", "viewers": null, "startedAt": "2026-11-23T16:00:07.000Z", "coverUrl": "https://p16-common-sign.tiktokcdn.com/tos-maliva-avt-0068/ba67b11de451691939223e9d978e613a~tplv-tiktokx-cropcenter:720:720.webp?dr=14579&refresh_token=54b3fd8d&x-expires=1795730400&x-signature=z1%2BShn%2B8n85qGUVFRn%2BCnB7Gwpg%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=fdd36af4&idc=my", "host": { "id": "107955", "username": "tiktok", "displayName": "TikTok", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-maliva-avt-0068/ba67b11de451691939223e9d978e613a~tplv-tiktokx-cropcenter:1080:1080.webp?dr=14579&refresh_token=a5346d01&x-expires=1795730400&x-signature=KalJhiErhMSNDpaaq4kpkdW3ZW8%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=fdd36af4&idc=my", "verified": true, "url": "https://www.tiktok.com/@tiktok" }, "ext": { "streamId": "3579254828209537974", "entered": 652, "endedAt": null } } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.tiktok.live({ handle: \"tiktok\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.tiktok.live(handle=\"tiktok\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/tiktok/live \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=tiktok\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_TikTokLive": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/TikTokLive" } } }, "TikTokLive": { "allOf": [ { "type": "object", "description": "An account's live broadcast.", "required": [ "live", "ext" ], "properties": { "coverUrl": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "properties": { "endedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "entered": { "type": [ "integer", "null" ], "format": "int64", "description": "People who have entered the room since it started.", "minimum": 0 }, "streamId": { "type": [ "string", "null" ] } } }, { "type": "object", "description": "What only this platform has." } ] }, "host": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "live": { "type": "boolean" }, "roomId": { "type": [ "string", "null" ] }, "startedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "title": { "type": [ "string", "null" ] }, "viewers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, { "type": "object", "description": "A TikTok live room." } ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Playlist Posts (/docs/api-reference/tiktok/playlist-posts) The posts of a playlist, 30 a page. `GET https://api.socialapi.sh/v1/tiktok/playlist/posts` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.tiktok.playlistPosts({ id: "7681171537575824159" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.tiktok.playlist_posts(id="7681171537575824159") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/tiktok/playlist/posts \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "id=7681171537575824159" ``` **Response** ```json { "data": [ { "id": "7680721699171601694", "url": "https://www.tiktok.com/@tiktok/video/7680721699171601694", "text": "this summer was all about the classic hits. here's to the ones that never got away 💿 #SongsofTheSummer2026", "createdAt": "2026-09-02T00:03:08.000Z", "author": { "id": "107955", "username": "tiktok", "displayName": "TikTok", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-maliva-avt-0068/ba67b11de451691939223e9d978e613a~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=1d6b70e6&x-expires=1795730400&x-signature=D%2FVdCDPHFSaC7XH9Z7dcGGoWuDw%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=my", "verified": true, "url": "https://www.tiktok.com/@tiktok" }, "stats": { "views": 524200, "likes": 25900, "comments": 5691, "shares": 2424, "saves": 2983, "engagementRate": 0.0649 }, "media": [ { "kind": "video", "url": "https://v16-webapp-prime.tiktok.com/video/tos/alisg/tos-alisg-ve-37c799-sg/ogxOEIAFdQFtcjgA0ZILu4Is1wzfDfpCqe0Vlu/?a=1988&bti=ODszNWYuMDE6&&bt=1029&ft=-Csk_maLPD12NfpGgY-UxCvFaY6e3wv25IcAp&mime_type=video_mp4&rc=aGhoO2k8OjdmaTs1PDUzaUBpM3E1N3A5cjpwZDMzaTczNEAuLl41Xy80NTYxMTUzLWBiYSNgcWtxMmRzYl9hLS1kMTJzcw%3D%3D&expire=1795731802&l=20261125062225A3BFA851AD7F6B46D903&ply_type=2&policy=2&signature=15b4594373773aa5cbbaf4ccbd53dcc3&tk=tt_chain_token&btag=e00088000", "thumbnailUrl": "https://p16-common-sign.tiktokcdn.com/tos-useast8-p-0068-tx2/o8UZ7AA11Ciogu5XByiiAPBcCSAIMnAIEBfaK7~tplv-tiktokx-origin.image?dr=14575&x-expires=1795730400&x-signature=czn6FPnj3KPrb6F6XKZg2lQTIxg%3D&t=4d5b0474&ps=13740610&shp=81f88b70&shcp=43f4a2f9&idc=my", "width": 720, "height": 1280, "durationSeconds": 56 } ], "hashtags": [ "SongsofTheSummer2026" ], "mentions": [], "ext": { "authorSecUid": "MS4wLjABAAAAv7iSuuXDJGDvJkmH_vz1qkDZYo1apxgzaxdBSeIuPiM", "sound": { "id": "7680721756763523871", "title": "original sound", "artist": "TikTok", "original": true }, "durationSeconds": 56, "reposts": null, "pinned": false, "ad": false, "playlistId": "7681171537575824159", "region": null, "language": "en", "screenText": [], "subtitles": [ { "language": "eng-US", "format": "webvtt", "source": "ASR" } ] } }, { "id": "7680996287877008670", "url": "https://www.tiktok.com/@tiktok/video/7680996287877008670", "text": "You made this the summer of K-Pop on TikTok 🫰 #SongsofTheSummer2026", "createdAt": "2026-09-02T17:48:58.000Z", "author": { "id": "107955", "username": "tiktok", "displayName": "TikTok", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-maliva-avt-0068/ba67b11de451691939223e9d978e613a~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=1d6b70e6&x-expires=1795730400&x-signature=D%2FVdCDPHFSaC7XH9Z7dcGGoWuDw%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=my", "verified": true, "url": "https://www.tiktok.com/@tiktok" }, "stats": { "views": 630000, "likes": 67800, "comments": 4245, "shares": 4821, "saves": 8079, "engagementRate": 0.122 }, "media": [ { "kind": "video", "url": "https://v16-webapp-prime.tiktok.com/video/tos/alisg/tos-alisg-ve-37c799-sg/oE5EAjYIieDYQVqPfvYTRngIYYea4hAfGQFRCU/?a=1988&bti=ODszNWYuMDE6&&bt=1116&ft=-Csk_maLPD12NfpGgY-UxCvFaY6e3wv25IcAp&mime_type=video_mp4&rc=aGg6ODxpaWVlaTU3PDVnOEBpanl3OHk5cjg5ZDMzaTczNEA2Li1fLmJeXmMxNi5jYi0zYSM0bXNuMmQ0L2BhLS1kMTJzcw%3D%3D&expire=1795731805&l=20261125062225A3BFA851AD7F6B46D903&ply_type=2&policy=2&signature=0fa63144b8ff9050eec282b9ba1403d3&tk=tt_chain_token&btag=e00088000", "thumbnailUrl": "https://p16-common-sign.tiktokcdn.com/tos-useast8-p-0068-tx2/osUEAGqIYsRDcCiYAIVYGfEkFEARCAmljcePAE~tplv-tiktokx-origin.image?dr=14575&x-expires=1795730400&x-signature=KLB1MC9bkIR6rLAgGJm%2FMYNaRqo%3D&t=4d5b0474&ps=13740610&shp=81f88b70&shcp=43f4a2f9&idc=my", "width": 720, "height": 1280, "durationSeconds": 59 } ], "hashtags": [ "SongsofTheSummer2026" ], "mentions": [], "ext": { "authorSecUid": "MS4wLjABAAAAv7iSuuXDJGDvJkmH_vz1qkDZYo1apxgzaxdBSeIuPiM", "sound": { "id": "7680996477660941087", "title": "original sound", "artist": "TikTok", "original": true }, "durationSeconds": 59, "reposts": null, "pinned": false, "ad": false, "playlistId": "7681171537575824159", "region": null, "language": "en", "screenText": [], "subtitles": [] } } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/tiktok/playlist/posts": { "get": { "tags": [ "TikTok" ], "summary": "The posts of a playlist, 30 a page.", "description": "1 credit a page.", "operationId": "tiktokPlaylistPosts", "parameters": [ { "name": "url", "in": "query", "description": "The playlist's link (`https://www.tiktok.com/@user/playlist/-7311…`).", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The playlist's id (from `/v1/tiktok/profile/playlists`), instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_TikTokPost" }, "example": { "data": [ { "id": "7680721699171601694", "url": "https://www.tiktok.com/@tiktok/video/7680721699171601694", "text": "this summer was all about the classic hits. here's to the ones that never got away 💿 #SongsofTheSummer2026", "createdAt": "2026-09-02T00:03:08.000Z", "author": { "id": "107955", "username": "tiktok", "displayName": "TikTok", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-maliva-avt-0068/ba67b11de451691939223e9d978e613a~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=1d6b70e6&x-expires=1795730400&x-signature=D%2FVdCDPHFSaC7XH9Z7dcGGoWuDw%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=my", "verified": true, "url": "https://www.tiktok.com/@tiktok" }, "stats": { "views": 524200, "likes": 25900, "comments": 5691, "shares": 2424, "saves": 2983, "engagementRate": 0.0649 }, "media": [ { "kind": "video", "url": "https://v16-webapp-prime.tiktok.com/video/tos/alisg/tos-alisg-ve-37c799-sg/ogxOEIAFdQFtcjgA0ZILu4Is1wzfDfpCqe0Vlu/?a=1988&bti=ODszNWYuMDE6&&bt=1029&ft=-Csk_maLPD12NfpGgY-UxCvFaY6e3wv25IcAp&mime_type=video_mp4&rc=aGhoO2k8OjdmaTs1PDUzaUBpM3E1N3A5cjpwZDMzaTczNEAuLl41Xy80NTYxMTUzLWBiYSNgcWtxMmRzYl9hLS1kMTJzcw%3D%3D&expire=1795731802&l=20261125062225A3BFA851AD7F6B46D903&ply_type=2&policy=2&signature=15b4594373773aa5cbbaf4ccbd53dcc3&tk=tt_chain_token&btag=e00088000", "thumbnailUrl": "https://p16-common-sign.tiktokcdn.com/tos-useast8-p-0068-tx2/o8UZ7AA11Ciogu5XByiiAPBcCSAIMnAIEBfaK7~tplv-tiktokx-origin.image?dr=14575&x-expires=1795730400&x-signature=czn6FPnj3KPrb6F6XKZg2lQTIxg%3D&t=4d5b0474&ps=13740610&shp=81f88b70&shcp=43f4a2f9&idc=my", "width": 720, "height": 1280, "durationSeconds": 56 } ], "hashtags": [ "SongsofTheSummer2026" ], "mentions": [], "ext": { "authorSecUid": "MS4wLjABAAAAv7iSuuXDJGDvJkmH_vz1qkDZYo1apxgzaxdBSeIuPiM", "sound": { "id": "7680721756763523871", "title": "original sound", "artist": "TikTok", "original": true }, "durationSeconds": 56, "reposts": null, "pinned": false, "ad": false, "playlistId": "7681171537575824159", "region": null, "language": "en", "screenText": [], "subtitles": [ { "language": "eng-US", "format": "webvtt", "source": "ASR" } ] } }, { "id": "7680996287877008670", "url": "https://www.tiktok.com/@tiktok/video/7680996287877008670", "text": "You made this the summer of K-Pop on TikTok 🫰 #SongsofTheSummer2026", "createdAt": "2026-09-02T17:48:58.000Z", "author": { "id": "107955", "username": "tiktok", "displayName": "TikTok", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-maliva-avt-0068/ba67b11de451691939223e9d978e613a~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=1d6b70e6&x-expires=1795730400&x-signature=D%2FVdCDPHFSaC7XH9Z7dcGGoWuDw%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=my", "verified": true, "url": "https://www.tiktok.com/@tiktok" }, "stats": { "views": 630000, "likes": 67800, "comments": 4245, "shares": 4821, "saves": 8079, "engagementRate": 0.122 }, "media": [ { "kind": "video", "url": "https://v16-webapp-prime.tiktok.com/video/tos/alisg/tos-alisg-ve-37c799-sg/oE5EAjYIieDYQVqPfvYTRngIYYea4hAfGQFRCU/?a=1988&bti=ODszNWYuMDE6&&bt=1116&ft=-Csk_maLPD12NfpGgY-UxCvFaY6e3wv25IcAp&mime_type=video_mp4&rc=aGg6ODxpaWVlaTU3PDVnOEBpanl3OHk5cjg5ZDMzaTczNEA2Li1fLmJeXmMxNi5jYi0zYSM0bXNuMmQ0L2BhLS1kMTJzcw%3D%3D&expire=1795731805&l=20261125062225A3BFA851AD7F6B46D903&ply_type=2&policy=2&signature=0fa63144b8ff9050eec282b9ba1403d3&tk=tt_chain_token&btag=e00088000", "thumbnailUrl": "https://p16-common-sign.tiktokcdn.com/tos-useast8-p-0068-tx2/osUEAGqIYsRDcCiYAIVYGfEkFEARCAmljcePAE~tplv-tiktokx-origin.image?dr=14575&x-expires=1795730400&x-signature=KLB1MC9bkIR6rLAgGJm%2FMYNaRqo%3D&t=4d5b0474&ps=13740610&shp=81f88b70&shcp=43f4a2f9&idc=my", "width": 720, "height": 1280, "durationSeconds": 59 } ], "hashtags": [ "SongsofTheSummer2026" ], "mentions": [], "ext": { "authorSecUid": "MS4wLjABAAAAv7iSuuXDJGDvJkmH_vz1qkDZYo1apxgzaxdBSeIuPiM", "sound": { "id": "7680996477660941087", "title": "original sound", "artist": "TikTok", "original": true }, "durationSeconds": 59, "reposts": null, "pinned": false, "ad": false, "playlistId": "7681171537575824159", "region": null, "language": "en", "screenText": [], "subtitles": [] } } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.tiktok.playlistPosts({ id: \"7681171537575824159\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.tiktok.playlist_posts(id=\"7681171537575824159\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/tiktok/playlist/posts \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"id=7681171537575824159\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_TikTokPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/TikTokPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "TikTokPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "pinned", "ad", "screenText", "subtitles" ], "properties": { "ad": { "type": "boolean", "description": "A paid promotion." }, "authorSecUid": { "type": [ "string", "null" ], "description": "The author's secUid." }, "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "language": { "type": [ "string", "null" ], "description": "The caption's language, as TikTok detected it (ISO 639-1)." }, "pinned": { "type": "boolean", "description": "Pinned to the top of its author's profile." }, "playlistId": { "type": [ "string", "null" ], "description": "The playlist it belongs to." }, "region": { "type": [ "string", "null" ], "description": "Where it was posted from (ISO country)." }, "reposts": { "type": [ "integer", "null" ], "format": "int64", "description": "Reposts, where TikTok counts them.", "minimum": 0 }, "screenText": { "type": "array", "items": { "type": "string" }, "description": "Text the author put on the post as stickers, in order, each once; read from the\npost, not from its frames." }, "sound": { "oneOf": [ { "$ref": "#/components/schemas/TikTokSoundRef" }, { "type": "null" } ] }, "subtitles": { "type": "array", "items": { "$ref": "#/components/schemas/TikTokSubtitle" }, "description": "Captions TikTok made or the author uploaded; read one with\n`/v1/tiktok/post/transcript`." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A TikTok post: a video or a photo set." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "TikTokSubtitle": { "type": "object", "required": [ "language", "format", "source" ], "properties": { "format": { "type": "string", "description": "`webvtt`." }, "language": { "type": "string", "description": "`eng-US`, `tur-TR`…" }, "source": { "type": "string", "description": "`ASR` (generated) or `MT` (machine translated); others are the author's." } } }, "TikTokSoundRef": { "type": "object", "description": "The sound a post uses.", "required": [ "id", "title", "original" ], "properties": { "artist": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "original": { "type": "boolean" }, "title": { "type": "string" } } }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Post Comment Replies (/docs/api-reference/tiktok/post-comment-replies) The replies to one comment, 50 a page. `GET https://api.socialapi.sh/v1/tiktok/post/comment/replies` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.tiktok.postCommentReplies({ url: "https://www.tiktok.com/@nike/video/7711465226318728461", commentId: "7711470567174587188" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.tiktok.post_comment_replies(url="https://www.tiktok.com/@nike/video/7711465226318728461", comment_id="7711470567174587188") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/tiktok/post/comment/replies \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://www.tiktok.com/@nike/video/7711465226318728461" \ --data-urlencode "commentId=7711470567174587188" ``` **Response** ```json { "data": [], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/tiktok/post/comment/replies": { "get": { "tags": [ "TikTok" ], "summary": "The replies to one comment, 50 a page.", "description": "1 credit a page.", "operationId": "tiktokPostCommentReplies", "parameters": [ { "name": "url", "in": "query", "description": "The post's link.", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The post's id, instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "commentId", "in": "query", "description": "The comment whose replies to list (a comment's `id`).", "required": true, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_TikTokComment" }, "example": { "data": [], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.tiktok.postCommentReplies({ url: \"https://www.tiktok.com/@nike/video/7711465226318728461\", commentId: \"7711470567174587188\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.tiktok.post_comment_replies(url=\"https://www.tiktok.com/@nike/video/7711465226318728461\", comment_id=\"7711470567174587188\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/tiktok/post/comment/replies \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://www.tiktok.com/@nike/video/7711465226318728461\" \\\n --data-urlencode \"commentId=7711470567174587188\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_TikTokComment": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/TikTokComment" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "TikTokComment": { "allOf": [ { "type": "object", "description": "A comment or a reply.", "required": [ "id", "postId", "text", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "pinned", "likedByCreator" ], "properties": { "language": { "type": [ "string", "null" ] }, "likedByCreator": { "type": "boolean", "description": "Liked by the post's author." }, "pinned": { "type": "boolean", "description": "Pinned by the post's author." } } }, { "type": "object", "description": "What only this platform has." } ] }, "id": { "type": "string" }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "parentId": { "type": [ "string", "null" ], "description": "The comment this replies to; absent on a top-level comment." }, "postId": { "type": "string" }, "replies": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "text": { "type": "string" } } }, { "type": "object", "description": "A TikTok comment or reply." } ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Post Comments (/docs/api-reference/tiktok/post-comments) A post's top-level comments, 50 a page. `GET https://api.socialapi.sh/v1/tiktok/post/comments` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.tiktok.postComments({ url: "https://www.tiktok.com/@nike/video/7711465226318728461" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.tiktok.post_comments(url="https://www.tiktok.com/@nike/video/7711465226318728461") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/tiktok/post/comments \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://www.tiktok.com/@nike/video/7711465226318728461" ``` **Response** ```json { "data": [ { "id": "7711470567174587188", "postId": "7711465226318728461", "parentId": null, "text": "day 3 for asking for free shoes or a sponsorship", "createdAt": "2026-11-23T20:44:54.000Z", "author": { "id": "7572676364739003409", "username": "mkhize_038", "displayName": "mkhiz€ _ $??", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-alisg-avt-0068/92b03a6787bff99c4ad5722cbbb6d833~tplv-tiktokx-cropcenter:100:100.jpg?dr=14579&refresh_token=84618990&x-expires=1795644000&x-signature=jZGiCYUL2Q2s1TgYLvvAXWnhnHA%3D&t=4d5b0474&ps=13740610&shp=30310797&shcp=ff37627b&idc=my", "verified": false, "url": "https://www.tiktok.com/@mkhize_038" }, "likes": 0, "replies": 0, "ext": { "pinned": false, "likedByCreator": false, "language": "en" } }, { "id": "7711465767753532178", "postId": "7711465226318728461", "parentId": null, "text": "The vroom sound soo real 😂😂😂", "createdAt": "2026-11-23T20:25:58.000Z", "author": { "id": "7209327424693240838", "username": "queen778887", "displayName": "Queen atelier 👞", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-alisg-avt-0068/e90050b9a58566070456fec057884e51~tplv-tiktokx-cropcenter:100:100.jpg?dr=14579&refresh_token=41547b71&x-expires=1795644000&x-signature=LY3w6Fzjm9hVaOelwQRH0HqCpIs%3D&t=4d5b0474&ps=13740610&shp=30310797&shcp=ff37627b&idc=my", "verified": false, "url": "https://www.tiktok.com/@queen778887" }, "likes": 1, "replies": 0, "ext": { "pinned": false, "likedByCreator": false, "language": "en" } } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/tiktok/post/comments": { "get": { "tags": [ "TikTok" ], "summary": "A post's top-level comments, 50 a page.", "description": "1 credit a page.", "operationId": "tiktokPostComments", "parameters": [ { "name": "url", "in": "query", "description": "The post's link.", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The post's id, instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_TikTokComment" }, "example": { "data": [ { "id": "7711470567174587188", "postId": "7711465226318728461", "parentId": null, "text": "day 3 for asking for free shoes or a sponsorship", "createdAt": "2026-11-23T20:44:54.000Z", "author": { "id": "7572676364739003409", "username": "mkhize_038", "displayName": "mkhiz€ _ $??", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-alisg-avt-0068/92b03a6787bff99c4ad5722cbbb6d833~tplv-tiktokx-cropcenter:100:100.jpg?dr=14579&refresh_token=84618990&x-expires=1795644000&x-signature=jZGiCYUL2Q2s1TgYLvvAXWnhnHA%3D&t=4d5b0474&ps=13740610&shp=30310797&shcp=ff37627b&idc=my", "verified": false, "url": "https://www.tiktok.com/@mkhize_038" }, "likes": 0, "replies": 0, "ext": { "pinned": false, "likedByCreator": false, "language": "en" } }, { "id": "7711465767753532178", "postId": "7711465226318728461", "parentId": null, "text": "The vroom sound soo real 😂😂😂", "createdAt": "2026-11-23T20:25:58.000Z", "author": { "id": "7209327424693240838", "username": "queen778887", "displayName": "Queen atelier 👞", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-alisg-avt-0068/e90050b9a58566070456fec057884e51~tplv-tiktokx-cropcenter:100:100.jpg?dr=14579&refresh_token=41547b71&x-expires=1795644000&x-signature=LY3w6Fzjm9hVaOelwQRH0HqCpIs%3D&t=4d5b0474&ps=13740610&shp=30310797&shcp=ff37627b&idc=my", "verified": false, "url": "https://www.tiktok.com/@queen778887" }, "likes": 1, "replies": 0, "ext": { "pinned": false, "likedByCreator": false, "language": "en" } } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.tiktok.postComments({ url: \"https://www.tiktok.com/@nike/video/7711465226318728461\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.tiktok.post_comments(url=\"https://www.tiktok.com/@nike/video/7711465226318728461\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/tiktok/post/comments \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://www.tiktok.com/@nike/video/7711465226318728461\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_TikTokComment": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/TikTokComment" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "TikTokComment": { "allOf": [ { "type": "object", "description": "A comment or a reply.", "required": [ "id", "postId", "text", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "pinned", "likedByCreator" ], "properties": { "language": { "type": [ "string", "null" ] }, "likedByCreator": { "type": "boolean", "description": "Liked by the post's author." }, "pinned": { "type": "boolean", "description": "Pinned by the post's author." } } }, { "type": "object", "description": "What only this platform has." } ] }, "id": { "type": "string" }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "parentId": { "type": [ "string", "null" ], "description": "The comment this replies to; absent on a top-level comment." }, "postId": { "type": "string" }, "replies": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "text": { "type": "string" } } }, { "type": "object", "description": "A TikTok comment or reply." } ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Post Related (/docs/api-reference/tiktok/post-related) Posts TikTok recommends beside one post. `GET https://api.socialapi.sh/v1/tiktok/post/related` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.tiktok.postRelated({ url: "https://www.tiktok.com/@nike/video/7711465226318728461" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.tiktok.post_related(url="https://www.tiktok.com/@nike/video/7711465226318728461") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/tiktok/post/related \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://www.tiktok.com/@nike/video/7711465226318728461" ``` **Response** ```json { "data": [ { "id": "7709854470548638996", "url": "https://www.tiktok.com/@ig.itsme_hisman/video/7709854470548638996", "text": null, "createdAt": "2026-11-19T12:13:05.000Z", "author": { "id": "6809451368878572545", "username": "ig.itsme_hisman", "displayName": "𝓞𝓷𝓲𝓲-𝓬𝓱𝓪𝓷", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-alisg-avt-0068/5de21ae98e0d97c3ba821184e8050cba~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=9ce090c0&x-expires=1795730400&x-signature=9dHQTbpG%2FbPo8PGLr%2Bk4kqQHCDY%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=my", "verified": false, "url": "https://www.tiktok.com/@ig.itsme_hisman" }, "stats": { "views": 5100000, "likes": 718900, "comments": 2956, "shares": 819800, "saves": 41361, "engagementRate": 0.3023 }, "media": [ { "kind": "video", "url": "https://v16-webapp-prime.tiktok.com/video/tos/alisg/tos-alisg-pve-0037c001/ocIZPvQAoDAFAEu5vQjJkffH1cDODCcItK9VKe/?a=1988&bti=ODszNWYuMDE6&&bt=390&ft=-Csk_maLPD12N.pGgY-UxlTFbY6e3wv25VcAp&mime_type=video_mp4&rc=aWZmNDk6Njg6aDk5ZjllO0BpMzdtamw5cmVoZTMzODczNEA1YGFgL2M2XjIxMjYuMV5eYSNkYXEvMmRzYnNhLS1kMTFzcw%3D%3D&expire=1795731745&l=20261125062218221A5E7C4E3B7D00461F&ply_type=2&policy=2&signature=01f935daffd9baafd0e93d628e17349d&tk=tt_chain_token&btag=e000b0000", "thumbnailUrl": "https://p16-common-sign.tiktokcdn.com/tos-alisg-p-0037/owINeVtIlCuYDAjHkZQAHFEDc5DiJfBAKfAv9o~tplv-tiktokx-origin.image?dr=14575&x-expires=1795730400&x-signature=8cRWxgtCZiqjP5xAlTG5VfyqnZU%3D&t=4d5b0474&ps=13740610&shp=81f88b70&shcp=43f4a2f9&idc=my", "width": 576, "height": 1024, "durationSeconds": 6 } ], "hashtags": [], "mentions": [], "ext": { "authorSecUid": "MS4wLjABAAAAxklZYtwL_YeldwJr4YXbD-BhUFq8909WrMT7MTKmSHMKkrd6-d2HuLRAySqCz7A2", "sound": { "id": "7471523954004380417", "title": "original sound - (•~•)Jansen!!!!", "artist": "(•~•)Jansen!!!!", "original": true }, "durationSeconds": 6, "reposts": null, "pinned": false, "ad": false, "playlistId": null, "region": null, "language": null, "screenText": [ "pov: nagtatampo ka" ], "subtitles": [ { "language": "fil-PH", "format": "webvtt", "source": "ASR" } ] } }, { "id": "7709461517367872788", "url": "https://www.tiktok.com/@dubbers17/video/7709461517367872788", "text": "I have no boots gng,,✌️😭 kelen tim langsung pake or styling nih btw?? top nya dari @Bitsnbobs76 yaa💗 #outfitideas #styling #fitcheck #affiliate #pemula", "createdAt": "2026-11-18T10:48:14.000Z", "author": { "id": "7577317926308103186", "username": "dubbers17", "displayName": "dudutt", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-alisg-avt-0068/b2edb5a7fd154e4921420780a1c59d58~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=9d727fa7&x-expires=1795730400&x-signature=q%2FmnN%2FlS1cojTUZGRtQlbe2cucE%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=my", "verified": false, "url": "https://www.tiktok.com/@dubbers17" }, "stats": { "views": 38500000, "likes": 7600000, "comments": 16100, "shares": 194000, "saves": 336711, "engagementRate": 0.2029 }, "media": [ { "kind": "video", "url": "https://v16-webapp-prime.tiktok.com/video/tos/alisg/tos-alisg-pve-0037c001/oMxQnPehGMgeSwf9ZAWfASIQGAKWUNl8RyFrvw/?a=1988&bti=ODszNWYuMDE6&&bt=429&ft=-Csk_maLPD12N.pGgY-UxlTFbY6e3wv25VcAp&mime_type=video_mp4&rc=NWRoOmRlNWQ0Ojk2aDczNkBpM3k8Nms5cm5yZTMzODczNEBhNGE1LzVeNi8xLTIwYl4xYSMtYy5fMmRrMXJhLS1kMWBzcw%3D%3D&expire=1795731751&l=20261125062218221A5E7C4E3B7D00461F&ply_type=2&policy=2&signature=36c1e60fb325f4a8ff294adeb408fbe0&tk=tt_chain_token&btag=e000b0000", "thumbnailUrl": "https://p19-common-sign.tiktokcdn.com/tos-alisg-p-0037/okeWARFfQ9GwHSzlx8Kx7QwSrN0BhMfceFQAAG~tplv-tiktokx-origin.image?dr=14575&x-expires=1795730400&x-signature=44w%2FnrAwM9fT5JbS9nhVTRRU9Kk%3D&t=4d5b0474&ps=13740610&shp=81f88b70&shcp=43f4a2f9&idc=my", "width": 576, "height": 1024, "durationSeconds": 12 } ], "hashtags": [ "outfitideas", "styling", "fitcheck" ], "mentions": [ "Bitsnbobs76" ], "ext": { "authorSecUid": "MS4wLjABAAAAsWnEwlLOdxKXLhd5fO4SuKNnDNtP8epv9Wka1lC9bwluUSsOT1ISbAs1C2HKS4sQ", "sound": { "id": "7569985736587004703", "title": "original sound", "artist": "︎", "original": true }, "durationSeconds": 12, "reposts": null, "pinned": false, "ad": false, "playlistId": null, "region": null, "language": "id", "screenText": [ "wearing vs..", "styling" ], "subtitles": [] } } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/tiktok/post/related": { "get": { "tags": [ "TikTok" ], "summary": "Posts TikTok recommends beside one post.", "description": "1 credit.", "operationId": "tiktokPostRelated", "parameters": [ { "name": "url", "in": "query", "description": "The post's link (`https://www.tiktok.com/@user/video/7311…`, or a share link).", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The post's id, instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_TikTokPost" }, "example": { "data": [ { "id": "7709854470548638996", "url": "https://www.tiktok.com/@ig.itsme_hisman/video/7709854470548638996", "text": null, "createdAt": "2026-11-19T12:13:05.000Z", "author": { "id": "6809451368878572545", "username": "ig.itsme_hisman", "displayName": "𝓞𝓷𝓲𝓲-𝓬𝓱𝓪𝓷", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-alisg-avt-0068/5de21ae98e0d97c3ba821184e8050cba~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=9ce090c0&x-expires=1795730400&x-signature=9dHQTbpG%2FbPo8PGLr%2Bk4kqQHCDY%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=my", "verified": false, "url": "https://www.tiktok.com/@ig.itsme_hisman" }, "stats": { "views": 5100000, "likes": 718900, "comments": 2956, "shares": 819800, "saves": 41361, "engagementRate": 0.3023 }, "media": [ { "kind": "video", "url": "https://v16-webapp-prime.tiktok.com/video/tos/alisg/tos-alisg-pve-0037c001/ocIZPvQAoDAFAEu5vQjJkffH1cDODCcItK9VKe/?a=1988&bti=ODszNWYuMDE6&&bt=390&ft=-Csk_maLPD12N.pGgY-UxlTFbY6e3wv25VcAp&mime_type=video_mp4&rc=aWZmNDk6Njg6aDk5ZjllO0BpMzdtamw5cmVoZTMzODczNEA1YGFgL2M2XjIxMjYuMV5eYSNkYXEvMmRzYnNhLS1kMTFzcw%3D%3D&expire=1795731745&l=20261125062218221A5E7C4E3B7D00461F&ply_type=2&policy=2&signature=01f935daffd9baafd0e93d628e17349d&tk=tt_chain_token&btag=e000b0000", "thumbnailUrl": "https://p16-common-sign.tiktokcdn.com/tos-alisg-p-0037/owINeVtIlCuYDAjHkZQAHFEDc5DiJfBAKfAv9o~tplv-tiktokx-origin.image?dr=14575&x-expires=1795730400&x-signature=8cRWxgtCZiqjP5xAlTG5VfyqnZU%3D&t=4d5b0474&ps=13740610&shp=81f88b70&shcp=43f4a2f9&idc=my", "width": 576, "height": 1024, "durationSeconds": 6 } ], "hashtags": [], "mentions": [], "ext": { "authorSecUid": "MS4wLjABAAAAxklZYtwL_YeldwJr4YXbD-BhUFq8909WrMT7MTKmSHMKkrd6-d2HuLRAySqCz7A2", "sound": { "id": "7471523954004380417", "title": "original sound - (•~•)Jansen!!!!", "artist": "(•~•)Jansen!!!!", "original": true }, "durationSeconds": 6, "reposts": null, "pinned": false, "ad": false, "playlistId": null, "region": null, "language": null, "screenText": [ "pov: nagtatampo ka" ], "subtitles": [ { "language": "fil-PH", "format": "webvtt", "source": "ASR" } ] } }, { "id": "7709461517367872788", "url": "https://www.tiktok.com/@dubbers17/video/7709461517367872788", "text": "I have no boots gng,,✌️😭 kelen tim langsung pake or styling nih btw?? top nya dari @Bitsnbobs76 yaa💗 #outfitideas #styling #fitcheck #affiliate #pemula", "createdAt": "2026-11-18T10:48:14.000Z", "author": { "id": "7577317926308103186", "username": "dubbers17", "displayName": "dudutt", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-alisg-avt-0068/b2edb5a7fd154e4921420780a1c59d58~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=9d727fa7&x-expires=1795730400&x-signature=q%2FmnN%2FlS1cojTUZGRtQlbe2cucE%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=my", "verified": false, "url": "https://www.tiktok.com/@dubbers17" }, "stats": { "views": 38500000, "likes": 7600000, "comments": 16100, "shares": 194000, "saves": 336711, "engagementRate": 0.2029 }, "media": [ { "kind": "video", "url": "https://v16-webapp-prime.tiktok.com/video/tos/alisg/tos-alisg-pve-0037c001/oMxQnPehGMgeSwf9ZAWfASIQGAKWUNl8RyFrvw/?a=1988&bti=ODszNWYuMDE6&&bt=429&ft=-Csk_maLPD12N.pGgY-UxlTFbY6e3wv25VcAp&mime_type=video_mp4&rc=NWRoOmRlNWQ0Ojk2aDczNkBpM3k8Nms5cm5yZTMzODczNEBhNGE1LzVeNi8xLTIwYl4xYSMtYy5fMmRrMXJhLS1kMWBzcw%3D%3D&expire=1795731751&l=20261125062218221A5E7C4E3B7D00461F&ply_type=2&policy=2&signature=36c1e60fb325f4a8ff294adeb408fbe0&tk=tt_chain_token&btag=e000b0000", "thumbnailUrl": "https://p19-common-sign.tiktokcdn.com/tos-alisg-p-0037/okeWARFfQ9GwHSzlx8Kx7QwSrN0BhMfceFQAAG~tplv-tiktokx-origin.image?dr=14575&x-expires=1795730400&x-signature=44w%2FnrAwM9fT5JbS9nhVTRRU9Kk%3D&t=4d5b0474&ps=13740610&shp=81f88b70&shcp=43f4a2f9&idc=my", "width": 576, "height": 1024, "durationSeconds": 12 } ], "hashtags": [ "outfitideas", "styling", "fitcheck" ], "mentions": [ "Bitsnbobs76" ], "ext": { "authorSecUid": "MS4wLjABAAAAsWnEwlLOdxKXLhd5fO4SuKNnDNtP8epv9Wka1lC9bwluUSsOT1ISbAs1C2HKS4sQ", "sound": { "id": "7569985736587004703", "title": "original sound", "artist": "︎", "original": true }, "durationSeconds": 12, "reposts": null, "pinned": false, "ad": false, "playlistId": null, "region": null, "language": "id", "screenText": [ "wearing vs..", "styling" ], "subtitles": [] } } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.tiktok.postRelated({ url: \"https://www.tiktok.com/@nike/video/7711465226318728461\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.tiktok.post_related(url=\"https://www.tiktok.com/@nike/video/7711465226318728461\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/tiktok/post/related \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://www.tiktok.com/@nike/video/7711465226318728461\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_TikTokPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/TikTokPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "TikTokPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "pinned", "ad", "screenText", "subtitles" ], "properties": { "ad": { "type": "boolean", "description": "A paid promotion." }, "authorSecUid": { "type": [ "string", "null" ], "description": "The author's secUid." }, "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "language": { "type": [ "string", "null" ], "description": "The caption's language, as TikTok detected it (ISO 639-1)." }, "pinned": { "type": "boolean", "description": "Pinned to the top of its author's profile." }, "playlistId": { "type": [ "string", "null" ], "description": "The playlist it belongs to." }, "region": { "type": [ "string", "null" ], "description": "Where it was posted from (ISO country)." }, "reposts": { "type": [ "integer", "null" ], "format": "int64", "description": "Reposts, where TikTok counts them.", "minimum": 0 }, "screenText": { "type": "array", "items": { "type": "string" }, "description": "Text the author put on the post as stickers, in order, each once; read from the\npost, not from its frames." }, "sound": { "oneOf": [ { "$ref": "#/components/schemas/TikTokSoundRef" }, { "type": "null" } ] }, "subtitles": { "type": "array", "items": { "$ref": "#/components/schemas/TikTokSubtitle" }, "description": "Captions TikTok made or the author uploaded; read one with\n`/v1/tiktok/post/transcript`." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A TikTok post: a video or a photo set." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "TikTokSubtitle": { "type": "object", "required": [ "language", "format", "source" ], "properties": { "format": { "type": "string", "description": "`webvtt`." }, "language": { "type": "string", "description": "`eng-US`, `tur-TR`…" }, "source": { "type": "string", "description": "`ASR` (generated) or `MT` (machine translated); others are the author's." } } }, "TikTokSoundRef": { "type": "object", "description": "The sound a post uses.", "required": [ "id", "title", "original" ], "properties": { "artist": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "original": { "type": "boolean" }, "title": { "type": "string" } } }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Post Transcript (/docs/api-reference/tiktok/post-transcript) A post's captions as text with their times. `GET https://api.socialapi.sh/v1/tiktok/post/transcript` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.tiktok.postTranscript({ url: "https://www.tiktok.com/@nike/video/7711414040114892045" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.tiktok.post_transcript(url="https://www.tiktok.com/@nike/video/7711414040114892045").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/tiktok/post/transcript \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://www.tiktok.com/@nike/video/7711414040114892045" ``` **Response** ```json { "data": { "postId": "7711414040114892045", "language": "eng-US", "source": "ASR", "text": "Pole or podium?\nPodium. Podium.\nPole. Podium.\nUh, podium. Podium.\nStart soft. Transition of hard. Hard.\nHard or do it.\nHe knows him more than I do.\nUh, let's go soft.\nGotta be fast. Soft.\nGoing for the win. The win.\nEasy. The win,\nthe win. I mean,\nthe win is the win. But like if you got the fastest lap.\nI'm a stats girl. And you can wave that around and be like,\nwell, I was faster.\nUh. Oh, rain.\nI…", "cues": [ { "startSeconds": 0.02, "endSeconds": 1.2, "text": "Pole or podium?" }, { "startSeconds": 1.74, "endSeconds": 2.9, "text": "Podium. Podium." }, { "startSeconds": 2.901, "endSeconds": 4.121, "text": "Pole. Podium." } ] } } ``` **OpenAPI** ```json { "paths": { "/v1/tiktok/post/transcript": { "get": { "tags": [ "TikTok" ], "summary": "A post's captions as text with their times.", "description": "TikTok's own, generated or the author's, in the language asked for when it has it.\n`404` when the post has none. 10 credits.", "operationId": "tiktokPostTranscript", "parameters": [ { "name": "url", "in": "query", "description": "The post's link.", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The post's id, instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "language", "in": "query", "description": "A language to prefer, such as `en` or `tr`; the first available otherwise.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_TikTokTranscript" }, "example": { "data": { "postId": "7711414040114892045", "language": "eng-US", "source": "ASR", "text": "Pole or podium?\nPodium. Podium.\nPole. Podium.\nUh, podium. Podium.\nStart soft. Transition of hard. Hard.\nHard or do it.\nHe knows him more than I do.\nUh, let's go soft.\nGotta be fast. Soft.\nGoing for the win. The win.\nEasy. The win,\nthe win. I mean,\nthe win is the win. But like if you got the fastest lap.\nI'm a stats girl. And you can wave that around and be like,\nwell, I was faster.\nUh. Oh, rain.\nI…", "cues": [ { "startSeconds": 0.02, "endSeconds": 1.2, "text": "Pole or podium?" }, { "startSeconds": 1.74, "endSeconds": 2.9, "text": "Podium. Podium." }, { "startSeconds": 2.901, "endSeconds": 4.121, "text": "Pole. Podium." } ] } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.tiktok.postTranscript({ url: \"https://www.tiktok.com/@nike/video/7711414040114892045\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.tiktok.post_transcript(url=\"https://www.tiktok.com/@nike/video/7711414040114892045\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/tiktok/post/transcript \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://www.tiktok.com/@nike/video/7711414040114892045\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_TikTokTranscript": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/TikTokTranscript" } } }, "TikTokTranscript": { "allOf": [ { "type": "object", "description": "A post's captions as text.", "required": [ "postId", "language", "source", "text", "cues" ], "properties": { "cues": { "type": "array", "items": { "$ref": "#/components/schemas/TikTokCue" }, "description": "Each cue with its time." }, "language": { "type": "string" }, "postId": { "type": "string" }, "source": { "type": "string", "description": "`ASR` (generated by TikTok) or the author's." }, "text": { "type": "string", "description": "The captions as plain text, one cue per line." } } }, { "type": "object", "description": "A TikTok post's captions as text." } ] }, "TikTokCue": { "type": "object", "required": [ "startSeconds", "endSeconds", "text" ], "properties": { "endSeconds": { "type": "number", "format": "double" }, "startSeconds": { "type": "number", "format": "double" }, "text": { "type": "string" } } } } } } ``` # Post (/docs/api-reference/tiktok/post) One post with its counts, media and sound. `GET https://api.socialapi.sh/v1/tiktok/post` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.tiktok.post({ url: "https://www.tiktok.com/@nike/video/7711465226318728461" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.tiktok.post(url="https://www.tiktok.com/@nike/video/7711465226318728461").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/tiktok/post \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://www.tiktok.com/@nike/video/7711465226318728461" ``` **Response** ```json { "data": { "id": "7711465226318728461", "url": "https://www.tiktok.com/@nike/video/7711465226318728461", "text": "Vroom vroom 🏎️💨 #Formula1 #LasVegasGP #NSW #Nike Feat. @Miku Martineau @lizzy greene @Nick @Caleb McLaughlin @Sabrina Ionescu @Brianna LaPaglia", "createdAt": "2026-11-23T20:24:10.000Z", "author": { "id": "208464585232822272", "username": "nike", "displayName": "Nike", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-maliva-avt-0068/e0b0ac7b6ad6447a8e923fd1eb162f2c~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=c73b1f8a&x-expires=1795730400&x-signature=WFCAToitWtbkgo5qXRwrQmcX%2FZY%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=my", "verified": true, "url": "https://www.tiktok.com/@nike" }, "stats": { "views": 18200, "likes": 309, "comments": 14, "shares": 5, "saves": 17, "engagementRate": 0.018 }, "media": [ { "kind": "video", "url": "https://v16-webapp-prime.tiktok.com/video/tos/alisg/tos-alisg-ve-37c799-sg/o0kDDPDSFCeIBoEwTRQMABOEM1SIESQfgrKdjE/?a=1988&bti=ODszNWYuMDE6&&bt=1397&ft=I~da4ogrD12NvFib3lIxRM5jblBF-UjNSqopiX&mime_type=video_mp4&rc=ZzppN2U1OzY2PGVnN2c0Z0BpM3g3NnQ5cmxkZjMzZzczNEAtMC0tXjZeNmIxNmMyLi4tYSMzYmlnMmQ0Li9hLS1kMS9zcw%3D%3D&expire=1795731747&l=20261125062214C3852EA1C0A1CA306089&ply_type=2&policy=2&signature=eeb581e1c797db185a28e6f60ab2e820&tk=tt_chain_token&btag=e000b0000", "thumbnailUrl": "https://p16-common-sign.tiktokcdn.com/tos-useast5-p-0068-tx/oMeIeALC2IGwPxAAHOAAe3IEWJQ6jbPHkAcUQE~tplv-tiktokx-origin.image?dr=14575&x-expires=1795730400&x-signature=fWhitTvuuSB%2FxWl2xEN2vB%2BBXsQ%3D&t=4d5b0474&ps=13740610&shp=81f88b70&shcp=43f4a2f9&idc=my", "width": 720, "height": 1280, "durationSeconds": 13 } ], "hashtags": [ "Formula1", "LasVegasGP", "NSW" ], "mentions": [ "Miku", "lizzy", "Nick" ], "ext": { "authorSecUid": "MS4wLjABAAAA_3ndMt8d_tECTdpKgCxcx238tOnQZX-20wqN01aMui5zQ7hsqSdff-jC5qYC-Cl_", "sound": { "id": "7711465298314021645", "title": "original sound", "artist": "Nike", "original": true }, "durationSeconds": 13, "reposts": null, "pinned": false, "ad": false, "playlistId": null, "region": null, "language": "nl", "screenText": [], "subtitles": [] } } } ``` **OpenAPI** ```json { "paths": { "/v1/tiktok/post": { "get": { "tags": [ "TikTok" ], "summary": "One post with its counts, media and sound.", "description": "Caption, author, view, like, comment, share and save counts and the engagement rate,\nmedia, sound, hashtags, the text on it and the captions it has. 1 credit.", "operationId": "tiktokPost", "parameters": [ { "name": "url", "in": "query", "description": "The post's link (`https://www.tiktok.com/@user/video/7311…`, or a share link).", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The post's id, instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_TikTokPost" }, "example": { "data": { "id": "7711465226318728461", "url": "https://www.tiktok.com/@nike/video/7711465226318728461", "text": "Vroom vroom 🏎️💨 #Formula1 #LasVegasGP #NSW #Nike Feat. @Miku Martineau @lizzy greene @Nick @Caleb McLaughlin @Sabrina Ionescu @Brianna LaPaglia", "createdAt": "2026-11-23T20:24:10.000Z", "author": { "id": "208464585232822272", "username": "nike", "displayName": "Nike", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-maliva-avt-0068/e0b0ac7b6ad6447a8e923fd1eb162f2c~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=c73b1f8a&x-expires=1795730400&x-signature=WFCAToitWtbkgo5qXRwrQmcX%2FZY%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=my", "verified": true, "url": "https://www.tiktok.com/@nike" }, "stats": { "views": 18200, "likes": 309, "comments": 14, "shares": 5, "saves": 17, "engagementRate": 0.018 }, "media": [ { "kind": "video", "url": "https://v16-webapp-prime.tiktok.com/video/tos/alisg/tos-alisg-ve-37c799-sg/o0kDDPDSFCeIBoEwTRQMABOEM1SIESQfgrKdjE/?a=1988&bti=ODszNWYuMDE6&&bt=1397&ft=I~da4ogrD12NvFib3lIxRM5jblBF-UjNSqopiX&mime_type=video_mp4&rc=ZzppN2U1OzY2PGVnN2c0Z0BpM3g3NnQ5cmxkZjMzZzczNEAtMC0tXjZeNmIxNmMyLi4tYSMzYmlnMmQ0Li9hLS1kMS9zcw%3D%3D&expire=1795731747&l=20261125062214C3852EA1C0A1CA306089&ply_type=2&policy=2&signature=eeb581e1c797db185a28e6f60ab2e820&tk=tt_chain_token&btag=e000b0000", "thumbnailUrl": "https://p16-common-sign.tiktokcdn.com/tos-useast5-p-0068-tx/oMeIeALC2IGwPxAAHOAAe3IEWJQ6jbPHkAcUQE~tplv-tiktokx-origin.image?dr=14575&x-expires=1795730400&x-signature=fWhitTvuuSB%2FxWl2xEN2vB%2BBXsQ%3D&t=4d5b0474&ps=13740610&shp=81f88b70&shcp=43f4a2f9&idc=my", "width": 720, "height": 1280, "durationSeconds": 13 } ], "hashtags": [ "Formula1", "LasVegasGP", "NSW" ], "mentions": [ "Miku", "lizzy", "Nick" ], "ext": { "authorSecUid": "MS4wLjABAAAA_3ndMt8d_tECTdpKgCxcx238tOnQZX-20wqN01aMui5zQ7hsqSdff-jC5qYC-Cl_", "sound": { "id": "7711465298314021645", "title": "original sound", "artist": "Nike", "original": true }, "durationSeconds": 13, "reposts": null, "pinned": false, "ad": false, "playlistId": null, "region": null, "language": "nl", "screenText": [], "subtitles": [] } } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.tiktok.post({ url: \"https://www.tiktok.com/@nike/video/7711465226318728461\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.tiktok.post(url=\"https://www.tiktok.com/@nike/video/7711465226318728461\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/tiktok/post \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://www.tiktok.com/@nike/video/7711465226318728461\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_TikTokPost": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/TikTokPost" } } }, "TikTokPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "pinned", "ad", "screenText", "subtitles" ], "properties": { "ad": { "type": "boolean", "description": "A paid promotion." }, "authorSecUid": { "type": [ "string", "null" ], "description": "The author's secUid." }, "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "language": { "type": [ "string", "null" ], "description": "The caption's language, as TikTok detected it (ISO 639-1)." }, "pinned": { "type": "boolean", "description": "Pinned to the top of its author's profile." }, "playlistId": { "type": [ "string", "null" ], "description": "The playlist it belongs to." }, "region": { "type": [ "string", "null" ], "description": "Where it was posted from (ISO country)." }, "reposts": { "type": [ "integer", "null" ], "format": "int64", "description": "Reposts, where TikTok counts them.", "minimum": 0 }, "screenText": { "type": "array", "items": { "type": "string" }, "description": "Text the author put on the post as stickers, in order, each once; read from the\npost, not from its frames." }, "sound": { "oneOf": [ { "$ref": "#/components/schemas/TikTokSoundRef" }, { "type": "null" } ] }, "subtitles": { "type": "array", "items": { "$ref": "#/components/schemas/TikTokSubtitle" }, "description": "Captions TikTok made or the author uploaded; read one with\n`/v1/tiktok/post/transcript`." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A TikTok post: a video or a photo set." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "TikTokSubtitle": { "type": "object", "required": [ "language", "format", "source" ], "properties": { "format": { "type": "string", "description": "`webvtt`." }, "language": { "type": "string", "description": "`eng-US`, `tur-TR`…" }, "source": { "type": "string", "description": "`ASR` (generated) or `MT` (machine translated); others are the author's." } } }, "TikTokSoundRef": { "type": "object", "description": "The sound a post uses.", "required": [ "id", "title", "original" ], "properties": { "artist": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "original": { "type": "boolean" }, "title": { "type": "string" } } }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Profile Followers (/docs/api-reference/tiktok/profile-followers) An account's followers, newest first, 30 a page. `GET https://api.socialapi.sh/v1/tiktok/profile/followers` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.tiktok.profileFollowers({ handle: "nike" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.tiktok.profile_followers(handle="nike") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/tiktok/profile/followers \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=nike" ``` **Response** ```json { "data": [ { "id": "7501094596236117013", "username": "santiago.miguel906", "displayName": "santi", "bio": "mi anime fav es one piece", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-alisg-avt-0068/9ebb0e01c1f5795a2e72ce8b979138b5~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=a71e7a37&x-expires=1795730400&x-signature=ZKDpPQXZjju1aEpZmwn%2FU%2FDN6Pw%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=my", "url": "https://www.tiktok.com/@santiago.miguel906", "verified": false, "private": false, "followers": 109, "following": 1189, "likes": 38, "posts": 1, "externalUrl": null, "createdAt": null, "ext": { "secUid": "MS4wLjABAAAAR1b3oaVy900bF4fsSDfZH2BWWkrAzdJQeWWVZr2Q2B2Q1wmUL5FDkD8cUpcOF58O", "friends": 0, "liked": 9249, "category": null, "seller": false, "likesPublic": false, "roomId": null } }, { "id": "7602004957567894541", "username": "chickenjoe205", "displayName": "૮(˶ᵔᵕᵔ˶)ა ᵒ̴̶̷̤ꇴᵒ̴̶̷̤ ˃̶͈◡˂̶͈", "bio": null, "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-maliva-avt-0068/5f97e8aa7edb844f910a7b1ec3002235~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=88332f90&x-expires=1795730400&x-signature=w2IA7BXBVAq1%2BX9PjihxML2dHaQ%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=my", "url": "https://www.tiktok.com/@chickenjoe205", "verified": false, "private": false, "followers": 159, "following": 790, "likes": 1023, "posts": 28, "externalUrl": null, "createdAt": null, "ext": { "secUid": "MS4wLjABAAAAluZjPyqxb_Dw9Z-yzSNtvXOxXbgaz4_70gBNW6SijFin819Z55v50MktilnKAkA1", "friends": 0, "liked": 22199, "category": null, "seller": false, "likesPublic": false, "roomId": null } } ], "pagination": { "nextCursor": "1795558630", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/tiktok/profile/followers": { "get": { "tags": [ "TikTok" ], "summary": "An account's followers, newest first, 30 a page.", "description": "1 credit a page.", "operationId": "tiktokProfileFollowers", "parameters": [ { "name": "handle", "in": "query", "description": "The username, with or without `@`.", "required": false, "schema": { "type": "string" } }, { "name": "secUid", "in": "query", "description": "TikTok's stable key for the account (a profile's `ext.secUid`), instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "The profile's link, instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_TikTokProfile" }, "example": { "data": [ { "id": "7501094596236117013", "username": "santiago.miguel906", "displayName": "santi", "bio": "mi anime fav es one piece", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-alisg-avt-0068/9ebb0e01c1f5795a2e72ce8b979138b5~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=a71e7a37&x-expires=1795730400&x-signature=ZKDpPQXZjju1aEpZmwn%2FU%2FDN6Pw%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=my", "url": "https://www.tiktok.com/@santiago.miguel906", "verified": false, "private": false, "followers": 109, "following": 1189, "likes": 38, "posts": 1, "externalUrl": null, "createdAt": null, "ext": { "secUid": "MS4wLjABAAAAR1b3oaVy900bF4fsSDfZH2BWWkrAzdJQeWWVZr2Q2B2Q1wmUL5FDkD8cUpcOF58O", "friends": 0, "liked": 9249, "category": null, "seller": false, "likesPublic": false, "roomId": null } }, { "id": "7602004957567894541", "username": "chickenjoe205", "displayName": "૮(˶ᵔᵕᵔ˶)ა ᵒ̴̶̷̤ꇴᵒ̴̶̷̤ ˃̶͈◡˂̶͈", "bio": null, "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-maliva-avt-0068/5f97e8aa7edb844f910a7b1ec3002235~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=88332f90&x-expires=1795730400&x-signature=w2IA7BXBVAq1%2BX9PjihxML2dHaQ%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=my", "url": "https://www.tiktok.com/@chickenjoe205", "verified": false, "private": false, "followers": 159, "following": 790, "likes": 1023, "posts": 28, "externalUrl": null, "createdAt": null, "ext": { "secUid": "MS4wLjABAAAAluZjPyqxb_Dw9Z-yzSNtvXOxXbgaz4_70gBNW6SijFin819Z55v50MktilnKAkA1", "friends": 0, "liked": 22199, "category": null, "seller": false, "likesPublic": false, "roomId": null } } ], "pagination": { "nextCursor": "1795558630", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.tiktok.profileFollowers({ handle: \"nike\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.tiktok.profile_followers(handle=\"nike\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/tiktok/profile/followers \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=nike\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_TikTokProfile": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/TikTokProfile" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "TikTokProfile": { "allOf": [ { "type": "object", "description": "An account.", "required": [ "id", "username", "url", "verified", "private", "ext" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "bio": { "type": [ "string", "null" ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "displayName": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "secUid", "seller", "likesPublic" ], "properties": { "category": { "type": [ "string", "null" ], "description": "The business category, for business accounts." }, "friends": { "type": [ "integer", "null" ], "format": "int64", "description": "Mutual follows.", "minimum": 0 }, "liked": { "type": [ "integer", "null" ], "format": "int64", "description": "Posts the account has liked.", "minimum": 0 }, "likesPublic": { "type": "boolean", "description": "Whether its likes list is public." }, "roomId": { "type": [ "string", "null" ], "description": "The live room it is broadcasting in, when it is live." }, "secUid": { "type": "string", "description": "TikTok's stable key for the account; the handle can change, this does not." }, "seller": { "type": "boolean", "description": "Whether the account sells through TikTok Shop." } } }, { "type": "object", "description": "What only this platform has." } ] }, "externalUrl": { "type": [ "string", "null" ], "description": "The link in the bio." }, "followers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "following": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "id": { "type": "string", "description": "The platform's id for the account." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "description": "Likes the account's posts received in total.", "minimum": 0 }, "posts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "private": { "type": "boolean" }, "url": { "type": "string", "description": "The profile's page." }, "username": { "type": "string", "description": "The handle, without `@`." }, "verified": { "type": "boolean" } } }, { "type": "object", "description": "A TikTok account." } ] }, "Timestamp": { "type": "string", "format": "date-time" } } } } ``` # Profile Following (/docs/api-reference/tiktok/profile-following) The accounts an account follows, when it shows them. `GET https://api.socialapi.sh/v1/tiktok/profile/following` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.tiktok.profileFollowing({ handle: "tiktok" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.tiktok.profile_following(handle="tiktok") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/tiktok/profile/following \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=tiktok" ``` **Response** ```json { "data": [ { "id": "6994771535970370566", "username": "shou.time", "displayName": "Shou", "bio": "TikTok", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-maliva-avt-0068/7311585113949601834~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=87649410&x-expires=1795730400&x-signature=b4WxKIQgcnoXEnwQP75r5IGo%2BCM%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=my", "url": "https://www.tiktok.com/@shou.time", "verified": true, "private": false, "followers": 4620631, "following": 239, "likes": 11563856, "posts": 55, "externalUrl": null, "createdAt": null, "ext": { "secUid": "MS4wLjABAAAAk-_0L7XuKDvMfmosBPF1VEuFTaxX_KlOs4E1E2Fn0akBT4lQECDR39BENch7v9Up", "friends": 0, "liked": 108, "category": null, "seller": false, "likesPublic": false, "roomId": null } }, { "id": "6551237489917432832", "username": "tiktokcreators", "displayName": "tiktok creators", "bio": "The official account for TikTok Creators who inspire creativity and bring joy ✨\n\n⬇️ Creator Programs 💰⬇️", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-maliva-avt-0068/8a3909f393315b8cf96ea44747b6dfbb~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=173bce55&x-expires=1795730400&x-signature=Oa%2B2zBeayhXFIsK%2FRwBMzjDUk9I%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=my", "url": "https://www.tiktok.com/@tiktokcreators", "verified": true, "private": false, "followers": 9039643, "following": 570, "likes": 33952505, "posts": 1180, "externalUrl": null, "createdAt": null, "ext": { "secUid": "MS4wLjABAAAAXqqA-cLDC0hfQPIrS5APYNsg04zkl-socWCkqkI3UIOaEe6_Qnokg0GcWpLnMNQP", "friends": 0, "liked": 1924, "category": null, "seller": false, "likesPublic": false, "roomId": null } } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/tiktok/profile/following": { "get": { "tags": [ "TikTok" ], "summary": "The accounts an account follows, when it shows them.", "description": "`403 PRIVATE` when it hides them. 1 credit a page.", "operationId": "tiktokProfileFollowing", "parameters": [ { "name": "handle", "in": "query", "description": "The username, with or without `@`.", "required": false, "schema": { "type": "string" } }, { "name": "secUid", "in": "query", "description": "TikTok's stable key for the account (a profile's `ext.secUid`), instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "The profile's link, instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_TikTokProfile" }, "example": { "data": [ { "id": "6994771535970370566", "username": "shou.time", "displayName": "Shou", "bio": "TikTok", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-maliva-avt-0068/7311585113949601834~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=87649410&x-expires=1795730400&x-signature=b4WxKIQgcnoXEnwQP75r5IGo%2BCM%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=my", "url": "https://www.tiktok.com/@shou.time", "verified": true, "private": false, "followers": 4620631, "following": 239, "likes": 11563856, "posts": 55, "externalUrl": null, "createdAt": null, "ext": { "secUid": "MS4wLjABAAAAk-_0L7XuKDvMfmosBPF1VEuFTaxX_KlOs4E1E2Fn0akBT4lQECDR39BENch7v9Up", "friends": 0, "liked": 108, "category": null, "seller": false, "likesPublic": false, "roomId": null } }, { "id": "6551237489917432832", "username": "tiktokcreators", "displayName": "tiktok creators", "bio": "The official account for TikTok Creators who inspire creativity and bring joy ✨\n\n⬇️ Creator Programs 💰⬇️", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-maliva-avt-0068/8a3909f393315b8cf96ea44747b6dfbb~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=173bce55&x-expires=1795730400&x-signature=Oa%2B2zBeayhXFIsK%2FRwBMzjDUk9I%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=my", "url": "https://www.tiktok.com/@tiktokcreators", "verified": true, "private": false, "followers": 9039643, "following": 570, "likes": 33952505, "posts": 1180, "externalUrl": null, "createdAt": null, "ext": { "secUid": "MS4wLjABAAAAXqqA-cLDC0hfQPIrS5APYNsg04zkl-socWCkqkI3UIOaEe6_Qnokg0GcWpLnMNQP", "friends": 0, "liked": 1924, "category": null, "seller": false, "likesPublic": false, "roomId": null } } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.tiktok.profileFollowing({ handle: \"tiktok\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.tiktok.profile_following(handle=\"tiktok\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/tiktok/profile/following \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=tiktok\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_TikTokProfile": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/TikTokProfile" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "TikTokProfile": { "allOf": [ { "type": "object", "description": "An account.", "required": [ "id", "username", "url", "verified", "private", "ext" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "bio": { "type": [ "string", "null" ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "displayName": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "secUid", "seller", "likesPublic" ], "properties": { "category": { "type": [ "string", "null" ], "description": "The business category, for business accounts." }, "friends": { "type": [ "integer", "null" ], "format": "int64", "description": "Mutual follows.", "minimum": 0 }, "liked": { "type": [ "integer", "null" ], "format": "int64", "description": "Posts the account has liked.", "minimum": 0 }, "likesPublic": { "type": "boolean", "description": "Whether its likes list is public." }, "roomId": { "type": [ "string", "null" ], "description": "The live room it is broadcasting in, when it is live." }, "secUid": { "type": "string", "description": "TikTok's stable key for the account; the handle can change, this does not." }, "seller": { "type": "boolean", "description": "Whether the account sells through TikTok Shop." } } }, { "type": "object", "description": "What only this platform has." } ] }, "externalUrl": { "type": [ "string", "null" ], "description": "The link in the bio." }, "followers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "following": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "id": { "type": "string", "description": "The platform's id for the account." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "description": "Likes the account's posts received in total.", "minimum": 0 }, "posts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "private": { "type": "boolean" }, "url": { "type": "string", "description": "The profile's page." }, "username": { "type": "string", "description": "The handle, without `@`." }, "verified": { "type": "boolean" } } }, { "type": "object", "description": "A TikTok account." } ] }, "Timestamp": { "type": "string", "format": "date-time" } } } } ``` # Profile Liked (/docs/api-reference/tiktok/profile-liked) Posts an account liked, when its likes are public. `GET https://api.socialapi.sh/v1/tiktok/profile/liked` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.tiktok.profileLiked({ handle: "tiktok" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.tiktok.profile_liked(handle="tiktok") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/tiktok/profile/liked \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=tiktok" ``` **Response** ```json { "data": [], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/tiktok/profile/liked": { "get": { "tags": [ "TikTok" ], "summary": "Posts an account liked, when its likes are public.", "description": "An empty list when they are not. 1 credit a page.", "operationId": "tiktokProfileLiked", "parameters": [ { "name": "handle", "in": "query", "description": "The username, with or without `@`.", "required": false, "schema": { "type": "string" } }, { "name": "secUid", "in": "query", "description": "TikTok's stable key for the account (a profile's `ext.secUid`), instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "The profile's link, instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_TikTokPost" }, "example": { "data": [], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.tiktok.profileLiked({ handle: \"tiktok\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.tiktok.profile_liked(handle=\"tiktok\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/tiktok/profile/liked \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=tiktok\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_TikTokPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/TikTokPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "TikTokPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "pinned", "ad", "screenText", "subtitles" ], "properties": { "ad": { "type": "boolean", "description": "A paid promotion." }, "authorSecUid": { "type": [ "string", "null" ], "description": "The author's secUid." }, "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "language": { "type": [ "string", "null" ], "description": "The caption's language, as TikTok detected it (ISO 639-1)." }, "pinned": { "type": "boolean", "description": "Pinned to the top of its author's profile." }, "playlistId": { "type": [ "string", "null" ], "description": "The playlist it belongs to." }, "region": { "type": [ "string", "null" ], "description": "Where it was posted from (ISO country)." }, "reposts": { "type": [ "integer", "null" ], "format": "int64", "description": "Reposts, where TikTok counts them.", "minimum": 0 }, "screenText": { "type": "array", "items": { "type": "string" }, "description": "Text the author put on the post as stickers, in order, each once; read from the\npost, not from its frames." }, "sound": { "oneOf": [ { "$ref": "#/components/schemas/TikTokSoundRef" }, { "type": "null" } ] }, "subtitles": { "type": "array", "items": { "$ref": "#/components/schemas/TikTokSubtitle" }, "description": "Captions TikTok made or the author uploaded; read one with\n`/v1/tiktok/post/transcript`." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A TikTok post: a video or a photo set." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "TikTokSubtitle": { "type": "object", "required": [ "language", "format", "source" ], "properties": { "format": { "type": "string", "description": "`webvtt`." }, "language": { "type": "string", "description": "`eng-US`, `tur-TR`…" }, "source": { "type": "string", "description": "`ASR` (generated) or `MT` (machine translated); others are the author's." } } }, "TikTokSoundRef": { "type": "object", "description": "The sound a post uses.", "required": [ "id", "title", "original" ], "properties": { "artist": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "original": { "type": "boolean" }, "title": { "type": "string" } } }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Profile Playlists (/docs/api-reference/tiktok/profile-playlists) The playlists an account made. `GET https://api.socialapi.sh/v1/tiktok/profile/playlists` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.tiktok.profilePlaylists({ handle: "tiktok" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.tiktok.profile_playlists(handle="tiktok") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/tiktok/profile/playlists \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=tiktok" ``` **Response** ```json { "data": [ { "id": "7681171537575824159", "name": "Songs Of The Summer 2026", "url": "https://www.tiktok.com/@tiktok/playlist/Songs-Of-The-Summer-2026-7681171537575824159", "coverUrl": "https://p16-common-sign.tiktokcdn.com/tos-useast8-p-0068-tx2/o8UZ7AA11Ciogu5XByiiAPBcCSAIMnAIEBfaK7~tplv-tiktokx-origin.image?dr=14575&x-expires=1795579200&x-signature=RuQtV4tKJccyVgGQc6Z8Gmw014g%3D&t=4d5b0474&ps=13740610&shp=81f88b70&shcp=43f4a2f9&idc=my", "posts": 3, "ext": { "creatorUsername": "tiktok" } }, { "id": "7659874208872221471", "name": "Behind The Breakthrough", "url": "https://www.tiktok.com/@tiktok/playlist/Behind-The-Breakthrough-7659874208872221471", "coverUrl": "https://p16-common-sign.tiktokcdn.com/tos-useast8-p-0068-tx2/oM4EVAFCUEDiowAA0eAAfLEzqLIhR4OEVASzPC~tplv-tiktokx-origin.image?dr=14575&x-expires=1795579200&x-signature=GpJYhZaQC1Z%2BMapfT8WSbBU0eko%3D&t=4d5b0474&ps=13740610&shp=81f88b70&shcp=43f4a2f9&idc=my", "posts": 6, "ext": { "creatorUsername": "tiktok" } } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/tiktok/profile/playlists": { "get": { "tags": [ "TikTok" ], "summary": "The playlists an account made.", "description": "1 credit a page.", "operationId": "tiktokProfilePlaylists", "parameters": [ { "name": "handle", "in": "query", "description": "The username, with or without `@`.", "required": false, "schema": { "type": "string" } }, { "name": "secUid", "in": "query", "description": "TikTok's stable key for the account (a profile's `ext.secUid`), instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "The profile's link, instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_TikTokPlaylist" }, "example": { "data": [ { "id": "7681171537575824159", "name": "Songs Of The Summer 2026", "url": "https://www.tiktok.com/@tiktok/playlist/Songs-Of-The-Summer-2026-7681171537575824159", "coverUrl": "https://p16-common-sign.tiktokcdn.com/tos-useast8-p-0068-tx2/o8UZ7AA11Ciogu5XByiiAPBcCSAIMnAIEBfaK7~tplv-tiktokx-origin.image?dr=14575&x-expires=1795579200&x-signature=RuQtV4tKJccyVgGQc6Z8Gmw014g%3D&t=4d5b0474&ps=13740610&shp=81f88b70&shcp=43f4a2f9&idc=my", "posts": 3, "ext": { "creatorUsername": "tiktok" } }, { "id": "7659874208872221471", "name": "Behind The Breakthrough", "url": "https://www.tiktok.com/@tiktok/playlist/Behind-The-Breakthrough-7659874208872221471", "coverUrl": "https://p16-common-sign.tiktokcdn.com/tos-useast8-p-0068-tx2/oM4EVAFCUEDiowAA0eAAfLEzqLIhR4OEVASzPC~tplv-tiktokx-origin.image?dr=14575&x-expires=1795579200&x-signature=GpJYhZaQC1Z%2BMapfT8WSbBU0eko%3D&t=4d5b0474&ps=13740610&shp=81f88b70&shcp=43f4a2f9&idc=my", "posts": 6, "ext": { "creatorUsername": "tiktok" } } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.tiktok.profilePlaylists({ handle: \"tiktok\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.tiktok.profile_playlists(handle=\"tiktok\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/tiktok/profile/playlists \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=tiktok\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_TikTokPlaylist": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/TikTokPlaylist" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "TikTokPlaylist": { "allOf": [ { "type": "object", "description": "A playlist, mix or collection of posts.", "required": [ "id", "name", "ext" ], "properties": { "coverUrl": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "properties": { "creatorUsername": { "type": [ "string", "null" ], "description": "The handle of the account that made it." } } }, { "type": "object", "description": "What only this platform has." } ] }, "id": { "type": "string" }, "name": { "type": "string" }, "posts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "url": { "type": [ "string", "null" ] } } }, { "type": "object", "description": "A TikTok playlist." } ] } } } } ``` # Profile Posts (/docs/api-reference/tiktok/profile-posts) An account's posts, newest first, 30 a page. `GET https://api.socialapi.sh/v1/tiktok/profile/posts` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.tiktok.profilePosts({ handle: "nike" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.tiktok.profile_posts(handle="nike") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/tiktok/profile/posts \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=nike" ``` **Response** ```json { "data": [ { "id": "7711465226318728461", "url": "https://www.tiktok.com/@nike/video/7711465226318728461", "text": "Vroom vroom 🏎️💨 #Formula1 #LasVegasGP #NSW #Nike Feat. @Miku Martineau @lizzy greene @Nick @Caleb McLaughlin @Sabrina Ionescu @Brianna LaPaglia", "createdAt": "2026-11-23T20:24:10.000Z", "author": { "id": "208464585232822272", "username": "nike", "displayName": "Nike", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-maliva-avt-0068/e0b0ac7b6ad6447a8e923fd1eb162f2c~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=c73b1f8a&x-expires=1795730400&x-signature=WFCAToitWtbkgo5qXRwrQmcX%2FZY%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=my", "verified": true, "url": "https://www.tiktok.com/@nike" }, "stats": { "views": 18200, "likes": 309, "comments": 14, "shares": 5, "saves": 17, "engagementRate": 0.018 }, "media": [ { "kind": "video", "url": "https://v16-webapp-prime.tiktok.com/video/tos/alisg/tos-alisg-ve-37c799-sg/o0kDDPDSFCeIBoEwTRQMABOEM1SIESQfgrKdjE/?a=1988&bti=ODszNWYuMDE6&&bt=1397&ft=I~da4oJwD12Nvkkb3lIxR4bNLlBF-UjNSbopiX&mime_type=video_mp4&rc=ZzppN2U1OzY2PGVnN2c0Z0BpM3g3NnQ5cmxkZjMzZzczNEAtMC0tXjZeNmIxNmMyLi4tYSMzYmlnMmQ0Li9hLS1kMS9zcw%3D%3D&expire=1795731854&l=20261125062401F5D7C61FE8069925FC37&ply_type=2&policy=2&signature=f40036e4d779d55738cdeebc4d92928f&tk=tt_chain_token&btag=e000b0000", "thumbnailUrl": "https://p16-common-sign.tiktokcdn.com/tos-useast5-p-0068-tx/oMeIeALC2IGwPxAAHOAAe3IEWJQ6jbPHkAcUQE~tplv-tiktokx-origin.image?dr=14575&x-expires=1795730400&x-signature=fWhitTvuuSB%2FxWl2xEN2vB%2BBXsQ%3D&t=4d5b0474&ps=13740610&shp=81f88b70&shcp=43f4a2f9&idc=my", "width": 720, "height": 1280, "durationSeconds": 13 } ], "hashtags": [ "Formula1", "LasVegasGP", "NSW" ], "mentions": [ "Miku", "lizzy", "Nick" ], "ext": { "authorSecUid": "MS4wLjABAAAA_3ndMt8d_tECTdpKgCxcx238tOnQZX-20wqN01aMui5zQ7hsqSdff-jC5qYC-Cl_", "sound": { "id": "7711465298314021645", "title": "original sound", "artist": "Nike", "original": true }, "durationSeconds": 13, "reposts": null, "pinned": false, "ad": false, "playlistId": null, "region": null, "language": "nl", "screenText": [], "subtitles": [] } }, { "id": "7711414040114892045", "url": "https://www.tiktok.com/@nike/video/7711414040114892045", "text": "Mode push or box box? Nike family answering the big questions from Vegas. #Formula1 #LasVegasGP #NSW #Nike Feat. @Miku Martineau @lizzy greene @Nick @noah beck @Caleb McLaughlin @Sabrina Ionescu @Brianna LaPaglia", "createdAt": "2026-11-23T17:05:31.000Z", "author": { "id": "208464585232822272", "username": "nike", "displayName": "Nike", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-maliva-avt-0068/e0b0ac7b6ad6447a8e923fd1eb162f2c~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=c73b1f8a&x-expires=1795730400&x-signature=WFCAToitWtbkgo5qXRwrQmcX%2FZY%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=my", "verified": true, "url": "https://www.tiktok.com/@nike" }, "stats": { "views": 9265, "likes": 351, "comments": 13, "shares": 8, "saves": 20, "engagementRate": 0.0402 }, "media": [ { "kind": "video", "url": "https://v16-webapp-prime.tiktok.com/video/tos/alisg/tos-alisg-ve-37c799-sg/oQIPUULoFBxwE9yAiE4Q90acBEILZgKUHijAR/?a=1988&bti=ODszNWYuMDE6&&bt=1427&ft=I~da4oJwD12Nvkkb3lIxR4bNLlBF-UjNSbopiX&mime_type=video_mp4&rc=aGVnaGUzNzY1ZDM0NzU1M0Bpanc4OW45cjs6ZjMzZzczNEA2LzUwYWJjXzQxMDM1NDMvYSMyNmIyMmQ0MS9hLS1kMS9zcw%3D%3D&expire=1795731907&l=20261125062401F5D7C61FE8069925FC37&ply_type=2&policy=2&signature=8053e4971cbbbdafac72141b14d41c57&tk=tt_chain_token&btag=e00090000", "thumbnailUrl": "https://p16-common-sign.tiktokcdn.com/tos-useast5-p-0068-tx/okaWE1EB4PAEDiwgAIcARB6AaAEjylyhnikDI~tplv-tiktokx-origin.image?dr=14575&x-expires=1795730400&x-signature=ysNydei3newlYGkacpZQIzqSmV8%3D&t=4d5b0474&ps=13740610&shp=81f88b70&shcp=43f4a2f9&idc=my", "width": 720, "height": 1280, "durationSeconds": 66 } ], "hashtags": [ "Formula1", "LasVegasGP", "NSW" ], "mentions": [ "Miku", "lizzy", "Nick" ], "ext": { "authorSecUid": "MS4wLjABAAAA_3ndMt8d_tECTdpKgCxcx238tOnQZX-20wqN01aMui5zQ7hsqSdff-jC5qYC-Cl_", "sound": { "id": "7711414149750459167", "title": "original sound", "artist": "Nike", "original": true }, "durationSeconds": 66, "reposts": null, "pinned": false, "ad": false, "playlistId": null, "region": null, "language": "en", "screenText": [], "subtitles": [ { "language": "eng-US", "format": "webvtt", "source": "ASR" } ] } } ], "pagination": { "nextCursor": "1792764276701", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/tiktok/profile/posts": { "get": { "tags": [ "TikTok" ], "summary": "An account's posts, newest first, 30 a page.", "description": "Pinned ones come first of all. 1 credit a page.", "operationId": "tiktokProfilePosts", "parameters": [ { "name": "handle", "in": "query", "description": "The username, with or without `@`.", "required": false, "schema": { "type": "string" } }, { "name": "secUid", "in": "query", "description": "TikTok's stable key for the account (a profile's `ext.secUid`), instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "The profile's link, instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_TikTokPost" }, "example": { "data": [ { "id": "7711465226318728461", "url": "https://www.tiktok.com/@nike/video/7711465226318728461", "text": "Vroom vroom 🏎️💨 #Formula1 #LasVegasGP #NSW #Nike Feat. @Miku Martineau @lizzy greene @Nick @Caleb McLaughlin @Sabrina Ionescu @Brianna LaPaglia", "createdAt": "2026-11-23T20:24:10.000Z", "author": { "id": "208464585232822272", "username": "nike", "displayName": "Nike", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-maliva-avt-0068/e0b0ac7b6ad6447a8e923fd1eb162f2c~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=c73b1f8a&x-expires=1795730400&x-signature=WFCAToitWtbkgo5qXRwrQmcX%2FZY%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=my", "verified": true, "url": "https://www.tiktok.com/@nike" }, "stats": { "views": 18200, "likes": 309, "comments": 14, "shares": 5, "saves": 17, "engagementRate": 0.018 }, "media": [ { "kind": "video", "url": "https://v16-webapp-prime.tiktok.com/video/tos/alisg/tos-alisg-ve-37c799-sg/o0kDDPDSFCeIBoEwTRQMABOEM1SIESQfgrKdjE/?a=1988&bti=ODszNWYuMDE6&&bt=1397&ft=I~da4oJwD12Nvkkb3lIxR4bNLlBF-UjNSbopiX&mime_type=video_mp4&rc=ZzppN2U1OzY2PGVnN2c0Z0BpM3g3NnQ5cmxkZjMzZzczNEAtMC0tXjZeNmIxNmMyLi4tYSMzYmlnMmQ0Li9hLS1kMS9zcw%3D%3D&expire=1795731854&l=20261125062401F5D7C61FE8069925FC37&ply_type=2&policy=2&signature=f40036e4d779d55738cdeebc4d92928f&tk=tt_chain_token&btag=e000b0000", "thumbnailUrl": "https://p16-common-sign.tiktokcdn.com/tos-useast5-p-0068-tx/oMeIeALC2IGwPxAAHOAAe3IEWJQ6jbPHkAcUQE~tplv-tiktokx-origin.image?dr=14575&x-expires=1795730400&x-signature=fWhitTvuuSB%2FxWl2xEN2vB%2BBXsQ%3D&t=4d5b0474&ps=13740610&shp=81f88b70&shcp=43f4a2f9&idc=my", "width": 720, "height": 1280, "durationSeconds": 13 } ], "hashtags": [ "Formula1", "LasVegasGP", "NSW" ], "mentions": [ "Miku", "lizzy", "Nick" ], "ext": { "authorSecUid": "MS4wLjABAAAA_3ndMt8d_tECTdpKgCxcx238tOnQZX-20wqN01aMui5zQ7hsqSdff-jC5qYC-Cl_", "sound": { "id": "7711465298314021645", "title": "original sound", "artist": "Nike", "original": true }, "durationSeconds": 13, "reposts": null, "pinned": false, "ad": false, "playlistId": null, "region": null, "language": "nl", "screenText": [], "subtitles": [] } }, { "id": "7711414040114892045", "url": "https://www.tiktok.com/@nike/video/7711414040114892045", "text": "Mode push or box box? Nike family answering the big questions from Vegas. #Formula1 #LasVegasGP #NSW #Nike Feat. @Miku Martineau @lizzy greene @Nick @noah beck @Caleb McLaughlin @Sabrina Ionescu @Brianna LaPaglia", "createdAt": "2026-11-23T17:05:31.000Z", "author": { "id": "208464585232822272", "username": "nike", "displayName": "Nike", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-maliva-avt-0068/e0b0ac7b6ad6447a8e923fd1eb162f2c~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=c73b1f8a&x-expires=1795730400&x-signature=WFCAToitWtbkgo5qXRwrQmcX%2FZY%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=my", "verified": true, "url": "https://www.tiktok.com/@nike" }, "stats": { "views": 9265, "likes": 351, "comments": 13, "shares": 8, "saves": 20, "engagementRate": 0.0402 }, "media": [ { "kind": "video", "url": "https://v16-webapp-prime.tiktok.com/video/tos/alisg/tos-alisg-ve-37c799-sg/oQIPUULoFBxwE9yAiE4Q90acBEILZgKUHijAR/?a=1988&bti=ODszNWYuMDE6&&bt=1427&ft=I~da4oJwD12Nvkkb3lIxR4bNLlBF-UjNSbopiX&mime_type=video_mp4&rc=aGVnaGUzNzY1ZDM0NzU1M0Bpanc4OW45cjs6ZjMzZzczNEA2LzUwYWJjXzQxMDM1NDMvYSMyNmIyMmQ0MS9hLS1kMS9zcw%3D%3D&expire=1795731907&l=20261125062401F5D7C61FE8069925FC37&ply_type=2&policy=2&signature=8053e4971cbbbdafac72141b14d41c57&tk=tt_chain_token&btag=e00090000", "thumbnailUrl": "https://p16-common-sign.tiktokcdn.com/tos-useast5-p-0068-tx/okaWE1EB4PAEDiwgAIcARB6AaAEjylyhnikDI~tplv-tiktokx-origin.image?dr=14575&x-expires=1795730400&x-signature=ysNydei3newlYGkacpZQIzqSmV8%3D&t=4d5b0474&ps=13740610&shp=81f88b70&shcp=43f4a2f9&idc=my", "width": 720, "height": 1280, "durationSeconds": 66 } ], "hashtags": [ "Formula1", "LasVegasGP", "NSW" ], "mentions": [ "Miku", "lizzy", "Nick" ], "ext": { "authorSecUid": "MS4wLjABAAAA_3ndMt8d_tECTdpKgCxcx238tOnQZX-20wqN01aMui5zQ7hsqSdff-jC5qYC-Cl_", "sound": { "id": "7711414149750459167", "title": "original sound", "artist": "Nike", "original": true }, "durationSeconds": 66, "reposts": null, "pinned": false, "ad": false, "playlistId": null, "region": null, "language": "en", "screenText": [], "subtitles": [ { "language": "eng-US", "format": "webvtt", "source": "ASR" } ] } } ], "pagination": { "nextCursor": "1792764276701", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.tiktok.profilePosts({ handle: \"nike\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.tiktok.profile_posts(handle=\"nike\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/tiktok/profile/posts \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=nike\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_TikTokPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/TikTokPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "TikTokPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "pinned", "ad", "screenText", "subtitles" ], "properties": { "ad": { "type": "boolean", "description": "A paid promotion." }, "authorSecUid": { "type": [ "string", "null" ], "description": "The author's secUid." }, "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "language": { "type": [ "string", "null" ], "description": "The caption's language, as TikTok detected it (ISO 639-1)." }, "pinned": { "type": "boolean", "description": "Pinned to the top of its author's profile." }, "playlistId": { "type": [ "string", "null" ], "description": "The playlist it belongs to." }, "region": { "type": [ "string", "null" ], "description": "Where it was posted from (ISO country)." }, "reposts": { "type": [ "integer", "null" ], "format": "int64", "description": "Reposts, where TikTok counts them.", "minimum": 0 }, "screenText": { "type": "array", "items": { "type": "string" }, "description": "Text the author put on the post as stickers, in order, each once; read from the\npost, not from its frames." }, "sound": { "oneOf": [ { "$ref": "#/components/schemas/TikTokSoundRef" }, { "type": "null" } ] }, "subtitles": { "type": "array", "items": { "$ref": "#/components/schemas/TikTokSubtitle" }, "description": "Captions TikTok made or the author uploaded; read one with\n`/v1/tiktok/post/transcript`." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A TikTok post: a video or a photo set." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "TikTokSubtitle": { "type": "object", "required": [ "language", "format", "source" ], "properties": { "format": { "type": "string", "description": "`webvtt`." }, "language": { "type": "string", "description": "`eng-US`, `tur-TR`…" }, "source": { "type": "string", "description": "`ASR` (generated) or `MT` (machine translated); others are the author's." } } }, "TikTokSoundRef": { "type": "object", "description": "The sound a post uses.", "required": [ "id", "title", "original" ], "properties": { "artist": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "original": { "type": "boolean" }, "title": { "type": "string" } } }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Profile Reposts (/docs/api-reference/tiktok/profile-reposts) Other people's posts an account reposted. `GET https://api.socialapi.sh/v1/tiktok/profile/reposts` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.tiktok.profileReposts({ handle: "tiktok" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.tiktok.profile_reposts(handle="tiktok") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/tiktok/profile/reposts \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=tiktok" ``` **Response** ```json { "data": [ { "id": "7710332231457328415", "url": "https://www.tiktok.com/@parishilton/video/7710332231457328415", "text": "Come in, bestie - we’re going Slivmas shopping 🛍️🎅🏽💖🎄 I’m taking you inside my holiday workshop to share some of my favorite gifts, traditions, and a little holiday magic! 🎁✨ #SlayTheHolidays #DealDrops", "createdAt": "2026-11-20T19:07:11.000Z", "author": { "id": "8822217", "username": "parishilton", "displayName": "ParisHilton", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-maliva-avt-0068/264d0172cb6821ab943d09018524dcd7~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=393b709d&x-expires=1795730400&x-signature=04doPezZqtfK3ZuWN3UvDCW50z0%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=my", "verified": true, "url": "https://www.tiktok.com/@parishilton" }, "stats": { "views": 3900000, "likes": 16800, "comments": 462, "shares": 535, "saves": 2221, "engagementRate": 0.0046 }, "media": [ { "kind": "video", "url": "https://v16-webapp-prime.tiktok.com/video/tos/alisg/tos-alisg-ve-37c799-sg/oAsAfPmfAg7ISzqWjEKCILNnyEEsIQFAUkrAfD/?a=1988&bti=ODszNWYuMDE6&&bt=1202&ft=ytpHh9DfxxOusd.743yE8lcLVWOuRx_HFKKgKPIwK~5QZ.z7T&mime_type=video_mp4&rc=O2Y0OTc8ZGk4PDM6ZTY8ZkBpM2luOnM5cnk8ZjMzaTczNEAuYGAyMTEvNjMxYTBjLzIvYSMyam1sMmRzYi1hLS1kMTJzcw%3D%3D&expire=1795732026&l=20261125062210FDC0F7BF4B08952012D7&ply_type=2&policy=2&signature=d8d3360477a4909cf6e0941c16fce964&tk=tt_chain_token&btag=e00098000", "thumbnailUrl": "https://p16-common-sign.tiktokcdn.com/tos-useast8-p-0068-tx2/ocApIVEDAYfEjzqANrJBEmKQLAFetRAAFdCb6A~tplv-tiktokx-origin.image?dr=14575&x-expires=1795730400&x-signature=bIlt4%2FTzeCz%2FDd9dk2ay8NHt6ZI%3D&t=4d5b0474&ps=13740610&shp=81f88b70&shcp=43f4a2f9&idc=my", "width": 720, "height": 1280, "durationSeconds": 295 } ], "hashtags": [ "SlayTheHolidays", "DealDrops" ], "mentions": [], "ext": { "authorSecUid": "MS4wLjABAAAArea-pdB2SSkSz7D5pYd7n_BGMd8Xv6lVNaKQ4vppkiQ", "sound": { "id": "7710333030632950558", "title": "original sound", "artist": "ParisHilton", "original": true }, "durationSeconds": 295, "reposts": null, "pinned": false, "ad": true, "playlistId": null, "region": null, "language": "en", "screenText": [], "subtitles": [ { "language": "eng-US", "format": "webvtt", "source": "ASR" } ] } }, { "id": "7706134881109101838", "url": "https://www.tiktok.com/@rashadjonesbbq/video/7706134881109101838", "text": "TikTok has done MORE for Big Lee’s than we could have ever imagined. ❤️🔥 It's not just about views, likes, or followers. TikTok has helped bring people through our doors from all over the country. We've met customers who traveled hundreds of miles because they saw our videos. We've welcomed people who discovered us through their For You Page, reconnected with old customers, and introduced our bar…", "createdAt": "2026-11-10T00:00:00.000Z", "author": { "id": "6983474474222420997", "username": "rashadjonesbbq", "displayName": "Rashad Jones BBQ", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-maliva-avt-0068/4121ac86d284e09ed0cece677bbb5758~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=a7f0c6ea&x-expires=1795730400&x-signature=wZHW5Fph%2BgIDJqwSrnxW05Srsag%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=my", "verified": true, "url": "https://www.tiktok.com/@rashadjonesbbq" }, "stats": { "views": 28800, "likes": 805, "comments": 40, "shares": 20, "saves": 53, "engagementRate": 0.03 }, "media": [ { "kind": "video", "url": "https://v16-webapp-prime.tiktok.com/video/tos/alisg/tos-alisg-ve-37c799-sg/oIrjVqL28vtECYfzDAIb23kfRNGggFQDghSBga/?a=1988&bti=ODszNWYuMDE6&&bt=1157&ft=ytpHh9DfxxOusd.743yE8lcLVWOuRx_HFKKgKPIwK~5QZ.z7T&mime_type=video_mp4&rc=NDdoOWc1ZjM7NWg0OWQ8ZEBpM3V1b3U5cjd0ZTMzZzgzNEBhNmM1NGA1Xy4xLV80Ni42YSM1LmhxMmRjZmxhLS1kLy9zcw%3D%3D&expire=1795731771&l=20261125062210FDC0F7BF4B08952012D7&ply_type=2&policy=2&signature=c67f40e353b6b94cf6f25dd49044ef13&tk=tt_chain_token&btag=e00088000", "thumbnailUrl": "https://p16-common-sign.tiktokcdn.com/tos-useast5-p-0068-tx/oQIeRrEVK4jUJLeIPUHGmAAEkHHeAlkA7QAcI1~tplv-tiktokx-origin.image?dr=14575&x-expires=1795730400&x-signature=bvxu8nb9VLu%2BpdFk5MnP9TAqx1c%3D&t=4d5b0474&ps=13740610&shp=81f88b70&shcp=43f4a2f9&idc=my", "width": 720, "height": 1280, "durationSeconds": 40 } ], "hashtags": [ "BigLeesBBQ", "TikTokBusiness", "SmallBusiness" ], "mentions": [], "ext": { "authorSecUid": "MS4wLjABAAAAAAPTYLj0FogWck7j7dKlvLDKFO0fLi5zpR8oZcG8MVjxMP8McAmZIGNUoSljCf9s", "sound": { "id": "7706135151197113102", "title": "original sound - Rashad Jones BBQ", "artist": "Rashad Jones BBQ", "original": true }, "durationSeconds": 40, "reposts": null, "pinned": false, "ad": false, "playlistId": null, "region": null, "language": "en", "screenText": [], "subtitles": [ { "language": "eng-US", "format": "webvtt", "source": "ASR" } ] } } ], "pagination": { "nextCursor": "30", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/tiktok/profile/reposts": { "get": { "tags": [ "TikTok" ], "summary": "Other people's posts an account reposted.", "description": "1 credit a page.", "operationId": "tiktokProfileReposts", "parameters": [ { "name": "handle", "in": "query", "description": "The username, with or without `@`.", "required": false, "schema": { "type": "string" } }, { "name": "secUid", "in": "query", "description": "TikTok's stable key for the account (a profile's `ext.secUid`), instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "The profile's link, instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_TikTokPost" }, "example": { "data": [ { "id": "7710332231457328415", "url": "https://www.tiktok.com/@parishilton/video/7710332231457328415", "text": "Come in, bestie - we’re going Slivmas shopping 🛍️🎅🏽💖🎄 I’m taking you inside my holiday workshop to share some of my favorite gifts, traditions, and a little holiday magic! 🎁✨ #SlayTheHolidays #DealDrops", "createdAt": "2026-11-20T19:07:11.000Z", "author": { "id": "8822217", "username": "parishilton", "displayName": "ParisHilton", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-maliva-avt-0068/264d0172cb6821ab943d09018524dcd7~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=393b709d&x-expires=1795730400&x-signature=04doPezZqtfK3ZuWN3UvDCW50z0%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=my", "verified": true, "url": "https://www.tiktok.com/@parishilton" }, "stats": { "views": 3900000, "likes": 16800, "comments": 462, "shares": 535, "saves": 2221, "engagementRate": 0.0046 }, "media": [ { "kind": "video", "url": "https://v16-webapp-prime.tiktok.com/video/tos/alisg/tos-alisg-ve-37c799-sg/oAsAfPmfAg7ISzqWjEKCILNnyEEsIQFAUkrAfD/?a=1988&bti=ODszNWYuMDE6&&bt=1202&ft=ytpHh9DfxxOusd.743yE8lcLVWOuRx_HFKKgKPIwK~5QZ.z7T&mime_type=video_mp4&rc=O2Y0OTc8ZGk4PDM6ZTY8ZkBpM2luOnM5cnk8ZjMzaTczNEAuYGAyMTEvNjMxYTBjLzIvYSMyam1sMmRzYi1hLS1kMTJzcw%3D%3D&expire=1795732026&l=20261125062210FDC0F7BF4B08952012D7&ply_type=2&policy=2&signature=d8d3360477a4909cf6e0941c16fce964&tk=tt_chain_token&btag=e00098000", "thumbnailUrl": "https://p16-common-sign.tiktokcdn.com/tos-useast8-p-0068-tx2/ocApIVEDAYfEjzqANrJBEmKQLAFetRAAFdCb6A~tplv-tiktokx-origin.image?dr=14575&x-expires=1795730400&x-signature=bIlt4%2FTzeCz%2FDd9dk2ay8NHt6ZI%3D&t=4d5b0474&ps=13740610&shp=81f88b70&shcp=43f4a2f9&idc=my", "width": 720, "height": 1280, "durationSeconds": 295 } ], "hashtags": [ "SlayTheHolidays", "DealDrops" ], "mentions": [], "ext": { "authorSecUid": "MS4wLjABAAAArea-pdB2SSkSz7D5pYd7n_BGMd8Xv6lVNaKQ4vppkiQ", "sound": { "id": "7710333030632950558", "title": "original sound", "artist": "ParisHilton", "original": true }, "durationSeconds": 295, "reposts": null, "pinned": false, "ad": true, "playlistId": null, "region": null, "language": "en", "screenText": [], "subtitles": [ { "language": "eng-US", "format": "webvtt", "source": "ASR" } ] } }, { "id": "7706134881109101838", "url": "https://www.tiktok.com/@rashadjonesbbq/video/7706134881109101838", "text": "TikTok has done MORE for Big Lee’s than we could have ever imagined. ❤️🔥 It's not just about views, likes, or followers. TikTok has helped bring people through our doors from all over the country. We've met customers who traveled hundreds of miles because they saw our videos. We've welcomed people who discovered us through their For You Page, reconnected with old customers, and introduced our bar…", "createdAt": "2026-11-10T00:00:00.000Z", "author": { "id": "6983474474222420997", "username": "rashadjonesbbq", "displayName": "Rashad Jones BBQ", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-maliva-avt-0068/4121ac86d284e09ed0cece677bbb5758~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=a7f0c6ea&x-expires=1795730400&x-signature=wZHW5Fph%2BgIDJqwSrnxW05Srsag%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=my", "verified": true, "url": "https://www.tiktok.com/@rashadjonesbbq" }, "stats": { "views": 28800, "likes": 805, "comments": 40, "shares": 20, "saves": 53, "engagementRate": 0.03 }, "media": [ { "kind": "video", "url": "https://v16-webapp-prime.tiktok.com/video/tos/alisg/tos-alisg-ve-37c799-sg/oIrjVqL28vtECYfzDAIb23kfRNGggFQDghSBga/?a=1988&bti=ODszNWYuMDE6&&bt=1157&ft=ytpHh9DfxxOusd.743yE8lcLVWOuRx_HFKKgKPIwK~5QZ.z7T&mime_type=video_mp4&rc=NDdoOWc1ZjM7NWg0OWQ8ZEBpM3V1b3U5cjd0ZTMzZzgzNEBhNmM1NGA1Xy4xLV80Ni42YSM1LmhxMmRjZmxhLS1kLy9zcw%3D%3D&expire=1795731771&l=20261125062210FDC0F7BF4B08952012D7&ply_type=2&policy=2&signature=c67f40e353b6b94cf6f25dd49044ef13&tk=tt_chain_token&btag=e00088000", "thumbnailUrl": "https://p16-common-sign.tiktokcdn.com/tos-useast5-p-0068-tx/oQIeRrEVK4jUJLeIPUHGmAAEkHHeAlkA7QAcI1~tplv-tiktokx-origin.image?dr=14575&x-expires=1795730400&x-signature=bvxu8nb9VLu%2BpdFk5MnP9TAqx1c%3D&t=4d5b0474&ps=13740610&shp=81f88b70&shcp=43f4a2f9&idc=my", "width": 720, "height": 1280, "durationSeconds": 40 } ], "hashtags": [ "BigLeesBBQ", "TikTokBusiness", "SmallBusiness" ], "mentions": [], "ext": { "authorSecUid": "MS4wLjABAAAAAAPTYLj0FogWck7j7dKlvLDKFO0fLi5zpR8oZcG8MVjxMP8McAmZIGNUoSljCf9s", "sound": { "id": "7706135151197113102", "title": "original sound - Rashad Jones BBQ", "artist": "Rashad Jones BBQ", "original": true }, "durationSeconds": 40, "reposts": null, "pinned": false, "ad": false, "playlistId": null, "region": null, "language": "en", "screenText": [], "subtitles": [ { "language": "eng-US", "format": "webvtt", "source": "ASR" } ] } } ], "pagination": { "nextCursor": "30", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.tiktok.profileReposts({ handle: \"tiktok\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.tiktok.profile_reposts(handle=\"tiktok\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/tiktok/profile/reposts \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=tiktok\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_TikTokPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/TikTokPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "TikTokPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "pinned", "ad", "screenText", "subtitles" ], "properties": { "ad": { "type": "boolean", "description": "A paid promotion." }, "authorSecUid": { "type": [ "string", "null" ], "description": "The author's secUid." }, "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "language": { "type": [ "string", "null" ], "description": "The caption's language, as TikTok detected it (ISO 639-1)." }, "pinned": { "type": "boolean", "description": "Pinned to the top of its author's profile." }, "playlistId": { "type": [ "string", "null" ], "description": "The playlist it belongs to." }, "region": { "type": [ "string", "null" ], "description": "Where it was posted from (ISO country)." }, "reposts": { "type": [ "integer", "null" ], "format": "int64", "description": "Reposts, where TikTok counts them.", "minimum": 0 }, "screenText": { "type": "array", "items": { "type": "string" }, "description": "Text the author put on the post as stickers, in order, each once; read from the\npost, not from its frames." }, "sound": { "oneOf": [ { "$ref": "#/components/schemas/TikTokSoundRef" }, { "type": "null" } ] }, "subtitles": { "type": "array", "items": { "$ref": "#/components/schemas/TikTokSubtitle" }, "description": "Captions TikTok made or the author uploaded; read one with\n`/v1/tiktok/post/transcript`." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A TikTok post: a video or a photo set." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "TikTokSubtitle": { "type": "object", "required": [ "language", "format", "source" ], "properties": { "format": { "type": "string", "description": "`webvtt`." }, "language": { "type": "string", "description": "`eng-US`, `tur-TR`…" }, "source": { "type": "string", "description": "`ASR` (generated) or `MT` (machine translated); others are the author's." } } }, "TikTokSoundRef": { "type": "object", "description": "The sound a post uses.", "required": [ "id", "title", "original" ], "properties": { "artist": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "original": { "type": "boolean" }, "title": { "type": "string" } } }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Profile (/docs/api-reference/tiktok/profile) A profile with its exact follower and like counts. `GET https://api.socialapi.sh/v1/tiktok/profile` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.tiktok.profile({ handle: "nike" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.tiktok.profile(handle="nike").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/tiktok/profile \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=nike" ``` **Response** ```json { "data": { "id": "208464585232822272", "username": "nike", "displayName": "Nike", "bio": "Just Do It.", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-maliva-avt-0068/e0b0ac7b6ad6447a8e923fd1eb162f2c~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=c73b1f8a&x-expires=1795730400&x-signature=WFCAToitWtbkgo5qXRwrQmcX%2FZY%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=my", "url": "https://www.tiktok.com/@nike", "verified": true, "private": false, "followers": 9440793, "following": 94, "likes": 51312842, "posts": 1131, "externalUrl": "http://empli.fi/niketiktok", "createdAt": null, "ext": { "secUid": "MS4wLjABAAAA_3ndMt8d_tECTdpKgCxcx238tOnQZX-20wqN01aMui5zQ7hsqSdff-jC5qYC-Cl_", "friends": 47, "liked": 0, "category": "Sports, Fitness & Outdoors", "seller": false, "likesPublic": false, "roomId": null } } } ``` **OpenAPI** ```json { "paths": { "/v1/tiktok/profile": { "get": { "tags": [ "TikTok" ], "summary": "A profile with its exact follower and like counts.", "description": "Name, bio, link, verified, private, and exact follower, following, like and post\ncounts. 1 credit.", "operationId": "tiktokProfile", "parameters": [ { "name": "handle", "in": "query", "description": "The username, with or without `@`.", "required": false, "schema": { "type": "string" } }, { "name": "secUid", "in": "query", "description": "TikTok's stable key for the account (a profile's `ext.secUid`), instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "The profile's link (`https://www.tiktok.com/@nike`, or a share link), instead of\n`handle`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_TikTokProfile" }, "example": { "data": { "id": "208464585232822272", "username": "nike", "displayName": "Nike", "bio": "Just Do It.", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-maliva-avt-0068/e0b0ac7b6ad6447a8e923fd1eb162f2c~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=c73b1f8a&x-expires=1795730400&x-signature=WFCAToitWtbkgo5qXRwrQmcX%2FZY%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=my", "url": "https://www.tiktok.com/@nike", "verified": true, "private": false, "followers": 9440793, "following": 94, "likes": 51312842, "posts": 1131, "externalUrl": "http://empli.fi/niketiktok", "createdAt": null, "ext": { "secUid": "MS4wLjABAAAA_3ndMt8d_tECTdpKgCxcx238tOnQZX-20wqN01aMui5zQ7hsqSdff-jC5qYC-Cl_", "friends": 47, "liked": 0, "category": "Sports, Fitness & Outdoors", "seller": false, "likesPublic": false, "roomId": null } } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.tiktok.profile({ handle: \"nike\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.tiktok.profile(handle=\"nike\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/tiktok/profile \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=nike\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_TikTokProfile": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/TikTokProfile" } } }, "TikTokProfile": { "allOf": [ { "type": "object", "description": "An account.", "required": [ "id", "username", "url", "verified", "private", "ext" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "bio": { "type": [ "string", "null" ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "displayName": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "secUid", "seller", "likesPublic" ], "properties": { "category": { "type": [ "string", "null" ], "description": "The business category, for business accounts." }, "friends": { "type": [ "integer", "null" ], "format": "int64", "description": "Mutual follows.", "minimum": 0 }, "liked": { "type": [ "integer", "null" ], "format": "int64", "description": "Posts the account has liked.", "minimum": 0 }, "likesPublic": { "type": "boolean", "description": "Whether its likes list is public." }, "roomId": { "type": [ "string", "null" ], "description": "The live room it is broadcasting in, when it is live." }, "secUid": { "type": "string", "description": "TikTok's stable key for the account; the handle can change, this does not." }, "seller": { "type": "boolean", "description": "Whether the account sells through TikTok Shop." } } }, { "type": "object", "description": "What only this platform has." } ] }, "externalUrl": { "type": [ "string", "null" ], "description": "The link in the bio." }, "followers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "following": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "id": { "type": "string", "description": "The platform's id for the account." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "description": "Likes the account's posts received in total.", "minimum": 0 }, "posts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "private": { "type": "boolean" }, "url": { "type": "string", "description": "The profile's page." }, "username": { "type": "string", "description": "The handle, without `@`." }, "verified": { "type": "boolean" } } }, { "type": "object", "description": "A TikTok account." } ] }, "Timestamp": { "type": "string", "format": "date-time" } } } } ``` # Search Users (/docs/api-reference/tiktok/search-users) Accounts matching a query. `GET https://api.socialapi.sh/v1/tiktok/search/users` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.tiktok.searchUsers({ query: "nike" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.tiktok.search_users(query="nike") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/tiktok/search/users \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "query=nike" ``` **Response** ```json { "data": [ { "id": "208464585232822272", "username": "nike", "displayName": "Nike", "bio": "Just Do It.", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-maliva-avt-0068/e0b0ac7b6ad6447a8e923fd1eb162f2c~tplv-tiktokx-cropcenter:100:100.webp?biz_tag=tiktok_user.user_cover&dr=14579&idc=my&ps=13740610&refresh_token=1c9c423e&shcp=c1333099&shp=30310797&t=4d5b0474&x-expires=1795644000&x-signature=GDOAKVksH9yIGSSxLOPyuZReusg%3D", "url": "https://www.tiktok.com/@nike", "verified": true, "private": false, "followers": 9400000, "following": null, "likes": 51312863, "posts": null, "externalUrl": null, "createdAt": null, "ext": { "secUid": "MS4wLjABAAAA_3ndMt8d_tECTdpKgCxcx238tOnQZX-20wqN01aMui5zQ7hsqSdff-jC5qYC-Cl_", "friends": null, "liked": null, "category": null, "seller": false, "likesPublic": false, "roomId": null } }, { "id": "7481436802697839659", "username": "nikefootball", "displayName": "Nike Football", "bio": null, "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-maliva-avt-0068/91b628158cd4dd88147039197d1842b5~tplv-tiktokx-cropcenter:100:100.webp?biz_tag=tiktok_user.user_cover&dr=14579&idc=my&ps=13740610&refresh_token=2151fe4f&shcp=c1333099&shp=30310797&t=4d5b0474&x-expires=1795644000&x-signature=ZC%2FbrXSuga4hgIfG6NMZSYJrjCo%3D", "url": "https://www.tiktok.com/@nikefootball", "verified": true, "private": false, "followers": 714200, "following": null, "likes": 5983320, "posts": null, "externalUrl": null, "createdAt": null, "ext": { "secUid": "MS4wLjABAAAASaJUsOF0LAshl5VRYETtJiROSRolZzdAtYOxG1ldR40x8Qk9pY9zvd3jzQI67kWY", "friends": null, "liked": null, "category": null, "seller": false, "likesPublic": false, "roomId": null } } ], "pagination": { "nextCursor": "10", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/tiktok/search/users": { "get": { "tags": [ "TikTok" ], "summary": "Accounts matching a query.", "description": "1 credit a page.", "operationId": "tiktokSearchUsers", "parameters": [ { "name": "query", "in": "query", "description": "What to search for.", "required": true, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_TikTokProfile" }, "example": { "data": [ { "id": "208464585232822272", "username": "nike", "displayName": "Nike", "bio": "Just Do It.", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-maliva-avt-0068/e0b0ac7b6ad6447a8e923fd1eb162f2c~tplv-tiktokx-cropcenter:100:100.webp?biz_tag=tiktok_user.user_cover&dr=14579&idc=my&ps=13740610&refresh_token=1c9c423e&shcp=c1333099&shp=30310797&t=4d5b0474&x-expires=1795644000&x-signature=GDOAKVksH9yIGSSxLOPyuZReusg%3D", "url": "https://www.tiktok.com/@nike", "verified": true, "private": false, "followers": 9400000, "following": null, "likes": 51312863, "posts": null, "externalUrl": null, "createdAt": null, "ext": { "secUid": "MS4wLjABAAAA_3ndMt8d_tECTdpKgCxcx238tOnQZX-20wqN01aMui5zQ7hsqSdff-jC5qYC-Cl_", "friends": null, "liked": null, "category": null, "seller": false, "likesPublic": false, "roomId": null } }, { "id": "7481436802697839659", "username": "nikefootball", "displayName": "Nike Football", "bio": null, "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-maliva-avt-0068/91b628158cd4dd88147039197d1842b5~tplv-tiktokx-cropcenter:100:100.webp?biz_tag=tiktok_user.user_cover&dr=14579&idc=my&ps=13740610&refresh_token=2151fe4f&shcp=c1333099&shp=30310797&t=4d5b0474&x-expires=1795644000&x-signature=ZC%2FbrXSuga4hgIfG6NMZSYJrjCo%3D", "url": "https://www.tiktok.com/@nikefootball", "verified": true, "private": false, "followers": 714200, "following": null, "likes": 5983320, "posts": null, "externalUrl": null, "createdAt": null, "ext": { "secUid": "MS4wLjABAAAASaJUsOF0LAshl5VRYETtJiROSRolZzdAtYOxG1ldR40x8Qk9pY9zvd3jzQI67kWY", "friends": null, "liked": null, "category": null, "seller": false, "likesPublic": false, "roomId": null } } ], "pagination": { "nextCursor": "10", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.tiktok.searchUsers({ query: \"nike\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.tiktok.search_users(query=\"nike\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/tiktok/search/users \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"query=nike\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_TikTokProfile": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/TikTokProfile" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "TikTokProfile": { "allOf": [ { "type": "object", "description": "An account.", "required": [ "id", "username", "url", "verified", "private", "ext" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "bio": { "type": [ "string", "null" ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "displayName": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "secUid", "seller", "likesPublic" ], "properties": { "category": { "type": [ "string", "null" ], "description": "The business category, for business accounts." }, "friends": { "type": [ "integer", "null" ], "format": "int64", "description": "Mutual follows.", "minimum": 0 }, "liked": { "type": [ "integer", "null" ], "format": "int64", "description": "Posts the account has liked.", "minimum": 0 }, "likesPublic": { "type": "boolean", "description": "Whether its likes list is public." }, "roomId": { "type": [ "string", "null" ], "description": "The live room it is broadcasting in, when it is live." }, "secUid": { "type": "string", "description": "TikTok's stable key for the account; the handle can change, this does not." }, "seller": { "type": "boolean", "description": "Whether the account sells through TikTok Shop." } } }, { "type": "object", "description": "What only this platform has." } ] }, "externalUrl": { "type": [ "string", "null" ], "description": "The link in the bio." }, "followers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "following": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "id": { "type": "string", "description": "The platform's id for the account." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "description": "Likes the account's posts received in total.", "minimum": 0 }, "posts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "private": { "type": "boolean" }, "url": { "type": "string", "description": "The profile's page." }, "username": { "type": "string", "description": "The handle, without `@`." }, "verified": { "type": "boolean" } } }, { "type": "object", "description": "A TikTok account." } ] }, "Timestamp": { "type": "string", "format": "date-time" } } } } ``` # Search (/docs/api-reference/tiktok/search) Posts matching a query, 30 a page. `GET https://api.socialapi.sh/v1/tiktok/search` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.tiktok.search({ query: "nike" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.tiktok.search(query="nike") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/tiktok/search \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "query=nike" ``` **Response** ```json { "data": [ { "id": "7619097889943358750", "url": "https://www.tiktok.com/@kylekruegerr/video/7619097889943358750", "text": "i just got the world's most futuristic shoe and my feet are so confused 😂 what should i step on next? #tech #gadget #sneakers #nikemind #unboxing", "createdAt": "2026-03-19T22:31:17.000Z", "author": { "id": "1693136", "username": "kylekruegerr", "displayName": "Kyle Krueger", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-maliva-avt-0068/7310438429072818219~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=940b8bb0&x-expires=1795730400&x-signature=QQusCBNyXyvcp9om9BjBGWg5bY8%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=my", "verified": true, "url": "https://www.tiktok.com/@kylekruegerr" }, "stats": { "views": 956800, "likes": 70000, "comments": 475, "shares": 780, "saves": 5478, "engagementRate": 0.0745 }, "media": [ { "kind": "video", "url": "https://v16-webapp-prime.tiktok.com/video/tos/alisg/tos-alisg-ve-37c799-sg/ogzMePQRGR1W44RIAMLAU2GFWFe1mfQgIjANRe/?a=1988&bti=ODszNWYuMDE6&&bt=2131&ft=I~da4ogrD12Nviib3lIxRGk_glBF-UjNSaopiX&mime_type=video_mp4&rc=aDM0ODdpZ2VmNDs2aDhpZEBpMzhmN245cjM6OTMzaTczNEAvMS5eMmIyXzUxMF4yMmM1YSNrM25eMmRrZnJhLS1kMTJzcw%3D%3D&expire=1795731809&l=20261125062227EA51D5AF8CDBD04ED5A1&ply_type=2&policy=2&signature=976d6306a330b4925b6b24b4c72bc705&tk=tt_chain_token&btag=e00090000", "thumbnailUrl": "https://p16-common-sign.tiktokcdn.com/tos-useast8-p-0068-tx2/oMm4CLAvfAQgRkVYIDRpmTBceEEVFECGoHLQVo~tplv-tiktokx-origin.image?dr=14575&x-expires=1795730400&x-signature=M%2BntKKNV4hD3A3Gkp83Y1sooqxA%3D&t=4d5b0474&ps=13740610&shp=81f88b70&shcp=43f4a2f9&idc=my", "width": 720, "height": 1280, "durationSeconds": 61 } ], "hashtags": [ "tech", "gadget", "sneakers" ], "mentions": [], "ext": { "authorSecUid": "MS4wLjABAAAAgk1KZSB3EIeiyrn91ljrZTpDwmcRD4vyoxCgZrg4kpo", "sound": { "id": "7579661510428428289", "title": "Cycle Syncing Frequency", "artist": "Still Haven", "original": false }, "durationSeconds": 61, "reposts": null, "pinned": false, "ad": false, "playlistId": null, "region": null, "language": "en", "screenText": [], "subtitles": [ { "language": "eng-US", "format": "webvtt", "source": "ASR" } ] } }, { "id": "7711846763140795678", "url": "https://www.tiktok.com/@prvt.selection/video/7711846763140795678", "text": "GTA 6 X TRAVIS SCOTT… THE REAL SHOE OF THE YEAR?! 👀 Gaming and sneaker culture collide with arguably one of the most anticipated Nike collaborations in recent memory. With three different Air Force 1 colorways, which one are you going for? And does this collaboration have the potential to be shoe of the year?", "createdAt": "2026-11-24T21:04:21.000Z", "author": { "id": "6882811036690400261", "username": "prvt.selection", "displayName": "Private Selection", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-maliva-avt-0068/902c44e093a86e7dbd25c967b7277a64~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=b81fffce&x-expires=1795730400&x-signature=u7t7utjZqVBJshtLf%2BLJ683CJh8%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=my", "verified": false, "url": "https://www.tiktok.com/@prvt.selection" }, "stats": { "views": 345, "likes": 4, "comments": 0, "shares": 0, "saves": 1, "engagementRate": 0.0116 }, "media": [ { "kind": "video", "url": "https://v16-webapp-prime.tiktok.com/video/tos/alisg/tos-alisg-ve-37c799-sg/okeKpdHeQXeYLgAwgeFINecGAI7io0BEGVLtRA/?a=1988&bti=ODszNWYuMDE6&&bt=1347&ft=I~da4ogrD12Nviib3lIxRGk_glBF-UjNSaopiX&mime_type=video_mp4&rc=Z2c3Z2VoZzY1NjQ3ZTpkaUBpM3FvcnY5cmp5ZjMzaTczNEBhNi8yNWMvNi8xXzA0XzNjYSMuYjUtMmRzay9hLS1kMTJzcw%3D%3D&expire=1795731907&l=20261125062227EA51D5AF8CDBD04ED5A1&ply_type=2&policy=2&signature=4ef1958b5ea4a3451151bcd3ccca98d5&tk=tt_chain_token&btag=e00090000", "thumbnailUrl": "https://p16-common-sign.tiktokcdn.com/tos-useast8-p-0068-tx2/o0EuCDEfjWEFAqI8CKDLuvFfz9xCAA4IDWeSQI~tplv-tiktokx-origin.image?dr=14575&x-expires=1795730400&x-signature=AI25XV4OUmYIuvuRFqHPC9917i0%3D&t=4d5b0474&ps=13740610&shp=81f88b70&shcp=43f4a2f9&idc=my", "width": 720, "height": 1280, "durationSeconds": 159 } ], "hashtags": [], "mentions": [], "ext": { "authorSecUid": "MS4wLjABAAAASx-z_tSjxVU98BPvHJGX2DNkrgpCiwUZ5UB82oI_IsvHopoQdMy_tD6BuVd0S8HM", "sound": { "id": "7711846812595850015", "title": "original sound", "artist": "Private Selection", "original": true }, "durationSeconds": 159, "reposts": null, "pinned": false, "ad": false, "playlistId": null, "region": null, "language": "en", "screenText": [], "subtitles": [] } } ], "pagination": { "nextCursor": "30:20261125062227EA51D5AF8CDBD04ED5A1", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/tiktok/search": { "get": { "tags": [ "TikTok" ], "summary": "Posts matching a query, 30 a page.", "description": "1 credit a page.", "operationId": "tiktokSearch", "parameters": [ { "name": "query", "in": "query", "description": "What to search for.", "required": true, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_TikTokPost" }, "example": { "data": [ { "id": "7619097889943358750", "url": "https://www.tiktok.com/@kylekruegerr/video/7619097889943358750", "text": "i just got the world's most futuristic shoe and my feet are so confused 😂 what should i step on next? #tech #gadget #sneakers #nikemind #unboxing", "createdAt": "2026-03-19T22:31:17.000Z", "author": { "id": "1693136", "username": "kylekruegerr", "displayName": "Kyle Krueger", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-maliva-avt-0068/7310438429072818219~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=940b8bb0&x-expires=1795730400&x-signature=QQusCBNyXyvcp9om9BjBGWg5bY8%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=my", "verified": true, "url": "https://www.tiktok.com/@kylekruegerr" }, "stats": { "views": 956800, "likes": 70000, "comments": 475, "shares": 780, "saves": 5478, "engagementRate": 0.0745 }, "media": [ { "kind": "video", "url": "https://v16-webapp-prime.tiktok.com/video/tos/alisg/tos-alisg-ve-37c799-sg/ogzMePQRGR1W44RIAMLAU2GFWFe1mfQgIjANRe/?a=1988&bti=ODszNWYuMDE6&&bt=2131&ft=I~da4ogrD12Nviib3lIxRGk_glBF-UjNSaopiX&mime_type=video_mp4&rc=aDM0ODdpZ2VmNDs2aDhpZEBpMzhmN245cjM6OTMzaTczNEAvMS5eMmIyXzUxMF4yMmM1YSNrM25eMmRrZnJhLS1kMTJzcw%3D%3D&expire=1795731809&l=20261125062227EA51D5AF8CDBD04ED5A1&ply_type=2&policy=2&signature=976d6306a330b4925b6b24b4c72bc705&tk=tt_chain_token&btag=e00090000", "thumbnailUrl": "https://p16-common-sign.tiktokcdn.com/tos-useast8-p-0068-tx2/oMm4CLAvfAQgRkVYIDRpmTBceEEVFECGoHLQVo~tplv-tiktokx-origin.image?dr=14575&x-expires=1795730400&x-signature=M%2BntKKNV4hD3A3Gkp83Y1sooqxA%3D&t=4d5b0474&ps=13740610&shp=81f88b70&shcp=43f4a2f9&idc=my", "width": 720, "height": 1280, "durationSeconds": 61 } ], "hashtags": [ "tech", "gadget", "sneakers" ], "mentions": [], "ext": { "authorSecUid": "MS4wLjABAAAAgk1KZSB3EIeiyrn91ljrZTpDwmcRD4vyoxCgZrg4kpo", "sound": { "id": "7579661510428428289", "title": "Cycle Syncing Frequency", "artist": "Still Haven", "original": false }, "durationSeconds": 61, "reposts": null, "pinned": false, "ad": false, "playlistId": null, "region": null, "language": "en", "screenText": [], "subtitles": [ { "language": "eng-US", "format": "webvtt", "source": "ASR" } ] } }, { "id": "7711846763140795678", "url": "https://www.tiktok.com/@prvt.selection/video/7711846763140795678", "text": "GTA 6 X TRAVIS SCOTT… THE REAL SHOE OF THE YEAR?! 👀 Gaming and sneaker culture collide with arguably one of the most anticipated Nike collaborations in recent memory. With three different Air Force 1 colorways, which one are you going for? And does this collaboration have the potential to be shoe of the year?", "createdAt": "2026-11-24T21:04:21.000Z", "author": { "id": "6882811036690400261", "username": "prvt.selection", "displayName": "Private Selection", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-maliva-avt-0068/902c44e093a86e7dbd25c967b7277a64~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=b81fffce&x-expires=1795730400&x-signature=u7t7utjZqVBJshtLf%2BLJ683CJh8%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=my", "verified": false, "url": "https://www.tiktok.com/@prvt.selection" }, "stats": { "views": 345, "likes": 4, "comments": 0, "shares": 0, "saves": 1, "engagementRate": 0.0116 }, "media": [ { "kind": "video", "url": "https://v16-webapp-prime.tiktok.com/video/tos/alisg/tos-alisg-ve-37c799-sg/okeKpdHeQXeYLgAwgeFINecGAI7io0BEGVLtRA/?a=1988&bti=ODszNWYuMDE6&&bt=1347&ft=I~da4ogrD12Nviib3lIxRGk_glBF-UjNSaopiX&mime_type=video_mp4&rc=Z2c3Z2VoZzY1NjQ3ZTpkaUBpM3FvcnY5cmp5ZjMzaTczNEBhNi8yNWMvNi8xXzA0XzNjYSMuYjUtMmRzay9hLS1kMTJzcw%3D%3D&expire=1795731907&l=20261125062227EA51D5AF8CDBD04ED5A1&ply_type=2&policy=2&signature=4ef1958b5ea4a3451151bcd3ccca98d5&tk=tt_chain_token&btag=e00090000", "thumbnailUrl": "https://p16-common-sign.tiktokcdn.com/tos-useast8-p-0068-tx2/o0EuCDEfjWEFAqI8CKDLuvFfz9xCAA4IDWeSQI~tplv-tiktokx-origin.image?dr=14575&x-expires=1795730400&x-signature=AI25XV4OUmYIuvuRFqHPC9917i0%3D&t=4d5b0474&ps=13740610&shp=81f88b70&shcp=43f4a2f9&idc=my", "width": 720, "height": 1280, "durationSeconds": 159 } ], "hashtags": [], "mentions": [], "ext": { "authorSecUid": "MS4wLjABAAAASx-z_tSjxVU98BPvHJGX2DNkrgpCiwUZ5UB82oI_IsvHopoQdMy_tD6BuVd0S8HM", "sound": { "id": "7711846812595850015", "title": "original sound", "artist": "Private Selection", "original": true }, "durationSeconds": 159, "reposts": null, "pinned": false, "ad": false, "playlistId": null, "region": null, "language": "en", "screenText": [], "subtitles": [] } } ], "pagination": { "nextCursor": "30:20261125062227EA51D5AF8CDBD04ED5A1", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.tiktok.search({ query: \"nike\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.tiktok.search(query=\"nike\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/tiktok/search \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"query=nike\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_TikTokPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/TikTokPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "TikTokPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "pinned", "ad", "screenText", "subtitles" ], "properties": { "ad": { "type": "boolean", "description": "A paid promotion." }, "authorSecUid": { "type": [ "string", "null" ], "description": "The author's secUid." }, "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "language": { "type": [ "string", "null" ], "description": "The caption's language, as TikTok detected it (ISO 639-1)." }, "pinned": { "type": "boolean", "description": "Pinned to the top of its author's profile." }, "playlistId": { "type": [ "string", "null" ], "description": "The playlist it belongs to." }, "region": { "type": [ "string", "null" ], "description": "Where it was posted from (ISO country)." }, "reposts": { "type": [ "integer", "null" ], "format": "int64", "description": "Reposts, where TikTok counts them.", "minimum": 0 }, "screenText": { "type": "array", "items": { "type": "string" }, "description": "Text the author put on the post as stickers, in order, each once; read from the\npost, not from its frames." }, "sound": { "oneOf": [ { "$ref": "#/components/schemas/TikTokSoundRef" }, { "type": "null" } ] }, "subtitles": { "type": "array", "items": { "$ref": "#/components/schemas/TikTokSubtitle" }, "description": "Captions TikTok made or the author uploaded; read one with\n`/v1/tiktok/post/transcript`." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A TikTok post: a video or a photo set." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "TikTokSubtitle": { "type": "object", "required": [ "language", "format", "source" ], "properties": { "format": { "type": "string", "description": "`webvtt`." }, "language": { "type": "string", "description": "`eng-US`, `tur-TR`…" }, "source": { "type": "string", "description": "`ASR` (generated) or `MT` (machine translated); others are the author's." } } }, "TikTokSoundRef": { "type": "object", "description": "The sound a post uses.", "required": [ "id", "title", "original" ], "properties": { "artist": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "original": { "type": "boolean" }, "title": { "type": "string" } } }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Sound Posts (/docs/api-reference/tiktok/sound-posts) Posts that use a sound, 30 a page. `GET https://api.socialapi.sh/v1/tiktok/sound/posts` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.tiktok.soundPosts({ id: "7711465298314021645" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.tiktok.sound_posts(id="7711465298314021645") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/tiktok/sound/posts \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "id=7711465298314021645" ``` **Response** ```json { "data": [ { "id": "7711465226318728461", "url": "https://www.tiktok.com/@nike/video/7711465226318728461", "text": "Vroom vroom 🏎️💨 #Formula1 #LasVegasGP #NSW #Nike Feat. @Miku Martineau @lizzy greene @Nick @Caleb McLaughlin @Sabrina Ionescu @Brianna LaPaglia", "createdAt": "2026-11-23T20:24:10.000Z", "author": { "id": "208464585232822272", "username": "nike", "displayName": "Nike", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-maliva-avt-0068/e0b0ac7b6ad6447a8e923fd1eb162f2c~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=c73b1f8a&x-expires=1795730400&x-signature=WFCAToitWtbkgo5qXRwrQmcX%2FZY%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=my", "verified": true, "url": "https://www.tiktok.com/@nike" }, "stats": { "views": 18200, "likes": 309, "comments": 14, "shares": 5, "saves": 17, "engagementRate": 0.018 }, "media": [ { "kind": "video", "url": "https://v16-webapp-prime.tiktok.com/video/tos/alisg/tos-alisg-ve-37c799-sg/o0kDDPDSFCeIBoEwTRQMABOEM1SIESQfgrKdjE/?a=1988&bti=ODszNWYuMDE6&&bt=1397&ft=-Csk_mK9PD12Nd4GgY-Uxr12GY6e3wv25-cAp&mime_type=video_mp4&rc=ZzppN2U1OzY2PGVnN2c0Z0BpM3g3NnQ5cmxkZjMzZzczNEAtMC0tXjZeNmIxNmMyLi4tYSMzYmlnMmQ0Li9hLS1kMS9zcw%3D%3D&expire=1795731859&l=2026112506240674E98A2A700D87276E0E&ply_type=2&policy=2&signature=c1ddeb2c0815ecd12706c0e33c8cd765&tk=tt_chain_token&btag=e000b0000", "thumbnailUrl": "https://p16-common-sign.tiktokcdn.com/tos-useast5-p-0068-tx/oMeIeALC2IGwPxAAHOAAe3IEWJQ6jbPHkAcUQE~tplv-tiktokx-origin.image?dr=14575&x-expires=1795730400&x-signature=fWhitTvuuSB%2FxWl2xEN2vB%2BBXsQ%3D&t=4d5b0474&ps=13740610&shp=81f88b70&shcp=43f4a2f9&idc=my", "width": 720, "height": 1280, "durationSeconds": 13 } ], "hashtags": [ "Formula1", "LasVegasGP", "NSW" ], "mentions": [ "Miku", "lizzy", "Nick" ], "ext": { "authorSecUid": "MS4wLjABAAAA_3ndMt8d_tECTdpKgCxcx238tOnQZX-20wqN01aMui5zQ7hsqSdff-jC5qYC-Cl_", "sound": { "id": "7711465298314021645", "title": "original sound", "artist": "Nike", "original": true }, "durationSeconds": 13, "reposts": null, "pinned": false, "ad": false, "playlistId": null, "region": null, "language": "nl", "screenText": [], "subtitles": [] } } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/tiktok/sound/posts": { "get": { "tags": [ "TikTok" ], "summary": "Posts that use a sound, 30 a page.", "description": "1 credit a page.", "operationId": "tiktokSoundPosts", "parameters": [ { "name": "url", "in": "query", "description": "The sound's link.", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The sound's id, instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_TikTokPost" }, "example": { "data": [ { "id": "7711465226318728461", "url": "https://www.tiktok.com/@nike/video/7711465226318728461", "text": "Vroom vroom 🏎️💨 #Formula1 #LasVegasGP #NSW #Nike Feat. @Miku Martineau @lizzy greene @Nick @Caleb McLaughlin @Sabrina Ionescu @Brianna LaPaglia", "createdAt": "2026-11-23T20:24:10.000Z", "author": { "id": "208464585232822272", "username": "nike", "displayName": "Nike", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-maliva-avt-0068/e0b0ac7b6ad6447a8e923fd1eb162f2c~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=c73b1f8a&x-expires=1795730400&x-signature=WFCAToitWtbkgo5qXRwrQmcX%2FZY%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=my", "verified": true, "url": "https://www.tiktok.com/@nike" }, "stats": { "views": 18200, "likes": 309, "comments": 14, "shares": 5, "saves": 17, "engagementRate": 0.018 }, "media": [ { "kind": "video", "url": "https://v16-webapp-prime.tiktok.com/video/tos/alisg/tos-alisg-ve-37c799-sg/o0kDDPDSFCeIBoEwTRQMABOEM1SIESQfgrKdjE/?a=1988&bti=ODszNWYuMDE6&&bt=1397&ft=-Csk_mK9PD12Nd4GgY-Uxr12GY6e3wv25-cAp&mime_type=video_mp4&rc=ZzppN2U1OzY2PGVnN2c0Z0BpM3g3NnQ5cmxkZjMzZzczNEAtMC0tXjZeNmIxNmMyLi4tYSMzYmlnMmQ0Li9hLS1kMS9zcw%3D%3D&expire=1795731859&l=2026112506240674E98A2A700D87276E0E&ply_type=2&policy=2&signature=c1ddeb2c0815ecd12706c0e33c8cd765&tk=tt_chain_token&btag=e000b0000", "thumbnailUrl": "https://p16-common-sign.tiktokcdn.com/tos-useast5-p-0068-tx/oMeIeALC2IGwPxAAHOAAe3IEWJQ6jbPHkAcUQE~tplv-tiktokx-origin.image?dr=14575&x-expires=1795730400&x-signature=fWhitTvuuSB%2FxWl2xEN2vB%2BBXsQ%3D&t=4d5b0474&ps=13740610&shp=81f88b70&shcp=43f4a2f9&idc=my", "width": 720, "height": 1280, "durationSeconds": 13 } ], "hashtags": [ "Formula1", "LasVegasGP", "NSW" ], "mentions": [ "Miku", "lizzy", "Nick" ], "ext": { "authorSecUid": "MS4wLjABAAAA_3ndMt8d_tECTdpKgCxcx238tOnQZX-20wqN01aMui5zQ7hsqSdff-jC5qYC-Cl_", "sound": { "id": "7711465298314021645", "title": "original sound", "artist": "Nike", "original": true }, "durationSeconds": 13, "reposts": null, "pinned": false, "ad": false, "playlistId": null, "region": null, "language": "nl", "screenText": [], "subtitles": [] } } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.tiktok.soundPosts({ id: \"7711465298314021645\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.tiktok.sound_posts(id=\"7711465298314021645\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/tiktok/sound/posts \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"id=7711465298314021645\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_TikTokPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/TikTokPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "TikTokPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "pinned", "ad", "screenText", "subtitles" ], "properties": { "ad": { "type": "boolean", "description": "A paid promotion." }, "authorSecUid": { "type": [ "string", "null" ], "description": "The author's secUid." }, "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "language": { "type": [ "string", "null" ], "description": "The caption's language, as TikTok detected it (ISO 639-1)." }, "pinned": { "type": "boolean", "description": "Pinned to the top of its author's profile." }, "playlistId": { "type": [ "string", "null" ], "description": "The playlist it belongs to." }, "region": { "type": [ "string", "null" ], "description": "Where it was posted from (ISO country)." }, "reposts": { "type": [ "integer", "null" ], "format": "int64", "description": "Reposts, where TikTok counts them.", "minimum": 0 }, "screenText": { "type": "array", "items": { "type": "string" }, "description": "Text the author put on the post as stickers, in order, each once; read from the\npost, not from its frames." }, "sound": { "oneOf": [ { "$ref": "#/components/schemas/TikTokSoundRef" }, { "type": "null" } ] }, "subtitles": { "type": "array", "items": { "$ref": "#/components/schemas/TikTokSubtitle" }, "description": "Captions TikTok made or the author uploaded; read one with\n`/v1/tiktok/post/transcript`." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A TikTok post: a video or a photo set." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "TikTokSubtitle": { "type": "object", "required": [ "language", "format", "source" ], "properties": { "format": { "type": "string", "description": "`webvtt`." }, "language": { "type": "string", "description": "`eng-US`, `tur-TR`…" }, "source": { "type": "string", "description": "`ASR` (generated) or `MT` (machine translated); others are the author's." } } }, "TikTokSoundRef": { "type": "object", "description": "The sound a post uses.", "required": [ "id", "title", "original" ], "properties": { "artist": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "original": { "type": "boolean" }, "title": { "type": "string" } } }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Sound (/docs/api-reference/tiktok/sound) A sound, and how many posts use it. `GET https://api.socialapi.sh/v1/tiktok/sound` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.tiktok.sound({ id: "7711465298314021645" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.tiktok.sound(id="7711465298314021645").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/tiktok/sound \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "id=7711465298314021645" ``` **Response** ```json { "data": { "id": "7711465298314021645", "title": "original sound", "artist": "Nike", "url": "https://www.tiktok.com/music/original-sound-7711465298314021645", "coverUrl": "https://p16-common-sign.tiktokcdn.com/tos-maliva-avt-0068/e0b0ac7b6ad6447a8e923fd1eb162f2c~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=c73b1f8a&x-expires=1795730400&x-signature=WFCAToitWtbkgo5qXRwrQmcX%2FZY%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=my", "playUrl": "https://v77.tiktokcdn.com/18561280bd0a1c77beb782a4266b724b/6b076011/video/tos/alisg/tos-alisg-v-2370c799-sg/oMAI8g96QU8okJCClSeGeH8THXELAAUAA7fWQ7/?a=1180&bti=ODszNWYuMDE6&&bt=125&ft=.NpOcInz7ThjlupVXq8Zmo&mime_type=audio_mpeg&rc=anN2bXk5cnRkZjMzZzU8NEBpanN2bXk5cnRkZjMzZzU8NEBjcmsvMmRzLi9hLS1kMS9zYSNjcmsvMmRzLi9hLS1kMS9zcw%3D%3D&vvpl=1&l=20261125062404FD1F8DEF82FA14581BED&btag=e00070000", "durationSeconds": 13, "original": true, "posts": 0, "ext": { "authorUsername": "nike", "copyrighted": false, "commercial": false } } } ``` **OpenAPI** ```json { "paths": { "/v1/tiktok/sound": { "get": { "tags": [ "TikTok" ], "summary": "A sound, and how many posts use it.", "description": "Its title, artist and duration, and how many posts use it. 1 credit.", "operationId": "tiktokSound", "parameters": [ { "name": "url", "in": "query", "description": "The sound's link (`https://www.tiktok.com/music/-7311…`, or a share link).", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The sound's id (a post's `ext.sound.id`), instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_TikTokSound" }, "example": { "data": { "id": "7711465298314021645", "title": "original sound", "artist": "Nike", "url": "https://www.tiktok.com/music/original-sound-7711465298314021645", "coverUrl": "https://p16-common-sign.tiktokcdn.com/tos-maliva-avt-0068/e0b0ac7b6ad6447a8e923fd1eb162f2c~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=c73b1f8a&x-expires=1795730400&x-signature=WFCAToitWtbkgo5qXRwrQmcX%2FZY%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=my", "playUrl": "https://v77.tiktokcdn.com/18561280bd0a1c77beb782a4266b724b/6b076011/video/tos/alisg/tos-alisg-v-2370c799-sg/oMAI8g96QU8okJCClSeGeH8THXELAAUAA7fWQ7/?a=1180&bti=ODszNWYuMDE6&&bt=125&ft=.NpOcInz7ThjlupVXq8Zmo&mime_type=audio_mpeg&rc=anN2bXk5cnRkZjMzZzU8NEBpanN2bXk5cnRkZjMzZzU8NEBjcmsvMmRzLi9hLS1kMS9zYSNjcmsvMmRzLi9hLS1kMS9zcw%3D%3D&vvpl=1&l=20261125062404FD1F8DEF82FA14581BED&btag=e00070000", "durationSeconds": 13, "original": true, "posts": 0, "ext": { "authorUsername": "nike", "copyrighted": false, "commercial": false } } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.tiktok.sound({ id: \"7711465298314021645\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.tiktok.sound(id=\"7711465298314021645\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/tiktok/sound \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"id=7711465298314021645\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_TikTokSound": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/TikTokSound" } } }, "TikTokSound": { "allOf": [ { "type": "object", "description": "A sound or song posts use.", "required": [ "id", "title", "url", "original", "ext" ], "properties": { "artist": { "type": [ "string", "null" ], "description": "The artist, or the account the original sound is from." }, "coverUrl": { "type": [ "string", "null" ] }, "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "ext": { "allOf": [ { "type": "object", "required": [ "copyrighted", "commercial" ], "properties": { "authorUsername": { "type": [ "string", "null" ], "description": "The handle of the account an original sound is from." }, "commercial": { "type": "boolean", "description": "Cleared for commercial use." }, "copyrighted": { "type": "boolean" } } }, { "type": "object", "description": "What only this platform has." } ] }, "id": { "type": "string" }, "original": { "type": "boolean", "description": "Whether it is an account's own recording rather than a released song." }, "playUrl": { "type": [ "string", "null" ] }, "posts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "title": { "type": "string" }, "url": { "type": "string" } } }, { "type": "object", "description": "A TikTok sound." } ] } } } } ``` # Trending (/docs/api-reference/tiktok/trending) What the explore page shows now, by category. `GET https://api.socialapi.sh/v1/tiktok/trending` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.tiktok.trending({ category: "all" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.tiktok.trending(category="all") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/tiktok/trending \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "category=all" ``` **Response** ```json { "data": [ { "id": "7709821044638403861", "url": "https://www.tiktok.com/@locxin2.0/video/7709821044638403861", "text": "Shea in MPL PH😱 #mplphilippines #MLBB #mobilelegends #fyp", "createdAt": "2026-11-19T10:03:21.000Z", "author": { "id": "7229173383006012422", "username": "locxin2.0", "displayName": "locxin dump", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-alisg-avt-0068/45be72f6e05c506e39cda87ae13f6fc1~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=e3990f3d&x-expires=1795730400&x-signature=YjAOhzH%2Fa0ORw9hfzyO3vXPqe4o%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=my", "verified": false, "url": "https://www.tiktok.com/@locxin2.0" }, "stats": { "views": 2800000, "likes": 184800, "comments": 359, "shares": 6265, "saves": 5916, "engagementRate": 0.0684 }, "media": [ { "kind": "video", "url": "https://v16-webapp-prime.tiktok.com/video/tos/alisg/tos-alisg-pve-0037c001/oMegZDfEpAfuVxuodICkjgAkGFQIF9IDD13sk9/?a=1988&bti=ODszNWYuMDE6&&bt=772&ft=-Csk_maLPD12NnpGgY-UxS.2hY6e3wv25VcAp&mime_type=video_mp4&rc=ZzZoODNlOzU4O2lpZTZpNUBpamZ1O3Q5cmZmZTMzODczNEAvMS01X2AtXjExLTFjYC5hYSNvLWtrMmRjZnNhLS1kMTFzcw%3D%3D&expire=1795731784&l=20261125062232FBD6CE1666E57A379CB3&ply_type=2&policy=2&signature=d1d892546b5a6ea6f5074b0b8552994d&tk=tt_chain_token&btag=e00088000", "thumbnailUrl": "https://p16-common-sign.tiktokcdn.com/tos-alisg-p-0037/oYGZFxufjVEjPoD2C9DegkFsnWIfAA1Qd5yWQI~tplv-tiktokx-origin.image?dr=14575&x-expires=1795730400&x-signature=FSvZ1s0%2BB6kVvQszoddElq3NLM8%3D&t=4d5b0474&ps=13740610&shp=81f88b70&shcp=43f4a2f9&idc=my", "width": 576, "height": 768, "durationSeconds": 32 } ], "hashtags": [ "mplphilippines", "MLBB", "mobilelegends" ], "mentions": [], "ext": { "authorSecUid": "MS4wLjABAAAAZv-bcnR_aY3hu7HMSw2WumRaKLTdHI-XqgGhbKxsCHl6Eie2oYMlDm8Pi2edsH_6", "sound": { "id": "7709821083649624840", "title": "original sound - locxin dump", "artist": "locxin dump", "original": true }, "durationSeconds": 32, "reposts": null, "pinned": false, "ad": false, "playlistId": null, "region": null, "language": "en", "screenText": [], "subtitles": [] } }, { "id": "7707965932445977876", "url": "https://www.tiktok.com/@henrythanhcong/video/7707965932445977876", "text": "lâu r nha #xuhuong #fyp #vrial #viraltiktok #viralvideo", "createdAt": "2026-11-14T10:04:36.000Z", "author": { "id": "6576109295027781634", "username": "henrythanhcong", "displayName": "✈️Henry Thành Công 🚀🚀", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-alisg-avt-0068/a438862549958bb6dc8375996c8835a8~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=32e494d6&x-expires=1795730400&x-signature=BhSQ61Q13ZQk9CWrDPWaZltNEq8%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=my", "verified": false, "url": "https://www.tiktok.com/@henrythanhcong" }, "stats": { "views": 1600000, "likes": 64200, "comments": 1538, "shares": 1744, "saves": 8543, "engagementRate": 0.0422 }, "media": [ { "kind": "video", "url": "https://v16-webapp-prime.tiktok.com/video/tos/alisg/tos-alisg-pve-0037c001/oYQBEDAF4IE4rjQApwI8fQEGV3MeDfTCojcV04/?a=1988&bti=ODszNWYuMDE6&&bt=941&ft=-Csk_maLPD12NnpGgY-UxS.2hY6e3wv25VcAp&mime_type=video_mp4&rc=aGk0ZWQ8OWZpZjw7OjY4PEBpank0aHY5cjo2ZTMzODczNEAuXmI2LjRfNjUxXy4vYDAxYSNvbGVeMmRrMXBhLS1kMTFzcw%3D%3D&expire=1795731761&l=20261125062232FBD6CE1666E57A379CB3&ply_type=2&policy=2&signature=2fc8157f4cf66133541a46e5678de5a9&tk=tt_chain_token&btag=e000b0000", "thumbnailUrl": "https://p16-common-sign.tiktokcdn.com/tos-alisg-p-0037/oIIQQeIAoZAF3EGMvbjf48f0PQDQDCPI4CjVp4~tplv-tiktokx-origin.image?dr=14575&x-expires=1795730400&x-signature=DgZbPvrx0H1W%2FcwOF69xZvfkz2A%3D&t=4d5b0474&ps=13740610&shp=81f88b70&shcp=43f4a2f9&idc=my", "width": 576, "height": 768, "durationSeconds": 9 } ], "hashtags": [ "xuhuong", "fyp", "vrial" ], "mentions": [], "ext": { "authorSecUid": "MS4wLjABAAAAfI6EaYkodAHd89OaVbgFaLEVf7xFi_9rn5lPMQ1LNUWOFzbsDagW76IW1TsqT4Yp", "sound": { "id": "7707965965081905921", "title": "âm thanh gốc - ✈️Henry Thành Công 🚀🚀", "artist": "✈️Henry Thành Công 🚀🚀", "original": true }, "durationSeconds": 9, "reposts": null, "pinned": false, "ad": false, "playlistId": "7329209693400746759", "region": null, "language": "vi", "screenText": [], "subtitles": [] } } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/tiktok/trending": { "get": { "tags": [ "TikTok" ], "summary": "What the explore page shows now, by category.", "description": "For one of its categories, `all` by default. A fresh set of about 30 posts each time.\n5 credits.", "operationId": "tiktokTrending", "parameters": [ { "name": "category", "in": "query", "description": "The explore page's category. Default `all`.", "required": false, "schema": { "type": "string", "description": "A category of TikTok's explore page.", "enum": [ "all", "singing-dancing", "comedy", "sports", "anime-comics", "relationship", "shows", "lipsync", "daily-life", "beauty-care", "games", "society", "outfit", "cars", "food", "animals", "family", "drama", "fitness-health", "education", "technology" ] } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_TikTokPost" }, "example": { "data": [ { "id": "7709821044638403861", "url": "https://www.tiktok.com/@locxin2.0/video/7709821044638403861", "text": "Shea in MPL PH😱 #mplphilippines #MLBB #mobilelegends #fyp", "createdAt": "2026-11-19T10:03:21.000Z", "author": { "id": "7229173383006012422", "username": "locxin2.0", "displayName": "locxin dump", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-alisg-avt-0068/45be72f6e05c506e39cda87ae13f6fc1~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=e3990f3d&x-expires=1795730400&x-signature=YjAOhzH%2Fa0ORw9hfzyO3vXPqe4o%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=my", "verified": false, "url": "https://www.tiktok.com/@locxin2.0" }, "stats": { "views": 2800000, "likes": 184800, "comments": 359, "shares": 6265, "saves": 5916, "engagementRate": 0.0684 }, "media": [ { "kind": "video", "url": "https://v16-webapp-prime.tiktok.com/video/tos/alisg/tos-alisg-pve-0037c001/oMegZDfEpAfuVxuodICkjgAkGFQIF9IDD13sk9/?a=1988&bti=ODszNWYuMDE6&&bt=772&ft=-Csk_maLPD12NnpGgY-UxS.2hY6e3wv25VcAp&mime_type=video_mp4&rc=ZzZoODNlOzU4O2lpZTZpNUBpamZ1O3Q5cmZmZTMzODczNEAvMS01X2AtXjExLTFjYC5hYSNvLWtrMmRjZnNhLS1kMTFzcw%3D%3D&expire=1795731784&l=20261125062232FBD6CE1666E57A379CB3&ply_type=2&policy=2&signature=d1d892546b5a6ea6f5074b0b8552994d&tk=tt_chain_token&btag=e00088000", "thumbnailUrl": "https://p16-common-sign.tiktokcdn.com/tos-alisg-p-0037/oYGZFxufjVEjPoD2C9DegkFsnWIfAA1Qd5yWQI~tplv-tiktokx-origin.image?dr=14575&x-expires=1795730400&x-signature=FSvZ1s0%2BB6kVvQszoddElq3NLM8%3D&t=4d5b0474&ps=13740610&shp=81f88b70&shcp=43f4a2f9&idc=my", "width": 576, "height": 768, "durationSeconds": 32 } ], "hashtags": [ "mplphilippines", "MLBB", "mobilelegends" ], "mentions": [], "ext": { "authorSecUid": "MS4wLjABAAAAZv-bcnR_aY3hu7HMSw2WumRaKLTdHI-XqgGhbKxsCHl6Eie2oYMlDm8Pi2edsH_6", "sound": { "id": "7709821083649624840", "title": "original sound - locxin dump", "artist": "locxin dump", "original": true }, "durationSeconds": 32, "reposts": null, "pinned": false, "ad": false, "playlistId": null, "region": null, "language": "en", "screenText": [], "subtitles": [] } }, { "id": "7707965932445977876", "url": "https://www.tiktok.com/@henrythanhcong/video/7707965932445977876", "text": "lâu r nha #xuhuong #fyp #vrial #viraltiktok #viralvideo", "createdAt": "2026-11-14T10:04:36.000Z", "author": { "id": "6576109295027781634", "username": "henrythanhcong", "displayName": "✈️Henry Thành Công 🚀🚀", "avatarUrl": "https://p16-common-sign.tiktokcdn.com/tos-alisg-avt-0068/a438862549958bb6dc8375996c8835a8~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=14579&refresh_token=32e494d6&x-expires=1795730400&x-signature=BhSQ61Q13ZQk9CWrDPWaZltNEq8%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=my", "verified": false, "url": "https://www.tiktok.com/@henrythanhcong" }, "stats": { "views": 1600000, "likes": 64200, "comments": 1538, "shares": 1744, "saves": 8543, "engagementRate": 0.0422 }, "media": [ { "kind": "video", "url": "https://v16-webapp-prime.tiktok.com/video/tos/alisg/tos-alisg-pve-0037c001/oYQBEDAF4IE4rjQApwI8fQEGV3MeDfTCojcV04/?a=1988&bti=ODszNWYuMDE6&&bt=941&ft=-Csk_maLPD12NnpGgY-UxS.2hY6e3wv25VcAp&mime_type=video_mp4&rc=aGk0ZWQ8OWZpZjw7OjY4PEBpank0aHY5cjo2ZTMzODczNEAuXmI2LjRfNjUxXy4vYDAxYSNvbGVeMmRrMXBhLS1kMTFzcw%3D%3D&expire=1795731761&l=20261125062232FBD6CE1666E57A379CB3&ply_type=2&policy=2&signature=2fc8157f4cf66133541a46e5678de5a9&tk=tt_chain_token&btag=e000b0000", "thumbnailUrl": "https://p16-common-sign.tiktokcdn.com/tos-alisg-p-0037/oIIQQeIAoZAF3EGMvbjf48f0PQDQDCPI4CjVp4~tplv-tiktokx-origin.image?dr=14575&x-expires=1795730400&x-signature=DgZbPvrx0H1W%2FcwOF69xZvfkz2A%3D&t=4d5b0474&ps=13740610&shp=81f88b70&shcp=43f4a2f9&idc=my", "width": 576, "height": 768, "durationSeconds": 9 } ], "hashtags": [ "xuhuong", "fyp", "vrial" ], "mentions": [], "ext": { "authorSecUid": "MS4wLjABAAAAfI6EaYkodAHd89OaVbgFaLEVf7xFi_9rn5lPMQ1LNUWOFzbsDagW76IW1TsqT4Yp", "sound": { "id": "7707965965081905921", "title": "âm thanh gốc - ✈️Henry Thành Công 🚀🚀", "artist": "✈️Henry Thành Công 🚀🚀", "original": true }, "durationSeconds": 9, "reposts": null, "pinned": false, "ad": false, "playlistId": "7329209693400746759", "region": null, "language": "vi", "screenText": [], "subtitles": [] } } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.tiktok.trending({ category: \"all\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.tiktok.trending(category=\"all\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/tiktok/trending \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"category=all\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_TikTokPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/TikTokPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "TikTokPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "pinned", "ad", "screenText", "subtitles" ], "properties": { "ad": { "type": "boolean", "description": "A paid promotion." }, "authorSecUid": { "type": [ "string", "null" ], "description": "The author's secUid." }, "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "language": { "type": [ "string", "null" ], "description": "The caption's language, as TikTok detected it (ISO 639-1)." }, "pinned": { "type": "boolean", "description": "Pinned to the top of its author's profile." }, "playlistId": { "type": [ "string", "null" ], "description": "The playlist it belongs to." }, "region": { "type": [ "string", "null" ], "description": "Where it was posted from (ISO country)." }, "reposts": { "type": [ "integer", "null" ], "format": "int64", "description": "Reposts, where TikTok counts them.", "minimum": 0 }, "screenText": { "type": "array", "items": { "type": "string" }, "description": "Text the author put on the post as stickers, in order, each once; read from the\npost, not from its frames." }, "sound": { "oneOf": [ { "$ref": "#/components/schemas/TikTokSoundRef" }, { "type": "null" } ] }, "subtitles": { "type": "array", "items": { "$ref": "#/components/schemas/TikTokSubtitle" }, "description": "Captions TikTok made or the author uploaded; read one with\n`/v1/tiktok/post/transcript`." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A TikTok post: a video or a photo set." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "TikTokSubtitle": { "type": "object", "required": [ "language", "format", "source" ], "properties": { "format": { "type": "string", "description": "`webvtt`." }, "language": { "type": "string", "description": "`eng-US`, `tur-TR`…" }, "source": { "type": "string", "description": "`ASR` (generated) or `MT` (machine translated); others are the author's." } } }, "TikTokSoundRef": { "type": "object", "description": "The sound a post uses.", "required": [ "id", "title", "original" ], "properties": { "artist": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "original": { "type": "boolean" }, "title": { "type": "string" } } }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Batch Live (/docs/api-reference/twitch/batch-live) Up to 100 channels' live status at once. `GET https://api.socialapi.sh/v1/twitch/batch/live` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.twitch.batchLive({ handles: "shroud,twitch,riotgames" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.twitch.batch_live(handles="shroud,twitch,riotgames") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/twitch/batch/live \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handles=shroud,twitch,riotgames" ``` **Response** ```json { "data": [ { "live": true, "roomId": "321358163420", "title": "day3.. we finally got lucia the real main character YAHOO!", "viewers": 5445, "startedAt": "2026-11-25T17:38:16.000Z", "coverUrl": "https://static-cdn.jtvnw.net/previews-ttv/live_user_shroud-1280x720.jpg", "host": { "id": "37402112", "username": "shroud", "displayName": "shroud", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/c754eebf-745b-4e0a-814a-10bcaecaabbc-profile_image-300x300.png", "verified": true, "url": "https://www.twitch.tv/shroud" }, "ext": { "category": { "id": "1867279146", "name": "Grand Theft Auto VI", "slug": "grand-theft-auto-vi", "url": "https://www.twitch.tv/directory/category/grand-theft-auto-vi", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/1867279146_IGDB-285x380.jpg" }, "language": "EN", "tags": [ "English", "DropsEnabled" ], "labels": [ "MatureGame" ], "rerun": false, "chatters": 4472, "videoId": "2940500640", "fps": 60, "width": 2560, "height": 1440, "lastLiveAt": "2026-11-25T17:38:22.069Z" } }, { "live": false, "roomId": null, "title": "GTAVI Countdown", "viewers": null, "startedAt": null, "coverUrl": null, "host": { "id": "12826", "username": "twitch", "displayName": "Twitch", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/e437c251-ced5-476f-b3c6-fd6686c51550-profile_image-300x300.png", "verified": true, "url": "https://www.twitch.tv/twitch" }, "ext": { "category": { "id": "1867279146", "name": "Grand Theft Auto VI", "slug": "grand-theft-auto-vi", "url": "https://www.twitch.tv/directory/category/grand-theft-auto-vi", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/1867279146_IGDB-285x380.jpg" }, "language": "EN", "tags": [], "labels": [], "rerun": false, "chatters": null, "videoId": null, "fps": null, "width": null, "height": null, "lastLiveAt": "2026-11-18T11:03:47.255Z" } } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/twitch/batch/live": { "get": { "tags": [ "Twitch" ], "summary": "Up to 100 channels' live status at once.", "description": "Each as `/live` answers it, on air or off; a login that names no channel is left out.\n1 credit a channel found (one served from the cache is free).", "operationId": "twitchBatchLive", "parameters": [ { "name": "handles", "in": "query", "description": "Channels' logins, comma-separated: up to 100 for `/batch/live`, 50 for\n`/batch/profiles`.", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_TwitchLive" }, "example": { "data": [ { "live": true, "roomId": "321358163420", "title": "day3.. we finally got lucia the real main character YAHOO!", "viewers": 5445, "startedAt": "2026-11-25T17:38:16.000Z", "coverUrl": "https://static-cdn.jtvnw.net/previews-ttv/live_user_shroud-1280x720.jpg", "host": { "id": "37402112", "username": "shroud", "displayName": "shroud", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/c754eebf-745b-4e0a-814a-10bcaecaabbc-profile_image-300x300.png", "verified": true, "url": "https://www.twitch.tv/shroud" }, "ext": { "category": { "id": "1867279146", "name": "Grand Theft Auto VI", "slug": "grand-theft-auto-vi", "url": "https://www.twitch.tv/directory/category/grand-theft-auto-vi", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/1867279146_IGDB-285x380.jpg" }, "language": "EN", "tags": [ "English", "DropsEnabled" ], "labels": [ "MatureGame" ], "rerun": false, "chatters": 4472, "videoId": "2940500640", "fps": 60, "width": 2560, "height": 1440, "lastLiveAt": "2026-11-25T17:38:22.069Z" } }, { "live": false, "roomId": null, "title": "GTAVI Countdown", "viewers": null, "startedAt": null, "coverUrl": null, "host": { "id": "12826", "username": "twitch", "displayName": "Twitch", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/e437c251-ced5-476f-b3c6-fd6686c51550-profile_image-300x300.png", "verified": true, "url": "https://www.twitch.tv/twitch" }, "ext": { "category": { "id": "1867279146", "name": "Grand Theft Auto VI", "slug": "grand-theft-auto-vi", "url": "https://www.twitch.tv/directory/category/grand-theft-auto-vi", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/1867279146_IGDB-285x380.jpg" }, "language": "EN", "tags": [], "labels": [], "rerun": false, "chatters": null, "videoId": null, "fps": null, "width": null, "height": null, "lastLiveAt": "2026-11-18T11:03:47.255Z" } } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.twitch.batchLive({ handles: \"shroud,twitch,riotgames\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.twitch.batch_live(handles=\"shroud,twitch,riotgames\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/twitch/batch/live \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handles=shroud,twitch,riotgames\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_TwitchLive": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/TwitchLive" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "TwitchLive": { "allOf": [ { "type": "object", "description": "An account's live broadcast.", "required": [ "live", "ext" ], "properties": { "coverUrl": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "tags", "labels", "rerun" ], "properties": { "category": { "oneOf": [ { "$ref": "#/components/schemas/TwitchCategoryRef" }, { "type": "null" } ] }, "chatters": { "type": [ "integer", "null" ], "format": "int64", "description": "Accounts in the chat now; on `/live` and `/batch/live` only.", "minimum": 0 }, "fps": { "type": [ "number", "null" ], "format": "double", "description": "The picture's frame rate and size." }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "labels": { "type": "array", "items": { "type": "string" }, "description": "Twitch's content labels (`MatureGame`)." }, "language": { "type": [ "string", "null" ], "description": "The broadcast's language (`EN`)." }, "lastLiveAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "When the channel's latest broadcast began: this one's, or the last when off air." }, { "type": "null" } ] }, "rerun": { "type": "boolean", "description": "A past broadcast shown again, rather than a live one." }, "tags": { "type": "array", "items": { "type": "string" }, "description": "The tags the channel gave the broadcast." }, "videoId": { "type": [ "string", "null" ], "description": "The video the broadcast is being recorded to." }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, { "type": "object", "description": "What only this platform has." } ] }, "host": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "live": { "type": "boolean" }, "roomId": { "type": [ "string", "null" ] }, "startedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "title": { "type": [ "string", "null" ] }, "viewers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, { "type": "object", "description": "A channel's live status, with its broadcast when it is on." } ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } }, "TwitchCategoryRef": { "type": "object", "description": "A category as a video, a clip, a broadcast or a channel names it.", "required": [ "id", "name" ], "properties": { "coverUrl": { "type": [ "string", "null" ], "description": "Its box art." }, "id": { "type": "string" }, "name": { "type": "string" }, "slug": { "type": [ "string", "null" ], "description": "The name in its link (`just-chatting`)." }, "url": { "type": [ "string", "null" ] } } } } } } ``` # Batch Profiles (/docs/api-reference/twitch/batch-profiles) Up to 50 channels at once, by their logins. `GET https://api.socialapi.sh/v1/twitch/batch/profiles` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.twitch.batchProfiles({ handles: "shroud,twitch" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.twitch.batch_profiles(handles="shroud,twitch") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/twitch/batch/profiles \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handles=shroud,twitch" ``` **Response** ```json { "data": [ { "id": "37402112", "username": "shroud", "displayName": "shroud", "bio": "I'm back baby", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/c754eebf-745b-4e0a-814a-10bcaecaabbc-profile_image-300x300.png", "url": "https://www.twitch.tv/shroud", "verified": true, "private": false, "followers": 11286234, "following": null, "likes": null, "posts": 1624, "externalUrl": null, "createdAt": "2012-11-03T15:50:32.878Z", "ext": { "partner": true, "affiliate": false, "live": true, "bannerUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/dbee25e8-55b7-4565-87f0-e9d4661dcc66-profile_banner-480.jpeg", "offlineImageUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/0e68b939-5868-4ee5-b2b8-fdb51521c84d-channel_offline_image-1920x1080.jpeg", "color": "#00ADFF", "language": "EN", "links": [ { "name": "discord", "title": "Discord", "url": "https://discord.gg/shroud" }, { "name": "twitter", "title": "Twitter", "url": "https://twitter.com/shroud" }, { "name": "youtube", "title": "YouTube", "url": "https://youtube.com/shroud" } ], "panels": [ { "title": null, "description": null, "imageUrl": "https://panels.twitch.tv/panel-37402112-image-b4e05d8f-d6ac-44d4-bd27-ee2cc7f3c13a", "linkUrl": "https://load.gg/shroud-palworldocg" }, { "title": null, "description": null, "imageUrl": "https://panels.twitch.tv/panel-37402112-image-407517f5-8549-42ec-9433-d19837869c09", "linkUrl": "https://load.gg/shroudLogitech" }, { "title": null, "description": null, "imageUrl": "https://panels.twitch.tv/panel-37402112-image-503ca1b8-22d5-4eab-b610-e673c13860d8", "linkUrl": "https://www.youtube.com/shroud" } ], "team": { "name": "loadedllc", "displayName": "Loaded", "url": "https://www.twitch.tv/team/loadedllc" }, "lastLiveAt": "2026-11-25T17:38:22.069Z", "lastTitle": "day3.. we finally got lucia the real main character YAHOO!", "lastCategory": { "id": "1867279146", "name": "Grand Theft Auto VI", "slug": "grand-theft-auto-vi", "url": "https://www.twitch.tv/directory/category/grand-theft-auto-vi", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/1867279146_IGDB-285x380.jpg" }, "updatedAt": "2026-11-25T17:35:01.451Z" } }, { "id": "12826", "username": "twitch", "displayName": "Twitch", "bio": "Twitch is where thousands of communities come together for whatever, every day.", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/e437c251-ced5-476f-b3c6-fd6686c51550-profile_image-300x300.png", "url": "https://www.twitch.tv/twitch", "verified": true, "private": false, "followers": 2511426, "following": null, "likes": null, "posts": 1136, "externalUrl": null, "createdAt": "2007-05-22T10:39:54.238Z", "ext": { "partner": true, "affiliate": false, "live": false, "bannerUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/06dce325-ae71-46f9-8392-a35918c8a61a-profile_banner-480.png", "offlineImageUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/3f5f72bf-ae59-4470-8f8a-730d9ef87500-channel_offline_image-1920x1080.png", "color": "#5C16C5", "language": "EN", "links": [ { "name": "twitter", "title": "Twitter", "url": "https://twitter.com/twitch" }, { "name": "instagram", "title": "Instagram", "url": "https://www.instagram.com/twitch/" }, { "name": "tiktok", "title": "TikTok", "url": "https://www.tiktok.com/@twitch" } ], "panels": [ { "title": null, "description": null, "imageUrl": "https://panels.twitch.tv/panel-12826-image-67e1ff1f-483d-4af5-8240-2c9bb286872b", "linkUrl": "https://www.youtube.com/twitch" }, { "title": null, "description": null, "imageUrl": "https://panels.twitch.tv/panel-12826-image-693d22c1-92aa-4e0d-b872-d32c2e3412d5", "linkUrl": "https://twitter.com/Twitch" }, { "title": null, "description": null, "imageUrl": "https://panels.twitch.tv/panel-12826-image-d3ef4dcd-2fce-48c6-985f-fea065c26c95", "linkUrl": "https://www.instagram.com/twitch/" } ], "team": { "name": "twitchcon", "displayName": "TwitchCon San Diego 2026", "url": "https://www.twitch.tv/team/twitchcon" }, "lastLiveAt": "2026-11-18T11:03:47.255Z", "lastTitle": "GTAVI Countdown", "lastCategory": { "id": "1867279146", "name": "Grand Theft Auto VI", "slug": "grand-theft-auto-vi", "url": "https://www.twitch.tv/directory/category/grand-theft-auto-vi", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/1867279146_IGDB-285x380.jpg" }, "updatedAt": "2026-11-18T01:01:10.485Z" } } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/twitch/batch/profiles": { "get": { "tags": [ "Twitch" ], "summary": "Up to 50 channels at once, by their logins.", "description": "Each as `/profile` answers it; a login that names no channel is left out. 1 credit a\nchannel found (one served from the cache is free).", "operationId": "twitchBatchProfiles", "parameters": [ { "name": "handles", "in": "query", "description": "Channels' logins, comma-separated: up to 100 for `/batch/live`, 50 for\n`/batch/profiles`.", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_TwitchProfile" }, "example": { "data": [ { "id": "37402112", "username": "shroud", "displayName": "shroud", "bio": "I'm back baby", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/c754eebf-745b-4e0a-814a-10bcaecaabbc-profile_image-300x300.png", "url": "https://www.twitch.tv/shroud", "verified": true, "private": false, "followers": 11286234, "following": null, "likes": null, "posts": 1624, "externalUrl": null, "createdAt": "2012-11-03T15:50:32.878Z", "ext": { "partner": true, "affiliate": false, "live": true, "bannerUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/dbee25e8-55b7-4565-87f0-e9d4661dcc66-profile_banner-480.jpeg", "offlineImageUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/0e68b939-5868-4ee5-b2b8-fdb51521c84d-channel_offline_image-1920x1080.jpeg", "color": "#00ADFF", "language": "EN", "links": [ { "name": "discord", "title": "Discord", "url": "https://discord.gg/shroud" }, { "name": "twitter", "title": "Twitter", "url": "https://twitter.com/shroud" }, { "name": "youtube", "title": "YouTube", "url": "https://youtube.com/shroud" } ], "panels": [ { "title": null, "description": null, "imageUrl": "https://panels.twitch.tv/panel-37402112-image-b4e05d8f-d6ac-44d4-bd27-ee2cc7f3c13a", "linkUrl": "https://load.gg/shroud-palworldocg" }, { "title": null, "description": null, "imageUrl": "https://panels.twitch.tv/panel-37402112-image-407517f5-8549-42ec-9433-d19837869c09", "linkUrl": "https://load.gg/shroudLogitech" }, { "title": null, "description": null, "imageUrl": "https://panels.twitch.tv/panel-37402112-image-503ca1b8-22d5-4eab-b610-e673c13860d8", "linkUrl": "https://www.youtube.com/shroud" } ], "team": { "name": "loadedllc", "displayName": "Loaded", "url": "https://www.twitch.tv/team/loadedllc" }, "lastLiveAt": "2026-11-25T17:38:22.069Z", "lastTitle": "day3.. we finally got lucia the real main character YAHOO!", "lastCategory": { "id": "1867279146", "name": "Grand Theft Auto VI", "slug": "grand-theft-auto-vi", "url": "https://www.twitch.tv/directory/category/grand-theft-auto-vi", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/1867279146_IGDB-285x380.jpg" }, "updatedAt": "2026-11-25T17:35:01.451Z" } }, { "id": "12826", "username": "twitch", "displayName": "Twitch", "bio": "Twitch is where thousands of communities come together for whatever, every day.", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/e437c251-ced5-476f-b3c6-fd6686c51550-profile_image-300x300.png", "url": "https://www.twitch.tv/twitch", "verified": true, "private": false, "followers": 2511426, "following": null, "likes": null, "posts": 1136, "externalUrl": null, "createdAt": "2007-05-22T10:39:54.238Z", "ext": { "partner": true, "affiliate": false, "live": false, "bannerUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/06dce325-ae71-46f9-8392-a35918c8a61a-profile_banner-480.png", "offlineImageUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/3f5f72bf-ae59-4470-8f8a-730d9ef87500-channel_offline_image-1920x1080.png", "color": "#5C16C5", "language": "EN", "links": [ { "name": "twitter", "title": "Twitter", "url": "https://twitter.com/twitch" }, { "name": "instagram", "title": "Instagram", "url": "https://www.instagram.com/twitch/" }, { "name": "tiktok", "title": "TikTok", "url": "https://www.tiktok.com/@twitch" } ], "panels": [ { "title": null, "description": null, "imageUrl": "https://panels.twitch.tv/panel-12826-image-67e1ff1f-483d-4af5-8240-2c9bb286872b", "linkUrl": "https://www.youtube.com/twitch" }, { "title": null, "description": null, "imageUrl": "https://panels.twitch.tv/panel-12826-image-693d22c1-92aa-4e0d-b872-d32c2e3412d5", "linkUrl": "https://twitter.com/Twitch" }, { "title": null, "description": null, "imageUrl": "https://panels.twitch.tv/panel-12826-image-d3ef4dcd-2fce-48c6-985f-fea065c26c95", "linkUrl": "https://www.instagram.com/twitch/" } ], "team": { "name": "twitchcon", "displayName": "TwitchCon San Diego 2026", "url": "https://www.twitch.tv/team/twitchcon" }, "lastLiveAt": "2026-11-18T11:03:47.255Z", "lastTitle": "GTAVI Countdown", "lastCategory": { "id": "1867279146", "name": "Grand Theft Auto VI", "slug": "grand-theft-auto-vi", "url": "https://www.twitch.tv/directory/category/grand-theft-auto-vi", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/1867279146_IGDB-285x380.jpg" }, "updatedAt": "2026-11-18T01:01:10.485Z" } } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.twitch.batchProfiles({ handles: \"shroud,twitch\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.twitch.batch_profiles(handles=\"shroud,twitch\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/twitch/batch/profiles \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handles=shroud,twitch\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_TwitchProfile": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/TwitchProfile" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "TwitchProfile": { "allOf": [ { "type": "object", "description": "An account.", "required": [ "id", "username", "url", "verified", "private", "ext" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "bio": { "type": [ "string", "null" ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "displayName": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "partner", "affiliate", "live", "links", "panels" ], "properties": { "affiliate": { "type": "boolean", "description": "A Twitch Affiliate." }, "bannerUrl": { "type": [ "string", "null" ] }, "color": { "type": [ "string", "null" ], "description": "Its accent colour (`#00ADFF`)." }, "language": { "type": [ "string", "null" ], "description": "The language it broadcasts in (`EN`)." }, "lastCategory": { "oneOf": [ { "$ref": "#/components/schemas/TwitchCategoryRef" }, { "type": "null" } ] }, "lastLiveAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "When its latest broadcast began, its title and its category." }, { "type": "null" } ] }, "lastTitle": { "type": [ "string", "null" ] }, "links": { "type": "array", "items": { "$ref": "#/components/schemas/TwitchLink" }, "description": "The links it lists." }, "live": { "type": "boolean", "description": "On air now. `/v1/twitch/live` has the broadcast." }, "offlineImageUrl": { "type": [ "string", "null" ], "description": "The picture its player shows while it is off air." }, "panels": { "type": "array", "items": { "$ref": "#/components/schemas/TwitchPanel" }, "description": "The panels under its player." }, "partner": { "type": "boolean", "description": "A Twitch Partner (`verified` says the same)." }, "team": { "oneOf": [ { "$ref": "#/components/schemas/TwitchTeamRef" }, { "type": "null" } ] }, "updatedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] } } }, { "type": "object", "description": "What only this platform has." } ] }, "externalUrl": { "type": [ "string", "null" ], "description": "The link in the bio." }, "followers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "following": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "id": { "type": "string", "description": "The platform's id for the account." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "description": "Likes the account's posts received in total.", "minimum": 0 }, "posts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "private": { "type": "boolean" }, "url": { "type": "string", "description": "The profile's page." }, "username": { "type": "string", "description": "The handle, without `@`." }, "verified": { "type": "boolean" } } }, { "type": "object", "description": "A Twitch channel." } ] }, "Timestamp": { "type": "string", "format": "date-time" }, "TwitchTeamRef": { "type": "object", "description": "The team a channel shows on its page.", "required": [ "name", "url" ], "properties": { "displayName": { "type": [ "string", "null" ] }, "name": { "type": "string", "description": "The name in its link." }, "url": { "type": "string" } } }, "TwitchPanel": { "type": "object", "description": "A panel under a channel's player: a picture, a text, a link, any of them.", "properties": { "description": { "type": [ "string", "null" ] }, "imageUrl": { "type": [ "string", "null" ] }, "linkUrl": { "type": [ "string", "null" ] }, "title": { "type": [ "string", "null" ] } } }, "TwitchLink": { "type": "object", "description": "A link a channel lists.", "required": [ "url" ], "properties": { "name": { "type": [ "string", "null" ], "description": "What it links to, as Twitch names it (`discord`, `youtube`)." }, "title": { "type": [ "string", "null" ] }, "url": { "type": "string" } } }, "TwitchCategoryRef": { "type": "object", "description": "A category as a video, a clip, a broadcast or a channel names it.", "required": [ "id", "name" ], "properties": { "coverUrl": { "type": [ "string", "null" ], "description": "Its box art." }, "id": { "type": "string" }, "name": { "type": "string" }, "slug": { "type": [ "string", "null" ], "description": "The name in its link (`just-chatting`)." }, "url": { "type": [ "string", "null" ] } } } } } } ``` # Category Clips (/docs/api-reference/twitch/category-clips) A category's clips, most viewed first, 30 a page. `GET https://api.socialapi.sh/v1/twitch/category/clips` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.twitch.categoryClips({ slug: "just-chatting", period: "week" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.twitch.category_clips(slug="just-chatting", period="week") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/twitch/category/clips \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "slug=just-chatting" \ --data-urlencode "period=week" ``` **Response** ```json { "data": [ { "id": "TalentedKathishShrimpSaltBae-LIfHpO44k4jUFwp9", "url": "https://www.twitch.tv/nekoko88/clip/TalentedKathishShrimpSaltBae-LIfHpO44k4jUFwp9", "text": null, "createdAt": "2026-11-20T12:12:40.000Z", "author": { "id": "778750478", "username": "nekoko88", "displayName": "みけねこねここ", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/a277b71e-28ef-445b-a9f8-b7a624407651-profile_image-300x300.png", "verified": true, "url": "https://www.twitch.tv/nekoko88" }, "stats": { "views": 156709, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://d1ndex63qxojbr.cloudfront.net/nauth/126de74f-3917-4cc5-b19a-52a33add6212/landscape/h264/1080/index.mp4?sig=e37a6f3c6ff89e544fedd3e7a2c2aa03e4a7e061&token=%7B%22authorization%22%3A%7B%22forbidden%22%3Afalse%2C%22reason%22%3A%22%22%7D%2C%22clip_uri%22%3A%22https%3A%2F%2Fd1ndex63qxojbr.cloudfront.net%2Fnauth%2F126de74f-3917-4cc5-b19a-52a33add6212%2Flandscape%2Fh264%2F720%2Findex.mp4%22%2C%22clip_slug%22%3A%22TalentedKathishShrimpSaltBae-LIfHpO44k4jUFwp9%22%2C%22device_id%22%3A%22dzuv5s0195yqx92h8qb30uzc878xtic6%22%2C%22expires%22%3A1795706024%2C%22user_id%22%3A%22%22%2C%22version%22%3A3%7D", "thumbnailUrl": "https://static-cdn.jtvnw.net/twitch-video-assets/twitch-vap-video-assets-prod-us-west-2/126de74f-3917-4cc5-b19a-52a33add6212/landscape/thumb/thumb-0000000000-1920x1080.jpg", "width": null, "height": 1080, "durationSeconds": 5 } ], "hashtags": [], "mentions": [], "ext": { "kind": "clip", "title": "ぽよんぽよん", "category": { "id": "509658", "name": "Just Chatting", "slug": "just-chatting", "url": "https://www.twitch.tv/directory/category/just-chatting", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/509658-285x380.jpg" }, "language": "JA", "durationSeconds": 5, "recording": false, "chapters": [], "labels": [], "clipId": "3928991337", "curator": { "id": "546653203", "username": "energizingsnail", "displayName": "電傳蟲", "avatarUrl": "https://static-cdn.jtvnw.net/user-default-pictures-uv/75305d54-c7cc-40d1-bb9c-91fbe85943c7-profile_image-300x300.png", "verified": false, "url": "https://www.twitch.tv/energizingsnail" }, "videoId": "2934841286", "videoOffsetSeconds": 625, "featured": false } }, { "id": "BoldPiliableMinkCoolStoryBro-nDCcktLkOFAarmAm", "url": "https://www.twitch.tv/lacy/clip/BoldPiliableMinkCoolStoryBro-nDCcktLkOFAarmAm", "text": null, "createdAt": "2026-11-19T01:25:07.000Z", "author": { "id": "494543675", "username": "lacy", "displayName": "Lacy", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/48487d3b-e713-4a49-ad35-dec6ab7d690e-profile_image-300x300.png", "verified": true, "url": "https://www.twitch.tv/lacy" }, "stats": { "views": 110185, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://d1ndex63qxojbr.cloudfront.net/nauth/711b6e81-71ad-414e-b6bc-504df8c21663/landscape/h264/1080/index.mp4?sig=5343488bc808c56a9e7b0b881059b04093586192&token=%7B%22authorization%22%3A%7B%22forbidden%22%3Afalse%2C%22reason%22%3A%22%22%7D%2C%22clip_uri%22%3A%22https%3A%2F%2Fd1ndex63qxojbr.cloudfront.net%2Fnauth%2F711b6e81-71ad-414e-b6bc-504df8c21663%2Flandscape%2Fh264%2F720%2Findex.mp4%22%2C%22clip_slug%22%3A%22BoldPiliableMinkCoolStoryBro-nDCcktLkOFAarmAm%22%2C%22device_id%22%3A%22dzuv5s0195yqx92h8qb30uzc878xtic6%22%2C%22expires%22%3A1795706024%2C%22user_id%22%3A%22%22%2C%22version%22%3A3%7D", "thumbnailUrl": "https://static-cdn.jtvnw.net/twitch-video-assets/twitch-vap-video-assets-prod-us-west-2/711b6e81-71ad-414e-b6bc-504df8c21663/landscape/thumb/thumb-0000000000-1920x1080.jpg", "width": null, "height": 1080, "durationSeconds": 5 } ], "hashtags": [], "mentions": [], "ext": { "kind": "clip", "title": "SON...", "category": { "id": "509658", "name": "Just Chatting", "slug": "just-chatting", "url": "https://www.twitch.tv/directory/category/just-chatting", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/509658-285x380.jpg" }, "language": "EN", "durationSeconds": 5, "recording": false, "chapters": [], "labels": [], "clipId": "528367945", "curator": { "id": "765028907", "username": "renderagain", "displayName": "Renderagain", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/4d289bfd-2ca7-4362-b936-fef9421faaac-profile_image-300x300.png", "verified": false, "url": "https://www.twitch.tv/renderagain" }, "videoId": "2932194507", "videoOffsetSeconds": 54807, "featured": false } } ], "pagination": { "nextCursor": "MzA=", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/twitch/category/clips": { "get": { "tags": [ "Twitch" ], "summary": "A category's clips, most viewed first, 30 a page.", "description": "Over the last day, week, month or all time, by language if asked. 1 credit a page.", "operationId": "twitchCategoryClips", "parameters": [ { "name": "name", "in": "query", "description": "The category's name as written (`Just Chatting`).", "required": false, "schema": { "type": "string" } }, { "name": "slug", "in": "query", "description": "The name in its link (`just-chatting`), instead of `name`.", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "Its numeric id, instead of either.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "Its link, instead of any.", "required": false, "schema": { "type": "string" } }, { "name": "period", "in": "query", "description": "How far back: `day`, `week` (the default), `month` or `all`.", "required": false, "schema": { "type": "string", "description": "How far back a list of clips looks.", "enum": [ "day", "week", "month", "all" ] } }, { "name": "language", "in": "query", "description": "Only clips in this language (`en`, `tr`).", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_TwitchPost" }, "example": { "data": [ { "id": "TalentedKathishShrimpSaltBae-LIfHpO44k4jUFwp9", "url": "https://www.twitch.tv/nekoko88/clip/TalentedKathishShrimpSaltBae-LIfHpO44k4jUFwp9", "text": null, "createdAt": "2026-11-20T12:12:40.000Z", "author": { "id": "778750478", "username": "nekoko88", "displayName": "みけねこねここ", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/a277b71e-28ef-445b-a9f8-b7a624407651-profile_image-300x300.png", "verified": true, "url": "https://www.twitch.tv/nekoko88" }, "stats": { "views": 156709, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://d1ndex63qxojbr.cloudfront.net/nauth/126de74f-3917-4cc5-b19a-52a33add6212/landscape/h264/1080/index.mp4?sig=e37a6f3c6ff89e544fedd3e7a2c2aa03e4a7e061&token=%7B%22authorization%22%3A%7B%22forbidden%22%3Afalse%2C%22reason%22%3A%22%22%7D%2C%22clip_uri%22%3A%22https%3A%2F%2Fd1ndex63qxojbr.cloudfront.net%2Fnauth%2F126de74f-3917-4cc5-b19a-52a33add6212%2Flandscape%2Fh264%2F720%2Findex.mp4%22%2C%22clip_slug%22%3A%22TalentedKathishShrimpSaltBae-LIfHpO44k4jUFwp9%22%2C%22device_id%22%3A%22dzuv5s0195yqx92h8qb30uzc878xtic6%22%2C%22expires%22%3A1795706024%2C%22user_id%22%3A%22%22%2C%22version%22%3A3%7D", "thumbnailUrl": "https://static-cdn.jtvnw.net/twitch-video-assets/twitch-vap-video-assets-prod-us-west-2/126de74f-3917-4cc5-b19a-52a33add6212/landscape/thumb/thumb-0000000000-1920x1080.jpg", "width": null, "height": 1080, "durationSeconds": 5 } ], "hashtags": [], "mentions": [], "ext": { "kind": "clip", "title": "ぽよんぽよん", "category": { "id": "509658", "name": "Just Chatting", "slug": "just-chatting", "url": "https://www.twitch.tv/directory/category/just-chatting", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/509658-285x380.jpg" }, "language": "JA", "durationSeconds": 5, "recording": false, "chapters": [], "labels": [], "clipId": "3928991337", "curator": { "id": "546653203", "username": "energizingsnail", "displayName": "電傳蟲", "avatarUrl": "https://static-cdn.jtvnw.net/user-default-pictures-uv/75305d54-c7cc-40d1-bb9c-91fbe85943c7-profile_image-300x300.png", "verified": false, "url": "https://www.twitch.tv/energizingsnail" }, "videoId": "2934841286", "videoOffsetSeconds": 625, "featured": false } }, { "id": "BoldPiliableMinkCoolStoryBro-nDCcktLkOFAarmAm", "url": "https://www.twitch.tv/lacy/clip/BoldPiliableMinkCoolStoryBro-nDCcktLkOFAarmAm", "text": null, "createdAt": "2026-11-19T01:25:07.000Z", "author": { "id": "494543675", "username": "lacy", "displayName": "Lacy", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/48487d3b-e713-4a49-ad35-dec6ab7d690e-profile_image-300x300.png", "verified": true, "url": "https://www.twitch.tv/lacy" }, "stats": { "views": 110185, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://d1ndex63qxojbr.cloudfront.net/nauth/711b6e81-71ad-414e-b6bc-504df8c21663/landscape/h264/1080/index.mp4?sig=5343488bc808c56a9e7b0b881059b04093586192&token=%7B%22authorization%22%3A%7B%22forbidden%22%3Afalse%2C%22reason%22%3A%22%22%7D%2C%22clip_uri%22%3A%22https%3A%2F%2Fd1ndex63qxojbr.cloudfront.net%2Fnauth%2F711b6e81-71ad-414e-b6bc-504df8c21663%2Flandscape%2Fh264%2F720%2Findex.mp4%22%2C%22clip_slug%22%3A%22BoldPiliableMinkCoolStoryBro-nDCcktLkOFAarmAm%22%2C%22device_id%22%3A%22dzuv5s0195yqx92h8qb30uzc878xtic6%22%2C%22expires%22%3A1795706024%2C%22user_id%22%3A%22%22%2C%22version%22%3A3%7D", "thumbnailUrl": "https://static-cdn.jtvnw.net/twitch-video-assets/twitch-vap-video-assets-prod-us-west-2/711b6e81-71ad-414e-b6bc-504df8c21663/landscape/thumb/thumb-0000000000-1920x1080.jpg", "width": null, "height": 1080, "durationSeconds": 5 } ], "hashtags": [], "mentions": [], "ext": { "kind": "clip", "title": "SON...", "category": { "id": "509658", "name": "Just Chatting", "slug": "just-chatting", "url": "https://www.twitch.tv/directory/category/just-chatting", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/509658-285x380.jpg" }, "language": "EN", "durationSeconds": 5, "recording": false, "chapters": [], "labels": [], "clipId": "528367945", "curator": { "id": "765028907", "username": "renderagain", "displayName": "Renderagain", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/4d289bfd-2ca7-4362-b936-fef9421faaac-profile_image-300x300.png", "verified": false, "url": "https://www.twitch.tv/renderagain" }, "videoId": "2932194507", "videoOffsetSeconds": 54807, "featured": false } } ], "pagination": { "nextCursor": "MzA=", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.twitch.categoryClips({ slug: \"just-chatting\", period: \"week\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.twitch.category_clips(slug=\"just-chatting\", period=\"week\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/twitch/category/clips \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"slug=just-chatting\" \\\n --data-urlencode \"period=week\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_TwitchPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/TwitchPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "TwitchPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "kind", "recording", "chapters", "labels", "featured" ], "properties": { "category": { "oneOf": [ { "$ref": "#/components/schemas/TwitchCategoryRef" }, { "type": "null" } ] }, "chapters": { "type": "array", "items": { "$ref": "#/components/schemas/TwitchChapter" }, "description": "A video's chapters; on `/post` only." }, "clipId": { "type": [ "string", "null" ], "description": "A clip's numeric id (its `id` is the name in its link)." }, "curator": { "oneOf": [ { "$ref": "#/components/schemas/Author", "description": "Who cut the clip." }, { "type": "null" } ] }, "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "featured": { "type": "boolean", "description": "A clip its channel features." }, "kind": { "$ref": "#/components/schemas/TwitchPostKind" }, "labels": { "type": "array", "items": { "type": "string" }, "description": "Twitch's content labels (`MatureGame`, `ProfanityVulgarity`)." }, "language": { "type": [ "string", "null" ], "description": "The language (`en`)." }, "recording": { "type": "boolean", "description": "A broadcast still on air: its video is being recorded, and grows." }, "title": { "type": [ "string", "null" ], "description": "The title (`text` is a video's description, which few have)." }, "videoId": { "type": [ "string", "null" ], "description": "The video a clip was cut from, and where in it, in seconds." }, "videoOffsetSeconds": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A video (a past broadcast, a highlight, an upload) or a clip." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "TwitchPostKind": { "type": "string", "description": "What a post is.", "enum": [ "archive", "highlight", "upload", "premiere", "clip" ] }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } }, "TwitchChapter": { "type": "object", "description": "A chapter of a video: a stretch of the broadcast in one category.", "required": [ "title", "startSeconds", "durationSeconds" ], "properties": { "category": { "oneOf": [ { "$ref": "#/components/schemas/TwitchCategoryRef" }, { "type": "null" } ] }, "durationSeconds": { "type": "integer", "format": "int64", "minimum": 0 }, "startSeconds": { "type": "integer", "format": "int64", "minimum": 0 }, "title": { "type": "string" } } }, "TwitchCategoryRef": { "type": "object", "description": "A category as a video, a clip, a broadcast or a channel names it.", "required": [ "id", "name" ], "properties": { "coverUrl": { "type": [ "string", "null" ], "description": "Its box art." }, "id": { "type": "string" }, "name": { "type": "string" }, "slug": { "type": [ "string", "null" ], "description": "The name in its link (`just-chatting`)." }, "url": { "type": [ "string", "null" ] } } }, "Timestamp": { "type": "string", "format": "date-time" } } } } ``` # Category Lives (/docs/api-reference/twitch/category-lives) A category's live channels, most watched first. `GET https://api.socialapi.sh/v1/twitch/category/lives` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.twitch.categoryLives({ slug: "just-chatting" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.twitch.category_lives(slug="just-chatting") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/twitch/category/lives \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "slug=just-chatting" ``` **Response** ```json { "data": [ { "live": true, "roomId": "319487525605", "title": "😎🤙🏿 провожаем пузатую шалупонь в 161616 + vidigame on computer", "viewers": 32486, "startedAt": "2026-11-25T17:03:59.000Z", "coverUrl": "https://static-cdn.jtvnw.net/previews-ttv/live_user_dangerlyoha-1280x720.jpg", "host": { "id": "402093335", "username": "dangerlyoha", "displayName": "dangerlyoha", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/85b8bdfa-f8ed-4b8f-ac26-0bf7439cd115-profile_image-300x300.png", "verified": true, "url": "https://www.twitch.tv/dangerlyoha" }, "ext": { "category": { "id": "509658", "name": "Just Chatting", "slug": "just-chatting", "url": "https://www.twitch.tv/directory/category/just-chatting", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/509658-285x380.jpg" }, "language": "EN", "tags": [ "Русский", "DropsВключены" ], "labels": [], "rerun": false, "chatters": null, "videoId": "2940471163", "fps": 60, "width": 1920, "height": 1080, "lastLiveAt": "2026-11-25T17:03:59.000Z" } }, { "live": true, "roomId": "321297480286", "title": "[DROPS ON] UNBANNED GTA 6 RELEASE STREAM FOREVER WOW BIG DAY HUGE DRAMA NEW GAMES BIG NEWS !restedXP | @asmongold247", "viewers": 31943, "startedAt": "2026-11-25T18:34:55.000Z", "coverUrl": "https://static-cdn.jtvnw.net/previews-ttv/live_user_zackrawrr-1280x720.jpg", "host": { "id": "552120296", "username": "zackrawrr", "displayName": "zackrawrr", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/a9ce83ba-c0bd-49cc-83bd-9d17647a211a-profile_image-300x300.png", "verified": true, "url": "https://www.twitch.tv/zackrawrr" }, "ext": { "category": { "id": "509658", "name": "Just Chatting", "slug": "just-chatting", "url": "https://www.twitch.tv/directory/category/just-chatting", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/509658-285x380.jpg" }, "language": "EN", "tags": [ "English", "politics", "bald" ], "labels": [ "DebatedSocialIssuesAndPolitics" ], "rerun": false, "chatters": null, "videoId": "2940553066", "fps": 60, "width": 1920, "height": 1080, "lastLiveAt": "2026-11-25T18:34:55.000Z" } } ], "pagination": { "nextCursor": "eyJzIjoxMjUwLjgwMzI5Njk5MDY0NywiZCI6ZmFsc2UsInQiOnRydWV9", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/twitch/category/lives": { "get": { "tags": [ "Twitch" ], "summary": "A category's live channels, most watched first.", "description": "30 a page, by language or tag if asked. 1 credit a page.", "operationId": "twitchCategoryLives", "parameters": [ { "name": "name", "in": "query", "description": "The category's name as written (`Just Chatting`).", "required": false, "schema": { "type": "string" } }, { "name": "slug", "in": "query", "description": "The name in its link (`just-chatting`), instead of `name`.", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "Its numeric id, instead of either.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "Its link, instead of any.", "required": false, "schema": { "type": "string" } }, { "name": "language", "in": "query", "description": "Only channels broadcasting in this language (`en`, `tr`).", "required": false, "schema": { "type": "string" } }, { "name": "tag", "in": "query", "description": "Only broadcasts with this tag (`DropsEnabled`).", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_TwitchLive" }, "example": { "data": [ { "live": true, "roomId": "319487525605", "title": "😎🤙🏿 провожаем пузатую шалупонь в 161616 + vidigame on computer", "viewers": 32486, "startedAt": "2026-11-25T17:03:59.000Z", "coverUrl": "https://static-cdn.jtvnw.net/previews-ttv/live_user_dangerlyoha-1280x720.jpg", "host": { "id": "402093335", "username": "dangerlyoha", "displayName": "dangerlyoha", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/85b8bdfa-f8ed-4b8f-ac26-0bf7439cd115-profile_image-300x300.png", "verified": true, "url": "https://www.twitch.tv/dangerlyoha" }, "ext": { "category": { "id": "509658", "name": "Just Chatting", "slug": "just-chatting", "url": "https://www.twitch.tv/directory/category/just-chatting", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/509658-285x380.jpg" }, "language": "EN", "tags": [ "Русский", "DropsВключены" ], "labels": [], "rerun": false, "chatters": null, "videoId": "2940471163", "fps": 60, "width": 1920, "height": 1080, "lastLiveAt": "2026-11-25T17:03:59.000Z" } }, { "live": true, "roomId": "321297480286", "title": "[DROPS ON] UNBANNED GTA 6 RELEASE STREAM FOREVER WOW BIG DAY HUGE DRAMA NEW GAMES BIG NEWS !restedXP | @asmongold247", "viewers": 31943, "startedAt": "2026-11-25T18:34:55.000Z", "coverUrl": "https://static-cdn.jtvnw.net/previews-ttv/live_user_zackrawrr-1280x720.jpg", "host": { "id": "552120296", "username": "zackrawrr", "displayName": "zackrawrr", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/a9ce83ba-c0bd-49cc-83bd-9d17647a211a-profile_image-300x300.png", "verified": true, "url": "https://www.twitch.tv/zackrawrr" }, "ext": { "category": { "id": "509658", "name": "Just Chatting", "slug": "just-chatting", "url": "https://www.twitch.tv/directory/category/just-chatting", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/509658-285x380.jpg" }, "language": "EN", "tags": [ "English", "politics", "bald" ], "labels": [ "DebatedSocialIssuesAndPolitics" ], "rerun": false, "chatters": null, "videoId": "2940553066", "fps": 60, "width": 1920, "height": 1080, "lastLiveAt": "2026-11-25T18:34:55.000Z" } } ], "pagination": { "nextCursor": "eyJzIjoxMjUwLjgwMzI5Njk5MDY0NywiZCI6ZmFsc2UsInQiOnRydWV9", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.twitch.categoryLives({ slug: \"just-chatting\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.twitch.category_lives(slug=\"just-chatting\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/twitch/category/lives \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"slug=just-chatting\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_TwitchLive": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/TwitchLive" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "TwitchLive": { "allOf": [ { "type": "object", "description": "An account's live broadcast.", "required": [ "live", "ext" ], "properties": { "coverUrl": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "tags", "labels", "rerun" ], "properties": { "category": { "oneOf": [ { "$ref": "#/components/schemas/TwitchCategoryRef" }, { "type": "null" } ] }, "chatters": { "type": [ "integer", "null" ], "format": "int64", "description": "Accounts in the chat now; on `/live` and `/batch/live` only.", "minimum": 0 }, "fps": { "type": [ "number", "null" ], "format": "double", "description": "The picture's frame rate and size." }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "labels": { "type": "array", "items": { "type": "string" }, "description": "Twitch's content labels (`MatureGame`)." }, "language": { "type": [ "string", "null" ], "description": "The broadcast's language (`EN`)." }, "lastLiveAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "When the channel's latest broadcast began: this one's, or the last when off air." }, { "type": "null" } ] }, "rerun": { "type": "boolean", "description": "A past broadcast shown again, rather than a live one." }, "tags": { "type": "array", "items": { "type": "string" }, "description": "The tags the channel gave the broadcast." }, "videoId": { "type": [ "string", "null" ], "description": "The video the broadcast is being recorded to." }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, { "type": "object", "description": "What only this platform has." } ] }, "host": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "live": { "type": "boolean" }, "roomId": { "type": [ "string", "null" ] }, "startedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "title": { "type": [ "string", "null" ] }, "viewers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, { "type": "object", "description": "A channel's live status, with its broadcast when it is on." } ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } }, "TwitchCategoryRef": { "type": "object", "description": "A category as a video, a clip, a broadcast or a channel names it.", "required": [ "id", "name" ], "properties": { "coverUrl": { "type": [ "string", "null" ], "description": "Its box art." }, "id": { "type": "string" }, "name": { "type": "string" }, "slug": { "type": [ "string", "null" ], "description": "The name in its link (`just-chatting`)." }, "url": { "type": [ "string", "null" ] } } } } } } ``` # Category Posts (/docs/api-reference/twitch/category-posts) A category's videos, 30 a page. `GET https://api.socialapi.sh/v1/twitch/category/posts` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.twitch.categoryPosts({ slug: "just-chatting" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.twitch.category_posts(slug="just-chatting") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/twitch/category/posts \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "slug=just-chatting" ``` **Response** ```json { "data": [ { "id": "2932628190", "url": "https://www.twitch.tv/videos/2932628190", "text": null, "createdAt": "2026-11-18T19:37:03.000Z", "author": { "id": "267160288", "username": "caseoh_", "displayName": "caseoh_", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/ef28ba12-c8ed-46d4-838b-a4c95ef5b469-profile_image-300x300.png", "verified": true, "url": "https://www.twitch.tv/caseoh_" }, "stats": { "views": 4828002, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://static-cdn.jtvnw.net/cf_vods/d2nvs31859zcd8/99dde58846fd9b6cf4c4_caseoh__317912867703_1795030618//thumb/thumb0-640x360.jpg", "width": null, "height": null, "durationSeconds": 52101 } ], "hashtags": [], "mentions": [], "ext": { "kind": "archive", "title": "🟨LOSING MY MIND🟨", "category": { "id": "509658", "name": "Just Chatting", "slug": "just-chatting", "url": "https://www.twitch.tv/directory/category/just-chatting", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/509658-285x380.jpg" }, "language": "en", "durationSeconds": 52101, "recording": false, "chapters": [], "labels": [ "MatureGame" ], "clipId": null, "curator": null, "videoId": null, "videoOffsetSeconds": null, "featured": false } }, { "id": "2932698524", "url": "https://www.twitch.tv/videos/2932698524", "text": null, "createdAt": "2026-11-18T20:52:44.000Z", "author": { "id": "459331509", "username": "auronplay", "displayName": "auronplay", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/1165c917-6c34-4179-8d24-8667f59eb179-profile_image-300x300.png", "verified": true, "url": "https://www.twitch.tv/auronplay" }, "stats": { "views": 4178721, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://static-cdn.jtvnw.net/cf_vods/d2nvs31859zcd8/f453174986a1ba10d695_auronplay_318387433955_1795035156/thumb/custom-32b193a1-318e-4e9d-a150-7caeb830a47e-640x360.jpeg", "width": null, "height": null, "durationSeconds": 20940 } ], "hashtags": [], "mentions": [], "ext": { "kind": "archive", "title": "🚨 !DROPS ON 🌴 GTA VI DESDE PS5 PRO 🌴ESTUVE ESPERANDO 13 AÑOS POR ESTE MOMENTO 🌴", "category": { "id": "509658", "name": "Just Chatting", "slug": "just-chatting", "url": "https://www.twitch.tv/directory/category/just-chatting", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/509658-285x380.jpg" }, "language": "es", "durationSeconds": 20940, "recording": false, "chapters": [], "labels": [ "MatureGame" ], "clipId": null, "curator": null, "videoId": null, "videoOffsetSeconds": null, "featured": false } } ], "pagination": { "nextCursor": "2934910069|1232419|2026-11-20T13:40:11Z|70709", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/twitch/category/posts": { "get": { "tags": [ "Twitch" ], "summary": "A category's videos, 30 a page.", "description": "Most viewed or newest first, by language if asked. 1 credit a page.", "operationId": "twitchCategoryPosts", "parameters": [ { "name": "name", "in": "query", "description": "The category's name as written (`Just Chatting`).", "required": false, "schema": { "type": "string" } }, { "name": "slug", "in": "query", "description": "The name in its link (`just-chatting`), instead of `name`.", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "Its numeric id, instead of either.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "Its link, instead of any.", "required": false, "schema": { "type": "string" } }, { "name": "sort", "in": "query", "description": "`views` (the default) or `latest`.", "required": false, "schema": { "type": "string", "description": "How a list of videos is ordered.", "enum": [ "latest", "views" ] } }, { "name": "language", "in": "query", "description": "Only videos in this language (`en`, `tr`).", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_TwitchPost" }, "example": { "data": [ { "id": "2932628190", "url": "https://www.twitch.tv/videos/2932628190", "text": null, "createdAt": "2026-11-18T19:37:03.000Z", "author": { "id": "267160288", "username": "caseoh_", "displayName": "caseoh_", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/ef28ba12-c8ed-46d4-838b-a4c95ef5b469-profile_image-300x300.png", "verified": true, "url": "https://www.twitch.tv/caseoh_" }, "stats": { "views": 4828002, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://static-cdn.jtvnw.net/cf_vods/d2nvs31859zcd8/99dde58846fd9b6cf4c4_caseoh__317912867703_1795030618//thumb/thumb0-640x360.jpg", "width": null, "height": null, "durationSeconds": 52101 } ], "hashtags": [], "mentions": [], "ext": { "kind": "archive", "title": "🟨LOSING MY MIND🟨", "category": { "id": "509658", "name": "Just Chatting", "slug": "just-chatting", "url": "https://www.twitch.tv/directory/category/just-chatting", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/509658-285x380.jpg" }, "language": "en", "durationSeconds": 52101, "recording": false, "chapters": [], "labels": [ "MatureGame" ], "clipId": null, "curator": null, "videoId": null, "videoOffsetSeconds": null, "featured": false } }, { "id": "2932698524", "url": "https://www.twitch.tv/videos/2932698524", "text": null, "createdAt": "2026-11-18T20:52:44.000Z", "author": { "id": "459331509", "username": "auronplay", "displayName": "auronplay", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/1165c917-6c34-4179-8d24-8667f59eb179-profile_image-300x300.png", "verified": true, "url": "https://www.twitch.tv/auronplay" }, "stats": { "views": 4178721, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://static-cdn.jtvnw.net/cf_vods/d2nvs31859zcd8/f453174986a1ba10d695_auronplay_318387433955_1795035156/thumb/custom-32b193a1-318e-4e9d-a150-7caeb830a47e-640x360.jpeg", "width": null, "height": null, "durationSeconds": 20940 } ], "hashtags": [], "mentions": [], "ext": { "kind": "archive", "title": "🚨 !DROPS ON 🌴 GTA VI DESDE PS5 PRO 🌴ESTUVE ESPERANDO 13 AÑOS POR ESTE MOMENTO 🌴", "category": { "id": "509658", "name": "Just Chatting", "slug": "just-chatting", "url": "https://www.twitch.tv/directory/category/just-chatting", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/509658-285x380.jpg" }, "language": "es", "durationSeconds": 20940, "recording": false, "chapters": [], "labels": [ "MatureGame" ], "clipId": null, "curator": null, "videoId": null, "videoOffsetSeconds": null, "featured": false } } ], "pagination": { "nextCursor": "2934910069|1232419|2026-11-20T13:40:11Z|70709", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.twitch.categoryPosts({ slug: \"just-chatting\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.twitch.category_posts(slug=\"just-chatting\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/twitch/category/posts \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"slug=just-chatting\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_TwitchPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/TwitchPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "TwitchPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "kind", "recording", "chapters", "labels", "featured" ], "properties": { "category": { "oneOf": [ { "$ref": "#/components/schemas/TwitchCategoryRef" }, { "type": "null" } ] }, "chapters": { "type": "array", "items": { "$ref": "#/components/schemas/TwitchChapter" }, "description": "A video's chapters; on `/post` only." }, "clipId": { "type": [ "string", "null" ], "description": "A clip's numeric id (its `id` is the name in its link)." }, "curator": { "oneOf": [ { "$ref": "#/components/schemas/Author", "description": "Who cut the clip." }, { "type": "null" } ] }, "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "featured": { "type": "boolean", "description": "A clip its channel features." }, "kind": { "$ref": "#/components/schemas/TwitchPostKind" }, "labels": { "type": "array", "items": { "type": "string" }, "description": "Twitch's content labels (`MatureGame`, `ProfanityVulgarity`)." }, "language": { "type": [ "string", "null" ], "description": "The language (`en`)." }, "recording": { "type": "boolean", "description": "A broadcast still on air: its video is being recorded, and grows." }, "title": { "type": [ "string", "null" ], "description": "The title (`text` is a video's description, which few have)." }, "videoId": { "type": [ "string", "null" ], "description": "The video a clip was cut from, and where in it, in seconds." }, "videoOffsetSeconds": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A video (a past broadcast, a highlight, an upload) or a clip." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "TwitchPostKind": { "type": "string", "description": "What a post is.", "enum": [ "archive", "highlight", "upload", "premiere", "clip" ] }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } }, "TwitchChapter": { "type": "object", "description": "A chapter of a video: a stretch of the broadcast in one category.", "required": [ "title", "startSeconds", "durationSeconds" ], "properties": { "category": { "oneOf": [ { "$ref": "#/components/schemas/TwitchCategoryRef" }, { "type": "null" } ] }, "durationSeconds": { "type": "integer", "format": "int64", "minimum": 0 }, "startSeconds": { "type": "integer", "format": "int64", "minimum": 0 }, "title": { "type": "string" } } }, "TwitchCategoryRef": { "type": "object", "description": "A category as a video, a clip, a broadcast or a channel names it.", "required": [ "id", "name" ], "properties": { "coverUrl": { "type": [ "string", "null" ], "description": "Its box art." }, "id": { "type": "string" }, "name": { "type": "string" }, "slug": { "type": [ "string", "null" ], "description": "The name in its link (`just-chatting`)." }, "url": { "type": [ "string", "null" ] } } }, "Timestamp": { "type": "string", "format": "date-time" } } } } ``` # Category (/docs/api-reference/twitch/category) A category with its viewers, channels and followers. `GET https://api.socialapi.sh/v1/twitch/category` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.twitch.category({ name: "Just Chatting" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.twitch.category(name="Just Chatting").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/twitch/category \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "name=Just Chatting" ``` **Response** ```json { "data": { "id": "509658", "name": "Just Chatting", "slug": "just-chatting", "url": "https://www.twitch.tv/directory/category/just-chatting", "description": null, "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/509658-285x380.jpg", "viewers": 415470, "channels": 5834, "followers": 53355320, "tags": [ "IRL" ] } } ``` **OpenAPI** ```json { "paths": { "/v1/twitch/category": { "get": { "tags": [ "Twitch" ], "summary": "A category with its viewers, channels and followers.", "description": "A game, or a kind of broadcast such as Just Chatting, with its description, box art and\ngenres. 1 credit.", "operationId": "twitchCategory", "parameters": [ { "name": "name", "in": "query", "description": "The category's name as written (`Just Chatting`).", "required": false, "schema": { "type": "string" } }, { "name": "slug", "in": "query", "description": "The name in its link (`just-chatting`), instead of `name`.", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "Its numeric id, instead of either.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "Its link (`https://www.twitch.tv/directory/category/just-chatting`), instead of any.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_TwitchCategory" }, "example": { "data": { "id": "509658", "name": "Just Chatting", "slug": "just-chatting", "url": "https://www.twitch.tv/directory/category/just-chatting", "description": null, "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/509658-285x380.jpg", "viewers": 415470, "channels": 5834, "followers": 53355320, "tags": [ "IRL" ] } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.twitch.category({ name: \"Just Chatting\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.twitch.category(name=\"Just Chatting\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/twitch/category \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"name=Just Chatting\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_TwitchCategory": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/TwitchCategory" } } }, "TwitchCategory": { "type": "object", "description": "A category: a game, or a kind of broadcast such as Just Chatting.", "required": [ "id", "name", "tags" ], "properties": { "channels": { "type": [ "integer", "null" ], "format": "int64", "description": "Channels broadcasting it now.", "minimum": 0 }, "coverUrl": { "type": [ "string", "null" ], "description": "Its box art." }, "description": { "type": [ "string", "null" ] }, "followers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "id": { "type": "string" }, "name": { "type": "string" }, "slug": { "type": [ "string", "null" ], "description": "The name in its link (`just-chatting`)." }, "tags": { "type": "array", "items": { "type": "string" }, "description": "Twitch's genres for it (`Simulation`, `IRL`)." }, "url": { "type": [ "string", "null" ] }, "viewers": { "type": [ "integer", "null" ], "format": "int64", "description": "People watching it now.", "minimum": 0 } } } } } } ``` # Twitch API (/docs/api-reference/twitch) Every Twitch endpoint, by group. Each is a `GET` under `/v1/twitch`. ## Quick Reference [#quick-reference] | Property | Value | | --- | --- | | Base path | `/v1/twitch` | | Endpoints | 20 | | Credits | 1 a call | | Guide | [Twitch](/docs/twitch) | ## Accounts [#accounts] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/twitch/profile`](/docs/api-reference/twitch/profile) | A channel with its follower count and links. | 1 | | [`GET /v1/twitch/profile/clips`](/docs/api-reference/twitch/profile-clips) | A channel's clips, most viewed first, 30 a page. | 1 | | [`GET /v1/twitch/profile/posts`](/docs/api-reference/twitch/profile-posts) | A channel's videos, 30 a page. | 1 | | [`GET /v1/twitch/profile/schedule`](/docs/api-reference/twitch/profile-schedule) | A channel's coming broadcasts, 30 a page. | 1 | | [`GET /v1/twitch/live`](/docs/api-reference/twitch/live) | Whether a channel is live, with its broadcast. | 1 | ## Posts [#posts] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/twitch/post`](/docs/api-reference/twitch/post) | One video or clip with its views and a link to play it. | 1 | | [`GET /v1/twitch/post/comments`](/docs/api-reference/twitch/post-comments) | A video's chat replay, about 60 messages a page. | 1 | ## Categories [#categories] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/twitch/category`](/docs/api-reference/twitch/category) | A category with its viewers, channels and followers. | 1 | | [`GET /v1/twitch/category/clips`](/docs/api-reference/twitch/category-clips) | A category's clips, most viewed first, 30 a page. | 1 | | [`GET /v1/twitch/category/lives`](/docs/api-reference/twitch/category-lives) | A category's live channels, most watched first. | 1 | | [`GET /v1/twitch/category/posts`](/docs/api-reference/twitch/category-posts) | A category's videos, 30 a page. | 1 | ## Discovery [#discovery] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/twitch/search`](/docs/api-reference/twitch/search) | Videos matching a query, 20 a page. | 1 | | [`GET /v1/twitch/search/categories`](/docs/api-reference/twitch/search-categories) | Categories matching a query, 30 a page. | 1 | | [`GET /v1/twitch/search/lives`](/docs/api-reference/twitch/search-lives) | Live channels matching a query, 30 a page. | 1 | | [`GET /v1/twitch/search/suggestions`](/docs/api-reference/twitch/search-suggestions) | What the search box suggests for a few letters. | 1 | | [`GET /v1/twitch/search/users`](/docs/api-reference/twitch/search-users) | Channels matching a query, 30 a page. | 1 | | [`GET /v1/twitch/trending`](/docs/api-reference/twitch/trending) | The live channels most watched now, 30 a page. | 1 | | [`GET /v1/twitch/trending/categories`](/docs/api-reference/twitch/trending-categories) | The categories most watched now, 30 a page. | 1 | ## Batch [#batch] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/twitch/batch/live`](/docs/api-reference/twitch/batch-live) | Up to 100 channels' live status at once. | 1 | | [`GET /v1/twitch/batch/profiles`](/docs/api-reference/twitch/batch-profiles) | Up to 50 channels at once, by their logins. | 1 | ## Example Request [#example-request] Every Twitch endpoint is called this way: its path, and what to read as query parameters. **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.twitch.profile({ handle: "shroud" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.twitch.profile(handle="shroud").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/twitch/profile \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=shroud" ``` **Response** ```json { "data": { "id": "37402112", "username": "shroud", "displayName": "shroud", "bio": "I'm back baby", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/c754eebf-745b-4e0a-814a-10bcaecaabbc-profile_image-300x300.png", "url": "https://www.twitch.tv/shroud", "verified": true, "private": false, "followers": 11286234, "following": null, "likes": null, "posts": 1624, "externalUrl": null, "createdAt": "2012-11-03T15:50:32.878Z", "ext": { "partner": true, "affiliate": false, "live": true, "bannerUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/dbee25e8-55b7-4565-87f0-e9d4661dcc66-profile_banner-480.jpeg", "offlineImageUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/0e68b939-5868-4ee5-b2b8-fdb51521c84d-channel_offline_image-1920x1080.jpeg", "color": "#00ADFF", "language": "EN", "links": [ { "name": "discord", "title": "Discord", "url": "https://discord.gg/shroud" }, { "name": "twitter", "title": "Twitter", "url": "https://twitter.com/shroud" }, { "name": "youtube", "title": "YouTube", "url": "https://youtube.com/shroud" } ], "panels": [ { "title": null, "description": null, "imageUrl": "https://panels.twitch.tv/panel-37402112-image-b4e05d8f-d6ac-44d4-bd27-ee2cc7f3c13a", "linkUrl": "https://load.gg/shroud-palworldocg" }, { "title": null, "description": null, "imageUrl": "https://panels.twitch.tv/panel-37402112-image-407517f5-8549-42ec-9433-d19837869c09", "linkUrl": "https://load.gg/shroudLogitech" }, { "title": null, "description": null, "imageUrl": "https://panels.twitch.tv/panel-37402112-image-503ca1b8-22d5-4eab-b610-e673c13860d8", "linkUrl": "https://www.youtube.com/shroud" } ], "team": { "name": "loadedllc", "displayName": "Loaded", "url": "https://www.twitch.tv/team/loadedllc" }, "lastLiveAt": "2026-11-25T17:38:22.069Z", "lastTitle": "day3.. we finally got lucia the real main character YAHOO!", "lastCategory": { "id": "1867279146", "name": "Grand Theft Auto VI", "slug": "grand-theft-auto-vi", "url": "https://www.twitch.tv/directory/category/grand-theft-auto-vi", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/1867279146_IGDB-285x380.jpg" }, "updatedAt": "2026-11-25T17:35:01.451Z" } } } ``` ## Errors [#errors] A call that fails costs nothing. See [Errors](/docs/errors) for every code. # Live (/docs/api-reference/twitch/live) Whether a channel is live, with its broadcast. `GET https://api.socialapi.sh/v1/twitch/live` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.twitch.live({ handle: "shroud" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.twitch.live(handle="shroud").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/twitch/live \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=shroud" ``` **Response** ```json { "data": { "live": true, "roomId": "321358163420", "title": "day3.. we finally got lucia the real main character YAHOO!", "viewers": 5445, "startedAt": "2026-11-25T17:38:16.000Z", "coverUrl": "https://static-cdn.jtvnw.net/previews-ttv/live_user_shroud-1280x720.jpg", "host": { "id": "37402112", "username": "shroud", "displayName": "shroud", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/c754eebf-745b-4e0a-814a-10bcaecaabbc-profile_image-300x300.png", "verified": true, "url": "https://www.twitch.tv/shroud" }, "ext": { "category": { "id": "1867279146", "name": "Grand Theft Auto VI", "slug": "grand-theft-auto-vi", "url": "https://www.twitch.tv/directory/category/grand-theft-auto-vi", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/1867279146_IGDB-285x380.jpg" }, "language": "EN", "tags": [ "English", "DropsEnabled" ], "labels": [ "MatureGame" ], "rerun": false, "chatters": 4472, "videoId": "2940500640", "fps": 60, "width": 2560, "height": 1440, "lastLiveAt": "2026-11-25T17:38:22.069Z" } } } ``` **OpenAPI** ```json { "paths": { "/v1/twitch/live": { "get": { "tags": [ "Twitch" ], "summary": "Whether a channel is live, with its broadcast.", "description": "Title, category, viewers, accounts in chat, start time, language, tags and a preview\npicture while it is on air; the title and category it is set to, and when it last was,\nwhile it is off. Cached a minute. 1 credit.", "operationId": "twitchLive", "parameters": [ { "name": "handle", "in": "query", "description": "The channel's login: the name in its link.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "The channel's link (`https://www.twitch.tv/shroud`), instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The channel's numeric id, instead of either.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_TwitchLive" }, "example": { "data": { "live": true, "roomId": "321358163420", "title": "day3.. we finally got lucia the real main character YAHOO!", "viewers": 5445, "startedAt": "2026-11-25T17:38:16.000Z", "coverUrl": "https://static-cdn.jtvnw.net/previews-ttv/live_user_shroud-1280x720.jpg", "host": { "id": "37402112", "username": "shroud", "displayName": "shroud", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/c754eebf-745b-4e0a-814a-10bcaecaabbc-profile_image-300x300.png", "verified": true, "url": "https://www.twitch.tv/shroud" }, "ext": { "category": { "id": "1867279146", "name": "Grand Theft Auto VI", "slug": "grand-theft-auto-vi", "url": "https://www.twitch.tv/directory/category/grand-theft-auto-vi", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/1867279146_IGDB-285x380.jpg" }, "language": "EN", "tags": [ "English", "DropsEnabled" ], "labels": [ "MatureGame" ], "rerun": false, "chatters": 4472, "videoId": "2940500640", "fps": 60, "width": 2560, "height": 1440, "lastLiveAt": "2026-11-25T17:38:22.069Z" } } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.twitch.live({ handle: \"shroud\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.twitch.live(handle=\"shroud\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/twitch/live \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=shroud\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_TwitchLive": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/TwitchLive" } } }, "TwitchLive": { "allOf": [ { "type": "object", "description": "An account's live broadcast.", "required": [ "live", "ext" ], "properties": { "coverUrl": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "tags", "labels", "rerun" ], "properties": { "category": { "oneOf": [ { "$ref": "#/components/schemas/TwitchCategoryRef" }, { "type": "null" } ] }, "chatters": { "type": [ "integer", "null" ], "format": "int64", "description": "Accounts in the chat now; on `/live` and `/batch/live` only.", "minimum": 0 }, "fps": { "type": [ "number", "null" ], "format": "double", "description": "The picture's frame rate and size." }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "labels": { "type": "array", "items": { "type": "string" }, "description": "Twitch's content labels (`MatureGame`)." }, "language": { "type": [ "string", "null" ], "description": "The broadcast's language (`EN`)." }, "lastLiveAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "When the channel's latest broadcast began: this one's, or the last when off air." }, { "type": "null" } ] }, "rerun": { "type": "boolean", "description": "A past broadcast shown again, rather than a live one." }, "tags": { "type": "array", "items": { "type": "string" }, "description": "The tags the channel gave the broadcast." }, "videoId": { "type": [ "string", "null" ], "description": "The video the broadcast is being recorded to." }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, { "type": "object", "description": "What only this platform has." } ] }, "host": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "live": { "type": "boolean" }, "roomId": { "type": [ "string", "null" ] }, "startedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "title": { "type": [ "string", "null" ] }, "viewers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, { "type": "object", "description": "A channel's live status, with its broadcast when it is on." } ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } }, "TwitchCategoryRef": { "type": "object", "description": "A category as a video, a clip, a broadcast or a channel names it.", "required": [ "id", "name" ], "properties": { "coverUrl": { "type": [ "string", "null" ], "description": "Its box art." }, "id": { "type": "string" }, "name": { "type": "string" }, "slug": { "type": [ "string", "null" ], "description": "The name in its link (`just-chatting`)." }, "url": { "type": [ "string", "null" ] } } } } } } ``` # Post Comments (/docs/api-reference/twitch/post-comments) A video's chat replay, about 60 messages a page. `GET https://api.socialapi.sh/v1/twitch/post/comments` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.twitch.postComments({ url: "https://www.twitch.tv/videos/2939600059" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.twitch.post_comments(url="https://www.twitch.tv/videos/2939600059") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/twitch/post/comments \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://www.twitch.tv/videos/2939600059" ``` **Response** ```json { "data": [ { "id": "1fe4d2ff-548a-4e36-a704-f928e7e6c995", "postId": "2939600059", "parentId": null, "text": "1st", "createdAt": "2026-11-24T19:18:40.049Z", "author": { "id": "530691241", "username": "iwrckdgaming", "displayName": "iwrckdgaming", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/ff73790e-7d9d-4c07-8faa-662b82eb0fa7-profile_image-300x300.png", "verified": false, "url": "https://www.twitch.tv/iwrckdgaming" }, "likes": null, "replies": null, "ext": { "offsetSeconds": 18, "color": "#00FF7F", "badges": [ "pichu" ], "emotes": [] } }, { "id": "1c8905ee-d57e-49da-8250-fc024162fd05", "postId": "2939600059", "parentId": null, "text": "hello", "createdAt": "2026-11-24T19:18:43.216Z", "author": { "id": "155386715", "username": "fischdepchen", "displayName": "fischdepchen", "avatarUrl": "https://static-cdn.jtvnw.net/user-default-pictures-uv/998f01ae-def8-11e9-b95c-784f43822e80-profile_image-300x300.png", "verified": false, "url": "https://www.twitch.tv/fischdepchen" }, "likes": null, "replies": null, "ext": { "offsetSeconds": 21, "color": "#FF4500", "badges": [ "premium" ], "emotes": [] } } ], "pagination": { "nextCursor": "eyJpZCI6ImE1ZDNjYTc2LTU2MTItNGU5MS04MjdmLWM2MjEyZTQwZWQ3MCIsImhrIjoiYnJvYWRjYXN0OjMyMDAzNjUwNTk0MyIsInNrIjoiQUFBQU5MR2FuNEFZNnhHQ1c2Rm9nQSJ9", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/twitch/post/comments": { "get": { "tags": [ "Twitch" ], "summary": "A video's chat replay, about 60 messages a page.", "description": "The messages written while it was live, in order, each with its author, its place in\nthe video in seconds, its badges and emotes. Start anywhere with `offset`. 1 credit a\npage.", "operationId": "twitchPostComments", "parameters": [ { "name": "url", "in": "query", "description": "The video's link.", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The video's number, instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "offset", "in": "query", "description": "Where in the video to start, in seconds (0, the default, is its beginning).", "required": false, "schema": { "type": "integer", "format": "int32", "minimum": 0 } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page; `offset` is not read with it.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_TwitchComment" }, "example": { "data": [ { "id": "1fe4d2ff-548a-4e36-a704-f928e7e6c995", "postId": "2939600059", "parentId": null, "text": "1st", "createdAt": "2026-11-24T19:18:40.049Z", "author": { "id": "530691241", "username": "iwrckdgaming", "displayName": "iwrckdgaming", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/ff73790e-7d9d-4c07-8faa-662b82eb0fa7-profile_image-300x300.png", "verified": false, "url": "https://www.twitch.tv/iwrckdgaming" }, "likes": null, "replies": null, "ext": { "offsetSeconds": 18, "color": "#00FF7F", "badges": [ "pichu" ], "emotes": [] } }, { "id": "1c8905ee-d57e-49da-8250-fc024162fd05", "postId": "2939600059", "parentId": null, "text": "hello", "createdAt": "2026-11-24T19:18:43.216Z", "author": { "id": "155386715", "username": "fischdepchen", "displayName": "fischdepchen", "avatarUrl": "https://static-cdn.jtvnw.net/user-default-pictures-uv/998f01ae-def8-11e9-b95c-784f43822e80-profile_image-300x300.png", "verified": false, "url": "https://www.twitch.tv/fischdepchen" }, "likes": null, "replies": null, "ext": { "offsetSeconds": 21, "color": "#FF4500", "badges": [ "premium" ], "emotes": [] } } ], "pagination": { "nextCursor": "eyJpZCI6ImE1ZDNjYTc2LTU2MTItNGU5MS04MjdmLWM2MjEyZTQwZWQ3MCIsImhrIjoiYnJvYWRjYXN0OjMyMDAzNjUwNTk0MyIsInNrIjoiQUFBQU5MR2FuNEFZNnhHQ1c2Rm9nQSJ9", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.twitch.postComments({ url: \"https://www.twitch.tv/videos/2939600059\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.twitch.post_comments(url=\"https://www.twitch.tv/videos/2939600059\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/twitch/post/comments \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://www.twitch.tv/videos/2939600059\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_TwitchComment": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/TwitchComment" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "TwitchComment": { "allOf": [ { "type": "object", "description": "A comment or a reply.", "required": [ "id", "postId", "text", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "offsetSeconds", "badges", "emotes" ], "properties": { "badges": { "type": "array", "items": { "type": "string" }, "description": "Its author's chat badges (`subscriber`, `moderator`, `vip`)." }, "color": { "type": [ "string", "null" ], "description": "The colour of its author's name (`#5F9EA0`)." }, "emotes": { "type": "array", "items": { "type": "string" }, "description": "The ids of the emotes in it; each is written in `text` by its name." }, "offsetSeconds": { "type": "integer", "format": "int64", "description": "Where in the video it was written, in seconds.", "minimum": 0 } } }, { "type": "object", "description": "What only this platform has." } ] }, "id": { "type": "string" }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "parentId": { "type": [ "string", "null" ], "description": "The comment this replies to; absent on a top-level comment." }, "postId": { "type": "string" }, "replies": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "text": { "type": "string" } } }, { "type": "object", "description": "A message of a video's chat replay." } ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Post (/docs/api-reference/twitch/post) One video or clip with its views and a link to play it. `GET https://api.socialapi.sh/v1/twitch/post` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.twitch.post({ url: "https://www.twitch.tv/videos/2939600059" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.twitch.post(url="https://www.twitch.tv/videos/2939600059").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/twitch/post \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://www.twitch.tv/videos/2939600059" ``` **Response** ```json { "data": { "id": "2939600059", "url": "https://www.twitch.tv/videos/2939600059", "text": null, "createdAt": "2026-11-24T19:18:20.000Z", "author": { "id": "37402112", "username": "shroud", "displayName": "shroud", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/c754eebf-745b-4e0a-814a-10bcaecaabbc-profile_image-300x300.png", "verified": true, "url": "https://www.twitch.tv/shroud" }, "stats": { "views": 228721, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://usher.ttvnw.net/vod/2939600059.m3u8?allow_source=true&allow_audio_only=true&sig=a9f8a5aca4fcb47a1781038b1dc3ba3c209bc3f9&token=%7B%22authorization%22%3A%7B%22forbidden%22%3Afalse%2C%22reason%22%3A%22%22%7D%2C%22chansub%22%3A%7B%22restricted_bitrates%22%3A%5B%5D%7D%2C%22device_id%22%3A%22s2b9sulbgmdn1bpfdo1x68ggo8qkq0m9%22%2C%22expires%22%3A1795706021%2C%22https_required%22%3Atrue%2C%22privileged%22%3Afalse%2C%22user_id%22%3Anull%2C%22version%22%3A3%2C%22vod_id%22%3A2939600059%2C%22maximum_resolution%22%3A%22FULL_HD%22%2C%22maximum_video_bitrate_kbps%22%3A12500%2C%22maximum_resolution_reasons%22%3A%7B%22QUAD_HD%22%3A%5B%22AUTHZ_NOT_LOGGED_IN%22%5D%2C%22ULTRA_HD%22%3A%5B%22AUTHZ_NOT_LOGGED_IN%22%5D%7D%2C%22maximum_video_bitrate_kbps_reasons%22%3A%5B%22AUTHZ_DISALLOWED_BITRATE%22%5D%2C%22channel_name%22%3A%22shroud%22%2C%22is_dvr%22%3Afalse%7D", "thumbnailUrl": "https://static-cdn.jtvnw.net/cf_vods/d2nvs31859zcd8/d51a94b098e603b359da_shroud_320036505943_1795547895//thumb/thumb0-640x360.jpg", "width": null, "height": null, "durationSeconds": 20005 } ], "hashtags": [], "mentions": [], "ext": { "kind": "archive", "title": "day 2 of feeling left out.. but we are VIBING BROTHERS!!!", "category": { "id": "1867279146", "name": "Grand Theft Auto VI", "slug": "grand-theft-auto-vi", "url": "https://www.twitch.tv/directory/category/grand-theft-auto-vi", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/1867279146_IGDB-285x380.jpg" }, "language": "en", "durationSeconds": 20005, "recording": false, "chapters": [], "labels": [ "MatureGame" ], "clipId": null, "curator": null, "videoId": null, "videoOffsetSeconds": null, "featured": false } } } ``` **OpenAPI** ```json { "paths": { "/v1/twitch/post": { "get": { "tags": [ "Twitch" ], "summary": "One video or clip with its views and a link to play it.", "description": "A video's title, length, category, chapters and playlist; a clip's title, who cut it,\nthe video it is from and its file. The links to play last about 20 hours. 1 credit.", "operationId": "twitchPost", "parameters": [ { "name": "url", "in": "query", "description": "A video's link (`https://www.twitch.tv/videos/2914038727`) or a clip's\n(`https://www.twitch.tv/shroud/clip/…`, `https://clips.twitch.tv/…`).", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "A video's number, or a clip's name in its link, instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_TwitchPost" }, "example": { "data": { "id": "2939600059", "url": "https://www.twitch.tv/videos/2939600059", "text": null, "createdAt": "2026-11-24T19:18:20.000Z", "author": { "id": "37402112", "username": "shroud", "displayName": "shroud", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/c754eebf-745b-4e0a-814a-10bcaecaabbc-profile_image-300x300.png", "verified": true, "url": "https://www.twitch.tv/shroud" }, "stats": { "views": 228721, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://usher.ttvnw.net/vod/2939600059.m3u8?allow_source=true&allow_audio_only=true&sig=a9f8a5aca4fcb47a1781038b1dc3ba3c209bc3f9&token=%7B%22authorization%22%3A%7B%22forbidden%22%3Afalse%2C%22reason%22%3A%22%22%7D%2C%22chansub%22%3A%7B%22restricted_bitrates%22%3A%5B%5D%7D%2C%22device_id%22%3A%22s2b9sulbgmdn1bpfdo1x68ggo8qkq0m9%22%2C%22expires%22%3A1795706021%2C%22https_required%22%3Atrue%2C%22privileged%22%3Afalse%2C%22user_id%22%3Anull%2C%22version%22%3A3%2C%22vod_id%22%3A2939600059%2C%22maximum_resolution%22%3A%22FULL_HD%22%2C%22maximum_video_bitrate_kbps%22%3A12500%2C%22maximum_resolution_reasons%22%3A%7B%22QUAD_HD%22%3A%5B%22AUTHZ_NOT_LOGGED_IN%22%5D%2C%22ULTRA_HD%22%3A%5B%22AUTHZ_NOT_LOGGED_IN%22%5D%7D%2C%22maximum_video_bitrate_kbps_reasons%22%3A%5B%22AUTHZ_DISALLOWED_BITRATE%22%5D%2C%22channel_name%22%3A%22shroud%22%2C%22is_dvr%22%3Afalse%7D", "thumbnailUrl": "https://static-cdn.jtvnw.net/cf_vods/d2nvs31859zcd8/d51a94b098e603b359da_shroud_320036505943_1795547895//thumb/thumb0-640x360.jpg", "width": null, "height": null, "durationSeconds": 20005 } ], "hashtags": [], "mentions": [], "ext": { "kind": "archive", "title": "day 2 of feeling left out.. but we are VIBING BROTHERS!!!", "category": { "id": "1867279146", "name": "Grand Theft Auto VI", "slug": "grand-theft-auto-vi", "url": "https://www.twitch.tv/directory/category/grand-theft-auto-vi", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/1867279146_IGDB-285x380.jpg" }, "language": "en", "durationSeconds": 20005, "recording": false, "chapters": [], "labels": [ "MatureGame" ], "clipId": null, "curator": null, "videoId": null, "videoOffsetSeconds": null, "featured": false } } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.twitch.post({ url: \"https://www.twitch.tv/videos/2939600059\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.twitch.post(url=\"https://www.twitch.tv/videos/2939600059\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/twitch/post \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://www.twitch.tv/videos/2939600059\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_TwitchPost": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/TwitchPost" } } }, "TwitchPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "kind", "recording", "chapters", "labels", "featured" ], "properties": { "category": { "oneOf": [ { "$ref": "#/components/schemas/TwitchCategoryRef" }, { "type": "null" } ] }, "chapters": { "type": "array", "items": { "$ref": "#/components/schemas/TwitchChapter" }, "description": "A video's chapters; on `/post` only." }, "clipId": { "type": [ "string", "null" ], "description": "A clip's numeric id (its `id` is the name in its link)." }, "curator": { "oneOf": [ { "$ref": "#/components/schemas/Author", "description": "Who cut the clip." }, { "type": "null" } ] }, "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "featured": { "type": "boolean", "description": "A clip its channel features." }, "kind": { "$ref": "#/components/schemas/TwitchPostKind" }, "labels": { "type": "array", "items": { "type": "string" }, "description": "Twitch's content labels (`MatureGame`, `ProfanityVulgarity`)." }, "language": { "type": [ "string", "null" ], "description": "The language (`en`)." }, "recording": { "type": "boolean", "description": "A broadcast still on air: its video is being recorded, and grows." }, "title": { "type": [ "string", "null" ], "description": "The title (`text` is a video's description, which few have)." }, "videoId": { "type": [ "string", "null" ], "description": "The video a clip was cut from, and where in it, in seconds." }, "videoOffsetSeconds": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A video (a past broadcast, a highlight, an upload) or a clip." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "TwitchPostKind": { "type": "string", "description": "What a post is.", "enum": [ "archive", "highlight", "upload", "premiere", "clip" ] }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } }, "TwitchChapter": { "type": "object", "description": "A chapter of a video: a stretch of the broadcast in one category.", "required": [ "title", "startSeconds", "durationSeconds" ], "properties": { "category": { "oneOf": [ { "$ref": "#/components/schemas/TwitchCategoryRef" }, { "type": "null" } ] }, "durationSeconds": { "type": "integer", "format": "int64", "minimum": 0 }, "startSeconds": { "type": "integer", "format": "int64", "minimum": 0 }, "title": { "type": "string" } } }, "TwitchCategoryRef": { "type": "object", "description": "A category as a video, a clip, a broadcast or a channel names it.", "required": [ "id", "name" ], "properties": { "coverUrl": { "type": [ "string", "null" ], "description": "Its box art." }, "id": { "type": "string" }, "name": { "type": "string" }, "slug": { "type": [ "string", "null" ], "description": "The name in its link (`just-chatting`)." }, "url": { "type": [ "string", "null" ] } } }, "Timestamp": { "type": "string", "format": "date-time" } } } } ``` # Profile Clips (/docs/api-reference/twitch/profile-clips) A channel's clips, most viewed first, 30 a page. `GET https://api.socialapi.sh/v1/twitch/profile/clips` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.twitch.profileClips({ handle: "shroud", period: "all" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.twitch.profile_clips(handle="shroud", period="all") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/twitch/profile/clips \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=shroud" \ --data-urlencode "period=all" ``` **Response** ```json { "data": [ { "id": "TangentialBillowingJalapenoYee-ccA2oB1pEYh4CHWJ", "url": "https://www.twitch.tv/shroud/clip/TangentialBillowingJalapenoYee-ccA2oB1pEYh4CHWJ", "text": null, "createdAt": "2023-06-02T11:41:50.000Z", "author": { "id": "37402112", "username": "shroud", "displayName": "shroud", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/c754eebf-745b-4e0a-814a-10bcaecaabbc-profile_image-300x300.png", "verified": true, "url": "https://www.twitch.tv/shroud" }, "stats": { "views": 563744, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://d1ndex63qxojbr.cloudfront.net/nauth/5696a6a8-e053-4c2e-a54c-5ca62c48102e/landscape/avc/1080/index.mp4?sig=868665cdb4eaa1155b409426ba60784b5b527638&token=%7B%22authorization%22%3A%7B%22forbidden%22%3Afalse%2C%22reason%22%3A%22%22%7D%2C%22clip_uri%22%3A%22https%3A%2F%2Fd1ndex63qxojbr.cloudfront.net%2Fnauth%2F5696a6a8-e053-4c2e-a54c-5ca62c48102e%2Flandscape%2Favc%2F1080%2Findex.mp4%22%2C%22clip_slug%22%3A%22TangentialBillowingJalapenoYee-ccA2oB1pEYh4CHWJ%22%2C%22device_id%22%3A%22dzuv5s0195yqx92h8qb30uzc878xtic6%22%2C%22expires%22%3A1795706021%2C%22user_id%22%3A%22%22%2C%22version%22%3A3%7D", "thumbnailUrl": "https://static-cdn.jtvnw.net/twitch-video-assets/twitch-vap-video-assets-prod-us-west-2/5696a6a8-e053-4c2e-a54c-5ca62c48102e/landscape/thumb/thumb-0000000000-1920x1080.jpg", "width": null, "height": 1080, "durationSeconds": 28 } ], "hashtags": [], "mentions": [], "ext": { "kind": "clip", "title": "F Shroud", "category": { "id": "515024", "name": "Diablo IV", "slug": "diablo-iv", "url": "https://www.twitch.tv/directory/category/diablo-iv", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/515024-285x380.jpg" }, "language": "EN", "durationSeconds": 28, "recording": false, "chapters": [], "labels": [], "clipId": "2358589597", "curator": { "id": "165804164", "username": "pato_bolado", "displayName": "Pato_Bolado", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/32755070-71cf-4911-948a-eb6ea0b952e7-profile_image-300x300.png", "verified": false, "url": "https://www.twitch.tv/pato_bolado" }, "videoId": "1835200464", "videoOffsetSeconds": 48930, "featured": false } }, { "id": "SuccessfulEndearingPidgeonPunchTrees-46KXLAMeuS9kpp5Q", "url": "https://www.twitch.tv/shroud/clip/SuccessfulEndearingPidgeonPunchTrees-46KXLAMeuS9kpp5Q", "text": null, "createdAt": "2023-08-05T10:53:38.000Z", "author": { "id": "37402112", "username": "shroud", "displayName": "shroud", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/c754eebf-745b-4e0a-814a-10bcaecaabbc-profile_image-300x300.png", "verified": true, "url": "https://www.twitch.tv/shroud" }, "stats": { "views": 563417, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://d1ndex63qxojbr.cloudfront.net/nauth/05f80190-90b4-4569-94ce-36a01d87b191/landscape/avc/1080/index.mp4?sig=3806163c9da3667fcde81c44e5ec8c41bcf6ab38&token=%7B%22authorization%22%3A%7B%22forbidden%22%3Afalse%2C%22reason%22%3A%22%22%7D%2C%22clip_uri%22%3A%22https%3A%2F%2Fd1ndex63qxojbr.cloudfront.net%2Fnauth%2F05f80190-90b4-4569-94ce-36a01d87b191%2Flandscape%2Favc%2F360%2Findex.mp4%22%2C%22clip_slug%22%3A%22SuccessfulEndearingPidgeonPunchTrees-46KXLAMeuS9kpp5Q%22%2C%22device_id%22%3A%22dzuv5s0195yqx92h8qb30uzc878xtic6%22%2C%22expires%22%3A1795706021%2C%22user_id%22%3A%22%22%2C%22version%22%3A3%7D", "thumbnailUrl": "https://static-cdn.jtvnw.net/twitch-video-assets/twitch-vap-video-assets-prod-us-west-2/05f80190-90b4-4569-94ce-36a01d87b191/landscape/thumb/thumb-0000000000-1920x1080.jpg", "width": null, "height": 1080, "durationSeconds": 19 } ], "hashtags": [], "mentions": [], "ext": { "kind": "clip", "title": "it's gonna be over", "category": { "id": "512923", "name": "Baldur's Gate 3", "slug": "baldurs-gate-3", "url": "https://www.twitch.tv/directory/category/baldurs-gate-3", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/512923_IGDB-285x380.jpg" }, "language": "EN", "durationSeconds": 19, "recording": false, "chapters": [], "labels": [], "clipId": "3663533447", "curator": { "id": "63640236", "username": "jawnpeed", "displayName": "JawnPeed", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/c146382f-eb67-4ae1-8e52-61ceca3b7bc0-profile_image-300x300.png", "verified": false, "url": "https://www.twitch.tv/jawnpeed" }, "videoId": "1890462089", "videoOffsetSeconds": 28052, "featured": false } } ], "pagination": { "nextCursor": "MzA=", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/twitch/profile/clips": { "get": { "tags": [ "Twitch" ], "summary": "A channel's clips, most viewed first, 30 a page.", "description": "Over the last day, week, month or all time, each with its views, who cut it, the video\nit is from and a link to its file. 1 credit a page.", "operationId": "twitchProfileClips", "parameters": [ { "name": "handle", "in": "query", "description": "The channel's login.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "The channel's link, instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The channel's numeric id, instead of either.", "required": false, "schema": { "type": "string" } }, { "name": "period", "in": "query", "description": "How far back: `day`, `week` (the default), `month` or `all`.", "required": false, "schema": { "type": "string", "description": "How far back a list of clips looks.", "enum": [ "day", "week", "month", "all" ] } }, { "name": "featured", "in": "query", "description": "Only the clips the channel features.", "required": false, "schema": { "type": "boolean" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_TwitchPost" }, "example": { "data": [ { "id": "TangentialBillowingJalapenoYee-ccA2oB1pEYh4CHWJ", "url": "https://www.twitch.tv/shroud/clip/TangentialBillowingJalapenoYee-ccA2oB1pEYh4CHWJ", "text": null, "createdAt": "2023-06-02T11:41:50.000Z", "author": { "id": "37402112", "username": "shroud", "displayName": "shroud", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/c754eebf-745b-4e0a-814a-10bcaecaabbc-profile_image-300x300.png", "verified": true, "url": "https://www.twitch.tv/shroud" }, "stats": { "views": 563744, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://d1ndex63qxojbr.cloudfront.net/nauth/5696a6a8-e053-4c2e-a54c-5ca62c48102e/landscape/avc/1080/index.mp4?sig=868665cdb4eaa1155b409426ba60784b5b527638&token=%7B%22authorization%22%3A%7B%22forbidden%22%3Afalse%2C%22reason%22%3A%22%22%7D%2C%22clip_uri%22%3A%22https%3A%2F%2Fd1ndex63qxojbr.cloudfront.net%2Fnauth%2F5696a6a8-e053-4c2e-a54c-5ca62c48102e%2Flandscape%2Favc%2F1080%2Findex.mp4%22%2C%22clip_slug%22%3A%22TangentialBillowingJalapenoYee-ccA2oB1pEYh4CHWJ%22%2C%22device_id%22%3A%22dzuv5s0195yqx92h8qb30uzc878xtic6%22%2C%22expires%22%3A1795706021%2C%22user_id%22%3A%22%22%2C%22version%22%3A3%7D", "thumbnailUrl": "https://static-cdn.jtvnw.net/twitch-video-assets/twitch-vap-video-assets-prod-us-west-2/5696a6a8-e053-4c2e-a54c-5ca62c48102e/landscape/thumb/thumb-0000000000-1920x1080.jpg", "width": null, "height": 1080, "durationSeconds": 28 } ], "hashtags": [], "mentions": [], "ext": { "kind": "clip", "title": "F Shroud", "category": { "id": "515024", "name": "Diablo IV", "slug": "diablo-iv", "url": "https://www.twitch.tv/directory/category/diablo-iv", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/515024-285x380.jpg" }, "language": "EN", "durationSeconds": 28, "recording": false, "chapters": [], "labels": [], "clipId": "2358589597", "curator": { "id": "165804164", "username": "pato_bolado", "displayName": "Pato_Bolado", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/32755070-71cf-4911-948a-eb6ea0b952e7-profile_image-300x300.png", "verified": false, "url": "https://www.twitch.tv/pato_bolado" }, "videoId": "1835200464", "videoOffsetSeconds": 48930, "featured": false } }, { "id": "SuccessfulEndearingPidgeonPunchTrees-46KXLAMeuS9kpp5Q", "url": "https://www.twitch.tv/shroud/clip/SuccessfulEndearingPidgeonPunchTrees-46KXLAMeuS9kpp5Q", "text": null, "createdAt": "2023-08-05T10:53:38.000Z", "author": { "id": "37402112", "username": "shroud", "displayName": "shroud", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/c754eebf-745b-4e0a-814a-10bcaecaabbc-profile_image-300x300.png", "verified": true, "url": "https://www.twitch.tv/shroud" }, "stats": { "views": 563417, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": "https://d1ndex63qxojbr.cloudfront.net/nauth/05f80190-90b4-4569-94ce-36a01d87b191/landscape/avc/1080/index.mp4?sig=3806163c9da3667fcde81c44e5ec8c41bcf6ab38&token=%7B%22authorization%22%3A%7B%22forbidden%22%3Afalse%2C%22reason%22%3A%22%22%7D%2C%22clip_uri%22%3A%22https%3A%2F%2Fd1ndex63qxojbr.cloudfront.net%2Fnauth%2F05f80190-90b4-4569-94ce-36a01d87b191%2Flandscape%2Favc%2F360%2Findex.mp4%22%2C%22clip_slug%22%3A%22SuccessfulEndearingPidgeonPunchTrees-46KXLAMeuS9kpp5Q%22%2C%22device_id%22%3A%22dzuv5s0195yqx92h8qb30uzc878xtic6%22%2C%22expires%22%3A1795706021%2C%22user_id%22%3A%22%22%2C%22version%22%3A3%7D", "thumbnailUrl": "https://static-cdn.jtvnw.net/twitch-video-assets/twitch-vap-video-assets-prod-us-west-2/05f80190-90b4-4569-94ce-36a01d87b191/landscape/thumb/thumb-0000000000-1920x1080.jpg", "width": null, "height": 1080, "durationSeconds": 19 } ], "hashtags": [], "mentions": [], "ext": { "kind": "clip", "title": "it's gonna be over", "category": { "id": "512923", "name": "Baldur's Gate 3", "slug": "baldurs-gate-3", "url": "https://www.twitch.tv/directory/category/baldurs-gate-3", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/512923_IGDB-285x380.jpg" }, "language": "EN", "durationSeconds": 19, "recording": false, "chapters": [], "labels": [], "clipId": "3663533447", "curator": { "id": "63640236", "username": "jawnpeed", "displayName": "JawnPeed", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/c146382f-eb67-4ae1-8e52-61ceca3b7bc0-profile_image-300x300.png", "verified": false, "url": "https://www.twitch.tv/jawnpeed" }, "videoId": "1890462089", "videoOffsetSeconds": 28052, "featured": false } } ], "pagination": { "nextCursor": "MzA=", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.twitch.profileClips({ handle: \"shroud\", period: \"all\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.twitch.profile_clips(handle=\"shroud\", period=\"all\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/twitch/profile/clips \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=shroud\" \\\n --data-urlencode \"period=all\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_TwitchPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/TwitchPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "TwitchPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "kind", "recording", "chapters", "labels", "featured" ], "properties": { "category": { "oneOf": [ { "$ref": "#/components/schemas/TwitchCategoryRef" }, { "type": "null" } ] }, "chapters": { "type": "array", "items": { "$ref": "#/components/schemas/TwitchChapter" }, "description": "A video's chapters; on `/post` only." }, "clipId": { "type": [ "string", "null" ], "description": "A clip's numeric id (its `id` is the name in its link)." }, "curator": { "oneOf": [ { "$ref": "#/components/schemas/Author", "description": "Who cut the clip." }, { "type": "null" } ] }, "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "featured": { "type": "boolean", "description": "A clip its channel features." }, "kind": { "$ref": "#/components/schemas/TwitchPostKind" }, "labels": { "type": "array", "items": { "type": "string" }, "description": "Twitch's content labels (`MatureGame`, `ProfanityVulgarity`)." }, "language": { "type": [ "string", "null" ], "description": "The language (`en`)." }, "recording": { "type": "boolean", "description": "A broadcast still on air: its video is being recorded, and grows." }, "title": { "type": [ "string", "null" ], "description": "The title (`text` is a video's description, which few have)." }, "videoId": { "type": [ "string", "null" ], "description": "The video a clip was cut from, and where in it, in seconds." }, "videoOffsetSeconds": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A video (a past broadcast, a highlight, an upload) or a clip." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "TwitchPostKind": { "type": "string", "description": "What a post is.", "enum": [ "archive", "highlight", "upload", "premiere", "clip" ] }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } }, "TwitchChapter": { "type": "object", "description": "A chapter of a video: a stretch of the broadcast in one category.", "required": [ "title", "startSeconds", "durationSeconds" ], "properties": { "category": { "oneOf": [ { "$ref": "#/components/schemas/TwitchCategoryRef" }, { "type": "null" } ] }, "durationSeconds": { "type": "integer", "format": "int64", "minimum": 0 }, "startSeconds": { "type": "integer", "format": "int64", "minimum": 0 }, "title": { "type": "string" } } }, "TwitchCategoryRef": { "type": "object", "description": "A category as a video, a clip, a broadcast or a channel names it.", "required": [ "id", "name" ], "properties": { "coverUrl": { "type": [ "string", "null" ], "description": "Its box art." }, "id": { "type": "string" }, "name": { "type": "string" }, "slug": { "type": [ "string", "null" ], "description": "The name in its link (`just-chatting`)." }, "url": { "type": [ "string", "null" ] } } }, "Timestamp": { "type": "string", "format": "date-time" } } } } ``` # Profile Posts (/docs/api-reference/twitch/profile-posts) A channel's videos, 30 a page. `GET https://api.socialapi.sh/v1/twitch/profile/posts` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.twitch.profilePosts({ handle: "shroud", type: "archive" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.twitch.profile_posts(handle="shroud", type="archive") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/twitch/profile/posts \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=shroud" \ --data-urlencode "type=archive" ``` **Response** ```json { "data": [ { "id": "2940500640", "url": "https://www.twitch.tv/videos/2940500640", "text": null, "createdAt": "2026-11-25T17:38:21.000Z", "author": { "id": "37402112", "username": "shroud", "displayName": "shroud", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/c754eebf-745b-4e0a-814a-10bcaecaabbc-profile_image-300x300.png", "verified": true, "url": "https://www.twitch.tv/shroud" }, "stats": { "views": 110, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": null, "width": null, "height": null, "durationSeconds": 5719 } ], "hashtags": [], "mentions": [], "ext": { "kind": "archive", "title": "day3.. we finally got lucia the real main character YAHOO!", "category": { "id": "1867279146", "name": "Grand Theft Auto VI", "slug": "grand-theft-auto-vi", "url": "https://www.twitch.tv/directory/category/grand-theft-auto-vi", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/1867279146_IGDB-285x380.jpg" }, "language": "en", "durationSeconds": 5719, "recording": true, "chapters": [], "labels": [ "MatureGame" ], "clipId": null, "curator": null, "videoId": null, "videoOffsetSeconds": null, "featured": false } }, { "id": "2939600059", "url": "https://www.twitch.tv/videos/2939600059", "text": null, "createdAt": "2026-11-24T19:18:20.000Z", "author": { "id": "37402112", "username": "shroud", "displayName": "shroud", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/c754eebf-745b-4e0a-814a-10bcaecaabbc-profile_image-300x300.png", "verified": true, "url": "https://www.twitch.tv/shroud" }, "stats": { "views": 228721, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://static-cdn.jtvnw.net/cf_vods/d2nvs31859zcd8/d51a94b098e603b359da_shroud_320036505943_1795547895//thumb/thumb0-640x360.jpg", "width": null, "height": null, "durationSeconds": 20005 } ], "hashtags": [], "mentions": [], "ext": { "kind": "archive", "title": "day 2 of feeling left out.. but we are VIBING BROTHERS!!!", "category": { "id": "1867279146", "name": "Grand Theft Auto VI", "slug": "grand-theft-auto-vi", "url": "https://www.twitch.tv/directory/category/grand-theft-auto-vi", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/1867279146_IGDB-285x380.jpg" }, "language": "en", "durationSeconds": 20005, "recording": false, "chapters": [], "labels": [ "MatureGame" ], "clipId": null, "curator": null, "videoId": null, "videoOffsetSeconds": null, "featured": false } } ], "pagination": { "nextCursor": "2891858791|407034|2026-10-04T17:04:06Z|30997", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/twitch/profile/posts": { "get": { "tags": [ "Twitch" ], "summary": "A channel's videos, 30 a page.", "description": "Past broadcasts, highlights and uploads, newest or most viewed first, with their views,\nlength and category. 1 credit a page.", "operationId": "twitchProfilePosts", "parameters": [ { "name": "handle", "in": "query", "description": "The channel's login.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "The channel's link, instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The channel's numeric id, instead of either.", "required": false, "schema": { "type": "string" } }, { "name": "type", "in": "query", "description": "`archive` (past broadcasts), `highlight` or `upload`; every kind when left out.", "required": false, "schema": { "type": "string", "description": "Which of a channel's videos.", "enum": [ "archive", "highlight", "upload" ] } }, { "name": "sort", "in": "query", "description": "`latest` (the default) or `views`.", "required": false, "schema": { "type": "string", "description": "How a list of videos is ordered.", "enum": [ "latest", "views" ] } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_TwitchPost" }, "example": { "data": [ { "id": "2940500640", "url": "https://www.twitch.tv/videos/2940500640", "text": null, "createdAt": "2026-11-25T17:38:21.000Z", "author": { "id": "37402112", "username": "shroud", "displayName": "shroud", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/c754eebf-745b-4e0a-814a-10bcaecaabbc-profile_image-300x300.png", "verified": true, "url": "https://www.twitch.tv/shroud" }, "stats": { "views": 110, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": null, "width": null, "height": null, "durationSeconds": 5719 } ], "hashtags": [], "mentions": [], "ext": { "kind": "archive", "title": "day3.. we finally got lucia the real main character YAHOO!", "category": { "id": "1867279146", "name": "Grand Theft Auto VI", "slug": "grand-theft-auto-vi", "url": "https://www.twitch.tv/directory/category/grand-theft-auto-vi", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/1867279146_IGDB-285x380.jpg" }, "language": "en", "durationSeconds": 5719, "recording": true, "chapters": [], "labels": [ "MatureGame" ], "clipId": null, "curator": null, "videoId": null, "videoOffsetSeconds": null, "featured": false } }, { "id": "2939600059", "url": "https://www.twitch.tv/videos/2939600059", "text": null, "createdAt": "2026-11-24T19:18:20.000Z", "author": { "id": "37402112", "username": "shroud", "displayName": "shroud", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/c754eebf-745b-4e0a-814a-10bcaecaabbc-profile_image-300x300.png", "verified": true, "url": "https://www.twitch.tv/shroud" }, "stats": { "views": 228721, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://static-cdn.jtvnw.net/cf_vods/d2nvs31859zcd8/d51a94b098e603b359da_shroud_320036505943_1795547895//thumb/thumb0-640x360.jpg", "width": null, "height": null, "durationSeconds": 20005 } ], "hashtags": [], "mentions": [], "ext": { "kind": "archive", "title": "day 2 of feeling left out.. but we are VIBING BROTHERS!!!", "category": { "id": "1867279146", "name": "Grand Theft Auto VI", "slug": "grand-theft-auto-vi", "url": "https://www.twitch.tv/directory/category/grand-theft-auto-vi", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/1867279146_IGDB-285x380.jpg" }, "language": "en", "durationSeconds": 20005, "recording": false, "chapters": [], "labels": [ "MatureGame" ], "clipId": null, "curator": null, "videoId": null, "videoOffsetSeconds": null, "featured": false } } ], "pagination": { "nextCursor": "2891858791|407034|2026-10-04T17:04:06Z|30997", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.twitch.profilePosts({ handle: \"shroud\", type: \"archive\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.twitch.profile_posts(handle=\"shroud\", type=\"archive\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/twitch/profile/posts \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=shroud\" \\\n --data-urlencode \"type=archive\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_TwitchPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/TwitchPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "TwitchPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "kind", "recording", "chapters", "labels", "featured" ], "properties": { "category": { "oneOf": [ { "$ref": "#/components/schemas/TwitchCategoryRef" }, { "type": "null" } ] }, "chapters": { "type": "array", "items": { "$ref": "#/components/schemas/TwitchChapter" }, "description": "A video's chapters; on `/post` only." }, "clipId": { "type": [ "string", "null" ], "description": "A clip's numeric id (its `id` is the name in its link)." }, "curator": { "oneOf": [ { "$ref": "#/components/schemas/Author", "description": "Who cut the clip." }, { "type": "null" } ] }, "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "featured": { "type": "boolean", "description": "A clip its channel features." }, "kind": { "$ref": "#/components/schemas/TwitchPostKind" }, "labels": { "type": "array", "items": { "type": "string" }, "description": "Twitch's content labels (`MatureGame`, `ProfanityVulgarity`)." }, "language": { "type": [ "string", "null" ], "description": "The language (`en`)." }, "recording": { "type": "boolean", "description": "A broadcast still on air: its video is being recorded, and grows." }, "title": { "type": [ "string", "null" ], "description": "The title (`text` is a video's description, which few have)." }, "videoId": { "type": [ "string", "null" ], "description": "The video a clip was cut from, and where in it, in seconds." }, "videoOffsetSeconds": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A video (a past broadcast, a highlight, an upload) or a clip." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "TwitchPostKind": { "type": "string", "description": "What a post is.", "enum": [ "archive", "highlight", "upload", "premiere", "clip" ] }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } }, "TwitchChapter": { "type": "object", "description": "A chapter of a video: a stretch of the broadcast in one category.", "required": [ "title", "startSeconds", "durationSeconds" ], "properties": { "category": { "oneOf": [ { "$ref": "#/components/schemas/TwitchCategoryRef" }, { "type": "null" } ] }, "durationSeconds": { "type": "integer", "format": "int64", "minimum": 0 }, "startSeconds": { "type": "integer", "format": "int64", "minimum": 0 }, "title": { "type": "string" } } }, "TwitchCategoryRef": { "type": "object", "description": "A category as a video, a clip, a broadcast or a channel names it.", "required": [ "id", "name" ], "properties": { "coverUrl": { "type": [ "string", "null" ], "description": "Its box art." }, "id": { "type": "string" }, "name": { "type": "string" }, "slug": { "type": [ "string", "null" ], "description": "The name in its link (`just-chatting`)." }, "url": { "type": [ "string", "null" ] } } }, "Timestamp": { "type": "string", "format": "date-time" } } } } ``` # Profile Schedule (/docs/api-reference/twitch/profile-schedule) A channel's coming broadcasts, 30 a page. `GET https://api.socialapi.sh/v1/twitch/profile/schedule` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.twitch.profileSchedule({ handle: "shroud" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.twitch.profile_schedule(handle="shroud") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/twitch/profile/schedule \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=shroud" ``` **Response** ```json { "data": [ { "id": "eyJzZWdtZW50SUQiOiJiNjQzZmVmMS00NDZiLTQ0ZDctYmQwNi01ODA2ZjgzMWFhZmMiLCJpc29ZZWFyIjoyMDI2LCJpc29XZWVrIjo0OH0=", "title": null, "startsAt": "2026-11-26T19:00:00.000Z", "endsAt": "2026-11-27T03:00:00.000Z", "cancelled": false, "categories": [] }, { "id": "eyJzZWdtZW50SUQiOiIxMGJjMGNiNy05Mzg4LTQ1N2QtOTJjNC1lYmZlNDk5ZjU5NTkiLCJpc29ZZWFyIjoyMDI2LCJpc29XZWVrIjo0OH0=", "title": null, "startsAt": "2026-11-27T19:00:00.000Z", "endsAt": "2026-11-28T03:00:00.000Z", "cancelled": false, "categories": [] } ], "pagination": { "nextCursor": "eyJyZWxhdGl2ZVRpbWUiOiIyMDI2LTEyLTIzVDE5OjEzOjE3LjIzMzAyNTE5OFoiLCJsYXN0U2VnbWVudElEIjoiMTcwYTI2ZjgtOGUzYi00YTc3LWFmODgtZjAxZDkzNmQzYTZlIiwibGFzdFNlZ21lbnRTdGFydFRpbWUiOnsic2Vjb25kcyI6MTc5ODU3MDgwMH0sIndlZWtkYXkiOiJXRURORVNEQVkiLCJ1dGNPZmZzZXRNaW51dGVzIjowfQ==", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/twitch/profile/schedule": { "get": { "tags": [ "Twitch" ], "summary": "A channel's coming broadcasts, 30 a page.", "description": "Each with its start, end, title and categories; an empty list for a channel that keeps\nno schedule. 1 credit a page.", "operationId": "twitchProfileSchedule", "parameters": [ { "name": "handle", "in": "query", "description": "The channel's login.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "The channel's link, instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The channel's numeric id, instead of either.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_TwitchScheduleSegment" }, "example": { "data": [ { "id": "eyJzZWdtZW50SUQiOiJiNjQzZmVmMS00NDZiLTQ0ZDctYmQwNi01ODA2ZjgzMWFhZmMiLCJpc29ZZWFyIjoyMDI2LCJpc29XZWVrIjo0OH0=", "title": null, "startsAt": "2026-11-26T19:00:00.000Z", "endsAt": "2026-11-27T03:00:00.000Z", "cancelled": false, "categories": [] }, { "id": "eyJzZWdtZW50SUQiOiIxMGJjMGNiNy05Mzg4LTQ1N2QtOTJjNC1lYmZlNDk5ZjU5NTkiLCJpc29ZZWFyIjoyMDI2LCJpc29XZWVrIjo0OH0=", "title": null, "startsAt": "2026-11-27T19:00:00.000Z", "endsAt": "2026-11-28T03:00:00.000Z", "cancelled": false, "categories": [] } ], "pagination": { "nextCursor": "eyJyZWxhdGl2ZVRpbWUiOiIyMDI2LTEyLTIzVDE5OjEzOjE3LjIzMzAyNTE5OFoiLCJsYXN0U2VnbWVudElEIjoiMTcwYTI2ZjgtOGUzYi00YTc3LWFmODgtZjAxZDkzNmQzYTZlIiwibGFzdFNlZ21lbnRTdGFydFRpbWUiOnsic2Vjb25kcyI6MTc5ODU3MDgwMH0sIndlZWtkYXkiOiJXRURORVNEQVkiLCJ1dGNPZmZzZXRNaW51dGVzIjowfQ==", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.twitch.profileSchedule({ handle: \"shroud\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.twitch.profile_schedule(handle=\"shroud\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/twitch/profile/schedule \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=shroud\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_TwitchScheduleSegment": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/TwitchScheduleSegment" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "TwitchScheduleSegment": { "type": "object", "description": "A broadcast on a channel's schedule.", "required": [ "id", "cancelled", "categories" ], "properties": { "cancelled": { "type": "boolean" }, "categories": { "type": "array", "items": { "$ref": "#/components/schemas/TwitchCategoryRef" } }, "endsAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "id": { "type": "string" }, "startsAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "When it starts and ends." }, { "type": "null" } ] }, "title": { "type": [ "string", "null" ] } } }, "Timestamp": { "type": "string", "format": "date-time" }, "TwitchCategoryRef": { "type": "object", "description": "A category as a video, a clip, a broadcast or a channel names it.", "required": [ "id", "name" ], "properties": { "coverUrl": { "type": [ "string", "null" ], "description": "Its box art." }, "id": { "type": "string" }, "name": { "type": "string" }, "slug": { "type": [ "string", "null" ], "description": "The name in its link (`just-chatting`)." }, "url": { "type": [ "string", "null" ] } } } } } } ``` # Profile (/docs/api-reference/twitch/profile) A channel with its follower count and links. `GET https://api.socialapi.sh/v1/twitch/profile` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.twitch.profile({ handle: "shroud" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.twitch.profile(handle="shroud").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/twitch/profile \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=shroud" ``` **Response** ```json { "data": { "id": "37402112", "username": "shroud", "displayName": "shroud", "bio": "I'm back baby", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/c754eebf-745b-4e0a-814a-10bcaecaabbc-profile_image-300x300.png", "url": "https://www.twitch.tv/shroud", "verified": true, "private": false, "followers": 11286234, "following": null, "likes": null, "posts": 1624, "externalUrl": null, "createdAt": "2012-11-03T15:50:32.878Z", "ext": { "partner": true, "affiliate": false, "live": true, "bannerUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/dbee25e8-55b7-4565-87f0-e9d4661dcc66-profile_banner-480.jpeg", "offlineImageUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/0e68b939-5868-4ee5-b2b8-fdb51521c84d-channel_offline_image-1920x1080.jpeg", "color": "#00ADFF", "language": "EN", "links": [ { "name": "discord", "title": "Discord", "url": "https://discord.gg/shroud" }, { "name": "twitter", "title": "Twitter", "url": "https://twitter.com/shroud" }, { "name": "youtube", "title": "YouTube", "url": "https://youtube.com/shroud" } ], "panels": [ { "title": null, "description": null, "imageUrl": "https://panels.twitch.tv/panel-37402112-image-b4e05d8f-d6ac-44d4-bd27-ee2cc7f3c13a", "linkUrl": "https://load.gg/shroud-palworldocg" }, { "title": null, "description": null, "imageUrl": "https://panels.twitch.tv/panel-37402112-image-407517f5-8549-42ec-9433-d19837869c09", "linkUrl": "https://load.gg/shroudLogitech" }, { "title": null, "description": null, "imageUrl": "https://panels.twitch.tv/panel-37402112-image-503ca1b8-22d5-4eab-b610-e673c13860d8", "linkUrl": "https://www.youtube.com/shroud" } ], "team": { "name": "loadedllc", "displayName": "Loaded", "url": "https://www.twitch.tv/team/loadedllc" }, "lastLiveAt": "2026-11-25T17:38:22.069Z", "lastTitle": "day3.. we finally got lucia the real main character YAHOO!", "lastCategory": { "id": "1867279146", "name": "Grand Theft Auto VI", "slug": "grand-theft-auto-vi", "url": "https://www.twitch.tv/directory/category/grand-theft-auto-vi", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/1867279146_IGDB-285x380.jpg" }, "updatedAt": "2026-11-25T17:35:01.451Z" } } } ``` **OpenAPI** ```json { "paths": { "/v1/twitch/profile": { "get": { "tags": [ "Twitch" ], "summary": "A channel with its follower count and links.", "description": "Name, bio, pictures, followers, the number of its videos, whether it is a partner, the\nlinks and panels under its player, its team, whether it is live and when it last was.\n1 credit.", "operationId": "twitchProfile", "parameters": [ { "name": "handle", "in": "query", "description": "The channel's login: the name in its link.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "The channel's link (`https://www.twitch.tv/shroud`), instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The channel's numeric id, instead of either.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_TwitchProfile" }, "example": { "data": { "id": "37402112", "username": "shroud", "displayName": "shroud", "bio": "I'm back baby", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/c754eebf-745b-4e0a-814a-10bcaecaabbc-profile_image-300x300.png", "url": "https://www.twitch.tv/shroud", "verified": true, "private": false, "followers": 11286234, "following": null, "likes": null, "posts": 1624, "externalUrl": null, "createdAt": "2012-11-03T15:50:32.878Z", "ext": { "partner": true, "affiliate": false, "live": true, "bannerUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/dbee25e8-55b7-4565-87f0-e9d4661dcc66-profile_banner-480.jpeg", "offlineImageUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/0e68b939-5868-4ee5-b2b8-fdb51521c84d-channel_offline_image-1920x1080.jpeg", "color": "#00ADFF", "language": "EN", "links": [ { "name": "discord", "title": "Discord", "url": "https://discord.gg/shroud" }, { "name": "twitter", "title": "Twitter", "url": "https://twitter.com/shroud" }, { "name": "youtube", "title": "YouTube", "url": "https://youtube.com/shroud" } ], "panels": [ { "title": null, "description": null, "imageUrl": "https://panels.twitch.tv/panel-37402112-image-b4e05d8f-d6ac-44d4-bd27-ee2cc7f3c13a", "linkUrl": "https://load.gg/shroud-palworldocg" }, { "title": null, "description": null, "imageUrl": "https://panels.twitch.tv/panel-37402112-image-407517f5-8549-42ec-9433-d19837869c09", "linkUrl": "https://load.gg/shroudLogitech" }, { "title": null, "description": null, "imageUrl": "https://panels.twitch.tv/panel-37402112-image-503ca1b8-22d5-4eab-b610-e673c13860d8", "linkUrl": "https://www.youtube.com/shroud" } ], "team": { "name": "loadedllc", "displayName": "Loaded", "url": "https://www.twitch.tv/team/loadedllc" }, "lastLiveAt": "2026-11-25T17:38:22.069Z", "lastTitle": "day3.. we finally got lucia the real main character YAHOO!", "lastCategory": { "id": "1867279146", "name": "Grand Theft Auto VI", "slug": "grand-theft-auto-vi", "url": "https://www.twitch.tv/directory/category/grand-theft-auto-vi", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/1867279146_IGDB-285x380.jpg" }, "updatedAt": "2026-11-25T17:35:01.451Z" } } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.twitch.profile({ handle: \"shroud\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.twitch.profile(handle=\"shroud\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/twitch/profile \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=shroud\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_TwitchProfile": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/TwitchProfile" } } }, "TwitchProfile": { "allOf": [ { "type": "object", "description": "An account.", "required": [ "id", "username", "url", "verified", "private", "ext" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "bio": { "type": [ "string", "null" ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "displayName": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "partner", "affiliate", "live", "links", "panels" ], "properties": { "affiliate": { "type": "boolean", "description": "A Twitch Affiliate." }, "bannerUrl": { "type": [ "string", "null" ] }, "color": { "type": [ "string", "null" ], "description": "Its accent colour (`#00ADFF`)." }, "language": { "type": [ "string", "null" ], "description": "The language it broadcasts in (`EN`)." }, "lastCategory": { "oneOf": [ { "$ref": "#/components/schemas/TwitchCategoryRef" }, { "type": "null" } ] }, "lastLiveAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "When its latest broadcast began, its title and its category." }, { "type": "null" } ] }, "lastTitle": { "type": [ "string", "null" ] }, "links": { "type": "array", "items": { "$ref": "#/components/schemas/TwitchLink" }, "description": "The links it lists." }, "live": { "type": "boolean", "description": "On air now. `/v1/twitch/live` has the broadcast." }, "offlineImageUrl": { "type": [ "string", "null" ], "description": "The picture its player shows while it is off air." }, "panels": { "type": "array", "items": { "$ref": "#/components/schemas/TwitchPanel" }, "description": "The panels under its player." }, "partner": { "type": "boolean", "description": "A Twitch Partner (`verified` says the same)." }, "team": { "oneOf": [ { "$ref": "#/components/schemas/TwitchTeamRef" }, { "type": "null" } ] }, "updatedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] } } }, { "type": "object", "description": "What only this platform has." } ] }, "externalUrl": { "type": [ "string", "null" ], "description": "The link in the bio." }, "followers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "following": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "id": { "type": "string", "description": "The platform's id for the account." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "description": "Likes the account's posts received in total.", "minimum": 0 }, "posts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "private": { "type": "boolean" }, "url": { "type": "string", "description": "The profile's page." }, "username": { "type": "string", "description": "The handle, without `@`." }, "verified": { "type": "boolean" } } }, { "type": "object", "description": "A Twitch channel." } ] }, "Timestamp": { "type": "string", "format": "date-time" }, "TwitchTeamRef": { "type": "object", "description": "The team a channel shows on its page.", "required": [ "name", "url" ], "properties": { "displayName": { "type": [ "string", "null" ] }, "name": { "type": "string", "description": "The name in its link." }, "url": { "type": "string" } } }, "TwitchPanel": { "type": "object", "description": "A panel under a channel's player: a picture, a text, a link, any of them.", "properties": { "description": { "type": [ "string", "null" ] }, "imageUrl": { "type": [ "string", "null" ] }, "linkUrl": { "type": [ "string", "null" ] }, "title": { "type": [ "string", "null" ] } } }, "TwitchLink": { "type": "object", "description": "A link a channel lists.", "required": [ "url" ], "properties": { "name": { "type": [ "string", "null" ], "description": "What it links to, as Twitch names it (`discord`, `youtube`)." }, "title": { "type": [ "string", "null" ] }, "url": { "type": "string" } } }, "TwitchCategoryRef": { "type": "object", "description": "A category as a video, a clip, a broadcast or a channel names it.", "required": [ "id", "name" ], "properties": { "coverUrl": { "type": [ "string", "null" ], "description": "Its box art." }, "id": { "type": "string" }, "name": { "type": "string" }, "slug": { "type": [ "string", "null" ], "description": "The name in its link (`just-chatting`)." }, "url": { "type": [ "string", "null" ] } } } } } } ``` # Search Categories (/docs/api-reference/twitch/search-categories) Categories matching a query, 30 a page. `GET https://api.socialapi.sh/v1/twitch/search/categories` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.twitch.searchCategories({ query: "minecraft" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.twitch.search_categories(query="minecraft") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/twitch/search/categories \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "query=minecraft" ``` **Response** ```json { "data": [ { "id": "27471", "name": "Minecraft", "slug": "minecraft", "url": "https://www.twitch.tv/directory/category/minecraft", "description": "Minecraft focuses on allowing the player to explore, interact with, and modify a dynamically-generated map made of one-cubic-meter-sized blocks. In addition to blocks, the environment features plants, mobs, and items. Some activities in the game include mining for ore, fighting hostile mobs, and crafting new blocks and tools by gathering various resources found in the game. The game's open-ended m…", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/27471_IGDB-285x380.jpg", "viewers": 43961, "channels": 3218, "followers": 4003931, "tags": [ "Simulation", "Adventure Game", "Arcade" ] }, { "id": "2042681592", "name": "Minecraft Dungeons II", "slug": "minecraft-dungeons-ii", "url": "https://www.twitch.tv/directory/category/minecraft-dungeons-ii", "description": "Drop the pickaxe, grab a sword, and charge into a thrilling new adventure in Minecraft Dungeons II. Journey through unexplored lands and mysterious locations, in a quest to stop a new evil from causing chaos in not one, but two worlds! Clash with menacing foes in explosive encounters and fight your way through hordes of mobs that will do everything in their power to stop you from saving the day.", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/2042681592_IGDB-285x380.jpg", "viewers": 79, "channels": 14, "followers": 11957, "tags": [ "RPG", "Action", "Adventure Game" ] } ], "pagination": { "nextCursor": "MzA=", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/twitch/search/categories": { "get": { "tags": [ "Twitch" ], "summary": "Categories matching a query, 30 a page.", "description": "1 credit a page.", "operationId": "twitchSearchCategories", "parameters": [ { "name": "query", "in": "query", "description": "What to search for.", "required": true, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_TwitchCategory" }, "example": { "data": [ { "id": "27471", "name": "Minecraft", "slug": "minecraft", "url": "https://www.twitch.tv/directory/category/minecraft", "description": "Minecraft focuses on allowing the player to explore, interact with, and modify a dynamically-generated map made of one-cubic-meter-sized blocks. In addition to blocks, the environment features plants, mobs, and items. Some activities in the game include mining for ore, fighting hostile mobs, and crafting new blocks and tools by gathering various resources found in the game. The game's open-ended m…", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/27471_IGDB-285x380.jpg", "viewers": 43961, "channels": 3218, "followers": 4003931, "tags": [ "Simulation", "Adventure Game", "Arcade" ] }, { "id": "2042681592", "name": "Minecraft Dungeons II", "slug": "minecraft-dungeons-ii", "url": "https://www.twitch.tv/directory/category/minecraft-dungeons-ii", "description": "Drop the pickaxe, grab a sword, and charge into a thrilling new adventure in Minecraft Dungeons II. Journey through unexplored lands and mysterious locations, in a quest to stop a new evil from causing chaos in not one, but two worlds! Clash with menacing foes in explosive encounters and fight your way through hordes of mobs that will do everything in their power to stop you from saving the day.", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/2042681592_IGDB-285x380.jpg", "viewers": 79, "channels": 14, "followers": 11957, "tags": [ "RPG", "Action", "Adventure Game" ] } ], "pagination": { "nextCursor": "MzA=", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.twitch.searchCategories({ query: \"minecraft\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.twitch.search_categories(query=\"minecraft\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/twitch/search/categories \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"query=minecraft\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_TwitchCategory": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/TwitchCategory" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "TwitchCategory": { "type": "object", "description": "A category: a game, or a kind of broadcast such as Just Chatting.", "required": [ "id", "name", "tags" ], "properties": { "channels": { "type": [ "integer", "null" ], "format": "int64", "description": "Channels broadcasting it now.", "minimum": 0 }, "coverUrl": { "type": [ "string", "null" ], "description": "Its box art." }, "description": { "type": [ "string", "null" ] }, "followers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "id": { "type": "string" }, "name": { "type": "string" }, "slug": { "type": [ "string", "null" ], "description": "The name in its link (`just-chatting`)." }, "tags": { "type": "array", "items": { "type": "string" }, "description": "Twitch's genres for it (`Simulation`, `IRL`)." }, "url": { "type": [ "string", "null" ] }, "viewers": { "type": [ "integer", "null" ], "format": "int64", "description": "People watching it now.", "minimum": 0 } } } } } } ``` # Search Lives (/docs/api-reference/twitch/search-lives) Live channels matching a query, 30 a page. `GET https://api.socialapi.sh/v1/twitch/search/lives` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.twitch.searchLives({ query: "valorant" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.twitch.search_lives(query="valorant") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/twitch/search/lives \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "query=valorant" ``` **Response** ```json { "data": [ { "live": true, "roomId": "321353907164", "title": "[SUBATHON MIAMI] MATCHDAY - VCT 2027 EMEA Kickoff Swiss Stage [BO3] : Joblife vs WIP Esports | 0-0 | !holy !free !astro !bfd !tr", "viewers": 15701, "startedAt": "2026-11-25T06:42:20.000Z", "coverUrl": "https://static-cdn.jtvnw.net/previews-ttv/live_user_jltomy-1280x720.jpg", "host": { "id": "155601320", "username": "jltomy", "displayName": "JLTomy", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/aa2bc80a-e317-494a-a94d-7492889e4f66-profile_image-300x300.png", "verified": true, "url": "https://www.twitch.tv/jltomy" }, "ext": { "category": { "id": "516575", "name": "VALORANT", "slug": "valorant", "url": "https://www.twitch.tv/directory/category/valorant", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/516575-285x380.jpg" }, "language": "FR", "tags": [ "Français", "DropsActivés" ], "labels": [], "rerun": false, "chatters": null, "videoId": "2940143792", "fps": 60, "width": 2560, "height": 1440, "lastLiveAt": "2026-11-25T06:42:20.000Z" } }, { "live": true, "roomId": "318417988578", "title": "SOLOQ VALORANT PRIME HEHE LOL WOWERS", "viewers": 1026, "startedAt": "2026-11-25T18:24:55.000Z", "coverUrl": "https://static-cdn.jtvnw.net/previews-ttv/live_user_mixwell-1280x720.jpg", "host": { "id": "96116107", "username": "mixwell", "displayName": "Mixwell", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/6d3b4513-6824-4912-848c-dc046ee262ad-profile_image-300x300.png", "verified": true, "url": "https://www.twitch.tv/mixwell" }, "ext": { "category": { "id": "516575", "name": "VALORANT", "slug": "valorant", "url": "https://www.twitch.tv/directory/category/valorant", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/516575-285x380.jpg" }, "language": "ES", "tags": [ "Español", "pro", "otakar" ], "labels": [], "rerun": false, "chatters": null, "videoId": "2940543880", "fps": 60, "width": 1920, "height": 1080, "lastLiveAt": "2026-11-25T18:24:55.000Z" } } ], "pagination": { "nextCursor": "MzA=", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/twitch/search/lives": { "get": { "tags": [ "Twitch" ], "summary": "Live channels matching a query, 30 a page.", "description": "1 credit a page.", "operationId": "twitchSearchLives", "parameters": [ { "name": "query", "in": "query", "description": "What to search for.", "required": true, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_TwitchLive" }, "example": { "data": [ { "live": true, "roomId": "321353907164", "title": "[SUBATHON MIAMI] MATCHDAY - VCT 2027 EMEA Kickoff Swiss Stage [BO3] : Joblife vs WIP Esports | 0-0 | !holy !free !astro !bfd !tr", "viewers": 15701, "startedAt": "2026-11-25T06:42:20.000Z", "coverUrl": "https://static-cdn.jtvnw.net/previews-ttv/live_user_jltomy-1280x720.jpg", "host": { "id": "155601320", "username": "jltomy", "displayName": "JLTomy", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/aa2bc80a-e317-494a-a94d-7492889e4f66-profile_image-300x300.png", "verified": true, "url": "https://www.twitch.tv/jltomy" }, "ext": { "category": { "id": "516575", "name": "VALORANT", "slug": "valorant", "url": "https://www.twitch.tv/directory/category/valorant", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/516575-285x380.jpg" }, "language": "FR", "tags": [ "Français", "DropsActivés" ], "labels": [], "rerun": false, "chatters": null, "videoId": "2940143792", "fps": 60, "width": 2560, "height": 1440, "lastLiveAt": "2026-11-25T06:42:20.000Z" } }, { "live": true, "roomId": "318417988578", "title": "SOLOQ VALORANT PRIME HEHE LOL WOWERS", "viewers": 1026, "startedAt": "2026-11-25T18:24:55.000Z", "coverUrl": "https://static-cdn.jtvnw.net/previews-ttv/live_user_mixwell-1280x720.jpg", "host": { "id": "96116107", "username": "mixwell", "displayName": "Mixwell", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/6d3b4513-6824-4912-848c-dc046ee262ad-profile_image-300x300.png", "verified": true, "url": "https://www.twitch.tv/mixwell" }, "ext": { "category": { "id": "516575", "name": "VALORANT", "slug": "valorant", "url": "https://www.twitch.tv/directory/category/valorant", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/516575-285x380.jpg" }, "language": "ES", "tags": [ "Español", "pro", "otakar" ], "labels": [], "rerun": false, "chatters": null, "videoId": "2940543880", "fps": 60, "width": 1920, "height": 1080, "lastLiveAt": "2026-11-25T18:24:55.000Z" } } ], "pagination": { "nextCursor": "MzA=", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.twitch.searchLives({ query: \"valorant\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.twitch.search_lives(query=\"valorant\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/twitch/search/lives \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"query=valorant\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_TwitchLive": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/TwitchLive" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "TwitchLive": { "allOf": [ { "type": "object", "description": "An account's live broadcast.", "required": [ "live", "ext" ], "properties": { "coverUrl": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "tags", "labels", "rerun" ], "properties": { "category": { "oneOf": [ { "$ref": "#/components/schemas/TwitchCategoryRef" }, { "type": "null" } ] }, "chatters": { "type": [ "integer", "null" ], "format": "int64", "description": "Accounts in the chat now; on `/live` and `/batch/live` only.", "minimum": 0 }, "fps": { "type": [ "number", "null" ], "format": "double", "description": "The picture's frame rate and size." }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "labels": { "type": "array", "items": { "type": "string" }, "description": "Twitch's content labels (`MatureGame`)." }, "language": { "type": [ "string", "null" ], "description": "The broadcast's language (`EN`)." }, "lastLiveAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "When the channel's latest broadcast began: this one's, or the last when off air." }, { "type": "null" } ] }, "rerun": { "type": "boolean", "description": "A past broadcast shown again, rather than a live one." }, "tags": { "type": "array", "items": { "type": "string" }, "description": "The tags the channel gave the broadcast." }, "videoId": { "type": [ "string", "null" ], "description": "The video the broadcast is being recorded to." }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, { "type": "object", "description": "What only this platform has." } ] }, "host": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "live": { "type": "boolean" }, "roomId": { "type": [ "string", "null" ] }, "startedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "title": { "type": [ "string", "null" ] }, "viewers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, { "type": "object", "description": "A channel's live status, with its broadcast when it is on." } ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } }, "TwitchCategoryRef": { "type": "object", "description": "A category as a video, a clip, a broadcast or a channel names it.", "required": [ "id", "name" ], "properties": { "coverUrl": { "type": [ "string", "null" ], "description": "Its box art." }, "id": { "type": "string" }, "name": { "type": "string" }, "slug": { "type": [ "string", "null" ], "description": "The name in its link (`just-chatting`)." }, "url": { "type": [ "string", "null" ] } } } } } } ``` # Search Suggestions (/docs/api-reference/twitch/search-suggestions) What the search box suggests for a few letters. `GET https://api.socialapi.sh/v1/twitch/search/suggestions` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.twitch.searchSuggestions({ query: "minec" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.twitch.search_suggestions(query="minec") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/twitch/search/suggestions \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "query=minec" ``` **Response** ```json { "data": [ { "text": "Minecraft" }, { "text": "Minecraft Dungeons II" } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/twitch/search/suggestions": { "get": { "tags": [ "Twitch" ], "summary": "What the search box suggests for a few letters.", "description": "Channels', categories' and searches' names. 1 credit.", "operationId": "twitchSearchSuggestions", "parameters": [ { "name": "query", "in": "query", "description": "The first letters of a search.", "required": true, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_Suggestion" }, "example": { "data": [ { "text": "Minecraft" }, { "text": "Minecraft Dungeons II" } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.twitch.searchSuggestions({ query: \"minec\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.twitch.search_suggestions(query=\"minec\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/twitch/search/suggestions \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"query=minec\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_Suggestion": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Suggestion" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "Suggestion": { "type": "object", "description": "A search suggestion.", "required": [ "text" ], "properties": { "text": { "type": "string" } } } } } } ``` # Search Users (/docs/api-reference/twitch/search-users) Channels matching a query, 30 a page. `GET https://api.socialapi.sh/v1/twitch/search/users` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.twitch.searchUsers({ query: "valorant" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.twitch.search_users(query="valorant") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/twitch/search/users \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "query=valorant" ``` **Response** ```json { "data": [ { "id": "598902753", "username": "valorant_emea", "displayName": "VALORANT_EMEA", "bio": "Official VALORANT Champions Tour EMEA Broadcast Channel.", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/babab2b8-e36f-4b10-8e16-47260e14892f-profile_image-300x300.png", "url": "https://www.twitch.tv/valorant_emea", "verified": true, "private": false, "followers": 791199, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": "2020-10-23T01:22:13.528Z", "ext": { "partner": true, "affiliate": false, "live": true, "bannerUrl": null, "offlineImageUrl": null, "color": null, "language": null, "links": [], "panels": [], "team": null, "lastLiveAt": "2026-11-25T15:30:31.771Z", "lastTitle": "VCT EMEA Kickoff Europe Qualifier Playoffs - Swiss Round 1 - NVJ vs AURR | JL vs WIP", "lastCategory": { "id": "516575", "name": "VALORANT", "slug": "valorant", "url": "https://www.twitch.tv/directory/category/valorant", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/516575-285x380.jpg" }, "updatedAt": null } }, { "id": "490592527", "username": "valorant", "displayName": "VALORANT", "bio": "VALORANT is a 5v5 character based tactical shooter video game from Riot Games.", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/7fbb949e-fb09-46db-87df-5e757af9f060-profile_image-300x300.png", "url": "https://www.twitch.tv/valorant", "verified": true, "private": false, "followers": 4934658, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": "2020-02-06T00:22:59.266Z", "ext": { "partner": true, "affiliate": false, "live": false, "bannerUrl": null, "offlineImageUrl": null, "color": null, "language": null, "links": [], "panels": [], "team": null, "lastLiveAt": "2026-11-01T23:04:21.228Z", "lastTitle": "M8 vs. KRÜ — VALORANT Game Changers Championship Sao Paulo— Grand Finals", "lastCategory": { "id": "516575", "name": "VALORANT", "slug": "valorant", "url": "https://www.twitch.tv/directory/category/valorant", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/516575-285x380.jpg" }, "updatedAt": null } } ], "pagination": { "nextCursor": "MzA=", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/twitch/search/users": { "get": { "tags": [ "Twitch" ], "summary": "Channels matching a query, 30 a page.", "description": "With their followers, and whether each is live. 1 credit a page.", "operationId": "twitchSearchUsers", "parameters": [ { "name": "query", "in": "query", "description": "What to search for.", "required": true, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_TwitchProfile" }, "example": { "data": [ { "id": "598902753", "username": "valorant_emea", "displayName": "VALORANT_EMEA", "bio": "Official VALORANT Champions Tour EMEA Broadcast Channel.", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/babab2b8-e36f-4b10-8e16-47260e14892f-profile_image-300x300.png", "url": "https://www.twitch.tv/valorant_emea", "verified": true, "private": false, "followers": 791199, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": "2020-10-23T01:22:13.528Z", "ext": { "partner": true, "affiliate": false, "live": true, "bannerUrl": null, "offlineImageUrl": null, "color": null, "language": null, "links": [], "panels": [], "team": null, "lastLiveAt": "2026-11-25T15:30:31.771Z", "lastTitle": "VCT EMEA Kickoff Europe Qualifier Playoffs - Swiss Round 1 - NVJ vs AURR | JL vs WIP", "lastCategory": { "id": "516575", "name": "VALORANT", "slug": "valorant", "url": "https://www.twitch.tv/directory/category/valorant", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/516575-285x380.jpg" }, "updatedAt": null } }, { "id": "490592527", "username": "valorant", "displayName": "VALORANT", "bio": "VALORANT is a 5v5 character based tactical shooter video game from Riot Games.", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/7fbb949e-fb09-46db-87df-5e757af9f060-profile_image-300x300.png", "url": "https://www.twitch.tv/valorant", "verified": true, "private": false, "followers": 4934658, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": "2020-02-06T00:22:59.266Z", "ext": { "partner": true, "affiliate": false, "live": false, "bannerUrl": null, "offlineImageUrl": null, "color": null, "language": null, "links": [], "panels": [], "team": null, "lastLiveAt": "2026-11-01T23:04:21.228Z", "lastTitle": "M8 vs. KRÜ — VALORANT Game Changers Championship Sao Paulo— Grand Finals", "lastCategory": { "id": "516575", "name": "VALORANT", "slug": "valorant", "url": "https://www.twitch.tv/directory/category/valorant", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/516575-285x380.jpg" }, "updatedAt": null } } ], "pagination": { "nextCursor": "MzA=", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.twitch.searchUsers({ query: \"valorant\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.twitch.search_users(query=\"valorant\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/twitch/search/users \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"query=valorant\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_TwitchProfile": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/TwitchProfile" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "TwitchProfile": { "allOf": [ { "type": "object", "description": "An account.", "required": [ "id", "username", "url", "verified", "private", "ext" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "bio": { "type": [ "string", "null" ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "displayName": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "partner", "affiliate", "live", "links", "panels" ], "properties": { "affiliate": { "type": "boolean", "description": "A Twitch Affiliate." }, "bannerUrl": { "type": [ "string", "null" ] }, "color": { "type": [ "string", "null" ], "description": "Its accent colour (`#00ADFF`)." }, "language": { "type": [ "string", "null" ], "description": "The language it broadcasts in (`EN`)." }, "lastCategory": { "oneOf": [ { "$ref": "#/components/schemas/TwitchCategoryRef" }, { "type": "null" } ] }, "lastLiveAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "When its latest broadcast began, its title and its category." }, { "type": "null" } ] }, "lastTitle": { "type": [ "string", "null" ] }, "links": { "type": "array", "items": { "$ref": "#/components/schemas/TwitchLink" }, "description": "The links it lists." }, "live": { "type": "boolean", "description": "On air now. `/v1/twitch/live` has the broadcast." }, "offlineImageUrl": { "type": [ "string", "null" ], "description": "The picture its player shows while it is off air." }, "panels": { "type": "array", "items": { "$ref": "#/components/schemas/TwitchPanel" }, "description": "The panels under its player." }, "partner": { "type": "boolean", "description": "A Twitch Partner (`verified` says the same)." }, "team": { "oneOf": [ { "$ref": "#/components/schemas/TwitchTeamRef" }, { "type": "null" } ] }, "updatedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] } } }, { "type": "object", "description": "What only this platform has." } ] }, "externalUrl": { "type": [ "string", "null" ], "description": "The link in the bio." }, "followers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "following": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "id": { "type": "string", "description": "The platform's id for the account." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "description": "Likes the account's posts received in total.", "minimum": 0 }, "posts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "private": { "type": "boolean" }, "url": { "type": "string", "description": "The profile's page." }, "username": { "type": "string", "description": "The handle, without `@`." }, "verified": { "type": "boolean" } } }, { "type": "object", "description": "A Twitch channel." } ] }, "Timestamp": { "type": "string", "format": "date-time" }, "TwitchTeamRef": { "type": "object", "description": "The team a channel shows on its page.", "required": [ "name", "url" ], "properties": { "displayName": { "type": [ "string", "null" ] }, "name": { "type": "string", "description": "The name in its link." }, "url": { "type": "string" } } }, "TwitchPanel": { "type": "object", "description": "A panel under a channel's player: a picture, a text, a link, any of them.", "properties": { "description": { "type": [ "string", "null" ] }, "imageUrl": { "type": [ "string", "null" ] }, "linkUrl": { "type": [ "string", "null" ] }, "title": { "type": [ "string", "null" ] } } }, "TwitchLink": { "type": "object", "description": "A link a channel lists.", "required": [ "url" ], "properties": { "name": { "type": [ "string", "null" ], "description": "What it links to, as Twitch names it (`discord`, `youtube`)." }, "title": { "type": [ "string", "null" ] }, "url": { "type": "string" } } }, "TwitchCategoryRef": { "type": "object", "description": "A category as a video, a clip, a broadcast or a channel names it.", "required": [ "id", "name" ], "properties": { "coverUrl": { "type": [ "string", "null" ], "description": "Its box art." }, "id": { "type": "string" }, "name": { "type": "string" }, "slug": { "type": [ "string", "null" ], "description": "The name in its link (`just-chatting`)." }, "url": { "type": [ "string", "null" ] } } } } } } ``` # Search (/docs/api-reference/twitch/search) Videos matching a query, 20 a page. `GET https://api.socialapi.sh/v1/twitch/search` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.twitch.search({ query: "valorant" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.twitch.search(query="valorant") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/twitch/search \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "query=valorant" ``` **Response** ```json { "data": [ { "id": "2939903945", "url": "https://www.twitch.tv/videos/2939903945", "text": null, "createdAt": "2026-11-25T00:58:10.000Z", "author": { "id": "884261414", "username": "ichinosetohr", "displayName": "一ノ瀬とおる", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/13176bed-4201-4ad4-8a95-378092e2e3b0-profile_image-300x300.png", "verified": true, "url": "https://www.twitch.tv/ichinosetohr" }, "stats": { "views": 26142, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://static-cdn.jtvnw.net/cf_vods/d3vd9lfkzbru3h/7d27f64b2ae58910743c_ichinosetohr_316757986545_1795568285//thumb/thumb0-640x360.jpg", "width": null, "height": null, "durationSeconds": 19688 } ], "hashtags": [], "mentions": [], "ext": { "kind": "archive", "title": "毎試合30キルする", "category": { "id": "516575", "name": "VALORANT", "slug": "valorant", "url": "https://www.twitch.tv/directory/category/valorant", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/516575-285x380.jpg" }, "language": "ja", "durationSeconds": 19688, "recording": false, "chapters": [], "labels": [], "clipId": null, "curator": null, "videoId": null, "videoOffsetSeconds": null, "featured": false } }, { "id": "2939978239", "url": "https://www.twitch.tv/videos/2939978239", "text": null, "createdAt": "2026-11-25T02:18:44.000Z", "author": { "id": "662899088", "username": "xwlumpy", "displayName": "xwLUMPY", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/13d50ddf-139a-44f1-85b1-de75993e0a9d-profile_image-300x300.png", "verified": true, "url": "https://www.twitch.tv/xwlumpy" }, "stats": { "views": 19578, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://static-cdn.jtvnw.net/cf_vods/d2nvs31859zcd8/f81f2ecb4cd73c0125cb_xwlumpy_318712539736_1795573120//thumb/thumb0-640x360.jpg", "width": null, "height": null, "durationSeconds": 23331 } ], "hashtags": [], "mentions": [], "ext": { "kind": "archive", "title": "🔫VALO HASTA PERDER UNA RANK Y GTA VI en busca de chichis 🔞🔫DROPS DE GTA VI🔞", "category": { "id": "516575", "name": "VALORANT", "slug": "valorant", "url": "https://www.twitch.tv/directory/category/valorant", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/516575-285x380.jpg" }, "language": "es", "durationSeconds": 23331, "recording": false, "chapters": [], "labels": [ "MatureGame" ], "clipId": null, "curator": null, "videoId": null, "videoOffsetSeconds": null, "featured": false } } ], "pagination": { "nextCursor": "MjA=", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/twitch/search": { "get": { "tags": [ "Twitch" ], "summary": "Videos matching a query, 20 a page.", "description": "1 credit a page.", "operationId": "twitchSearch", "parameters": [ { "name": "query", "in": "query", "description": "What to search for.", "required": true, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_TwitchPost" }, "example": { "data": [ { "id": "2939903945", "url": "https://www.twitch.tv/videos/2939903945", "text": null, "createdAt": "2026-11-25T00:58:10.000Z", "author": { "id": "884261414", "username": "ichinosetohr", "displayName": "一ノ瀬とおる", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/13176bed-4201-4ad4-8a95-378092e2e3b0-profile_image-300x300.png", "verified": true, "url": "https://www.twitch.tv/ichinosetohr" }, "stats": { "views": 26142, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://static-cdn.jtvnw.net/cf_vods/d3vd9lfkzbru3h/7d27f64b2ae58910743c_ichinosetohr_316757986545_1795568285//thumb/thumb0-640x360.jpg", "width": null, "height": null, "durationSeconds": 19688 } ], "hashtags": [], "mentions": [], "ext": { "kind": "archive", "title": "毎試合30キルする", "category": { "id": "516575", "name": "VALORANT", "slug": "valorant", "url": "https://www.twitch.tv/directory/category/valorant", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/516575-285x380.jpg" }, "language": "ja", "durationSeconds": 19688, "recording": false, "chapters": [], "labels": [], "clipId": null, "curator": null, "videoId": null, "videoOffsetSeconds": null, "featured": false } }, { "id": "2939978239", "url": "https://www.twitch.tv/videos/2939978239", "text": null, "createdAt": "2026-11-25T02:18:44.000Z", "author": { "id": "662899088", "username": "xwlumpy", "displayName": "xwLUMPY", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/13d50ddf-139a-44f1-85b1-de75993e0a9d-profile_image-300x300.png", "verified": true, "url": "https://www.twitch.tv/xwlumpy" }, "stats": { "views": 19578, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://static-cdn.jtvnw.net/cf_vods/d2nvs31859zcd8/f81f2ecb4cd73c0125cb_xwlumpy_318712539736_1795573120//thumb/thumb0-640x360.jpg", "width": null, "height": null, "durationSeconds": 23331 } ], "hashtags": [], "mentions": [], "ext": { "kind": "archive", "title": "🔫VALO HASTA PERDER UNA RANK Y GTA VI en busca de chichis 🔞🔫DROPS DE GTA VI🔞", "category": { "id": "516575", "name": "VALORANT", "slug": "valorant", "url": "https://www.twitch.tv/directory/category/valorant", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/516575-285x380.jpg" }, "language": "es", "durationSeconds": 23331, "recording": false, "chapters": [], "labels": [ "MatureGame" ], "clipId": null, "curator": null, "videoId": null, "videoOffsetSeconds": null, "featured": false } } ], "pagination": { "nextCursor": "MjA=", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.twitch.search({ query: \"valorant\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.twitch.search(query=\"valorant\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/twitch/search \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"query=valorant\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_TwitchPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/TwitchPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "TwitchPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "kind", "recording", "chapters", "labels", "featured" ], "properties": { "category": { "oneOf": [ { "$ref": "#/components/schemas/TwitchCategoryRef" }, { "type": "null" } ] }, "chapters": { "type": "array", "items": { "$ref": "#/components/schemas/TwitchChapter" }, "description": "A video's chapters; on `/post` only." }, "clipId": { "type": [ "string", "null" ], "description": "A clip's numeric id (its `id` is the name in its link)." }, "curator": { "oneOf": [ { "$ref": "#/components/schemas/Author", "description": "Who cut the clip." }, { "type": "null" } ] }, "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "featured": { "type": "boolean", "description": "A clip its channel features." }, "kind": { "$ref": "#/components/schemas/TwitchPostKind" }, "labels": { "type": "array", "items": { "type": "string" }, "description": "Twitch's content labels (`MatureGame`, `ProfanityVulgarity`)." }, "language": { "type": [ "string", "null" ], "description": "The language (`en`)." }, "recording": { "type": "boolean", "description": "A broadcast still on air: its video is being recorded, and grows." }, "title": { "type": [ "string", "null" ], "description": "The title (`text` is a video's description, which few have)." }, "videoId": { "type": [ "string", "null" ], "description": "The video a clip was cut from, and where in it, in seconds." }, "videoOffsetSeconds": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A video (a past broadcast, a highlight, an upload) or a clip." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "TwitchPostKind": { "type": "string", "description": "What a post is.", "enum": [ "archive", "highlight", "upload", "premiere", "clip" ] }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } }, "TwitchChapter": { "type": "object", "description": "A chapter of a video: a stretch of the broadcast in one category.", "required": [ "title", "startSeconds", "durationSeconds" ], "properties": { "category": { "oneOf": [ { "$ref": "#/components/schemas/TwitchCategoryRef" }, { "type": "null" } ] }, "durationSeconds": { "type": "integer", "format": "int64", "minimum": 0 }, "startSeconds": { "type": "integer", "format": "int64", "minimum": 0 }, "title": { "type": "string" } } }, "TwitchCategoryRef": { "type": "object", "description": "A category as a video, a clip, a broadcast or a channel names it.", "required": [ "id", "name" ], "properties": { "coverUrl": { "type": [ "string", "null" ], "description": "Its box art." }, "id": { "type": "string" }, "name": { "type": "string" }, "slug": { "type": [ "string", "null" ], "description": "The name in its link (`just-chatting`)." }, "url": { "type": [ "string", "null" ] } } }, "Timestamp": { "type": "string", "format": "date-time" } } } } ``` # Trending Categories (/docs/api-reference/twitch/trending-categories) The categories most watched now, 30 a page. `GET https://api.socialapi.sh/v1/twitch/trending/categories` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.twitch.trendingCategories(); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.twitch.trending_categories() ``` **cURL** ```bash curl https://api.socialapi.sh/v1/twitch/trending/categories \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" ``` **Response** ```json { "data": [ { "id": "1867279146", "name": "Grand Theft Auto VI", "slug": "grand-theft-auto-vi", "url": "https://www.twitch.tv/directory/category/grand-theft-auto-vi", "description": "Grand Theft Auto VI is an open-world action-adventure game developed by Rockstar Games. Set in the fictional U.S. state of Leonida, which includes Vice City and its surrounding regions, the game follows Jason Duval and Lucia Caminos, two criminals who become involved in a statewide conspiracy after a robbery goes wrong. Players can switch between the two protagonists while exploring the open world…", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/1867279146_IGDB-285x380.jpg", "viewers": 799573, "channels": 39221, "followers": 391255, "tags": [ "FPS", "Shooter", "Driving/Racing Game" ] }, { "id": "509658", "name": "Just Chatting", "slug": "just-chatting", "url": "https://www.twitch.tv/directory/category/just-chatting", "description": null, "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/509658-285x380.jpg", "viewers": 415470, "channels": 5828, "followers": 53355320, "tags": [ "IRL" ] } ], "pagination": { "nextCursor": "eyJzIjozMCwiZCI6ZmFsc2UsInQiOnRydWV9", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/twitch/trending/categories": { "get": { "tags": [ "Twitch" ], "summary": "The categories most watched now, 30 a page.", "description": "Each with its viewers, channels and followers. 1 credit a page.", "operationId": "twitchTrendingCategories", "parameters": [ { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_TwitchCategory" }, "example": { "data": [ { "id": "1867279146", "name": "Grand Theft Auto VI", "slug": "grand-theft-auto-vi", "url": "https://www.twitch.tv/directory/category/grand-theft-auto-vi", "description": "Grand Theft Auto VI is an open-world action-adventure game developed by Rockstar Games. Set in the fictional U.S. state of Leonida, which includes Vice City and its surrounding regions, the game follows Jason Duval and Lucia Caminos, two criminals who become involved in a statewide conspiracy after a robbery goes wrong. Players can switch between the two protagonists while exploring the open world…", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/1867279146_IGDB-285x380.jpg", "viewers": 799573, "channels": 39221, "followers": 391255, "tags": [ "FPS", "Shooter", "Driving/Racing Game" ] }, { "id": "509658", "name": "Just Chatting", "slug": "just-chatting", "url": "https://www.twitch.tv/directory/category/just-chatting", "description": null, "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/509658-285x380.jpg", "viewers": 415470, "channels": 5828, "followers": 53355320, "tags": [ "IRL" ] } ], "pagination": { "nextCursor": "eyJzIjozMCwiZCI6ZmFsc2UsInQiOnRydWV9", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.twitch.trendingCategories();" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.twitch.trending_categories()" }, { "lang": "bash", "label": "cURL", "source": "curl https://api.socialapi.sh/v1/twitch/trending/categories \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_TwitchCategory": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/TwitchCategory" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "TwitchCategory": { "type": "object", "description": "A category: a game, or a kind of broadcast such as Just Chatting.", "required": [ "id", "name", "tags" ], "properties": { "channels": { "type": [ "integer", "null" ], "format": "int64", "description": "Channels broadcasting it now.", "minimum": 0 }, "coverUrl": { "type": [ "string", "null" ], "description": "Its box art." }, "description": { "type": [ "string", "null" ] }, "followers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "id": { "type": "string" }, "name": { "type": "string" }, "slug": { "type": [ "string", "null" ], "description": "The name in its link (`just-chatting`)." }, "tags": { "type": "array", "items": { "type": "string" }, "description": "Twitch's genres for it (`Simulation`, `IRL`)." }, "url": { "type": [ "string", "null" ] }, "viewers": { "type": [ "integer", "null" ], "format": "int64", "description": "People watching it now.", "minimum": 0 } } } } } } ``` # Trending (/docs/api-reference/twitch/trending) The live channels most watched now, 30 a page. `GET https://api.socialapi.sh/v1/twitch/trending` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.twitch.trending(); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.twitch.trending() ``` **cURL** ```bash curl https://api.socialapi.sh/v1/twitch/trending \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" ``` **Response** ```json { "data": [ { "live": true, "roomId": "318474441316", "title": "RUSHEADA 🗣️ CUIDAO QUE TE LO PASAS 🗣️ NO CORRAS 🗣️ MÁS LENTO JUAN 🗣️ - Grand Theft Auto VI #6", "viewers": 72080, "startedAt": "2026-11-25T16:06:49.000Z", "coverUrl": "https://static-cdn.jtvnw.net/previews-ttv/live_user_illojuan-1280x720.jpg", "host": { "id": "90075649", "username": "illojuan", "displayName": "IlloJuan", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/43bec3fa-0027-4d4f-91ce-f3ebc1ec264d-profile_image-300x300.png", "verified": true, "url": "https://www.twitch.tv/illojuan" }, "ext": { "category": { "id": "1867279146", "name": "Grand Theft Auto VI", "slug": "grand-theft-auto-vi", "url": "https://www.twitch.tv/directory/category/grand-theft-auto-vi", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/1867279146_IGDB-285x380.jpg" }, "language": "ES", "tags": [ "Español", "DropsActivados" ], "labels": [ "MatureGame" ], "rerun": false, "chatters": null, "videoId": "2940424560", "fps": 60, "width": 2560, "height": 1440, "lastLiveAt": "2026-11-25T16:06:49.000Z" } }, { "live": true, "roomId": "318415094242", "title": "🔴[DROPS] GTA 6 FULL PLAYTHROUGH *ALMOST DONE*🔴", "viewers": 36156, "startedAt": "2026-11-25T13:36:37.000Z", "coverUrl": "https://static-cdn.jtvnw.net/previews-ttv/live_user_ohnepixel-1280x720.jpg", "host": { "id": "43683025", "username": "ohnepixel", "displayName": "ohnePixel", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/5742b015-e6ed-4f7c-a1dd-87cd88fe1eb9-profile_image-300x300.png", "verified": true, "url": "https://www.twitch.tv/ohnepixel" }, "ext": { "category": { "id": "1867279146", "name": "Grand Theft Auto VI", "slug": "grand-theft-auto-vi", "url": "https://www.twitch.tv/directory/category/grand-theft-auto-vi", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/1867279146_IGDB-285x380.jpg" }, "language": "EN", "tags": [ "English", "Drops", "DropsEnabled" ], "labels": [ "MatureGame" ], "rerun": false, "chatters": null, "videoId": "2940322036", "fps": 60, "width": 2560, "height": 1440, "lastLiveAt": "2026-11-25T13:36:37.000Z" } } ], "pagination": { "nextCursor": "eyJzIjo4ODY5LjIyMzc1OTcyNzE0LCJkIjpmYWxzZSwidCI6dHJ1ZX0=", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/twitch/trending": { "get": { "tags": [ "Twitch" ], "summary": "The live channels most watched now, 30 a page.", "description": "Across Twitch, by language or tag if asked. Cached two minutes. 1 credit a page.", "operationId": "twitchTrending", "parameters": [ { "name": "language", "in": "query", "description": "Only channels broadcasting in this language (`en`, `tr`).", "required": false, "schema": { "type": "string" } }, { "name": "tag", "in": "query", "description": "Only broadcasts with this tag (`DropsEnabled`).", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_TwitchLive" }, "example": { "data": [ { "live": true, "roomId": "318474441316", "title": "RUSHEADA 🗣️ CUIDAO QUE TE LO PASAS 🗣️ NO CORRAS 🗣️ MÁS LENTO JUAN 🗣️ - Grand Theft Auto VI #6", "viewers": 72080, "startedAt": "2026-11-25T16:06:49.000Z", "coverUrl": "https://static-cdn.jtvnw.net/previews-ttv/live_user_illojuan-1280x720.jpg", "host": { "id": "90075649", "username": "illojuan", "displayName": "IlloJuan", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/43bec3fa-0027-4d4f-91ce-f3ebc1ec264d-profile_image-300x300.png", "verified": true, "url": "https://www.twitch.tv/illojuan" }, "ext": { "category": { "id": "1867279146", "name": "Grand Theft Auto VI", "slug": "grand-theft-auto-vi", "url": "https://www.twitch.tv/directory/category/grand-theft-auto-vi", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/1867279146_IGDB-285x380.jpg" }, "language": "ES", "tags": [ "Español", "DropsActivados" ], "labels": [ "MatureGame" ], "rerun": false, "chatters": null, "videoId": "2940424560", "fps": 60, "width": 2560, "height": 1440, "lastLiveAt": "2026-11-25T16:06:49.000Z" } }, { "live": true, "roomId": "318415094242", "title": "🔴[DROPS] GTA 6 FULL PLAYTHROUGH *ALMOST DONE*🔴", "viewers": 36156, "startedAt": "2026-11-25T13:36:37.000Z", "coverUrl": "https://static-cdn.jtvnw.net/previews-ttv/live_user_ohnepixel-1280x720.jpg", "host": { "id": "43683025", "username": "ohnepixel", "displayName": "ohnePixel", "avatarUrl": "https://static-cdn.jtvnw.net/jtv_user_pictures/5742b015-e6ed-4f7c-a1dd-87cd88fe1eb9-profile_image-300x300.png", "verified": true, "url": "https://www.twitch.tv/ohnepixel" }, "ext": { "category": { "id": "1867279146", "name": "Grand Theft Auto VI", "slug": "grand-theft-auto-vi", "url": "https://www.twitch.tv/directory/category/grand-theft-auto-vi", "coverUrl": "https://static-cdn.jtvnw.net/ttv-boxart/1867279146_IGDB-285x380.jpg" }, "language": "EN", "tags": [ "English", "Drops", "DropsEnabled" ], "labels": [ "MatureGame" ], "rerun": false, "chatters": null, "videoId": "2940322036", "fps": 60, "width": 2560, "height": 1440, "lastLiveAt": "2026-11-25T13:36:37.000Z" } } ], "pagination": { "nextCursor": "eyJzIjo4ODY5LjIyMzc1OTcyNzE0LCJkIjpmYWxzZSwidCI6dHJ1ZX0=", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.twitch.trending();" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.twitch.trending()" }, { "lang": "bash", "label": "cURL", "source": "curl https://api.socialapi.sh/v1/twitch/trending \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_TwitchLive": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/TwitchLive" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "TwitchLive": { "allOf": [ { "type": "object", "description": "An account's live broadcast.", "required": [ "live", "ext" ], "properties": { "coverUrl": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "tags", "labels", "rerun" ], "properties": { "category": { "oneOf": [ { "$ref": "#/components/schemas/TwitchCategoryRef" }, { "type": "null" } ] }, "chatters": { "type": [ "integer", "null" ], "format": "int64", "description": "Accounts in the chat now; on `/live` and `/batch/live` only.", "minimum": 0 }, "fps": { "type": [ "number", "null" ], "format": "double", "description": "The picture's frame rate and size." }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "labels": { "type": "array", "items": { "type": "string" }, "description": "Twitch's content labels (`MatureGame`)." }, "language": { "type": [ "string", "null" ], "description": "The broadcast's language (`EN`)." }, "lastLiveAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "When the channel's latest broadcast began: this one's, or the last when off air." }, { "type": "null" } ] }, "rerun": { "type": "boolean", "description": "A past broadcast shown again, rather than a live one." }, "tags": { "type": "array", "items": { "type": "string" }, "description": "The tags the channel gave the broadcast." }, "videoId": { "type": [ "string", "null" ], "description": "The video the broadcast is being recorded to." }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, { "type": "object", "description": "What only this platform has." } ] }, "host": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "live": { "type": "boolean" }, "roomId": { "type": [ "string", "null" ] }, "startedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "title": { "type": [ "string", "null" ] }, "viewers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, { "type": "object", "description": "A channel's live status, with its broadcast when it is on." } ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } }, "TwitchCategoryRef": { "type": "object", "description": "A category as a video, a clip, a broadcast or a channel names it.", "required": [ "id", "name" ], "properties": { "coverUrl": { "type": [ "string", "null" ], "description": "Its box art." }, "id": { "type": "string" }, "name": { "type": "string" }, "slug": { "type": [ "string", "null" ], "description": "The name in its link (`just-chatting`)." }, "url": { "type": [ "string", "null" ] } } } } } } ``` # Community Posts (/docs/api-reference/x/community-posts) A community's top posts. `GET https://api.socialapi.sh/v1/x/community/posts` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.x.communityPosts({ url: "https://x.com/i/communities/1493446837214187523" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.x.community_posts(url="https://x.com/i/communities/1493446837214187523") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/x/community/posts \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://x.com/i/communities/1493446837214187523" ``` **Response** ```json { "data": [ { "id": "2124216278768341053", "url": "https://x.com/mike_dupa/status/2124216278768341053", "text": "I cut monthly cancellations on my app in half\n\nHere is how I did it and what I recommend:\n\n- Cut onboarding to 2 clicks to make it short\n- Turn on Stripe failed-payment emails (saves 3 in 10 renewals)\n- Offer every person who cancels a discount", "createdAt": "2026-11-21T19:00:01.545Z", "author": { "id": "1822528290625658880", "username": "mike_dupa", "displayName": "Mikey Builds", "avatarUrl": "https://pbs.twimg.com/profile_images/2117283252423524352/03itUBTv_400x400.jpg", "verified": true, "url": "https://x.com/mike_dupa" }, "stats": { "views": 8127, "likes": 531, "comments": 26, "shares": 19, "saves": 17, "engagementRate": 0.0709 }, "media": [], "hashtags": [], "mentions": [], "ext": { "quotes": 1, "language": "en", "conversationId": null, "replyTo": null, "repost": null, "quoted": null, "pinned": false, "sensitive": false, "links": [], "altTexts": [], "playlists": [] } }, { "id": "2115557010884190648", "url": "https://x.com/marckohlbrugge/status/2115557010884190648", "text": "My goal for http://buildinpublic.com is to become the definitive database of all makers and their projects\n\nTo that end, you can now add your projects to http://buildinpublic.com\n\nTo verify ownership and get the verified checkmark, just add the <meta name=\"twitter:creator\" content=\"@marckohlbrugge\"> tag to your site\n\nMany people already have this set up, so it seemed like an easy way to verify\n\nht…", "createdAt": "2026-10-28T21:31:11.200Z", "author": { "id": "641633", "username": "marckohlbrugge", "displayName": "Marc Köhlbrugge", "avatarUrl": "https://pbs.twimg.com/profile_images/1857124042433572864/iMivVaYP_400x400.jpg", "verified": true, "url": "https://x.com/marckohlbrugge" }, "stats": { "views": 54501, "likes": 472, "comments": 104, "shares": 16, "saves": 282, "engagementRate": 0.0109 }, "media": [ { "kind": "image", "url": "https://pbs.twimg.com/media/HVv0YX9XsAAZsE4.jpg", "thumbnailUrl": null, "width": 2560, "height": 1904, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "quotes": 8, "language": "en", "conversationId": null, "replyTo": null, "repost": null, "quoted": null, "pinned": false, "sensitive": false, "links": [ "http://buildinpublic.com", "https://buildinpublic.com/projects" ], "altTexts": [], "playlists": [] } } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/x/community/posts": { "get": { "tags": [ "X" ], "summary": "A community's top posts.", "description": "The community's 20 top posts, ranked by X, with their counts and views. One page.\n1 credit.", "operationId": "xCommunityPosts", "parameters": [ { "name": "url", "in": "query", "description": "The community's link (`https://x.com/i/communities/1493446837214187523`).", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The community's id, instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_XPost" }, "example": { "data": [ { "id": "2124216278768341053", "url": "https://x.com/mike_dupa/status/2124216278768341053", "text": "I cut monthly cancellations on my app in half\n\nHere is how I did it and what I recommend:\n\n- Cut onboarding to 2 clicks to make it short\n- Turn on Stripe failed-payment emails (saves 3 in 10 renewals)\n- Offer every person who cancels a discount", "createdAt": "2026-11-21T19:00:01.545Z", "author": { "id": "1822528290625658880", "username": "mike_dupa", "displayName": "Mikey Builds", "avatarUrl": "https://pbs.twimg.com/profile_images/2117283252423524352/03itUBTv_400x400.jpg", "verified": true, "url": "https://x.com/mike_dupa" }, "stats": { "views": 8127, "likes": 531, "comments": 26, "shares": 19, "saves": 17, "engagementRate": 0.0709 }, "media": [], "hashtags": [], "mentions": [], "ext": { "quotes": 1, "language": "en", "conversationId": null, "replyTo": null, "repost": null, "quoted": null, "pinned": false, "sensitive": false, "links": [], "altTexts": [], "playlists": [] } }, { "id": "2115557010884190648", "url": "https://x.com/marckohlbrugge/status/2115557010884190648", "text": "My goal for http://buildinpublic.com is to become the definitive database of all makers and their projects\n\nTo that end, you can now add your projects to http://buildinpublic.com\n\nTo verify ownership and get the verified checkmark, just add the <meta name=\"twitter:creator\" content=\"@marckohlbrugge\"> tag to your site\n\nMany people already have this set up, so it seemed like an easy way to verify\n\nht…", "createdAt": "2026-10-28T21:31:11.200Z", "author": { "id": "641633", "username": "marckohlbrugge", "displayName": "Marc Köhlbrugge", "avatarUrl": "https://pbs.twimg.com/profile_images/1857124042433572864/iMivVaYP_400x400.jpg", "verified": true, "url": "https://x.com/marckohlbrugge" }, "stats": { "views": 54501, "likes": 472, "comments": 104, "shares": 16, "saves": 282, "engagementRate": 0.0109 }, "media": [ { "kind": "image", "url": "https://pbs.twimg.com/media/HVv0YX9XsAAZsE4.jpg", "thumbnailUrl": null, "width": 2560, "height": 1904, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "quotes": 8, "language": "en", "conversationId": null, "replyTo": null, "repost": null, "quoted": null, "pinned": false, "sensitive": false, "links": [ "http://buildinpublic.com", "https://buildinpublic.com/projects" ], "altTexts": [], "playlists": [] } } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.x.communityPosts({ url: \"https://x.com/i/communities/1493446837214187523\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.x.community_posts(url=\"https://x.com/i/communities/1493446837214187523\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/x/community/posts \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://x.com/i/communities/1493446837214187523\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_XPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/XPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "XPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "pinned", "sensitive", "links", "altTexts", "playlists" ], "properties": { "altTexts": { "type": "array", "items": { "type": "string" }, "description": "Each image's description for screen readers, in `media`'s order; empty when none\nhas one." }, "conversationId": { "type": [ "string", "null" ], "description": "The thread it belongs to: its first post's id." }, "language": { "type": [ "string", "null" ], "description": "X's detection of its text's language (`en`; `zxx` for none)." }, "links": { "type": "array", "items": { "type": "string" }, "description": "The links in its text, in full." }, "pinned": { "type": "boolean", "description": "Pinned to its author's profile, in that account's posts." }, "playlists": { "type": "array", "items": { "type": "string" }, "description": "A video's playlist (HLS), for each video in `media`, in its order." }, "quoted": { "oneOf": [ { "$ref": "#/components/schemas/XQuoted" }, { "type": "null" } ] }, "quotes": { "type": [ "integer", "null" ], "format": "int64", "description": "Posts quoting it.", "minimum": 0 }, "replyTo": { "oneOf": [ { "$ref": "#/components/schemas/XReplyRef", "description": "What it replies to, when it is a reply." }, { "type": "null" } ] }, "repost": { "oneOf": [ { "$ref": "#/components/schemas/XRepost", "description": "Who reposted it into this list, in an account's posts." }, { "type": "null" } ] }, "sensitive": { "type": "boolean", "description": "Marked as possibly sensitive." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A post: text, images, a video, a link or a quote." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "XRepost": { "type": "object", "description": "Who reposted a post into the list it is in.", "required": [ "by", "id" ], "properties": { "at": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "by": { "$ref": "#/components/schemas/Author" }, "id": { "type": "string", "description": "The repost's own id." } } }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } }, "Timestamp": { "type": "string", "format": "date-time" }, "XReplyRef": { "type": "object", "description": "The post a reply answers.", "required": [ "postId" ], "properties": { "postId": { "type": "string", "description": "The post's id." }, "username": { "type": [ "string", "null" ], "description": "Its author's handle." } } }, "XQuoted": { "type": "object", "description": "The post a post quotes.", "required": [ "id", "url" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "id": { "type": "string" }, "text": { "type": [ "string", "null" ] }, "url": { "type": "string" } } } } } } ``` # Community (/docs/api-reference/x/community) A community with its members, rules and topic. `GET https://api.socialapi.sh/v1/x/community` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.x.community({ url: "https://x.com/i/communities/1493446837214187523" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.x.community(url="https://x.com/i/communities/1493446837214187523").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/x/community \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://x.com/i/communities/1493446837214187523" ``` **Response** ```json { "data": { "id": "1493446837214187523", "name": "Build in Public", "description": "Share what you're working on. Get feedback. Help each other move forward. – Sponsored by bolt.new ⚡", "url": "https://x.com/i/communities/1493446837214187523", "members": 271609, "createdAt": "2022-02-15T04:47:27.551Z", "topic": "Entrepreneurship", "joinPolicy": "Open", "question": null, "nsfw": false, "bannerUrl": "https://pbs.twimg.com/community_banner_img/1915033378811772928/KdaKUaRP?format=png&name=orig", "creator": "marckohlbrugge", "rules": [ { "name": "Share what you're working on", "description": "Don't be scared to share unfinished work" }, { "name": "Screenshots, screencasts, drafts, etc", "description": "Visual tweets tend to grab people's attention" }, { "name": "No self-promotion", "description": "Don't ask for upvotes or advertise your products/services." } ], "hashtags": [ "design", "code", "marketing" ] } } ``` **OpenAPI** ```json { "paths": { "/v1/x/community": { "get": { "tags": [ "X" ], "summary": "A community with its members, rules and topic.", "description": "Name, description, members, creation date, topic, who may join, its question to those\nwho do, its rules, its creator and the hashtags trending in it. 1 credit.", "operationId": "xCommunity", "parameters": [ { "name": "url", "in": "query", "description": "The community's link (`https://x.com/i/communities/1493446837214187523`).", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The community's id, instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_XCommunity" }, "example": { "data": { "id": "1493446837214187523", "name": "Build in Public", "description": "Share what you're working on. Get feedback. Help each other move forward. – Sponsored by bolt.new ⚡", "url": "https://x.com/i/communities/1493446837214187523", "members": 271609, "createdAt": "2022-02-15T04:47:27.551Z", "topic": "Entrepreneurship", "joinPolicy": "Open", "question": null, "nsfw": false, "bannerUrl": "https://pbs.twimg.com/community_banner_img/1915033378811772928/KdaKUaRP?format=png&name=orig", "creator": "marckohlbrugge", "rules": [ { "name": "Share what you're working on", "description": "Don't be scared to share unfinished work" }, { "name": "Screenshots, screencasts, drafts, etc", "description": "Visual tweets tend to grab people's attention" }, { "name": "No self-promotion", "description": "Don't ask for upvotes or advertise your products/services." } ], "hashtags": [ "design", "code", "marketing" ] } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.x.community({ url: \"https://x.com/i/communities/1493446837214187523\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.x.community(url=\"https://x.com/i/communities/1493446837214187523\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/x/community \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://x.com/i/communities/1493446837214187523\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_XCommunity": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/XCommunity" } } }, "XCommunity": { "type": "object", "description": "A community: a group of accounts posting about one subject.", "required": [ "id", "name", "url", "nsfw", "rules", "hashtags" ], "properties": { "bannerUrl": { "type": [ "string", "null" ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "creator": { "type": [ "string", "null" ], "description": "Its creator's handle." }, "description": { "type": [ "string", "null" ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags trending in it, without `#` (only `/v1/x/community` has them)." }, "id": { "type": "string" }, "joinPolicy": { "type": [ "string", "null" ], "description": "`Open`, or `RestrictedJoinRequestsRequireModeratorApproval`." }, "members": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "name": { "type": "string" }, "nsfw": { "type": "boolean" }, "question": { "type": [ "string", "null" ], "description": "The question it asks those who join." }, "rules": { "type": "array", "items": { "$ref": "#/components/schemas/XCommunityRule" } }, "topic": { "type": [ "string", "null" ], "description": "What it is about (`Entrepreneurship`)." }, "url": { "type": "string" } } }, "XCommunityRule": { "type": "object", "description": "One of a community's rules.", "required": [ "name" ], "properties": { "description": { "type": [ "string", "null" ] }, "name": { "type": "string" } } }, "Timestamp": { "type": "string", "format": "date-time" } } } } ``` # X (Twitter) API (/docs/api-reference/x) Every X (Twitter) endpoint, by group. Each is a `GET` under `/v1/x`. ## Quick Reference [#quick-reference] | Property | Value | | --- | --- | | Base path | `/v1/x` | | Endpoints | 13 | | Credits | See Below | | Guide | [X (Twitter)](/docs/x) | ## Accounts [#accounts] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/x/profile`](/docs/api-reference/x/profile) | An account with its follower and post counts. | 1 | | [`GET /v1/x/profile/highlights`](/docs/api-reference/x/profile-highlights) | The posts an account highlighted, newest first. | 1 | | [`GET /v1/x/profile/posts`](/docs/api-reference/x/profile-posts) | An account's posts and reposts, newest first. | 1 | | [`GET /v1/x/profile/similar`](/docs/api-reference/x/profile-similar) | Accounts like one, as X suggests them. | 1 | ## Communities [#communities] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/x/community`](/docs/api-reference/x/community) | A community with its members, rules and topic. | 1 | | [`GET /v1/x/community/posts`](/docs/api-reference/x/community-posts) | A community's top posts. | 1 | ## Posts [#posts] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/x/post`](/docs/api-reference/x/post) | One post with its views, likes, replies and reposts. | 1 | | [`GET /v1/x/post/comments`](/docs/api-reference/x/post-comments) | The top replies to a post. | 1 | | [`GET /v1/x/post/transcript`](/docs/api-reference/x/post-transcript) | A video post's captions as text. | 10 | ## Discovery [#discovery] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/x/trending`](/docs/api-reference/x/trending) | The topics trending in a country, or worldwide. | 1 | | [`GET /v1/x/trending/posts`](/docs/api-reference/x/trending-posts) | The posts trending on X today. | 1 | ## Live [#live] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/x/live`](/docs/api-reference/x/live) | A live video broadcast, running or ended. | 1 | | [`GET /v1/x/space`](/docs/api-reference/x/space) | A Space with its hosts, speakers and audience. | 1 | ## Example Request [#example-request] Every X (Twitter) endpoint is called this way: its path, and what to read as query parameters. **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.x.profile({ handle: "NASA" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.x.profile(handle="NASA").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/x/profile \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=NASA" ``` **Response** ```json { "data": { "id": "11348282", "username": "NASA", "displayName": "NASA", "bio": "Making the seemingly impossible, possible. ✨", "avatarUrl": "https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB_400x400.jpg", "url": "https://x.com/NASA", "verified": true, "private": false, "followers": 92078384, "following": 115, "likes": null, "posts": 74589, "externalUrl": "http://www.nasa.gov/", "createdAt": "2007-12-19T20:20:32.000Z", "ext": { "bannerUrl": "https://pbs.twimg.com/profile_banners/11348282/1788992290", "location": "Pale Blue Dot", "blueVerified": true, "verifiedType": "Government", "verifiedSince": "2009-08-07T19:53:50.941Z", "mediaPosts": 28267, "highlights": 296, "likesGiven": 17125, "pinnedPosts": [] } } } ``` ## Errors [#errors] A call that fails costs nothing. See [Errors](/docs/errors) for every code. # Live (/docs/api-reference/x/live) A live video broadcast, running or ended. `GET https://api.socialapi.sh/v1/x/live` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.x.live({ url: "https://x.com/i/broadcasts/2onVBonVMMWjaV" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.x.live(url="https://x.com/i/broadcasts/2onVBonVMMWjaV").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/x/live \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://x.com/i/broadcasts/2onVBonVMMWjaV" ``` **Response** ```json { "data": { "live": false, "roomId": "2onVBonVMMWjaV", "title": "Progress 97 Cargo Ship Docking", "viewers": null, "startedAt": "2026-11-26T11:27:04.739Z", "coverUrl": "https://prod-fastly-p.video.pscp.tv/Transcoding/v1/replay_thumbnail/pdxa/periscope-replays-public/eyJkIjowfQ/2onVBonVMMWjaV/chunk_1795695338186009745_1457_b.jpg?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsInZlcnNpb24iOiIyIn0.eyJBbGxvd2VkUHJvdG9jb2xzIjpbInRodW1iIl0sIkJyb2FkY2FzdElkIjoiMm9uVkJvblZNTVdqYVYiLCJHcmFudFR5cGUiOiJyZWFkIiwiR3JhbnRlZEF0IjoxNzk1Nzg2NTQ3LCJHcmFudGVkVG8iOiJ0dy0xNzk1Nzg2NTQ3MTM2MDk3NjMiLCJTdHJlYW1OYW1lIjoiMm9uVkJvblZNTVdqYVYiLCJleHAiOjE3OTU5NTkzNDd9.-eSOUpXp0VUtGse6yjiEAOYIrSwWnYEc-5F2g3LDO0U&service=proxsee&digest=RVyfltxAqAnmuDoJPogOAa0Ffupzq2tagh-EdWjZ390", "host": { "id": "11348282", "username": "NASA", "displayName": "NASA", "avatarUrl": "https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB_400x400.jpg", "verified": true, "url": "https://x.com/NASA" }, "ext": { "state": "timed_out", "endedAt": "2026-11-26T12:20:28.944Z", "replay": true, "views": 126485, "streamUrl": "https://prod-fastly-p.video.pscp.tv/Transcoding/v1/hls/2onVBonVMMWjaV/non_transcode/pdxa/periscope-replays-public/master_dynamic_16651048709796310152.m3u8?type=replay", "width": 3840, "height": 2160, "postId": "2125914231304327216" } } } ``` **OpenAPI** ```json { "paths": { "/v1/x/live": { "get": { "tags": [ "X" ], "summary": "A live video broadcast, running or ended.", "description": "Its title, state, host, start and end, viewers while it runs, views in all, its size,\nthe post that shares it and its stream's playlist (HLS): live while it runs, its replay\nafter. 1 credit, cached a minute.", "operationId": "xLive", "parameters": [ { "name": "url", "in": "query", "description": "The broadcast's link (`https://x.com/i/broadcasts/2onVBonVMMWjaV`).", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The broadcast's id, instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_XBroadcast" }, "example": { "data": { "live": false, "roomId": "2onVBonVMMWjaV", "title": "Progress 97 Cargo Ship Docking", "viewers": null, "startedAt": "2026-11-26T11:27:04.739Z", "coverUrl": "https://prod-fastly-p.video.pscp.tv/Transcoding/v1/replay_thumbnail/pdxa/periscope-replays-public/eyJkIjowfQ/2onVBonVMMWjaV/chunk_1795695338186009745_1457_b.jpg?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsInZlcnNpb24iOiIyIn0.eyJBbGxvd2VkUHJvdG9jb2xzIjpbInRodW1iIl0sIkJyb2FkY2FzdElkIjoiMm9uVkJvblZNTVdqYVYiLCJHcmFudFR5cGUiOiJyZWFkIiwiR3JhbnRlZEF0IjoxNzk1Nzg2NTQ3LCJHcmFudGVkVG8iOiJ0dy0xNzk1Nzg2NTQ3MTM2MDk3NjMiLCJTdHJlYW1OYW1lIjoiMm9uVkJvblZNTVdqYVYiLCJleHAiOjE3OTU5NTkzNDd9.-eSOUpXp0VUtGse6yjiEAOYIrSwWnYEc-5F2g3LDO0U&service=proxsee&digest=RVyfltxAqAnmuDoJPogOAa0Ffupzq2tagh-EdWjZ390", "host": { "id": "11348282", "username": "NASA", "displayName": "NASA", "avatarUrl": "https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB_400x400.jpg", "verified": true, "url": "https://x.com/NASA" }, "ext": { "state": "timed_out", "endedAt": "2026-11-26T12:20:28.944Z", "replay": true, "views": 126485, "streamUrl": "https://prod-fastly-p.video.pscp.tv/Transcoding/v1/hls/2onVBonVMMWjaV/non_transcode/pdxa/periscope-replays-public/master_dynamic_16651048709796310152.m3u8?type=replay", "width": 3840, "height": 2160, "postId": "2125914231304327216" } } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.x.live({ url: \"https://x.com/i/broadcasts/2onVBonVMMWjaV\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.x.live(url=\"https://x.com/i/broadcasts/2onVBonVMMWjaV\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/x/live \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://x.com/i/broadcasts/2onVBonVMMWjaV\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_XBroadcast": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/XBroadcast" } } }, "XBroadcast": { "allOf": [ { "type": "object", "description": "An account's live broadcast.", "required": [ "live", "ext" ], "properties": { "coverUrl": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "replay" ], "properties": { "endedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "postId": { "type": [ "string", "null" ], "description": "The post that shares it, as `/v1/x/post` takes it." }, "replay": { "type": "boolean", "description": "Whether its replay can be watched." }, "state": { "type": [ "string", "null" ], "description": "`running`, `ended` or `timed_out`." }, "streamUrl": { "type": [ "string", "null" ], "description": "Its stream's playlist (HLS): live while it runs, its replay after." }, "views": { "type": [ "integer", "null" ], "format": "int64", "description": "Its views in all, live and replayed.", "minimum": 0 }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, { "type": "object", "description": "What only this platform has." } ] }, "host": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "live": { "type": "boolean" }, "roomId": { "type": [ "string", "null" ] }, "startedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "title": { "type": [ "string", "null" ] }, "viewers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, { "type": "object", "description": "A live video broadcast." } ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Post Comments (/docs/api-reference/x/post-comments) The top replies to a post. `GET https://api.socialapi.sh/v1/x/post/comments` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.x.postComments({ url: "https://x.com/NASA/status/2125318351341994436" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.x.post_comments(url="https://x.com/NASA/status/2125318351341994436") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/x/post/comments \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://x.com/NASA/status/2125318351341994436" ``` **Response** ```json { "data": [ { "id": "2125343817897480679", "postId": "2125318351341994436", "parentId": null, "text": "The fact that NASA is not only involved in this, but making statements to the public, tells me that we’re completely fucked.", "createdAt": "2026-11-24T21:40:27.822Z", "author": { "id": "1511396637918339072", "username": "drawkkwast", "displayName": "Drawk Kwast", "avatarUrl": "https://pbs.twimg.com/profile_images/1940340278776209408/18IGwbVJ_400x400.jpg", "verified": true, "url": "https://x.com/drawkkwast" }, "likes": 20520, "replies": 89, "ext": { "url": "https://x.com/drawkkwast/status/2125343817897480679", "views": 1215786, "reposts": 455, "quotes": 9, "saves": 376, "media": [], "language": "en", "byAuthor": false } }, { "id": "2125412853821620459", "postId": "2125318351341994436", "parentId": null, "text": "Everyone in that area needs to go immediately to get bloodwork done to test for lead concentrations NOW before the detonation. This will provide a baseline in your medical records before exposure. Without that it will be much harder to prove in court damages.", "createdAt": "2026-11-25T02:14:47.269Z", "author": { "id": "1684768461099073537", "username": "ArgileNoland", "displayName": "Bud C. 🇺🇸", "avatarUrl": "https://pbs.twimg.com/profile_images/2115138626770128896/BWxEaPTY_400x400.jpg", "verified": true, "url": "https://x.com/ArgileNoland" }, "likes": 7203, "replies": 43, "ext": { "url": "https://x.com/ArgileNoland/status/2125412853821620459", "views": 664465, "reposts": 231, "quotes": 7, "saves": 199, "media": [], "language": "en", "byAuthor": false } } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/x/post/comments": { "get": { "tags": [ "X" ], "summary": "The top replies to a post.", "description": "The post's top replies, a few threads (about 3 to 5), each with its counts and media;\na reply to a reply names its parent. One page. 1 credit.", "operationId": "xPostComments", "parameters": [ { "name": "url", "in": "query", "description": "The post's link (`https://x.com/NASA/status/2125641758432284978`).", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The post's id, instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_XComment" }, "example": { "data": [ { "id": "2125343817897480679", "postId": "2125318351341994436", "parentId": null, "text": "The fact that NASA is not only involved in this, but making statements to the public, tells me that we’re completely fucked.", "createdAt": "2026-11-24T21:40:27.822Z", "author": { "id": "1511396637918339072", "username": "drawkkwast", "displayName": "Drawk Kwast", "avatarUrl": "https://pbs.twimg.com/profile_images/1940340278776209408/18IGwbVJ_400x400.jpg", "verified": true, "url": "https://x.com/drawkkwast" }, "likes": 20520, "replies": 89, "ext": { "url": "https://x.com/drawkkwast/status/2125343817897480679", "views": 1215786, "reposts": 455, "quotes": 9, "saves": 376, "media": [], "language": "en", "byAuthor": false } }, { "id": "2125412853821620459", "postId": "2125318351341994436", "parentId": null, "text": "Everyone in that area needs to go immediately to get bloodwork done to test for lead concentrations NOW before the detonation. This will provide a baseline in your medical records before exposure. Without that it will be much harder to prove in court damages.", "createdAt": "2026-11-25T02:14:47.269Z", "author": { "id": "1684768461099073537", "username": "ArgileNoland", "displayName": "Bud C. 🇺🇸", "avatarUrl": "https://pbs.twimg.com/profile_images/2115138626770128896/BWxEaPTY_400x400.jpg", "verified": true, "url": "https://x.com/ArgileNoland" }, "likes": 7203, "replies": 43, "ext": { "url": "https://x.com/ArgileNoland/status/2125412853821620459", "views": 664465, "reposts": 231, "quotes": 7, "saves": 199, "media": [], "language": "en", "byAuthor": false } } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.x.postComments({ url: \"https://x.com/NASA/status/2125318351341994436\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.x.post_comments(url=\"https://x.com/NASA/status/2125318351341994436\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/x/post/comments \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://x.com/NASA/status/2125318351341994436\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_XComment": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/XComment" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "XComment": { "allOf": [ { "type": "object", "description": "A comment or a reply.", "required": [ "id", "postId", "text", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "description": "A reply is a post of its own on X: what the comment schema has no room for.", "required": [ "url", "media", "byAuthor" ], "properties": { "byAuthor": { "type": "boolean", "description": "Written by the post's own author." }, "language": { "type": [ "string", "null" ] }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "quotes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "reposts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Bookmarks.", "minimum": 0 }, "url": { "type": "string" }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, { "type": "object", "description": "What only this platform has." } ] }, "id": { "type": "string" }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "parentId": { "type": [ "string", "null" ], "description": "The comment this replies to; absent on a top-level comment." }, "postId": { "type": "string" }, "replies": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "text": { "type": "string" } } }, { "type": "object", "description": "A reply to a post." } ] }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Post Transcript (/docs/api-reference/x/post-transcript) A video post's captions as text. `GET https://api.socialapi.sh/v1/x/post/transcript` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.x.postTranscript({ url: "https://x.com/NASA/status/2125641758432284978" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.x.post_transcript(url="https://x.com/NASA/status/2125641758432284978").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/x/post/transcript \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://x.com/NASA/status/2125641758432284978" ``` **Response** ```json { "data": { "postId": "2125641758432284978", "language": "en", "generated": false, "text": "NASA needs people from a\nwide variety of backgrounds.\nPhysical science,\nengineering,\nmedicine,\nmilitary,\nfighter pilot,\noperations,\nindustry\nand flight test.\nCome join us!", "cues": [ { "startSeconds": 0.3, "endSeconds": 1.401, "text": "NASA needs people from a" }, { "startSeconds": 1.401, "endSeconds": 2.869, "text": "wide variety of backgrounds." }, { "startSeconds": 2.869, "endSeconds": 3.77, "text": "Physical science," } ] } } ``` **OpenAPI** ```json { "paths": { "/v1/x/post/transcript": { "get": { "tags": [ "X" ], "summary": "A video post's captions as text.", "description": "X's own caption track, as timed lines and as plain text: the one uploaded with the\nvideo, or the one X made from its speech (`generated`). A post without a video, or a\nvideo without captions, is a `404`. 10 credits, cached 30 days.", "operationId": "xPostTranscript", "parameters": [ { "name": "url", "in": "query", "description": "The post's link (`https://x.com/NASA/status/2125641758432284978`).", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The post's id, instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_XTranscript" }, "example": { "data": { "postId": "2125641758432284978", "language": "en", "generated": false, "text": "NASA needs people from a\nwide variety of backgrounds.\nPhysical science,\nengineering,\nmedicine,\nmilitary,\nfighter pilot,\noperations,\nindustry\nand flight test.\nCome join us!", "cues": [ { "startSeconds": 0.3, "endSeconds": 1.401, "text": "NASA needs people from a" }, { "startSeconds": 1.401, "endSeconds": 2.869, "text": "wide variety of backgrounds." }, { "startSeconds": 2.869, "endSeconds": 3.77, "text": "Physical science," } ] } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.x.postTranscript({ url: \"https://x.com/NASA/status/2125641758432284978\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.x.post_transcript(url=\"https://x.com/NASA/status/2125641758432284978\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/x/post/transcript \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://x.com/NASA/status/2125641758432284978\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_XTranscript": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/XTranscript" } } }, "XTranscript": { "type": "object", "description": "A video's captions as text.", "required": [ "postId", "generated", "text", "cues" ], "properties": { "cues": { "type": "array", "items": { "$ref": "#/components/schemas/XCue" } }, "generated": { "type": "boolean", "description": "Made by X from the video's speech, rather than uploaded with it." }, "language": { "type": [ "string", "null" ] }, "postId": { "type": "string" }, "text": { "type": "string", "description": "The captions as plain text, one line a cue." } } }, "XCue": { "type": "object", "required": [ "startSeconds", "endSeconds", "text" ], "properties": { "endSeconds": { "type": "number", "format": "double" }, "startSeconds": { "type": "number", "format": "double" }, "text": { "type": "string" } } } } } } ``` # Post (/docs/api-reference/x/post) One post with its views, likes, replies and reposts. `GET https://api.socialapi.sh/v1/x/post` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.x.post({ url: "https://x.com/NASA/status/2125318351341994436" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.x.post(url="https://x.com/NASA/status/2125318351341994436").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/x/post \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://x.com/NASA/status/2125318351341994436" ``` **Response** ```json { "data": { "id": "2125318351341994436", "url": "https://x.com/NASA/status/2125318351341994436", "text": "As part of a coordinated, whole-of-government effort, NASA has rapidly mobilized specialized research aircraft, space-based observation capabilities, and scientific personnel to support ongoing efforts at the Iowa Army Ammunition Plant in Middletown, Iowa. NASA stands ready to bring its unique capabilities and world-class scientific expertise to bear whenever called upon in service of the nation a…", "createdAt": "2026-11-24T19:59:16.122Z", "author": { "id": "11348282", "username": "NASA", "displayName": "NASA", "avatarUrl": "https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB_400x400.jpg", "verified": true, "url": "https://x.com/NASA" }, "stats": { "views": 14066458, "likes": 37797, "comments": 2160, "shares": 3322, "saves": 9658, "engagementRate": 0.0031 }, "media": [], "hashtags": [], "mentions": [], "ext": { "quotes": 1611, "language": "en", "conversationId": null, "replyTo": null, "repost": null, "quoted": null, "pinned": false, "sensitive": false, "links": [], "altTexts": [], "playlists": [] } } } ``` **OpenAPI** ```json { "paths": { "/v1/x/post": { "get": { "tags": [ "X" ], "summary": "One post with its views, likes, replies and reposts.", "description": "Text with its links written out, media (a video's best MP4 and its HLS playlist), the\npost it quotes or answers, its language, and its counts, views, bookmarks and quotes\nincluded. 1 credit.", "operationId": "xPost", "parameters": [ { "name": "url", "in": "query", "description": "The post's link (`https://x.com/NASA/status/2125641758432284978`).", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The post's id, instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_XPost" }, "example": { "data": { "id": "2125318351341994436", "url": "https://x.com/NASA/status/2125318351341994436", "text": "As part of a coordinated, whole-of-government effort, NASA has rapidly mobilized specialized research aircraft, space-based observation capabilities, and scientific personnel to support ongoing efforts at the Iowa Army Ammunition Plant in Middletown, Iowa. NASA stands ready to bring its unique capabilities and world-class scientific expertise to bear whenever called upon in service of the nation a…", "createdAt": "2026-11-24T19:59:16.122Z", "author": { "id": "11348282", "username": "NASA", "displayName": "NASA", "avatarUrl": "https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB_400x400.jpg", "verified": true, "url": "https://x.com/NASA" }, "stats": { "views": 14066458, "likes": 37797, "comments": 2160, "shares": 3322, "saves": 9658, "engagementRate": 0.0031 }, "media": [], "hashtags": [], "mentions": [], "ext": { "quotes": 1611, "language": "en", "conversationId": null, "replyTo": null, "repost": null, "quoted": null, "pinned": false, "sensitive": false, "links": [], "altTexts": [], "playlists": [] } } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.x.post({ url: \"https://x.com/NASA/status/2125318351341994436\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.x.post(url=\"https://x.com/NASA/status/2125318351341994436\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/x/post \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://x.com/NASA/status/2125318351341994436\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_XPost": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/XPost" } } }, "XPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "pinned", "sensitive", "links", "altTexts", "playlists" ], "properties": { "altTexts": { "type": "array", "items": { "type": "string" }, "description": "Each image's description for screen readers, in `media`'s order; empty when none\nhas one." }, "conversationId": { "type": [ "string", "null" ], "description": "The thread it belongs to: its first post's id." }, "language": { "type": [ "string", "null" ], "description": "X's detection of its text's language (`en`; `zxx` for none)." }, "links": { "type": "array", "items": { "type": "string" }, "description": "The links in its text, in full." }, "pinned": { "type": "boolean", "description": "Pinned to its author's profile, in that account's posts." }, "playlists": { "type": "array", "items": { "type": "string" }, "description": "A video's playlist (HLS), for each video in `media`, in its order." }, "quoted": { "oneOf": [ { "$ref": "#/components/schemas/XQuoted" }, { "type": "null" } ] }, "quotes": { "type": [ "integer", "null" ], "format": "int64", "description": "Posts quoting it.", "minimum": 0 }, "replyTo": { "oneOf": [ { "$ref": "#/components/schemas/XReplyRef", "description": "What it replies to, when it is a reply." }, { "type": "null" } ] }, "repost": { "oneOf": [ { "$ref": "#/components/schemas/XRepost", "description": "Who reposted it into this list, in an account's posts." }, { "type": "null" } ] }, "sensitive": { "type": "boolean", "description": "Marked as possibly sensitive." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A post: text, images, a video, a link or a quote." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "XRepost": { "type": "object", "description": "Who reposted a post into the list it is in.", "required": [ "by", "id" ], "properties": { "at": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "by": { "$ref": "#/components/schemas/Author" }, "id": { "type": "string", "description": "The repost's own id." } } }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } }, "Timestamp": { "type": "string", "format": "date-time" }, "XReplyRef": { "type": "object", "description": "The post a reply answers.", "required": [ "postId" ], "properties": { "postId": { "type": "string", "description": "The post's id." }, "username": { "type": [ "string", "null" ], "description": "Its author's handle." } } }, "XQuoted": { "type": "object", "description": "The post a post quotes.", "required": [ "id", "url" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "id": { "type": "string" }, "text": { "type": [ "string", "null" ] }, "url": { "type": "string" } } } } } } ``` # Profile Highlights (/docs/api-reference/x/profile-highlights) The posts an account highlighted, newest first. `GET https://api.socialapi.sh/v1/x/profile/highlights` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.x.profileHighlights({ handle: "NASA" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.x.profile_highlights(handle="NASA") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/x/profile/highlights \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=NASA" ``` **Response** ```json { "data": [ { "id": "2125167587264770208", "url": "https://x.com/NASA/status/2125167587264770208", "text": "LIVE: An uncrewed Progress cargo spacecraft carrying food, fuel, and supplies is about to lift off on a two-day journey to the @Space_Station. Launch is scheduled for 5:17am ET (1017 UTC). https://x.com/i/broadcasts/2OdRLXzWgOzBYK", "createdAt": "2026-11-24T10:00:11.165Z", "author": { "id": "11348282", "username": "NASA", "displayName": "NASA", "avatarUrl": "https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB_400x400.jpg", "verified": true, "url": "https://x.com/NASA" }, "stats": { "views": 760102, "likes": 1590, "comments": 115, "shares": 236, "saves": 71, "engagementRate": 0.0026 }, "media": [], "hashtags": [], "mentions": [ "Space_Station" ], "ext": { "quotes": 19, "language": "en", "conversationId": null, "replyTo": null, "repost": null, "quoted": null, "pinned": false, "sensitive": false, "links": [ "https://x.com/i/broadcasts/2OdRLXzWgOzBYK" ], "altTexts": [], "playlists": [] } }, { "id": "2124903027370774900", "url": "https://x.com/NASA/status/2124903027370774900", "text": "We're on our way to explore the mysteries of Europa, an ocean world that could support life.\n\nTake a behind-the-scenes look at the mission that's making it possible. Our new documentary, The Europa Concept, is now on NASA+: https://plus.nasa.gov/video/the-europa-concept/", "createdAt": "2026-11-23T16:28:55.171Z", "author": { "id": "11348282", "username": "NASA", "displayName": "NASA", "avatarUrl": "https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB_400x400.jpg", "verified": true, "url": "https://x.com/NASA" }, "stats": { "views": 899733, "likes": 6135, "comments": 260, "shares": 1010, "saves": 863, "engagementRate": 0.0082 }, "media": [ { "kind": "video", "url": "https://video.twimg.com/amplify_video/2124902931874889728/vid/avc1/1920x1080/bqUo_GzISwvt_r1k.mp4?tag=16", "thumbnailUrl": "https://pbs.twimg.com/media/HX0sChTWkAAO3-x.png", "width": 720, "height": 405, "durationSeconds": 87.402 } ], "hashtags": [], "mentions": [], "ext": { "quotes": 105, "language": "en", "conversationId": null, "replyTo": null, "repost": null, "quoted": null, "pinned": false, "sensitive": false, "links": [ "https://plus.nasa.gov/video/the-europa-concept/" ], "altTexts": [], "playlists": [ "https://video.twimg.com/amplify_video/2124902931874889728/pl/20P7_wOL27G5jRSc.m3u8?tag=16&v=bcb" ] } } ], "pagination": { "nextCursor": "DAAHCgABHYIpjkG__-wLAAIAAAATMTg3NTEyNjk5Njg4NjY5MTE5OAgAAwAAAAIAAA", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/x/profile/highlights": { "get": { "tags": [ "X" ], "summary": "The posts an account highlighted, newest first.", "description": "20 a page, every one it highlighted. 1 credit a page.", "operationId": "xProfileHighlights", "parameters": [ { "name": "handle", "in": "query", "description": "The account's handle (`NASA`), with or without `@`.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "The profile's link, instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_XPost" }, "example": { "data": [ { "id": "2125167587264770208", "url": "https://x.com/NASA/status/2125167587264770208", "text": "LIVE: An uncrewed Progress cargo spacecraft carrying food, fuel, and supplies is about to lift off on a two-day journey to the @Space_Station. Launch is scheduled for 5:17am ET (1017 UTC). https://x.com/i/broadcasts/2OdRLXzWgOzBYK", "createdAt": "2026-11-24T10:00:11.165Z", "author": { "id": "11348282", "username": "NASA", "displayName": "NASA", "avatarUrl": "https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB_400x400.jpg", "verified": true, "url": "https://x.com/NASA" }, "stats": { "views": 760102, "likes": 1590, "comments": 115, "shares": 236, "saves": 71, "engagementRate": 0.0026 }, "media": [], "hashtags": [], "mentions": [ "Space_Station" ], "ext": { "quotes": 19, "language": "en", "conversationId": null, "replyTo": null, "repost": null, "quoted": null, "pinned": false, "sensitive": false, "links": [ "https://x.com/i/broadcasts/2OdRLXzWgOzBYK" ], "altTexts": [], "playlists": [] } }, { "id": "2124903027370774900", "url": "https://x.com/NASA/status/2124903027370774900", "text": "We're on our way to explore the mysteries of Europa, an ocean world that could support life.\n\nTake a behind-the-scenes look at the mission that's making it possible. Our new documentary, The Europa Concept, is now on NASA+: https://plus.nasa.gov/video/the-europa-concept/", "createdAt": "2026-11-23T16:28:55.171Z", "author": { "id": "11348282", "username": "NASA", "displayName": "NASA", "avatarUrl": "https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB_400x400.jpg", "verified": true, "url": "https://x.com/NASA" }, "stats": { "views": 899733, "likes": 6135, "comments": 260, "shares": 1010, "saves": 863, "engagementRate": 0.0082 }, "media": [ { "kind": "video", "url": "https://video.twimg.com/amplify_video/2124902931874889728/vid/avc1/1920x1080/bqUo_GzISwvt_r1k.mp4?tag=16", "thumbnailUrl": "https://pbs.twimg.com/media/HX0sChTWkAAO3-x.png", "width": 720, "height": 405, "durationSeconds": 87.402 } ], "hashtags": [], "mentions": [], "ext": { "quotes": 105, "language": "en", "conversationId": null, "replyTo": null, "repost": null, "quoted": null, "pinned": false, "sensitive": false, "links": [ "https://plus.nasa.gov/video/the-europa-concept/" ], "altTexts": [], "playlists": [ "https://video.twimg.com/amplify_video/2124902931874889728/pl/20P7_wOL27G5jRSc.m3u8?tag=16&v=bcb" ] } } ], "pagination": { "nextCursor": "DAAHCgABHYIpjkG__-wLAAIAAAATMTg3NTEyNjk5Njg4NjY5MTE5OAgAAwAAAAIAAA", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.x.profileHighlights({ handle: \"NASA\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.x.profile_highlights(handle=\"NASA\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/x/profile/highlights \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=NASA\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_XPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/XPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "XPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "pinned", "sensitive", "links", "altTexts", "playlists" ], "properties": { "altTexts": { "type": "array", "items": { "type": "string" }, "description": "Each image's description for screen readers, in `media`'s order; empty when none\nhas one." }, "conversationId": { "type": [ "string", "null" ], "description": "The thread it belongs to: its first post's id." }, "language": { "type": [ "string", "null" ], "description": "X's detection of its text's language (`en`; `zxx` for none)." }, "links": { "type": "array", "items": { "type": "string" }, "description": "The links in its text, in full." }, "pinned": { "type": "boolean", "description": "Pinned to its author's profile, in that account's posts." }, "playlists": { "type": "array", "items": { "type": "string" }, "description": "A video's playlist (HLS), for each video in `media`, in its order." }, "quoted": { "oneOf": [ { "$ref": "#/components/schemas/XQuoted" }, { "type": "null" } ] }, "quotes": { "type": [ "integer", "null" ], "format": "int64", "description": "Posts quoting it.", "minimum": 0 }, "replyTo": { "oneOf": [ { "$ref": "#/components/schemas/XReplyRef", "description": "What it replies to, when it is a reply." }, { "type": "null" } ] }, "repost": { "oneOf": [ { "$ref": "#/components/schemas/XRepost", "description": "Who reposted it into this list, in an account's posts." }, { "type": "null" } ] }, "sensitive": { "type": "boolean", "description": "Marked as possibly sensitive." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A post: text, images, a video, a link or a quote." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "XRepost": { "type": "object", "description": "Who reposted a post into the list it is in.", "required": [ "by", "id" ], "properties": { "at": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "by": { "$ref": "#/components/schemas/Author" }, "id": { "type": "string", "description": "The repost's own id." } } }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } }, "Timestamp": { "type": "string", "format": "date-time" }, "XReplyRef": { "type": "object", "description": "The post a reply answers.", "required": [ "postId" ], "properties": { "postId": { "type": "string", "description": "The post's id." }, "username": { "type": [ "string", "null" ], "description": "Its author's handle." } } }, "XQuoted": { "type": "object", "description": "The post a post quotes.", "required": [ "id", "url" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "id": { "type": "string" }, "text": { "type": [ "string", "null" ] }, "url": { "type": "string" } } } } } } ``` # Profile Posts (/docs/api-reference/x/profile-posts) An account's posts and reposts, newest first. `GET https://api.socialapi.sh/v1/x/profile/posts` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.x.profilePosts({ handle: "NASA" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.x.profile_posts(handle="NASA") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/x/profile/posts \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=NASA" ``` **Response** ```json { "data": [ { "id": "2125971502923129200", "url": "https://x.com/astro_anil/status/2125971502923129200", "text": "From space to Earth: wishing you a happy thanksgiving. From this vantage point there is so much to be grateful for on our planet. We wish we could spend the holiday a little closer to you - we will be watching you from here!", "createdAt": "2026-11-26T15:14:39.594Z", "author": { "id": "1456357980216066048", "username": "astro_anil", "displayName": "Anil Menon", "avatarUrl": "https://pbs.twimg.com/profile_images/2052785413719212034/9NTTJaza_400x400.jpg", "verified": true, "url": "https://x.com/astro_anil" }, "stats": { "views": 212172, "likes": 2413, "comments": 92, "shares": 362, "saves": 122, "engagementRate": 0.0135 }, "media": [ { "kind": "video", "url": "https://video.twimg.com/ext_tw_video/2125971421868208128/pu/vid/avc1/720x1280/BhYCb7zw6aIg_h6P.mp4?tag=12", "thumbnailUrl": "https://pbs.twimg.com/ext_tw_video_thumb/2125971421868208128/pu/img/4FqM4hobh79s-F3I.jpg", "width": 1080, "height": 1920, "durationSeconds": 108.466 } ], "hashtags": [], "mentions": [], "ext": { "quotes": 28, "language": "en", "conversationId": "2125971502923129200", "replyTo": null, "repost": { "by": { "id": "11348282", "username": "NASA", "displayName": "NASA", "avatarUrl": "https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB_400x400.jpg", "verified": true, "url": "https://x.com/NASA" }, "id": "2126050028032872522", "at": "2026-11-26T20:26:41.439Z" }, "quoted": null, "pinned": false, "sensitive": false, "links": [], "altTexts": [], "playlists": [ "https://video.twimg.com/ext_tw_video/2125971421868208128/pu/pl/b0SJiylVorYYPLUO.m3u8?tag=12&v=77b" ] } }, { "id": "2125915027819446402", "url": "https://x.com/NASA/status/2125915027819446402", "text": "LIVE: Watch the Progress 97 spacecraft arrive and dock to the @space_station after a two-day trip.\n\nThe unpiloted spacecraft will autonomously dock at 7:11am ET (1211 UTC), delivering food, fuel, and supplies. https://x.com/i/broadcasts/2onVBonVMMWjaV", "createdAt": "2026-11-26T11:30:14.880Z", "author": { "id": "11348282", "username": "NASA", "displayName": "NASA", "avatarUrl": "https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB_400x400.jpg", "verified": true, "url": "https://x.com/NASA" }, "stats": { "views": 744407, "likes": 1801, "comments": 158, "shares": 316, "saves": 105, "engagementRate": 0.0031 }, "media": [], "hashtags": [], "mentions": [ "space_station" ], "ext": { "quotes": 26, "language": "en", "conversationId": "2125915027819446402", "replyTo": null, "repost": null, "quoted": null, "pinned": false, "sensitive": false, "links": [ "https://x.com/i/broadcasts/2onVBonVMMWjaV" ], "altTexts": [], "playlists": [] } } ], "pagination": { "nextCursor": "DAAHCgABHYIpikI__-wLAAIAAAATMjEyMzc5ODMxNDg0Mzc4NzMwMAgAAwAAAAIAAA", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/x/profile/posts": { "get": { "tags": [ "X" ], "summary": "An account's posts and reposts, newest first.", "description": "20 a page, about 600 in all; its replies left out. A repost is the post it reposts,\nwith who reposted it. A protected account's posts are a `403`. 1 credit a page.", "operationId": "xProfilePosts", "parameters": [ { "name": "handle", "in": "query", "description": "The account's handle (`NASA`), with or without `@`.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "The profile's link, instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_XPost" }, "example": { "data": [ { "id": "2125971502923129200", "url": "https://x.com/astro_anil/status/2125971502923129200", "text": "From space to Earth: wishing you a happy thanksgiving. From this vantage point there is so much to be grateful for on our planet. We wish we could spend the holiday a little closer to you - we will be watching you from here!", "createdAt": "2026-11-26T15:14:39.594Z", "author": { "id": "1456357980216066048", "username": "astro_anil", "displayName": "Anil Menon", "avatarUrl": "https://pbs.twimg.com/profile_images/2052785413719212034/9NTTJaza_400x400.jpg", "verified": true, "url": "https://x.com/astro_anil" }, "stats": { "views": 212172, "likes": 2413, "comments": 92, "shares": 362, "saves": 122, "engagementRate": 0.0135 }, "media": [ { "kind": "video", "url": "https://video.twimg.com/ext_tw_video/2125971421868208128/pu/vid/avc1/720x1280/BhYCb7zw6aIg_h6P.mp4?tag=12", "thumbnailUrl": "https://pbs.twimg.com/ext_tw_video_thumb/2125971421868208128/pu/img/4FqM4hobh79s-F3I.jpg", "width": 1080, "height": 1920, "durationSeconds": 108.466 } ], "hashtags": [], "mentions": [], "ext": { "quotes": 28, "language": "en", "conversationId": "2125971502923129200", "replyTo": null, "repost": { "by": { "id": "11348282", "username": "NASA", "displayName": "NASA", "avatarUrl": "https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB_400x400.jpg", "verified": true, "url": "https://x.com/NASA" }, "id": "2126050028032872522", "at": "2026-11-26T20:26:41.439Z" }, "quoted": null, "pinned": false, "sensitive": false, "links": [], "altTexts": [], "playlists": [ "https://video.twimg.com/ext_tw_video/2125971421868208128/pu/pl/b0SJiylVorYYPLUO.m3u8?tag=12&v=77b" ] } }, { "id": "2125915027819446402", "url": "https://x.com/NASA/status/2125915027819446402", "text": "LIVE: Watch the Progress 97 spacecraft arrive and dock to the @space_station after a two-day trip.\n\nThe unpiloted spacecraft will autonomously dock at 7:11am ET (1211 UTC), delivering food, fuel, and supplies. https://x.com/i/broadcasts/2onVBonVMMWjaV", "createdAt": "2026-11-26T11:30:14.880Z", "author": { "id": "11348282", "username": "NASA", "displayName": "NASA", "avatarUrl": "https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB_400x400.jpg", "verified": true, "url": "https://x.com/NASA" }, "stats": { "views": 744407, "likes": 1801, "comments": 158, "shares": 316, "saves": 105, "engagementRate": 0.0031 }, "media": [], "hashtags": [], "mentions": [ "space_station" ], "ext": { "quotes": 26, "language": "en", "conversationId": "2125915027819446402", "replyTo": null, "repost": null, "quoted": null, "pinned": false, "sensitive": false, "links": [ "https://x.com/i/broadcasts/2onVBonVMMWjaV" ], "altTexts": [], "playlists": [] } } ], "pagination": { "nextCursor": "DAAHCgABHYIpikI__-wLAAIAAAATMjEyMzc5ODMxNDg0Mzc4NzMwMAgAAwAAAAIAAA", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.x.profilePosts({ handle: \"NASA\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.x.profile_posts(handle=\"NASA\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/x/profile/posts \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=NASA\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_XPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/XPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "XPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "pinned", "sensitive", "links", "altTexts", "playlists" ], "properties": { "altTexts": { "type": "array", "items": { "type": "string" }, "description": "Each image's description for screen readers, in `media`'s order; empty when none\nhas one." }, "conversationId": { "type": [ "string", "null" ], "description": "The thread it belongs to: its first post's id." }, "language": { "type": [ "string", "null" ], "description": "X's detection of its text's language (`en`; `zxx` for none)." }, "links": { "type": "array", "items": { "type": "string" }, "description": "The links in its text, in full." }, "pinned": { "type": "boolean", "description": "Pinned to its author's profile, in that account's posts." }, "playlists": { "type": "array", "items": { "type": "string" }, "description": "A video's playlist (HLS), for each video in `media`, in its order." }, "quoted": { "oneOf": [ { "$ref": "#/components/schemas/XQuoted" }, { "type": "null" } ] }, "quotes": { "type": [ "integer", "null" ], "format": "int64", "description": "Posts quoting it.", "minimum": 0 }, "replyTo": { "oneOf": [ { "$ref": "#/components/schemas/XReplyRef", "description": "What it replies to, when it is a reply." }, { "type": "null" } ] }, "repost": { "oneOf": [ { "$ref": "#/components/schemas/XRepost", "description": "Who reposted it into this list, in an account's posts." }, { "type": "null" } ] }, "sensitive": { "type": "boolean", "description": "Marked as possibly sensitive." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A post: text, images, a video, a link or a quote." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "XRepost": { "type": "object", "description": "Who reposted a post into the list it is in.", "required": [ "by", "id" ], "properties": { "at": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "by": { "$ref": "#/components/schemas/Author" }, "id": { "type": "string", "description": "The repost's own id." } } }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } }, "Timestamp": { "type": "string", "format": "date-time" }, "XReplyRef": { "type": "object", "description": "The post a reply answers.", "required": [ "postId" ], "properties": { "postId": { "type": "string", "description": "The post's id." }, "username": { "type": [ "string", "null" ], "description": "Its author's handle." } } }, "XQuoted": { "type": "object", "description": "The post a post quotes.", "required": [ "id", "url" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "id": { "type": "string" }, "text": { "type": [ "string", "null" ] }, "url": { "type": "string" } } } } } } ``` # Profile Similar (/docs/api-reference/x/profile-similar) Accounts like one, as X suggests them. `GET https://api.socialapi.sh/v1/x/profile/similar` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.x.profileSimilar({ handle: "NASA" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.x.profile_similar(handle="NASA") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/x/profile/similar \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=NASA" ``` **Response** ```json { "data": [ { "id": "44196397", "username": "elonmusk", "displayName": "Elon Musk", "bio": "http://Terafab.AI", "avatarUrl": "https://pbs.twimg.com/profile_images/2122506092437504001/NSS4RHyZ_400x400.jpg", "url": "https://x.com/elonmusk", "verified": false, "private": false, "followers": 239744401, "following": 1429, "likes": null, "posts": 112912, "externalUrl": null, "createdAt": "2009-06-02T20:12:29.000Z", "ext": { "bannerUrl": "https://pbs.twimg.com/profile_banners/44196397/1774145451", "location": null, "blueVerified": false, "verifiedType": null, "verifiedSince": null, "mediaPosts": 4788, "highlights": null, "likesGiven": 260389, "pinnedPosts": [ "2125797463047258119" ] } }, { "id": "50393960", "username": "BillGates", "displayName": "Bill Gates", "bio": "Sharing things I'm learning through my foundation work and other interests.", "avatarUrl": "https://pbs.twimg.com/profile_images/1879013694367252480/Gxa-Pspq_400x400.jpg", "url": "https://x.com/BillGates", "verified": false, "private": false, "followers": 65144461, "following": 575, "likes": null, "posts": 4540, "externalUrl": "https://gatesnot.es/tgn", "createdAt": "2009-06-24T18:44:10.000Z", "ext": { "bannerUrl": "https://pbs.twimg.com/profile_banners/50393960/1745250848", "location": "Seattle, WA", "blueVerified": false, "verifiedType": null, "verifiedSince": null, "mediaPosts": 1530, "highlights": null, "likesGiven": 548, "pinnedPosts": [] } } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/x/profile/similar": { "get": { "tags": [ "X" ], "summary": "Accounts like one, as X suggests them.", "description": "20 accounts, each with its counts, bio, link and pinned posts; checkmarks are not in\nthis list. 1 credit.", "operationId": "xProfileSimilar", "parameters": [ { "name": "handle", "in": "query", "description": "The account's handle (`NASA`), with or without `@`.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "The profile's link (`https://x.com/NASA`), instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_XProfile" }, "example": { "data": [ { "id": "44196397", "username": "elonmusk", "displayName": "Elon Musk", "bio": "http://Terafab.AI", "avatarUrl": "https://pbs.twimg.com/profile_images/2122506092437504001/NSS4RHyZ_400x400.jpg", "url": "https://x.com/elonmusk", "verified": false, "private": false, "followers": 239744401, "following": 1429, "likes": null, "posts": 112912, "externalUrl": null, "createdAt": "2009-06-02T20:12:29.000Z", "ext": { "bannerUrl": "https://pbs.twimg.com/profile_banners/44196397/1774145451", "location": null, "blueVerified": false, "verifiedType": null, "verifiedSince": null, "mediaPosts": 4788, "highlights": null, "likesGiven": 260389, "pinnedPosts": [ "2125797463047258119" ] } }, { "id": "50393960", "username": "BillGates", "displayName": "Bill Gates", "bio": "Sharing things I'm learning through my foundation work and other interests.", "avatarUrl": "https://pbs.twimg.com/profile_images/1879013694367252480/Gxa-Pspq_400x400.jpg", "url": "https://x.com/BillGates", "verified": false, "private": false, "followers": 65144461, "following": 575, "likes": null, "posts": 4540, "externalUrl": "https://gatesnot.es/tgn", "createdAt": "2009-06-24T18:44:10.000Z", "ext": { "bannerUrl": "https://pbs.twimg.com/profile_banners/50393960/1745250848", "location": "Seattle, WA", "blueVerified": false, "verifiedType": null, "verifiedSince": null, "mediaPosts": 1530, "highlights": null, "likesGiven": 548, "pinnedPosts": [] } } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.x.profileSimilar({ handle: \"NASA\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.x.profile_similar(handle=\"NASA\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/x/profile/similar \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=NASA\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_XProfile": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/XProfile" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "XProfile": { "allOf": [ { "type": "object", "description": "An account.", "required": [ "id", "username", "url", "verified", "private", "ext" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "bio": { "type": [ "string", "null" ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "displayName": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "blueVerified", "pinnedPosts" ], "properties": { "bannerUrl": { "type": [ "string", "null" ], "description": "The profile's banner picture." }, "blueVerified": { "type": "boolean", "description": "The paid checkmark (X Premium)." }, "highlights": { "type": [ "integer", "null" ], "format": "int64", "description": "Posts it highlighted, as `/v1/x/profile/highlights` lists them.", "minimum": 0 }, "likesGiven": { "type": [ "integer", "null" ], "format": "int64", "description": "Posts it liked.", "minimum": 0 }, "location": { "type": [ "string", "null" ], "description": "The place it names, as written." }, "mediaPosts": { "type": [ "integer", "null" ], "format": "int64", "description": "Posts with images or video.", "minimum": 0 }, "pinnedPosts": { "type": "array", "items": { "type": "string" }, "description": "Its pinned posts, as `/v1/x/post` takes them." }, "verifiedSince": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "Since when it is verified." }, { "type": "null" } ] }, "verifiedType": { "type": [ "string", "null" ], "description": "Why X verified it, when it did: `Government` or `Business`." } } }, { "type": "object", "description": "What only this platform has." } ] }, "externalUrl": { "type": [ "string", "null" ], "description": "The link in the bio." }, "followers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "following": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "id": { "type": "string", "description": "The platform's id for the account." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "description": "Likes the account's posts received in total.", "minimum": 0 }, "posts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "private": { "type": "boolean" }, "url": { "type": "string", "description": "The profile's page." }, "username": { "type": "string", "description": "The handle, without `@`." }, "verified": { "type": "boolean" } } }, { "type": "object", "description": "An X account." } ] }, "Timestamp": { "type": "string", "format": "date-time" } } } } ``` # Profile (/docs/api-reference/x/profile) An account with its follower and post counts. `GET https://api.socialapi.sh/v1/x/profile` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.x.profile({ handle: "NASA" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.x.profile(handle="NASA").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/x/profile \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=NASA" ``` **Response** ```json { "data": { "id": "11348282", "username": "NASA", "displayName": "NASA", "bio": "Making the seemingly impossible, possible. ✨", "avatarUrl": "https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB_400x400.jpg", "url": "https://x.com/NASA", "verified": true, "private": false, "followers": 92078384, "following": 115, "likes": null, "posts": 74589, "externalUrl": "http://www.nasa.gov/", "createdAt": "2007-12-19T20:20:32.000Z", "ext": { "bannerUrl": "https://pbs.twimg.com/profile_banners/11348282/1788992290", "location": "Pale Blue Dot", "blueVerified": true, "verifiedType": "Government", "verifiedSince": "2009-08-07T19:53:50.941Z", "mediaPosts": 28267, "highlights": 296, "likesGiven": 17125, "pinnedPosts": [] } } } ``` **OpenAPI** ```json { "paths": { "/v1/x/profile": { "get": { "tags": [ "X" ], "summary": "An account with its follower and post counts.", "description": "Name, bio, pictures, location, link, join date, followers, following, posts, media\nposts, highlights, the likes it gave, its checkmark and why X verified it, and its\npinned posts. 1 credit.", "operationId": "xProfile", "parameters": [ { "name": "handle", "in": "query", "description": "The account's handle (`NASA`), with or without `@`.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "The profile's link (`https://x.com/NASA`), instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_XProfile" }, "example": { "data": { "id": "11348282", "username": "NASA", "displayName": "NASA", "bio": "Making the seemingly impossible, possible. ✨", "avatarUrl": "https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB_400x400.jpg", "url": "https://x.com/NASA", "verified": true, "private": false, "followers": 92078384, "following": 115, "likes": null, "posts": 74589, "externalUrl": "http://www.nasa.gov/", "createdAt": "2007-12-19T20:20:32.000Z", "ext": { "bannerUrl": "https://pbs.twimg.com/profile_banners/11348282/1788992290", "location": "Pale Blue Dot", "blueVerified": true, "verifiedType": "Government", "verifiedSince": "2009-08-07T19:53:50.941Z", "mediaPosts": 28267, "highlights": 296, "likesGiven": 17125, "pinnedPosts": [] } } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.x.profile({ handle: \"NASA\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.x.profile(handle=\"NASA\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/x/profile \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=NASA\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_XProfile": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/XProfile" } } }, "XProfile": { "allOf": [ { "type": "object", "description": "An account.", "required": [ "id", "username", "url", "verified", "private", "ext" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "bio": { "type": [ "string", "null" ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "displayName": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "blueVerified", "pinnedPosts" ], "properties": { "bannerUrl": { "type": [ "string", "null" ], "description": "The profile's banner picture." }, "blueVerified": { "type": "boolean", "description": "The paid checkmark (X Premium)." }, "highlights": { "type": [ "integer", "null" ], "format": "int64", "description": "Posts it highlighted, as `/v1/x/profile/highlights` lists them.", "minimum": 0 }, "likesGiven": { "type": [ "integer", "null" ], "format": "int64", "description": "Posts it liked.", "minimum": 0 }, "location": { "type": [ "string", "null" ], "description": "The place it names, as written." }, "mediaPosts": { "type": [ "integer", "null" ], "format": "int64", "description": "Posts with images or video.", "minimum": 0 }, "pinnedPosts": { "type": "array", "items": { "type": "string" }, "description": "Its pinned posts, as `/v1/x/post` takes them." }, "verifiedSince": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp", "description": "Since when it is verified." }, { "type": "null" } ] }, "verifiedType": { "type": [ "string", "null" ], "description": "Why X verified it, when it did: `Government` or `Business`." } } }, { "type": "object", "description": "What only this platform has." } ] }, "externalUrl": { "type": [ "string", "null" ], "description": "The link in the bio." }, "followers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "following": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "id": { "type": "string", "description": "The platform's id for the account." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "description": "Likes the account's posts received in total.", "minimum": 0 }, "posts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "private": { "type": "boolean" }, "url": { "type": "string", "description": "The profile's page." }, "username": { "type": "string", "description": "The handle, without `@`." }, "verified": { "type": "boolean" } } }, { "type": "object", "description": "An X account." } ] }, "Timestamp": { "type": "string", "format": "date-time" } } } } ``` # Space (/docs/api-reference/x/space) A Space with its hosts, speakers and audience. `GET https://api.socialapi.sh/v1/x/space` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.x.space({ url: "https://x.com/i/spaces/1OyKAWNBLewJb" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.x.space(url="https://x.com/i/spaces/1OyKAWNBLewJb").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/x/space \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://x.com/i/spaces/1OyKAWNBLewJb" ``` **Response** ```json { "data": { "live": false, "roomId": "1OyKAWNBLewJb", "title": "#AskNASA: Climate Science Q&A", "viewers": null, "startedAt": "2024-04-18T18:57:41.659Z", "coverUrl": null, "host": { "id": "11348282", "username": "NASA", "displayName": "NASA", "avatarUrl": "https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB_400x400.jpg", "verified": true, "url": "https://x.com/NASA" }, "ext": { "state": "ended", "scheduledAt": "2024-04-18T19:00:00.000Z", "endedAt": "2024-04-18T20:02:42.692Z", "replay": true, "listeners": 13420, "replayViews": 25193, "admins": [ { "id": "11348282", "username": "NASA", "displayName": "NASA", "avatarUrl": "https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB_400x400.jpg", "verified": true, "url": "https://x.com/NASA" }, { "id": "15461733", "username": "NASAClimate", "displayName": "ARCHIVED - NASA Climate", "avatarUrl": "https://pbs.twimg.com/profile_images/1936100731549011968/EywhjyCE_400x400.png", "verified": false, "url": "https://x.com/NASAClimate" } ], "speakers": [ { "id": "1451773004", "username": "Space_Station", "displayName": "International Space Station", "avatarUrl": "https://pbs.twimg.com/profile_images/1949871812176732160/ZesOirrR_400x400.jpg", "verified": true, "url": "https://x.com/Space_Station" }, { "id": "24919888", "username": "NASAEarth", "displayName": "NASA Earth", "avatarUrl": "https://pbs.twimg.com/profile_images/2040064373323083776/2ez7ntt1_400x400.jpg", "verified": true, "url": "https://x.com/NASAEarth" }, { "id": "189253902", "username": "NASAScience_", "displayName": "NASA Science", "avatarUrl": "https://pbs.twimg.com/profile_images/2046257502250258432/Ja13oc9e_400x400.jpg", "verified": true, "url": "https://x.com/NASAScience_" } ], "streamUrl": "https://prod-fastly-a.video.pscp.tv/Transcoding/v1/hls/iQ2UWMLo1lfHeyBXddNbWBV8FKm7_X3nG8js-bjgO-qSMNNRiKZ-X_5xOhwEA4eWvclUrm291g7RKWUHA2azVQ/non_transcode/us-east-1/periscope-replay-direct-prod-us-east-1-public/audio-space/playlist_16733273508508111373.m3u8?type=replay", "postId": "1781034388731408737" } } } ``` **OpenAPI** ```json { "paths": { "/v1/x/space": { "get": { "tags": [ "X" ], "summary": "A Space with its hosts, speakers and audience.", "description": "A live audio conversation, running, planned or ended: its title, state, host, admins\nand speakers, schedule, listeners live and replays, the post that shares it and its\naudio's playlist (HLS). 1 credit, cached a minute.", "operationId": "xSpace", "parameters": [ { "name": "url", "in": "query", "description": "The Space's link (`https://x.com/i/spaces/1OyKAWNBLewJb`).", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The Space's id, instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_XSpace" }, "example": { "data": { "live": false, "roomId": "1OyKAWNBLewJb", "title": "#AskNASA: Climate Science Q&A", "viewers": null, "startedAt": "2024-04-18T18:57:41.659Z", "coverUrl": null, "host": { "id": "11348282", "username": "NASA", "displayName": "NASA", "avatarUrl": "https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB_400x400.jpg", "verified": true, "url": "https://x.com/NASA" }, "ext": { "state": "ended", "scheduledAt": "2024-04-18T19:00:00.000Z", "endedAt": "2024-04-18T20:02:42.692Z", "replay": true, "listeners": 13420, "replayViews": 25193, "admins": [ { "id": "11348282", "username": "NASA", "displayName": "NASA", "avatarUrl": "https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB_400x400.jpg", "verified": true, "url": "https://x.com/NASA" }, { "id": "15461733", "username": "NASAClimate", "displayName": "ARCHIVED - NASA Climate", "avatarUrl": "https://pbs.twimg.com/profile_images/1936100731549011968/EywhjyCE_400x400.png", "verified": false, "url": "https://x.com/NASAClimate" } ], "speakers": [ { "id": "1451773004", "username": "Space_Station", "displayName": "International Space Station", "avatarUrl": "https://pbs.twimg.com/profile_images/1949871812176732160/ZesOirrR_400x400.jpg", "verified": true, "url": "https://x.com/Space_Station" }, { "id": "24919888", "username": "NASAEarth", "displayName": "NASA Earth", "avatarUrl": "https://pbs.twimg.com/profile_images/2040064373323083776/2ez7ntt1_400x400.jpg", "verified": true, "url": "https://x.com/NASAEarth" }, { "id": "189253902", "username": "NASAScience_", "displayName": "NASA Science", "avatarUrl": "https://pbs.twimg.com/profile_images/2046257502250258432/Ja13oc9e_400x400.jpg", "verified": true, "url": "https://x.com/NASAScience_" } ], "streamUrl": "https://prod-fastly-a.video.pscp.tv/Transcoding/v1/hls/iQ2UWMLo1lfHeyBXddNbWBV8FKm7_X3nG8js-bjgO-qSMNNRiKZ-X_5xOhwEA4eWvclUrm291g7RKWUHA2azVQ/non_transcode/us-east-1/periscope-replay-direct-prod-us-east-1-public/audio-space/playlist_16733273508508111373.m3u8?type=replay", "postId": "1781034388731408737" } } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.x.space({ url: \"https://x.com/i/spaces/1OyKAWNBLewJb\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.x.space(url=\"https://x.com/i/spaces/1OyKAWNBLewJb\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/x/space \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://x.com/i/spaces/1OyKAWNBLewJb\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_XSpace": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/XSpace" } } }, "XSpace": { "allOf": [ { "type": "object", "description": "An account's live broadcast.", "required": [ "live", "ext" ], "properties": { "coverUrl": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "replay", "admins", "speakers" ], "properties": { "admins": { "type": "array", "items": { "$ref": "#/components/schemas/Author" }, "description": "Its hosts, and those who spoke (empty when X names them by id alone)." }, "endedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "listeners": { "type": [ "integer", "null" ], "format": "int64", "description": "Those who listened live, in all.", "minimum": 0 }, "postId": { "type": [ "string", "null" ], "description": "The post that shares it, as `/v1/x/post` takes it." }, "replay": { "type": "boolean", "description": "Whether its recording can be played." }, "replayViews": { "type": [ "integer", "null" ], "format": "int64", "description": "Plays of its recording.", "minimum": 0 }, "scheduledAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "speakers": { "type": "array", "items": { "$ref": "#/components/schemas/Author" } }, "state": { "type": [ "string", "null" ], "description": "`running`, `ended`, `not_started` or `canceled`." }, "streamUrl": { "type": [ "string", "null" ], "description": "Its audio's playlist (HLS): live while it runs, its recording after." } } }, { "type": "object", "description": "What only this platform has." } ] }, "host": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "live": { "type": "boolean" }, "roomId": { "type": [ "string", "null" ] }, "startedAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "title": { "type": [ "string", "null" ] }, "viewers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, { "type": "object", "description": "A Space: a live audio conversation." } ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Trending Posts (/docs/api-reference/x/trending-posts) The posts trending on X today. `GET https://api.socialapi.sh/v1/x/trending/posts` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.x.trendingPosts(); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.x.trending_posts() ``` **cURL** ```bash curl https://api.socialapi.sh/v1/x/trending/posts \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" ``` **Response** ```json { "data": [ { "id": "2126009871904473417", "url": "https://x.com/RealDWMead/status/2126009871904473417", "text": "Macy's Thanksgiving Day Parade", "createdAt": "2026-11-26T17:47:07.472Z", "author": { "id": "715915536769548288", "username": "RealDWMead", "displayName": "Real DW", "avatarUrl": "https://pbs.twimg.com/profile_images/2117000478143782912/v7yGM6Vs_400x400.jpg", "verified": true, "url": "https://x.com/RealDWMead" }, "stats": { "views": 5549057, "likes": 89480, "comments": 1452, "shares": 9107, "saves": 11343, "engagementRate": 0.018 }, "media": [ { "kind": "video", "url": "https://video.twimg.com/amplify_video/2126009852375785472/vid/avc1/1078x926/qkZTf4ZusZxP7o3n.mp4?tag=29", "thumbnailUrl": "https://pbs.twimg.com/amplify_video_thumb/2126009852375785472/img/mbCcqZJR31PBF9OJ.jpg", "width": 1078, "height": 926, "durationSeconds": 12.942 } ], "hashtags": [], "mentions": [], "ext": { "quotes": 771, "language": "en", "conversationId": null, "replyTo": null, "repost": null, "quoted": null, "pinned": false, "sensitive": false, "links": [], "altTexts": [], "playlists": [ "https://video.twimg.com/amplify_video/2126009852375785472/pl/Xynp5TEl3EIKn_5w.m3u8?tag=29&v=9da" ] } }, { "id": "2126058835836293262", "url": "https://x.com/DonaldTDaily/status/2126058835836293262", "text": "🚨#BREAKING: Mamdani is furious after Patriots in Times Square broke out a full marching band and turned Thanksgiving into a massive American celebration.\n\nKEEP ON ROLLING, AMERICA! 🇺🇸", "createdAt": "2026-11-26T21:01:41.383Z", "author": { "id": "869643503323631617", "username": "DonaldTDaily", "displayName": "Commentary Donald J. Trump News", "avatarUrl": "https://pbs.twimg.com/profile_images/2112081298592243713/9sWNKWXK_400x400.jpg", "verified": true, "url": "https://x.com/DonaldTDaily" }, "stats": { "views": 2420104, "likes": 118498, "comments": 3300, "shares": 20803, "saves": 4877, "engagementRate": 0.0589 }, "media": [ { "kind": "video", "url": "https://video.twimg.com/amplify_video/2126058339666698240/vid/avc1/968x1178/Q1hdzY-oezRgmqoF.mp4?tag=29", "thumbnailUrl": "https://pbs.twimg.com/amplify_video_thumb/2126058339666698240/img/m7WkUKcSS3hqVRyW.jpg", "width": 968, "height": 1178, "durationSeconds": 36.633 } ], "hashtags": [], "mentions": [], "ext": { "quotes": 836, "language": "en", "conversationId": null, "replyTo": null, "repost": null, "quoted": null, "pinned": false, "sensitive": false, "links": [], "altTexts": [], "playlists": [ "https://video.twimg.com/amplify_video/2126058339666698240/pl/tZJenG2s02BThvmx.m3u8?tag=29&v=cfc" ] } } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/x/trending/posts": { "get": { "tags": [ "X" ], "summary": "The posts trending on X today.", "description": "The posts trending worldwide over the last day, about 20, with their counts and views.\nOne page. 1 credit.", "operationId": "xTrendingPosts", "parameters": [ { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_XPost" }, "example": { "data": [ { "id": "2126009871904473417", "url": "https://x.com/RealDWMead/status/2126009871904473417", "text": "Macy's Thanksgiving Day Parade", "createdAt": "2026-11-26T17:47:07.472Z", "author": { "id": "715915536769548288", "username": "RealDWMead", "displayName": "Real DW", "avatarUrl": "https://pbs.twimg.com/profile_images/2117000478143782912/v7yGM6Vs_400x400.jpg", "verified": true, "url": "https://x.com/RealDWMead" }, "stats": { "views": 5549057, "likes": 89480, "comments": 1452, "shares": 9107, "saves": 11343, "engagementRate": 0.018 }, "media": [ { "kind": "video", "url": "https://video.twimg.com/amplify_video/2126009852375785472/vid/avc1/1078x926/qkZTf4ZusZxP7o3n.mp4?tag=29", "thumbnailUrl": "https://pbs.twimg.com/amplify_video_thumb/2126009852375785472/img/mbCcqZJR31PBF9OJ.jpg", "width": 1078, "height": 926, "durationSeconds": 12.942 } ], "hashtags": [], "mentions": [], "ext": { "quotes": 771, "language": "en", "conversationId": null, "replyTo": null, "repost": null, "quoted": null, "pinned": false, "sensitive": false, "links": [], "altTexts": [], "playlists": [ "https://video.twimg.com/amplify_video/2126009852375785472/pl/Xynp5TEl3EIKn_5w.m3u8?tag=29&v=9da" ] } }, { "id": "2126058835836293262", "url": "https://x.com/DonaldTDaily/status/2126058835836293262", "text": "🚨#BREAKING: Mamdani is furious after Patriots in Times Square broke out a full marching band and turned Thanksgiving into a massive American celebration.\n\nKEEP ON ROLLING, AMERICA! 🇺🇸", "createdAt": "2026-11-26T21:01:41.383Z", "author": { "id": "869643503323631617", "username": "DonaldTDaily", "displayName": "Commentary Donald J. Trump News", "avatarUrl": "https://pbs.twimg.com/profile_images/2112081298592243713/9sWNKWXK_400x400.jpg", "verified": true, "url": "https://x.com/DonaldTDaily" }, "stats": { "views": 2420104, "likes": 118498, "comments": 3300, "shares": 20803, "saves": 4877, "engagementRate": 0.0589 }, "media": [ { "kind": "video", "url": "https://video.twimg.com/amplify_video/2126058339666698240/vid/avc1/968x1178/Q1hdzY-oezRgmqoF.mp4?tag=29", "thumbnailUrl": "https://pbs.twimg.com/amplify_video_thumb/2126058339666698240/img/m7WkUKcSS3hqVRyW.jpg", "width": 968, "height": 1178, "durationSeconds": 36.633 } ], "hashtags": [], "mentions": [], "ext": { "quotes": 836, "language": "en", "conversationId": null, "replyTo": null, "repost": null, "quoted": null, "pinned": false, "sensitive": false, "links": [], "altTexts": [], "playlists": [ "https://video.twimg.com/amplify_video/2126058339666698240/pl/tZJenG2s02BThvmx.m3u8?tag=29&v=cfc" ] } } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.x.trendingPosts();" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.x.trending_posts()" }, { "lang": "bash", "label": "cURL", "source": "curl https://api.socialapi.sh/v1/x/trending/posts \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_XPost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/XPost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "XPost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "pinned", "sensitive", "links", "altTexts", "playlists" ], "properties": { "altTexts": { "type": "array", "items": { "type": "string" }, "description": "Each image's description for screen readers, in `media`'s order; empty when none\nhas one." }, "conversationId": { "type": [ "string", "null" ], "description": "The thread it belongs to: its first post's id." }, "language": { "type": [ "string", "null" ], "description": "X's detection of its text's language (`en`; `zxx` for none)." }, "links": { "type": "array", "items": { "type": "string" }, "description": "The links in its text, in full." }, "pinned": { "type": "boolean", "description": "Pinned to its author's profile, in that account's posts." }, "playlists": { "type": "array", "items": { "type": "string" }, "description": "A video's playlist (HLS), for each video in `media`, in its order." }, "quoted": { "oneOf": [ { "$ref": "#/components/schemas/XQuoted" }, { "type": "null" } ] }, "quotes": { "type": [ "integer", "null" ], "format": "int64", "description": "Posts quoting it.", "minimum": 0 }, "replyTo": { "oneOf": [ { "$ref": "#/components/schemas/XReplyRef", "description": "What it replies to, when it is a reply." }, { "type": "null" } ] }, "repost": { "oneOf": [ { "$ref": "#/components/schemas/XRepost", "description": "Who reposted it into this list, in an account's posts." }, { "type": "null" } ] }, "sensitive": { "type": "boolean", "description": "Marked as possibly sensitive." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A post: text, images, a video, a link or a quote." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "XRepost": { "type": "object", "description": "Who reposted a post into the list it is in.", "required": [ "by", "id" ], "properties": { "at": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "by": { "$ref": "#/components/schemas/Author" }, "id": { "type": "string", "description": "The repost's own id." } } }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } }, "Timestamp": { "type": "string", "format": "date-time" }, "XReplyRef": { "type": "object", "description": "The post a reply answers.", "required": [ "postId" ], "properties": { "postId": { "type": "string", "description": "The post's id." }, "username": { "type": [ "string", "null" ], "description": "Its author's handle." } } }, "XQuoted": { "type": "object", "description": "The post a post quotes.", "required": [ "id", "url" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "id": { "type": "string" }, "text": { "type": [ "string", "null" ] }, "url": { "type": "string" } } } } } } ``` # Trending (/docs/api-reference/x/trending) The topics trending in a country, or worldwide. `GET https://api.socialapi.sh/v1/x/trending` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.x.trending({ country: "us" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.x.trending(country="us") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/x/trending \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "country=us" ``` **Response** ```json { "data": [ { "name": "Black Friday", "rank": 1, "url": "https://x.com/search?q=%22Black+Friday%22", "query": "\"Black Friday\"", "posts": 410333 }, { "name": "Good Friday", "rank": 2, "url": "https://x.com/search?q=%22Good+Friday%22", "query": "\"Good Friday\"", "posts": 61900 } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/x/trending": { "get": { "tags": [ "X" ], "summary": "The topics trending in a country, or worldwide.", "description": "X's list for the country (about 30 to 50 topics, in its order), each with its search\nand, when X counts one, its volume of posts. The countries are those X keeps trends\nfor. 1 credit.", "operationId": "xTrending", "parameters": [ { "name": "country", "in": "query", "description": "The country, as its ISO code (`us`, `gb`, `tr`); worldwide without one.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_XTrend" }, "example": { "data": [ { "name": "Black Friday", "rank": 1, "url": "https://x.com/search?q=%22Black+Friday%22", "query": "\"Black Friday\"", "posts": 410333 }, { "name": "Good Friday", "rank": 2, "url": "https://x.com/search?q=%22Good+Friday%22", "query": "\"Good Friday\"", "posts": 61900 } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.x.trending({ country: \"us\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.x.trending(country=\"us\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/x/trending \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"country=us\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_XTrend": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/XTrend" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "XTrend": { "type": "object", "description": "A topic trending in a country.", "required": [ "name", "rank", "url", "query" ], "properties": { "name": { "type": "string", "description": "The topic, as X shows it (`#PercyJackson`, `Black Friday`)." }, "posts": { "type": [ "integer", "null" ], "format": "int64", "description": "Posts about it, when X says.", "minimum": 0 }, "query": { "type": "string", "description": "The search X runs for it." }, "rank": { "type": "integer", "format": "int32", "description": "Its place in the list, from 1.", "minimum": 0 }, "url": { "type": "string", "description": "Its search on X." } } } } } } ``` # Batch Posts (/docs/api-reference/youtube/batch-posts) Up to 50 videos at once, by their ids. `GET https://api.socialapi.sh/v1/youtube/batch/posts` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.youtube.batchPosts({ ids: "qiLUvCt3k6g,dXo5AvXG8Ds,Ip5EiqbuBpE" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.youtube.batch_posts(ids="qiLUvCt3k6g,dXo5AvXG8Ds,Ip5EiqbuBpE") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/youtube/batch/posts \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "ids=qiLUvCt3k6g,dXo5AvXG8Ds,Ip5EiqbuBpE" ``` **Response** ```json { "data": [ { "author": { "avatarUrl": "https://yt3.ggpht.com/gnvYLhXy8FAlPXZ2RTrkrgj-5kyt0vdE2FUGVOiKGdEZIa-wN5A-7nwZBlWJLzUMmoh1NWAU=s176-c-k-c0x00ffffff-no-rj", "displayName": "Linus Tech Tips", "id": "UCXuqSBlHAE6Xw-yeJA0Tunw", "url": "https://www.youtube.com/@LinusTechTips", "username": "LinusTechTips", "verified": true }, "createdAt": "2026-11-23T22:38:19.000Z", "ext": { "category": "Science & Technology", "channelSubscribers": "16.9M subscribers", "chapters": [], "durationSeconds": 4182, "familySafe": true, "keywords": [], "kind": "video", "liveNow": false, "membersOnly": true, "music": [], "publishedText": null, "title": "Linus is 3 hours late for WAN - Why is WAN Late Episode 28", "unlisted": false }, "hashtags": [], "id": "qiLUvCt3k6g", "media": [ { "durationSeconds": 4182, "height": null, "kind": "video", "thumbnailUrl": "https://i.ytimg.com/vi/qiLUvCt3k6g/maxresdefault.jpg", "url": null, "width": null } ], "mentions": [], "stats": { "comments": null, "engagementRate": null, "likes": 8, "saves": null, "shares": null, "views": null }, "text": "Thank you for your support! Check out Floatplane for more benefits at a lower price at https://lmg.gg/ytmemberships\n\n► GET MERCH: https://lttstore.com\n► LTX: https://lmg.gg/ltx23\n► SPONSORS, AFFILIATES, AND PARTNERS: https://lmg.gg/partners\n► OUR WAN PODCAST GEAR: https://lmg.gg/wanset\n\nFOLLOW US \n--------------------------------------------------- \nTwitter: https://twitter.com/linustech\nFacebook…", "url": "https://www.youtube.com/watch?v=qiLUvCt3k6g" }, { "author": { "avatarUrl": "https://yt3.ggpht.com/gnvYLhXy8FAlPXZ2RTrkrgj-5kyt0vdE2FUGVOiKGdEZIa-wN5A-7nwZBlWJLzUMmoh1NWAU=s176-c-k-c0x00ffffff-no-rj", "displayName": "Linus Tech Tips", "id": "UCXuqSBlHAE6Xw-yeJA0Tunw", "url": "https://www.youtube.com/@LinusTechTips", "username": "LinusTechTips", "verified": true }, "createdAt": "2026-11-23T22:39:48.000Z", "ext": { "category": "Science & Technology", "channelSubscribers": "16.9M subscribers", "chapters": [], "durationSeconds": 2111, "familySafe": true, "keywords": [], "kind": "video", "liveNow": false, "membersOnly": true, "music": [], "publishedText": null, "title": "Extras - AMD Upgrade Luke", "unlisted": false }, "hashtags": [], "id": "dXo5AvXG8Ds", "media": [ { "durationSeconds": 2111, "height": null, "kind": "video", "thumbnailUrl": "https://i.ytimg.com/vi/dXo5AvXG8Ds/maxresdefault.jpg", "url": null, "width": null } ], "mentions": [], "stats": { "comments": null, "engagementRate": null, "likes": 14, "saves": null, "shares": null, "views": null }, "text": "Thank you for your support! Check out Floatplane for more benefits at a lower price at https://lmg.gg/ytmemberships\n\n► GET MERCH: https://lttstore.com\n► LTX: https://lmg.gg/ltx23\n► SPONSORS, AFFILIATES, AND PARTNERS: https://lmg.gg/partners\n► OUR WAN PODCAST GEAR: https://lmg.gg/wanset\n\nFOLLOW US \n--------------------------------------------------- \nTwitter: https://twitter.com/linustech\nFacebook…", "url": "https://www.youtube.com/watch?v=dXo5AvXG8Ds" } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/youtube/batch/posts": { "get": { "tags": [ "YouTube" ], "summary": "Up to 50 videos at once, by their ids.", "description": "Each as `/post` answers it; one not found is left out. 1 credit a video found (one\nserved from the cache is free).", "operationId": "youtubeBatchPosts", "parameters": [ { "name": "ids", "in": "query", "description": "Up to 50 video ids, comma-separated.", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_YouTubePost" }, "example": { "data": [ { "author": { "avatarUrl": "https://yt3.ggpht.com/gnvYLhXy8FAlPXZ2RTrkrgj-5kyt0vdE2FUGVOiKGdEZIa-wN5A-7nwZBlWJLzUMmoh1NWAU=s176-c-k-c0x00ffffff-no-rj", "displayName": "Linus Tech Tips", "id": "UCXuqSBlHAE6Xw-yeJA0Tunw", "url": "https://www.youtube.com/@LinusTechTips", "username": "LinusTechTips", "verified": true }, "createdAt": "2026-11-23T22:38:19.000Z", "ext": { "category": "Science & Technology", "channelSubscribers": "16.9M subscribers", "chapters": [], "durationSeconds": 4182, "familySafe": true, "keywords": [], "kind": "video", "liveNow": false, "membersOnly": true, "music": [], "publishedText": null, "title": "Linus is 3 hours late for WAN - Why is WAN Late Episode 28", "unlisted": false }, "hashtags": [], "id": "qiLUvCt3k6g", "media": [ { "durationSeconds": 4182, "height": null, "kind": "video", "thumbnailUrl": "https://i.ytimg.com/vi/qiLUvCt3k6g/maxresdefault.jpg", "url": null, "width": null } ], "mentions": [], "stats": { "comments": null, "engagementRate": null, "likes": 8, "saves": null, "shares": null, "views": null }, "text": "Thank you for your support! Check out Floatplane for more benefits at a lower price at https://lmg.gg/ytmemberships\n\n► GET MERCH: https://lttstore.com\n► LTX: https://lmg.gg/ltx23\n► SPONSORS, AFFILIATES, AND PARTNERS: https://lmg.gg/partners\n► OUR WAN PODCAST GEAR: https://lmg.gg/wanset\n\nFOLLOW US \n--------------------------------------------------- \nTwitter: https://twitter.com/linustech\nFacebook…", "url": "https://www.youtube.com/watch?v=qiLUvCt3k6g" }, { "author": { "avatarUrl": "https://yt3.ggpht.com/gnvYLhXy8FAlPXZ2RTrkrgj-5kyt0vdE2FUGVOiKGdEZIa-wN5A-7nwZBlWJLzUMmoh1NWAU=s176-c-k-c0x00ffffff-no-rj", "displayName": "Linus Tech Tips", "id": "UCXuqSBlHAE6Xw-yeJA0Tunw", "url": "https://www.youtube.com/@LinusTechTips", "username": "LinusTechTips", "verified": true }, "createdAt": "2026-11-23T22:39:48.000Z", "ext": { "category": "Science & Technology", "channelSubscribers": "16.9M subscribers", "chapters": [], "durationSeconds": 2111, "familySafe": true, "keywords": [], "kind": "video", "liveNow": false, "membersOnly": true, "music": [], "publishedText": null, "title": "Extras - AMD Upgrade Luke", "unlisted": false }, "hashtags": [], "id": "dXo5AvXG8Ds", "media": [ { "durationSeconds": 2111, "height": null, "kind": "video", "thumbnailUrl": "https://i.ytimg.com/vi/dXo5AvXG8Ds/maxresdefault.jpg", "url": null, "width": null } ], "mentions": [], "stats": { "comments": null, "engagementRate": null, "likes": 14, "saves": null, "shares": null, "views": null }, "text": "Thank you for your support! Check out Floatplane for more benefits at a lower price at https://lmg.gg/ytmemberships\n\n► GET MERCH: https://lttstore.com\n► LTX: https://lmg.gg/ltx23\n► SPONSORS, AFFILIATES, AND PARTNERS: https://lmg.gg/partners\n► OUR WAN PODCAST GEAR: https://lmg.gg/wanset\n\nFOLLOW US \n--------------------------------------------------- \nTwitter: https://twitter.com/linustech\nFacebook…", "url": "https://www.youtube.com/watch?v=dXo5AvXG8Ds" } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.youtube.batchPosts({ ids: \"qiLUvCt3k6g,dXo5AvXG8Ds,Ip5EiqbuBpE\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.youtube.batch_posts(ids=\"qiLUvCt3k6g,dXo5AvXG8Ds,Ip5EiqbuBpE\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/youtube/batch/posts \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"ids=qiLUvCt3k6g,dXo5AvXG8Ds,Ip5EiqbuBpE\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_YouTubePost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/YouTubePost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "YouTubePost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "kind", "keywords", "chapters", "music", "liveNow", "unlisted", "membersOnly" ], "properties": { "category": { "type": [ "string", "null" ], "description": "YouTube's category (`Science & Technology`)." }, "channelSubscribers": { "type": [ "string", "null" ], "description": "The channel's subscribers, as YouTube writes them (`16.9M subscribers`)." }, "chapters": { "type": "array", "items": { "$ref": "#/components/schemas/YouTubeChapter" } }, "durationSeconds": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "familySafe": { "type": [ "boolean", "null" ], "description": "Suitable for all ages, as YouTube rates it." }, "keywords": { "type": "array", "items": { "type": "string" }, "description": "The tags its uploader gave it." }, "kind": { "$ref": "#/components/schemas/YouTubePostKind" }, "liveNow": { "type": "boolean", "description": "Live now." }, "membersOnly": { "type": "boolean", "description": "For the channel's members only." }, "music": { "type": "array", "items": { "$ref": "#/components/schemas/YouTubeSong" }, "description": "Songs credited in its description." }, "publishedText": { "type": [ "string", "null" ], "description": "When it was published, as YouTube writes it in lists (`3 days ago`): a list gives\nno exact time, which `createdAt` is on `/post`." }, "title": { "type": [ "string", "null" ], "description": "The video's title (`text` is its description)." }, "unlisted": { "type": "boolean", "description": "Unlisted: reachable by its link only." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A video, a Short, a live stream or a community post." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "YouTubeSong": { "type": "object", "description": "A song a video uses, as its description credits it.", "required": [ "title" ], "properties": { "album": { "type": [ "string", "null" ] }, "artist": { "type": [ "string", "null" ] }, "title": { "type": "string" } } }, "YouTubePostKind": { "type": "string", "description": "What a video is.", "enum": [ "video", "short", "live", "community" ] }, "YouTubeChapter": { "type": "object", "description": "A chapter of a video.", "required": [ "title", "startSeconds" ], "properties": { "startSeconds": { "type": "integer", "format": "int64", "minimum": 0 }, "title": { "type": "string" } } }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Batch Profiles (/docs/api-reference/youtube/batch-profiles) Up to 20 channels at once, by their ids or handles. `GET https://api.socialapi.sh/v1/youtube/batch/profiles` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.youtube.batchProfiles({ ids: "@LinusTechTips,@MrBeast" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.youtube.batch_profiles(ids="@LinusTechTips,@MrBeast") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/youtube/batch/profiles \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "ids=@LinusTechTips,@MrBeast" ``` **Response** ```json { "data": [ { "avatarUrl": "https://yt3.googleusercontent.com/gnvYLhXy8FAlPXZ2RTrkrgj-5kyt0vdE2FUGVOiKGdEZIa-wN5A-7nwZBlWJLzUMmoh1NWAU=s160-c-k-c0x00ffffff-no-rj", "bio": "Linus Tech Tips is a passionate team of \"professionally curious\" experts in consumer technology and video production who aim to educate and entertain.\n\nSponsorship Inquiries: partnerships@linusmediagroup.com", "createdAt": "2008-11-24T00:00:00.000Z", "displayName": "Linus Tech Tips", "ext": { "bannerUrl": "https://yt3.googleusercontent.com/U_7GWetO6k4sq3pAkbFEIIWzZLKcIJlGJqNz6NQAhgqF6DVD5pllwWF6trSUWEIRn4MkhNlhy9Y=w2560-fcrop64=1,00005a57ffffa5a8-k-c0xffffffff-no-nd-rj", "country": "Canada", "links": [ { "title": "lttstore.com", "url": "https://www.lttstore.com/" }, { "title": "Floatplane", "url": "https://www.floatplane.com/ltt" }, { "title": "Labs", "url": "https://www.lttlabs.com/" } ], "subscribersText": "16.9M subscribers", "views": 10045352646 }, "externalUrl": "https://www.lttstore.com/", "followers": 16900000, "following": null, "id": "UCXuqSBlHAE6Xw-yeJA0Tunw", "likes": null, "posts": 8011, "private": false, "url": "https://www.youtube.com/@LinusTechTips", "username": "LinusTechTips", "verified": true }, { "avatarUrl": "https://yt3.googleusercontent.com/nxYrc_1_2f77DoBadyxMTmv7ZpRZapHR5jbuYe7PlPd5cIRJxtNNEYyOC0ZsxaDyJJzXrnJiuDE=s160-c-k-c0x00ffffff-no-rj", "bio": "SUBSCRIBE FOR A COOKIE!\nNew MrBeast or MrBeast Gaming video every single Saturday at noon eastern time!\nAccomplishments:\n- Raised $20,000,000 To Plant 20,000,000 Trees\n- Removed 30,000,000 pounds of trash from the ocean\n- Helped 2,000 people walk again\n- Helped 1,000 blind people see\n- Helped 1,000 deaf people hear\n- Built wells in Africa\n- Built and gave away 100 houses\n- Adopted every dog in a s…", "createdAt": "2012-02-19T00:00:00.000Z", "displayName": "MrBeast", "ext": { "bannerUrl": "https://yt3.googleusercontent.com/mHMO_eEMp0dPvh0ADwXhPXNYb_GnjSVsLI8biqF1CpxT8OPl7izhNQsDPD3JHhd5y5Mg9GrP=w2560-fcrop64=1,00005a57ffffa5a8-k-c0xffffffff-no-nd-rj", "country": "United States", "links": [ { "title": "Follow", "url": "https://www.instagram.com/mrbeast/" }, { "title": "Twitter", "url": "https://twitter.com/MrBeast" }, { "title": "Facebook", "url": "https://facebook.com/mrbeast/" } ], "subscribersText": "528M subscribers", "views": 148150665175 }, "externalUrl": "https://www.instagram.com/mrbeast/", "followers": 528000000, "following": null, "id": "UCX6OQ3DkcsbYNE6H8uQQuVA", "likes": null, "posts": 1017, "private": false, "url": "https://www.youtube.com/@MrBeast", "username": "MrBeast", "verified": true } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/youtube/batch/profiles": { "get": { "tags": [ "YouTube" ], "summary": "Up to 20 channels at once, by their ids or handles.", "description": "Each as `/profile` answers it; one not found is left out. 1 credit a channel found\n(one served from the cache is free).", "operationId": "youtubeBatchProfiles", "parameters": [ { "name": "ids", "in": "query", "description": "Up to 20 channel ids (`UC…`) or handles (`@…`), comma-separated.", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_YouTubeProfile" }, "example": { "data": [ { "avatarUrl": "https://yt3.googleusercontent.com/gnvYLhXy8FAlPXZ2RTrkrgj-5kyt0vdE2FUGVOiKGdEZIa-wN5A-7nwZBlWJLzUMmoh1NWAU=s160-c-k-c0x00ffffff-no-rj", "bio": "Linus Tech Tips is a passionate team of \"professionally curious\" experts in consumer technology and video production who aim to educate and entertain.\n\nSponsorship Inquiries: partnerships@linusmediagroup.com", "createdAt": "2008-11-24T00:00:00.000Z", "displayName": "Linus Tech Tips", "ext": { "bannerUrl": "https://yt3.googleusercontent.com/U_7GWetO6k4sq3pAkbFEIIWzZLKcIJlGJqNz6NQAhgqF6DVD5pllwWF6trSUWEIRn4MkhNlhy9Y=w2560-fcrop64=1,00005a57ffffa5a8-k-c0xffffffff-no-nd-rj", "country": "Canada", "links": [ { "title": "lttstore.com", "url": "https://www.lttstore.com/" }, { "title": "Floatplane", "url": "https://www.floatplane.com/ltt" }, { "title": "Labs", "url": "https://www.lttlabs.com/" } ], "subscribersText": "16.9M subscribers", "views": 10045352646 }, "externalUrl": "https://www.lttstore.com/", "followers": 16900000, "following": null, "id": "UCXuqSBlHAE6Xw-yeJA0Tunw", "likes": null, "posts": 8011, "private": false, "url": "https://www.youtube.com/@LinusTechTips", "username": "LinusTechTips", "verified": true }, { "avatarUrl": "https://yt3.googleusercontent.com/nxYrc_1_2f77DoBadyxMTmv7ZpRZapHR5jbuYe7PlPd5cIRJxtNNEYyOC0ZsxaDyJJzXrnJiuDE=s160-c-k-c0x00ffffff-no-rj", "bio": "SUBSCRIBE FOR A COOKIE!\nNew MrBeast or MrBeast Gaming video every single Saturday at noon eastern time!\nAccomplishments:\n- Raised $20,000,000 To Plant 20,000,000 Trees\n- Removed 30,000,000 pounds of trash from the ocean\n- Helped 2,000 people walk again\n- Helped 1,000 blind people see\n- Helped 1,000 deaf people hear\n- Built wells in Africa\n- Built and gave away 100 houses\n- Adopted every dog in a s…", "createdAt": "2012-02-19T00:00:00.000Z", "displayName": "MrBeast", "ext": { "bannerUrl": "https://yt3.googleusercontent.com/mHMO_eEMp0dPvh0ADwXhPXNYb_GnjSVsLI8biqF1CpxT8OPl7izhNQsDPD3JHhd5y5Mg9GrP=w2560-fcrop64=1,00005a57ffffa5a8-k-c0xffffffff-no-nd-rj", "country": "United States", "links": [ { "title": "Follow", "url": "https://www.instagram.com/mrbeast/" }, { "title": "Twitter", "url": "https://twitter.com/MrBeast" }, { "title": "Facebook", "url": "https://facebook.com/mrbeast/" } ], "subscribersText": "528M subscribers", "views": 148150665175 }, "externalUrl": "https://www.instagram.com/mrbeast/", "followers": 528000000, "following": null, "id": "UCX6OQ3DkcsbYNE6H8uQQuVA", "likes": null, "posts": 1017, "private": false, "url": "https://www.youtube.com/@MrBeast", "username": "MrBeast", "verified": true } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.youtube.batchProfiles({ ids: \"@LinusTechTips,@MrBeast\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.youtube.batch_profiles(ids=\"@LinusTechTips,@MrBeast\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/youtube/batch/profiles \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"ids=@LinusTechTips,@MrBeast\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_YouTubeProfile": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/YouTubeProfile" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "YouTubeProfile": { "allOf": [ { "type": "object", "description": "An account.", "required": [ "id", "username", "url", "verified", "private", "ext" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "bio": { "type": [ "string", "null" ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "displayName": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "links" ], "properties": { "bannerUrl": { "type": [ "string", "null" ] }, "country": { "type": [ "string", "null" ], "description": "The country it states." }, "links": { "type": "array", "items": { "$ref": "#/components/schemas/YouTubeLink" }, "description": "The links on its about panel." }, "subscribersText": { "type": [ "string", "null" ], "description": "The subscriber count as YouTube writes it (`16.9M subscribers`): YouTube shows a\nvisitor only a rounded figure, which `followers` is." }, "views": { "type": [ "integer", "null" ], "format": "int64", "description": "Views of all its videos.", "minimum": 0 } } }, { "type": "object", "description": "What only this platform has." } ] }, "externalUrl": { "type": [ "string", "null" ], "description": "The link in the bio." }, "followers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "following": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "id": { "type": "string", "description": "The platform's id for the account." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "description": "Likes the account's posts received in total.", "minimum": 0 }, "posts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "private": { "type": "boolean" }, "url": { "type": "string", "description": "The profile's page." }, "username": { "type": "string", "description": "The handle, without `@`." }, "verified": { "type": "boolean" } } }, { "type": "object", "description": "A YouTube channel." } ] }, "YouTubeLink": { "type": "object", "description": "A link on a channel's about panel.", "required": [ "url" ], "properties": { "title": { "type": [ "string", "null" ] }, "url": { "type": "string" } } }, "Timestamp": { "type": "string", "format": "date-time" } } } } ``` # Batch Transcripts (/docs/api-reference/youtube/batch-transcripts) Up to 20 videos' captions at once, by their ids. `GET https://api.socialapi.sh/v1/youtube/batch/transcripts` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.youtube.batchTranscripts({ ids: "Ip5EiqbuBpE" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.youtube.batch_transcripts(ids="Ip5EiqbuBpE") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/youtube/batch/transcripts \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "ids=Ip5EiqbuBpE" ``` **Response** ```json { "data": [ { "cues": [ { "endSeconds": 7.1, "startSeconds": 0, "text": "Did you know that you can play any game," }, { "endSeconds": 7.1, "startSeconds": 1.8, "text": "even PC games, on Mac for free?" }, { "endSeconds": 12.5, "startSeconds": 7.8, "text": "Well, okay, not any game. And you still" } ], "generated": true, "language": "en", "languages": [ "en" ], "postId": "Ip5EiqbuBpE", "text": "Did you know that you can play any game,\neven PC games, on Mac for free?\nWell, okay, not any game. And you still\nhave to buy the software,\nnot to mention a Mac. But thanks to a\nnew open source program called FX Steam\nLauncher, you can now run Steam OS on\nApple Silicon, unlocking buckets of\ngames that were previously impossible to\nrun, either due to macOS not supporting\n32-bit apps anymore or devel…" } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/youtube/batch/transcripts": { "get": { "tags": [ "YouTube" ], "summary": "Up to 20 videos' captions at once, by their ids.", "description": "Each as `/post/transcript` answers it; a video without captions is left out. 5 credits\na transcript found (one served from the cache is free).", "operationId": "youtubeBatchTranscripts", "parameters": [ { "name": "ids", "in": "query", "description": "Up to 20 video ids, comma-separated.", "required": true, "schema": { "type": "string" } }, { "name": "language", "in": "query", "description": "A language code (`en`, `de`): its captions when a video has them, else those in\nthe language spoken.", "required": false, "schema": { "type": "string" } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_YouTubeTranscript" }, "example": { "data": [ { "cues": [ { "endSeconds": 7.1, "startSeconds": 0, "text": "Did you know that you can play any game," }, { "endSeconds": 7.1, "startSeconds": 1.8, "text": "even PC games, on Mac for free?" }, { "endSeconds": 12.5, "startSeconds": 7.8, "text": "Well, okay, not any game. And you still" } ], "generated": true, "language": "en", "languages": [ "en" ], "postId": "Ip5EiqbuBpE", "text": "Did you know that you can play any game,\neven PC games, on Mac for free?\nWell, okay, not any game. And you still\nhave to buy the software,\nnot to mention a Mac. But thanks to a\nnew open source program called FX Steam\nLauncher, you can now run Steam OS on\nApple Silicon, unlocking buckets of\ngames that were previously impossible to\nrun, either due to macOS not supporting\n32-bit apps anymore or devel…" } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.youtube.batchTranscripts({ ids: \"Ip5EiqbuBpE\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.youtube.batch_transcripts(ids=\"Ip5EiqbuBpE\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/youtube/batch/transcripts \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"ids=Ip5EiqbuBpE\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_YouTubeTranscript": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/YouTubeTranscript" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "YouTubeTranscript": { "type": "object", "description": "A video's captions as text.", "required": [ "postId", "language", "generated", "languages", "text", "cues" ], "properties": { "cues": { "type": "array", "items": { "$ref": "#/components/schemas/YouTubeCue" } }, "generated": { "type": "boolean", "description": "Generated by YouTube's speech recognition, rather than the uploader's." }, "language": { "type": "string", "description": "The track's language (`en`)." }, "languages": { "type": "array", "items": { "type": "string" }, "description": "Every language the video has captions in." }, "postId": { "type": "string" }, "text": { "type": "string", "description": "The captions as plain text, one cue a line." } } }, "YouTubeCue": { "type": "object", "required": [ "startSeconds", "endSeconds", "text" ], "properties": { "endSeconds": { "type": "number", "format": "double" }, "startSeconds": { "type": "number", "format": "double" }, "text": { "type": "string" } } } } } } ``` # Community (/docs/api-reference/youtube/community) One community post with its likes and images. `GET https://api.socialapi.sh/v1/youtube/community` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.youtube.community({ url: "https://www.youtube.com/post/UgkxKEltTHuMPh3O9wcRik3GPcX_lA3qrgpK" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.youtube.community(url="https://www.youtube.com/post/UgkxKEltTHuMPh3O9wcRik3GPcX_lA3qrgpK").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/youtube/community \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://www.youtube.com/post/UgkxKEltTHuMPh3O9wcRik3GPcX_lA3qrgpK" ``` **Response** ```json { "data": { "id": "UgkxKEltTHuMPh3O9wcRik3GPcX_lA3qrgpK", "url": "https://www.youtube.com/post/UgkxKEltTHuMPh3O9wcRik3GPcX_lA3qrgpK", "text": null, "createdAt": null, "author": { "id": "UCXuqSBlHAE6Xw-yeJA0Tunw", "username": "LinusTechTips", "displayName": "Linus Tech Tips", "avatarUrl": "https://yt3.googleusercontent.com/gnvYLhXy8FAlPXZ2RTrkrgj-5kyt0vdE2FUGVOiKGdEZIa-wN5A-7nwZBlWJLzUMmoh1NWAU=s76-c-k-c0x00ffffff-no-rj-mo", "verified": false, "url": "https://www.youtube.com/@LinusTechTips" }, "stats": { "views": null, "likes": 72000, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://yt3.ggpht.com/zVAwOyb82eQ120Ds-IIjYtICWtlyGpqOBMTf3Q6zX7ea6Nm7d_4S3FqyerrYVeZNpQCltlXJWvZGAoU=s1080-rw-nd-v1", "thumbnailUrl": null, "width": null, "height": null, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "kind": "community", "title": null, "durationSeconds": null, "publishedText": "12 days ago", "category": null, "keywords": [], "chapters": [], "music": [], "liveNow": false, "unlisted": false, "familySafe": null, "membersOnly": false, "channelSubscribers": null } } } ``` **OpenAPI** ```json { "paths": { "/v1/youtube/community": { "get": { "tags": [ "YouTube" ], "summary": "One community post with its likes and images.", "description": "By its link. 1 credit.", "operationId": "youtubeCommunity", "parameters": [ { "name": "url", "in": "query", "description": "The post's link (`https://www.youtube.com/post/Ugkx…`).", "required": true, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_YouTubePost" }, "example": { "data": { "id": "UgkxKEltTHuMPh3O9wcRik3GPcX_lA3qrgpK", "url": "https://www.youtube.com/post/UgkxKEltTHuMPh3O9wcRik3GPcX_lA3qrgpK", "text": null, "createdAt": null, "author": { "id": "UCXuqSBlHAE6Xw-yeJA0Tunw", "username": "LinusTechTips", "displayName": "Linus Tech Tips", "avatarUrl": "https://yt3.googleusercontent.com/gnvYLhXy8FAlPXZ2RTrkrgj-5kyt0vdE2FUGVOiKGdEZIa-wN5A-7nwZBlWJLzUMmoh1NWAU=s76-c-k-c0x00ffffff-no-rj-mo", "verified": false, "url": "https://www.youtube.com/@LinusTechTips" }, "stats": { "views": null, "likes": 72000, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://yt3.ggpht.com/zVAwOyb82eQ120Ds-IIjYtICWtlyGpqOBMTf3Q6zX7ea6Nm7d_4S3FqyerrYVeZNpQCltlXJWvZGAoU=s1080-rw-nd-v1", "thumbnailUrl": null, "width": null, "height": null, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "kind": "community", "title": null, "durationSeconds": null, "publishedText": "12 days ago", "category": null, "keywords": [], "chapters": [], "music": [], "liveNow": false, "unlisted": false, "familySafe": null, "membersOnly": false, "channelSubscribers": null } } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.youtube.community({ url: \"https://www.youtube.com/post/UgkxKEltTHuMPh3O9wcRik3GPcX_lA3qrgpK\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.youtube.community(url=\"https://www.youtube.com/post/UgkxKEltTHuMPh3O9wcRik3GPcX_lA3qrgpK\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/youtube/community \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://www.youtube.com/post/UgkxKEltTHuMPh3O9wcRik3GPcX_lA3qrgpK\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_YouTubePost": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/YouTubePost" } } }, "YouTubePost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "kind", "keywords", "chapters", "music", "liveNow", "unlisted", "membersOnly" ], "properties": { "category": { "type": [ "string", "null" ], "description": "YouTube's category (`Science & Technology`)." }, "channelSubscribers": { "type": [ "string", "null" ], "description": "The channel's subscribers, as YouTube writes them (`16.9M subscribers`)." }, "chapters": { "type": "array", "items": { "$ref": "#/components/schemas/YouTubeChapter" } }, "durationSeconds": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "familySafe": { "type": [ "boolean", "null" ], "description": "Suitable for all ages, as YouTube rates it." }, "keywords": { "type": "array", "items": { "type": "string" }, "description": "The tags its uploader gave it." }, "kind": { "$ref": "#/components/schemas/YouTubePostKind" }, "liveNow": { "type": "boolean", "description": "Live now." }, "membersOnly": { "type": "boolean", "description": "For the channel's members only." }, "music": { "type": "array", "items": { "$ref": "#/components/schemas/YouTubeSong" }, "description": "Songs credited in its description." }, "publishedText": { "type": [ "string", "null" ], "description": "When it was published, as YouTube writes it in lists (`3 days ago`): a list gives\nno exact time, which `createdAt` is on `/post`." }, "title": { "type": [ "string", "null" ], "description": "The video's title (`text` is its description)." }, "unlisted": { "type": "boolean", "description": "Unlisted: reachable by its link only." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A video, a Short, a live stream or a community post." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "YouTubeSong": { "type": "object", "description": "A song a video uses, as its description credits it.", "required": [ "title" ], "properties": { "album": { "type": [ "string", "null" ] }, "artist": { "type": [ "string", "null" ] }, "title": { "type": "string" } } }, "YouTubePostKind": { "type": "string", "description": "What a video is.", "enum": [ "video", "short", "live", "community" ] }, "YouTubeChapter": { "type": "object", "description": "A chapter of a video.", "required": [ "title", "startSeconds" ], "properties": { "startSeconds": { "type": "integer", "format": "int64", "minimum": 0 }, "title": { "type": "string" } } }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Hashtag Posts (/docs/api-reference/youtube/hashtag-posts) A hashtag's videos or Shorts, about 36 a page. `GET https://api.socialapi.sh/v1/youtube/hashtag/posts` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.youtube.hashtagPosts({ name: "cooking" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.youtube.hashtag_posts(name="cooking") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/youtube/hashtag/posts \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "name=cooking" ``` **Response** ```json { "data": [ { "id": "y9K0aFv7xzU", "url": "https://www.youtube.com/watch?v=y9K0aFv7xzU", "text": null, "createdAt": null, "author": { "id": "UCI78AdiI6f7VKhqW1i4B3Rw", "username": "", "displayName": "Zach Choi", "avatarUrl": "https://yt3.ggpht.com/ytc/AIdro_nv3K8KG6LvfLVy_U1RS77IdrpBcRs_08kB-bOymm3dlKot=s68-c-k-c0x00ffffff-no-rj", "verified": false, "url": "https://www.youtube.com/channel/UCI78AdiI6f7VKhqW1i4B3Rw" }, "stats": { "views": 726446, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://i.ytimg.com/vi/y9K0aFv7xzU/hqdefault.jpg?sqp=-oaymwE2CNACELwBSFXyq4qpAygIARUAAIhCGABwAcABBvABAfgBtgiAAoAPigIMCAAQARh_ID0oHTAP&rs=AOn4CLDPj4WGGyyXVsZCxITFsJ1-0JNeCA", "width": null, "height": null, "durationSeconds": 28 } ], "hashtags": [], "mentions": [], "ext": { "kind": "video", "title": "would you eat this? #asmr #cooking (#recipe in description)", "durationSeconds": 28, "publishedText": "5 days ago", "category": null, "keywords": [], "chapters": [], "music": [], "liveNow": false, "unlisted": false, "familySafe": null, "membersOnly": false, "channelSubscribers": null } }, { "id": "ujuyFehC6do", "url": "https://www.youtube.com/watch?v=ujuyFehC6do", "text": null, "createdAt": null, "author": { "id": "UCh9hXCt6UfiOge6r7RZrU3A", "username": "", "displayName": "Mama J Rae", "avatarUrl": "https://yt3.ggpht.com/RDg2CpT8FCeOcQRYL2Elh455iUrwC8Ma1QYRd0-Kb_-uL5blsz6d3zL4RXzYFPTJnzvhlcsRdQ=s68-c-k-c0x00ffffff-no-rj", "verified": false, "url": "https://www.youtube.com/channel/UCh9hXCt6UfiOge6r7RZrU3A" }, "stats": { "views": 4443589, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://i.ytimg.com/vi/ujuyFehC6do/hqdefault.jpg?sqp=-oaymwE2CNACELwBSFXyq4qpAygIARUAAIhCGABwAcABBvABAfgBtgiAAoAPigIMCAAQARhlIFYoSTAP&rs=AOn4CLCCbRBYlMqHJKVc5-vGedtrouoRrA", "width": null, "height": null, "durationSeconds": 177 } ], "hashtags": [], "mentions": [], "ext": { "kind": "video", "title": "Meatloaf & Mashed Potatoes! 🍽 #Cooking #Dinner #EasyRecipe", "durationSeconds": 177, "publishedText": "1 year ago", "category": null, "keywords": [], "chapters": [], "music": [], "liveNow": false, "unlisted": false, "familySafe": null, "membersOnly": false, "channelSubscribers": null } } ], "pagination": { "nextCursor": "4qmFsgKzBRIJRkVoYXNodGFnGo4FQ0NGNjB3TkRRMUZSUVVKcFlsOUplbXQxYzJsamJUVlZRa2ROTjNZMVRUZDZPVGMyZEZob2FtVjZXbXBvTm1VelZXb3dPRmwwZFdKemREZHBRbWN0VTJ0QlVtcHBhazUxU0d4MFJFMDFhMjlaTVhGWVlXNXdja3B2WW1GTFFWSnFVR3RQTWpWZk5GYzNlRmhWV1c1bExTMHlUblU1ZURVMVYwZFBhWGd0VFhwUmJITjFhRWRTYW5sMlRXVnRjbU5oUmpneVkxbHJkVFpUY0RSbWJERTBSSE5CVW1waWFuRklMUzA1Ukd0MVFXdFpNR1l0UmpoMmVuTTFjRlUwUjFCaU16RTRYMXB6T1ZOTU4yZEZXVEp5UkdN…", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/youtube/hashtag/posts": { "get": { "tags": [ "YouTube" ], "summary": "A hashtag's videos or Shorts, about 36 a page.", "description": "1 credit a page.", "operationId": "youtubeHashtagPosts", "parameters": [ { "name": "name", "in": "query", "description": "The hashtag, with or without `#`.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "Its page's link, instead of `name`.", "required": false, "schema": { "type": "string" } }, { "name": "shorts", "in": "query", "description": "Its Shorts alone.", "required": false, "schema": { "type": "boolean" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_YouTubePost" }, "example": { "data": [ { "id": "y9K0aFv7xzU", "url": "https://www.youtube.com/watch?v=y9K0aFv7xzU", "text": null, "createdAt": null, "author": { "id": "UCI78AdiI6f7VKhqW1i4B3Rw", "username": "", "displayName": "Zach Choi", "avatarUrl": "https://yt3.ggpht.com/ytc/AIdro_nv3K8KG6LvfLVy_U1RS77IdrpBcRs_08kB-bOymm3dlKot=s68-c-k-c0x00ffffff-no-rj", "verified": false, "url": "https://www.youtube.com/channel/UCI78AdiI6f7VKhqW1i4B3Rw" }, "stats": { "views": 726446, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://i.ytimg.com/vi/y9K0aFv7xzU/hqdefault.jpg?sqp=-oaymwE2CNACELwBSFXyq4qpAygIARUAAIhCGABwAcABBvABAfgBtgiAAoAPigIMCAAQARh_ID0oHTAP&rs=AOn4CLDPj4WGGyyXVsZCxITFsJ1-0JNeCA", "width": null, "height": null, "durationSeconds": 28 } ], "hashtags": [], "mentions": [], "ext": { "kind": "video", "title": "would you eat this? #asmr #cooking (#recipe in description)", "durationSeconds": 28, "publishedText": "5 days ago", "category": null, "keywords": [], "chapters": [], "music": [], "liveNow": false, "unlisted": false, "familySafe": null, "membersOnly": false, "channelSubscribers": null } }, { "id": "ujuyFehC6do", "url": "https://www.youtube.com/watch?v=ujuyFehC6do", "text": null, "createdAt": null, "author": { "id": "UCh9hXCt6UfiOge6r7RZrU3A", "username": "", "displayName": "Mama J Rae", "avatarUrl": "https://yt3.ggpht.com/RDg2CpT8FCeOcQRYL2Elh455iUrwC8Ma1QYRd0-Kb_-uL5blsz6d3zL4RXzYFPTJnzvhlcsRdQ=s68-c-k-c0x00ffffff-no-rj", "verified": false, "url": "https://www.youtube.com/channel/UCh9hXCt6UfiOge6r7RZrU3A" }, "stats": { "views": 4443589, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://i.ytimg.com/vi/ujuyFehC6do/hqdefault.jpg?sqp=-oaymwE2CNACELwBSFXyq4qpAygIARUAAIhCGABwAcABBvABAfgBtgiAAoAPigIMCAAQARhlIFYoSTAP&rs=AOn4CLCCbRBYlMqHJKVc5-vGedtrouoRrA", "width": null, "height": null, "durationSeconds": 177 } ], "hashtags": [], "mentions": [], "ext": { "kind": "video", "title": "Meatloaf & Mashed Potatoes! 🍽 #Cooking #Dinner #EasyRecipe", "durationSeconds": 177, "publishedText": "1 year ago", "category": null, "keywords": [], "chapters": [], "music": [], "liveNow": false, "unlisted": false, "familySafe": null, "membersOnly": false, "channelSubscribers": null } } ], "pagination": { "nextCursor": "4qmFsgKzBRIJRkVoYXNodGFnGo4FQ0NGNjB3TkRRMUZSUVVKcFlsOUplbXQxYzJsamJUVlZRa2ROTjNZMVRUZDZPVGMyZEZob2FtVjZXbXBvTm1VelZXb3dPRmwwZFdKemREZHBRbWN0VTJ0QlVtcHBhazUxU0d4MFJFMDFhMjlaTVhGWVlXNXdja3B2WW1GTFFWSnFVR3RQTWpWZk5GYzNlRmhWV1c1bExTMHlUblU1ZURVMVYwZFBhWGd0VFhwUmJITjFhRWRTYW5sMlRXVnRjbU5oUmpneVkxbHJkVFpUY0RSbWJERTBSSE5CVW1waWFuRklMUzA1Ukd0MVFXdFpNR1l0UmpoMmVuTTFjRlUwUjFCaU16RTRYMXB6T1ZOTU4yZEZXVEp5UkdN…", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.youtube.hashtagPosts({ name: \"cooking\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.youtube.hashtag_posts(name=\"cooking\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/youtube/hashtag/posts \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"name=cooking\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_YouTubePost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/YouTubePost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "YouTubePost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "kind", "keywords", "chapters", "music", "liveNow", "unlisted", "membersOnly" ], "properties": { "category": { "type": [ "string", "null" ], "description": "YouTube's category (`Science & Technology`)." }, "channelSubscribers": { "type": [ "string", "null" ], "description": "The channel's subscribers, as YouTube writes them (`16.9M subscribers`)." }, "chapters": { "type": "array", "items": { "$ref": "#/components/schemas/YouTubeChapter" } }, "durationSeconds": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "familySafe": { "type": [ "boolean", "null" ], "description": "Suitable for all ages, as YouTube rates it." }, "keywords": { "type": "array", "items": { "type": "string" }, "description": "The tags its uploader gave it." }, "kind": { "$ref": "#/components/schemas/YouTubePostKind" }, "liveNow": { "type": "boolean", "description": "Live now." }, "membersOnly": { "type": "boolean", "description": "For the channel's members only." }, "music": { "type": "array", "items": { "$ref": "#/components/schemas/YouTubeSong" }, "description": "Songs credited in its description." }, "publishedText": { "type": [ "string", "null" ], "description": "When it was published, as YouTube writes it in lists (`3 days ago`): a list gives\nno exact time, which `createdAt` is on `/post`." }, "title": { "type": [ "string", "null" ], "description": "The video's title (`text` is its description)." }, "unlisted": { "type": "boolean", "description": "Unlisted: reachable by its link only." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A video, a Short, a live stream or a community post." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "YouTubeSong": { "type": "object", "description": "A song a video uses, as its description credits it.", "required": [ "title" ], "properties": { "album": { "type": [ "string", "null" ] }, "artist": { "type": [ "string", "null" ] }, "title": { "type": "string" } } }, "YouTubePostKind": { "type": "string", "description": "What a video is.", "enum": [ "video", "short", "live", "community" ] }, "YouTubeChapter": { "type": "object", "description": "A chapter of a video.", "required": [ "title", "startSeconds" ], "properties": { "startSeconds": { "type": "integer", "format": "int64", "minimum": 0 }, "title": { "type": "string" } } }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Hashtag (/docs/api-reference/youtube/hashtag) A hashtag with its video and channel counts. `GET https://api.socialapi.sh/v1/youtube/hashtag` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.youtube.hashtag({ name: "cooking" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.youtube.hashtag(name="cooking").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/youtube/hashtag \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "name=cooking" ``` **Response** ```json { "data": { "id": "cooking", "name": "cooking", "description": null, "url": "https://www.youtube.com/hashtag/cooking", "posts": 43000000, "views": null, "ext": { "channels": 4300000 } } } ``` **OpenAPI** ```json { "paths": { "/v1/youtube/hashtag": { "get": { "tags": [ "YouTube" ], "summary": "A hashtag with its video and channel counts.", "description": "1 credit.", "operationId": "youtubeHashtag", "parameters": [ { "name": "name", "in": "query", "description": "The hashtag, with or without `#`.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "Its page's link (`https://www.youtube.com/hashtag/cooking`), instead of `name`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_YouTubeHashtag" }, "example": { "data": { "id": "cooking", "name": "cooking", "description": null, "url": "https://www.youtube.com/hashtag/cooking", "posts": 43000000, "views": null, "ext": { "channels": 4300000 } } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.youtube.hashtag({ name: \"cooking\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.youtube.hashtag(name=\"cooking\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/youtube/hashtag \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"name=cooking\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_YouTubeHashtag": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/YouTubeHashtag" } } }, "YouTubeHashtag": { "allOf": [ { "type": "object", "description": "A hashtag.", "required": [ "id", "name", "url", "ext" ], "properties": { "description": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "properties": { "channels": { "type": [ "integer", "null" ], "format": "int64", "description": "Channels that used it.", "minimum": 0 } } }, { "type": "object", "description": "What only this platform has." } ] }, "id": { "type": "string" }, "name": { "type": "string", "description": "Without `#`." }, "posts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "url": { "type": "string" }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, { "type": "object", "description": "A hashtag." } ] } } } } ``` # YouTube API (/docs/api-reference/youtube) Every YouTube endpoint, by group. Each is a `GET` under `/v1/youtube`. ## Quick Reference [#quick-reference] | Property | Value | | --- | --- | | Base path | `/v1/youtube` | | Endpoints | 26 | | Credits | See Below | | Guide | [YouTube](/docs/youtube) | ## Accounts [#accounts] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/youtube/profile`](/docs/api-reference/youtube/profile) | A channel with its subscribers, videos and views. | 1 | | [`GET /v1/youtube/profile/community`](/docs/api-reference/youtube/profile-community) | A channel's community posts, 10 a page. | 1 | | [`GET /v1/youtube/profile/lives`](/docs/api-reference/youtube/profile-lives) | A channel's live streams, on now and past, 30 a page. | 1 | | [`GET /v1/youtube/profile/playlists`](/docs/api-reference/youtube/profile-playlists) | A channel's playlists, 30 a page. | 1 | | [`GET /v1/youtube/profile/podcasts`](/docs/api-reference/youtube/profile-podcasts) | A channel's podcasts. | 1 | | [`GET /v1/youtube/profile/posts`](/docs/api-reference/youtube/profile-posts) | A channel's videos, 30 a page. | 1 | | [`GET /v1/youtube/profile/search`](/docs/api-reference/youtube/profile-search) | A search within one channel's videos, about 30 a page. | 1 | | [`GET /v1/youtube/profile/shorts`](/docs/api-reference/youtube/profile-shorts) | A channel's Shorts, about 48 a page. | 1 | ## Posts [#posts] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/youtube/community`](/docs/api-reference/youtube/community) | One community post with its likes and images. | 1 | | [`GET /v1/youtube/playlist`](/docs/api-reference/youtube/playlist) | A playlist with its owner and video count. | 1 | | [`GET /v1/youtube/playlist/posts`](/docs/api-reference/youtube/playlist-posts) | A playlist's videos in order, 100 a page. | 1 | | [`GET /v1/youtube/post`](/docs/api-reference/youtube/post) | One video or Short with its views, likes and chapters. | 1 | | [`GET /v1/youtube/post/comments`](/docs/api-reference/youtube/post-comments) | A video's comments, top or newest first, about 20 a page. | 1 | | [`GET /v1/youtube/post/comment/replies`](/docs/api-reference/youtube/post-comment-replies) | A comment's replies, 10 a page. | 1 | | [`GET /v1/youtube/post/related`](/docs/api-reference/youtube/post-related) | The videos YouTube suggests beside one, about 20 a page. | 1 | | [`GET /v1/youtube/post/transcript`](/docs/api-reference/youtube/post-transcript) | A video's captions as text. | 5 | ## Discovery [#discovery] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/youtube/hashtag`](/docs/api-reference/youtube/hashtag) | A hashtag with its video and channel counts. | 1 | | [`GET /v1/youtube/hashtag/posts`](/docs/api-reference/youtube/hashtag-posts) | A hashtag's videos or Shorts, about 36 a page. | 1 | | [`GET /v1/youtube/search`](/docs/api-reference/youtube/search) | Videos matching a query, about 20 a page. | 1 | | [`GET /v1/youtube/search/channels`](/docs/api-reference/youtube/search-channels) | Channels matching a query, about 20 a page. | 1 | | [`GET /v1/youtube/search/playlists`](/docs/api-reference/youtube/search-playlists) | Playlists matching a query, about 20 a page. | 1 | | [`GET /v1/youtube/search/suggestions`](/docs/api-reference/youtube/search-suggestions) | What the search box suggests for a few letters. | 1 | | [`GET /v1/youtube/trending`](/docs/api-reference/youtube/trending) | What is trending in a country, about 20 videos. | 1 | ## Batch [#batch] | Endpoint | Returns | Credits | | --- | --- | --- | | [`GET /v1/youtube/batch/posts`](/docs/api-reference/youtube/batch-posts) | Up to 50 videos at once, by their ids. | 1 | | [`GET /v1/youtube/batch/profiles`](/docs/api-reference/youtube/batch-profiles) | Up to 20 channels at once, by their ids or handles. | 1 | | [`GET /v1/youtube/batch/transcripts`](/docs/api-reference/youtube/batch-transcripts) | Up to 20 videos' captions at once, by their ids. | 5 | ## Example Request [#example-request] Every YouTube endpoint is called this way: its path, and what to read as query parameters. **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.youtube.profile({ handle: "LinusTechTips" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.youtube.profile(handle="LinusTechTips").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/youtube/profile \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=LinusTechTips" ``` **Response** ```json { "data": { "id": "UCXuqSBlHAE6Xw-yeJA0Tunw", "username": "LinusTechTips", "displayName": "Linus Tech Tips", "bio": "Linus Tech Tips is a passionate team of \"professionally curious\" experts in consumer technology and video production who aim to educate and entertain.\n\nSponsorship Inquiries: partnerships@linusmediagroup.com", "avatarUrl": "https://yt3.googleusercontent.com/gnvYLhXy8FAlPXZ2RTrkrgj-5kyt0vdE2FUGVOiKGdEZIa-wN5A-7nwZBlWJLzUMmoh1NWAU=s160-c-k-c0x00ffffff-no-rj", "url": "https://www.youtube.com/@LinusTechTips", "verified": true, "private": false, "followers": 16900000, "following": null, "likes": null, "posts": 8011, "externalUrl": "https://www.lttstore.com/", "createdAt": "2008-11-24T00:00:00.000Z", "ext": { "views": 10045352646, "country": "Canada", "bannerUrl": "https://yt3.googleusercontent.com/U_7GWetO6k4sq3pAkbFEIIWzZLKcIJlGJqNz6NQAhgqF6DVD5pllwWF6trSUWEIRn4MkhNlhy9Y=w2560-fcrop64=1,00005a57ffffa5a8-k-c0xffffffff-no-nd-rj", "links": [ { "title": "lttstore.com", "url": "https://www.lttstore.com/" }, { "title": "Floatplane", "url": "https://www.floatplane.com/ltt" }, { "title": "Labs", "url": "https://www.lttlabs.com/" } ], "subscribersText": "16.9M subscribers" } } } ``` ## Errors [#errors] A call that fails costs nothing. See [Errors](/docs/errors) for every code. # Playlist Posts (/docs/api-reference/youtube/playlist-posts) A playlist's videos in order, 100 a page. `GET https://api.socialapi.sh/v1/youtube/playlist/posts` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.youtube.playlistPosts({ id: "PLXm3b2ZSqTsc" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.youtube.playlist_posts(id="PLXm3b2ZSqTsc") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/youtube/playlist/posts \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "id=PLXm3b2ZSqTsc" ``` **Response** ```json { "data": [ { "id": "skdOVaiRq1c", "url": "https://www.youtube.com/watch?v=skdOVaiRq1c", "text": null, "createdAt": null, "author": { "id": "UCXuqSBlHAE6Xw-yeJA0Tunw", "username": "LinusTechTips", "displayName": "Linus Tech Tips", "avatarUrl": null, "verified": false, "url": "https://www.youtube.com/@LinusTechTips" }, "stats": { "views": 1300000, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://i.ytimg.com/vi/skdOVaiRq1c/hqdefault.jpg?sqp=-oaymwEcCNACELwBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLD53p9Eutt1Tbk_OfZSNQYUG77X5g", "width": null, "height": null, "durationSeconds": 938 } ], "hashtags": [], "mentions": [], "ext": { "kind": "video", "title": "Don’t Break Into my Grandparents House", "durationSeconds": 938, "publishedText": "7 days ago", "category": null, "keywords": [], "chapters": [], "music": [], "liveNow": false, "unlisted": false, "familySafe": null, "membersOnly": false, "channelSubscribers": null } } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/youtube/playlist/posts": { "get": { "tags": [ "YouTube" ], "summary": "A playlist's videos in order, 100 a page.", "description": "1 credit a page.", "operationId": "youtubePlaylistPosts", "parameters": [ { "name": "url", "in": "query", "description": "The playlist's link.", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The playlist's id, instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_YouTubePost" }, "example": { "data": [ { "id": "skdOVaiRq1c", "url": "https://www.youtube.com/watch?v=skdOVaiRq1c", "text": null, "createdAt": null, "author": { "id": "UCXuqSBlHAE6Xw-yeJA0Tunw", "username": "LinusTechTips", "displayName": "Linus Tech Tips", "avatarUrl": null, "verified": false, "url": "https://www.youtube.com/@LinusTechTips" }, "stats": { "views": 1300000, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://i.ytimg.com/vi/skdOVaiRq1c/hqdefault.jpg?sqp=-oaymwEcCNACELwBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLD53p9Eutt1Tbk_OfZSNQYUG77X5g", "width": null, "height": null, "durationSeconds": 938 } ], "hashtags": [], "mentions": [], "ext": { "kind": "video", "title": "Don’t Break Into my Grandparents House", "durationSeconds": 938, "publishedText": "7 days ago", "category": null, "keywords": [], "chapters": [], "music": [], "liveNow": false, "unlisted": false, "familySafe": null, "membersOnly": false, "channelSubscribers": null } } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.youtube.playlistPosts({ id: \"PLXm3b2ZSqTsc\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.youtube.playlist_posts(id=\"PLXm3b2ZSqTsc\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/youtube/playlist/posts \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"id=PLXm3b2ZSqTsc\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_YouTubePost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/YouTubePost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "YouTubePost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "kind", "keywords", "chapters", "music", "liveNow", "unlisted", "membersOnly" ], "properties": { "category": { "type": [ "string", "null" ], "description": "YouTube's category (`Science & Technology`)." }, "channelSubscribers": { "type": [ "string", "null" ], "description": "The channel's subscribers, as YouTube writes them (`16.9M subscribers`)." }, "chapters": { "type": "array", "items": { "$ref": "#/components/schemas/YouTubeChapter" } }, "durationSeconds": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "familySafe": { "type": [ "boolean", "null" ], "description": "Suitable for all ages, as YouTube rates it." }, "keywords": { "type": "array", "items": { "type": "string" }, "description": "The tags its uploader gave it." }, "kind": { "$ref": "#/components/schemas/YouTubePostKind" }, "liveNow": { "type": "boolean", "description": "Live now." }, "membersOnly": { "type": "boolean", "description": "For the channel's members only." }, "music": { "type": "array", "items": { "$ref": "#/components/schemas/YouTubeSong" }, "description": "Songs credited in its description." }, "publishedText": { "type": [ "string", "null" ], "description": "When it was published, as YouTube writes it in lists (`3 days ago`): a list gives\nno exact time, which `createdAt` is on `/post`." }, "title": { "type": [ "string", "null" ], "description": "The video's title (`text` is its description)." }, "unlisted": { "type": "boolean", "description": "Unlisted: reachable by its link only." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A video, a Short, a live stream or a community post." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "YouTubeSong": { "type": "object", "description": "A song a video uses, as its description credits it.", "required": [ "title" ], "properties": { "album": { "type": [ "string", "null" ] }, "artist": { "type": [ "string", "null" ] }, "title": { "type": "string" } } }, "YouTubePostKind": { "type": "string", "description": "What a video is.", "enum": [ "video", "short", "live", "community" ] }, "YouTubeChapter": { "type": "object", "description": "A chapter of a video.", "required": [ "title", "startSeconds" ], "properties": { "startSeconds": { "type": "integer", "format": "int64", "minimum": 0 }, "title": { "type": "string" } } }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Playlist (/docs/api-reference/youtube/playlist) A playlist with its owner and video count. `GET https://api.socialapi.sh/v1/youtube/playlist` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.youtube.playlist({ id: "PLXm3b2ZSqTsc" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.youtube.playlist(id="PLXm3b2ZSqTsc").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/youtube/playlist \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "id=PLXm3b2ZSqTsc" ``` **Response** ```json { "data": { "id": "PLXm3b2ZSqTsc", "name": "Home Security", "url": "https://www.youtube.com/playlist?list=PLXm3b2ZSqTsc", "coverUrl": "https://i.ytimg.com/vi/skdOVaiRq1c/hqdefault.jpg?sqp=-oaymwEXCNACELwBSFryq4qpAwkIARUAAIhCGAE=&rs=AOn4CLDL9YSkvZ65Ldue0eBW4rVi5tA79A", "posts": 1, "ext": { "description": "Videos about cameras, NVRs, and other home security products", "views": 70, "owner": { "id": "UCXuqSBlHAE6Xw-yeJA0Tunw", "username": "LinusTechTips", "displayName": null, "avatarUrl": "https://yt3.ggpht.com/gnvYLhXy8FAlPXZ2RTrkrgj-5kyt0vdE2FUGVOiKGdEZIa-wN5A-7nwZBlWJLzUMmoh1NWAU=s48-c-k-c0x00ffffff-no-rj", "verified": false, "url": "https://www.youtube.com/@LinusTechTips" }, "updatedText": null, "podcast": false } } } ``` **OpenAPI** ```json { "paths": { "/v1/youtube/playlist": { "get": { "tags": [ "YouTube" ], "summary": "A playlist with its owner and video count.", "description": "Title, description, owner, videos, views and when it was updated. 1 credit.", "operationId": "youtubePlaylist", "parameters": [ { "name": "url", "in": "query", "description": "The playlist's link (`https://www.youtube.com/playlist?list=PL…`).", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The playlist's id, instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_YouTubePlaylist" }, "example": { "data": { "id": "PLXm3b2ZSqTsc", "name": "Home Security", "url": "https://www.youtube.com/playlist?list=PLXm3b2ZSqTsc", "coverUrl": "https://i.ytimg.com/vi/skdOVaiRq1c/hqdefault.jpg?sqp=-oaymwEXCNACELwBSFryq4qpAwkIARUAAIhCGAE=&rs=AOn4CLDL9YSkvZ65Ldue0eBW4rVi5tA79A", "posts": 1, "ext": { "description": "Videos about cameras, NVRs, and other home security products", "views": 70, "owner": { "id": "UCXuqSBlHAE6Xw-yeJA0Tunw", "username": "LinusTechTips", "displayName": null, "avatarUrl": "https://yt3.ggpht.com/gnvYLhXy8FAlPXZ2RTrkrgj-5kyt0vdE2FUGVOiKGdEZIa-wN5A-7nwZBlWJLzUMmoh1NWAU=s48-c-k-c0x00ffffff-no-rj", "verified": false, "url": "https://www.youtube.com/@LinusTechTips" }, "updatedText": null, "podcast": false } } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.youtube.playlist({ id: \"PLXm3b2ZSqTsc\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.youtube.playlist(id=\"PLXm3b2ZSqTsc\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/youtube/playlist \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"id=PLXm3b2ZSqTsc\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_YouTubePlaylist": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/YouTubePlaylist" } } }, "YouTubePlaylist": { "allOf": [ { "type": "object", "description": "A playlist, mix or collection of posts.", "required": [ "id", "name", "ext" ], "properties": { "coverUrl": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "podcast" ], "properties": { "description": { "type": [ "string", "null" ] }, "owner": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "podcast": { "type": "boolean", "description": "A podcast's show rather than a list of videos." }, "updatedText": { "type": [ "string", "null" ], "description": "When it was last updated, as YouTube writes it (`Updated today`)." }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, { "type": "object", "description": "What only this platform has." } ] }, "id": { "type": "string" }, "name": { "type": "string" }, "posts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "url": { "type": [ "string", "null" ] } } }, { "type": "object", "description": "A playlist, or a podcast's show." } ] }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Post Comment Replies (/docs/api-reference/youtube/post-comment-replies) A comment's replies, 10 a page. `GET https://api.socialapi.sh/v1/youtube/post/comment/replies` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.youtube.postCommentReplies({ token: "Eg0SC0lwNUVpcWJ1QnBFGAYygwEaUBIaVWd4SWJsNnUzMEV2Um52WjhXNTRBYUFCQWciAggAKhhVQ1h1cVNCbEhBRTZYdy15ZUpBMFR1bncyC0lwNUVpcWJ1QnBFQAFICoIBAggBQi9jb21tZW50LXJlcGxpZXMtaXRlbS1VZ3hJYmw2dTMwRXZSbnZaOFc1NEFhQUJBZw%3D%3D" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.youtube.post_comment_replies(token="Eg0SC0lwNUVpcWJ1QnBFGAYygwEaUBIaVWd4SWJsNnUzMEV2Um52WjhXNTRBYUFCQWciAggAKhhVQ1h1cVNCbEhBRTZYdy15ZUpBMFR1bncyC0lwNUVpcWJ1QnBFQAFICoIBAggBQi9jb21tZW50LXJlcGxpZXMtaXRlbS1VZ3hJYmw2dTMwRXZSbnZaOFc1NEFhQUJBZw%3D%3D") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/youtube/post/comment/replies \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "token=Eg0SC0lwNUVpcWJ1QnBFGAYygwEaUBIaVWd4SWJsNnUzMEV2Um52WjhXNTRBYUFCQWciAggAKhhVQ1h1cVNCbEhBRTZYdy15ZUpBMFR1bncyC0lwNUVpcWJ1QnBFQAFICoIBAggBQi9jb21tZW50LXJlcGxpZXMtaXRlbS1VZ3hJYmw2dTMwRXZSbnZaOFc1NEFhQUJBZw%3D%3D" ``` **Response** ```json { "data": [ { "id": "UgxIbl6u30EvRnvZ8W54AaABAg.AdZkak57gSlAd_wuN30rch", "postId": "Ip5EiqbuBpE", "parentId": null, "text": "Yo Linus, the U.S. link for the Tech Sling on the bundle's website takes you to the $60 Tech Sack instead :D It threw me off a little bit! I Was like WHY is the bundle WAY more expensive?!", "createdAt": null, "author": { "id": "UChwFVpA3vr24SSnnnrmZVlA", "username": "AlTheEngineer", "displayName": null, "avatarUrl": "https://yt3.ggpht.com/ytc/AIdro_kyfydLc293VbbjgrpePSv3dbHu7agXv5XldsfMTFs=s88-c-k-c0x00ffffff-no-rj", "verified": false, "url": "https://www.youtube.com/@AlTheEngineer" }, "likes": 0, "replies": 0, "ext": { "publishedText": "1 day ago", "edited": true, "pinned": false, "byCreator": false, "repliesToken": null } } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/youtube/post/comment/replies": { "get": { "tags": [ "YouTube" ], "summary": "A comment's replies, 10 a page.", "description": "By the comment's `ext.repliesToken`. 1 credit a page.", "operationId": "youtubePostCommentReplies", "parameters": [ { "name": "token", "in": "query", "description": "The comment's `ext.repliesToken`.", "required": true, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_YouTubeComment" }, "example": { "data": [ { "id": "UgxIbl6u30EvRnvZ8W54AaABAg.AdZkak57gSlAd_wuN30rch", "postId": "Ip5EiqbuBpE", "parentId": null, "text": "Yo Linus, the U.S. link for the Tech Sling on the bundle's website takes you to the $60 Tech Sack instead :D It threw me off a little bit! I Was like WHY is the bundle WAY more expensive?!", "createdAt": null, "author": { "id": "UChwFVpA3vr24SSnnnrmZVlA", "username": "AlTheEngineer", "displayName": null, "avatarUrl": "https://yt3.ggpht.com/ytc/AIdro_kyfydLc293VbbjgrpePSv3dbHu7agXv5XldsfMTFs=s88-c-k-c0x00ffffff-no-rj", "verified": false, "url": "https://www.youtube.com/@AlTheEngineer" }, "likes": 0, "replies": 0, "ext": { "publishedText": "1 day ago", "edited": true, "pinned": false, "byCreator": false, "repliesToken": null } } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.youtube.postCommentReplies({ token: \"Eg0SC0lwNUVpcWJ1QnBFGAYygwEaUBIaVWd4SWJsNnUzMEV2Um52WjhXNTRBYUFCQWciAggAKhhVQ1h1cVNCbEhBRTZYdy15ZUpBMFR1bncyC0lwNUVpcWJ1QnBFQAFICoIBAggBQi9jb21tZW50LXJlcGxpZXMtaXRlbS1VZ3hJYmw2dTMwRXZSbnZaOFc1NEFhQUJBZw%3D%3D\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.youtube.post_comment_replies(token=\"Eg0SC0lwNUVpcWJ1QnBFGAYygwEaUBIaVWd4SWJsNnUzMEV2Um52WjhXNTRBYUFCQWciAggAKhhVQ1h1cVNCbEhBRTZYdy15ZUpBMFR1bncyC0lwNUVpcWJ1QnBFQAFICoIBAggBQi9jb21tZW50LXJlcGxpZXMtaXRlbS1VZ3hJYmw2dTMwRXZSbnZaOFc1NEFhQUJBZw%3D%3D\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/youtube/post/comment/replies \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"token=Eg0SC0lwNUVpcWJ1QnBFGAYygwEaUBIaVWd4SWJsNnUzMEV2Um52WjhXNTRBYUFCQWciAggAKhhVQ1h1cVNCbEhBRTZYdy15ZUpBMFR1bncyC0lwNUVpcWJ1QnBFQAFICoIBAggBQi9jb21tZW50LXJlcGxpZXMtaXRlbS1VZ3hJYmw2dTMwRXZSbnZaOFc1NEFhQUJBZw%3D%3D\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_YouTubeComment": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/YouTubeComment" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "YouTubeComment": { "allOf": [ { "type": "object", "description": "A comment or a reply.", "required": [ "id", "postId", "text", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "edited", "pinned", "byCreator" ], "properties": { "byCreator": { "type": "boolean", "description": "Written by the video's channel." }, "edited": { "type": "boolean" }, "pinned": { "type": "boolean", "description": "Pinned by the channel." }, "publishedText": { "type": [ "string", "null" ], "description": "When it was written, as YouTube writes it (`1 day ago`): YouTube gives no exact\ntime." }, "repliesToken": { "type": [ "string", "null" ], "description": "What `/v1/youtube/post/comment/replies` takes as `token`: its replies, when it has." } } }, { "type": "object", "description": "What only this platform has." } ] }, "id": { "type": "string" }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "parentId": { "type": [ "string", "null" ], "description": "The comment this replies to; absent on a top-level comment." }, "postId": { "type": "string" }, "replies": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "text": { "type": "string" } } }, { "type": "object", "description": "A comment, or a reply." } ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Post Comments (/docs/api-reference/youtube/post-comments) A video's comments, top or newest first, about 20 a page. `GET https://api.socialapi.sh/v1/youtube/post/comments` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.youtube.postComments({ url: "https://www.youtube.com/watch?v=Ip5EiqbuBpE", sort: "top" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.youtube.post_comments(url="https://www.youtube.com/watch?v=Ip5EiqbuBpE", sort="top") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/youtube/post/comments \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://www.youtube.com/watch?v=Ip5EiqbuBpE" \ --data-urlencode "sort=top" ``` **Response** ```json { "data": [ { "id": "UgxIbl6u30EvRnvZ8W54AaABAg", "postId": "Ip5EiqbuBpE", "parentId": null, "text": "Buy the brand new Tech Sling and earphone pouch and get a $30 LTT Gift card!\n\nUS: https://www.lttstore.com/products/tech-sling-earphone-pouch-free-30-gift-card-bundle\nGlobal: https://global.lttstore.com/products/tech-sling-earphone-pouch-30-gift-card-bundle", "createdAt": null, "author": { "id": "UCXuqSBlHAE6Xw-yeJA0Tunw", "username": "LinusTechTips", "displayName": null, "avatarUrl": "https://yt3.ggpht.com/gnvYLhXy8FAlPXZ2RTrkrgj-5kyt0vdE2FUGVOiKGdEZIa-wN5A-7nwZBlWJLzUMmoh1NWAU=s88-c-k-c0x00ffffff-no-rj", "verified": true, "url": "https://www.youtube.com/@LinusTechTips" }, "likes": 41, "replies": 1, "ext": { "publishedText": "1 day ago", "edited": false, "pinned": true, "byCreator": true, "repliesToken": "Eg0SC0lwNUVpcWJ1QnBFGAYygwEaUBIaVWd4SWJsNnUzMEV2Um52WjhXNTRBYUFCQWciAggAKhhVQ1h1cVNCbEhBRTZYdy15ZUpBMFR1bncyC0lwNUVpcWJ1QnBFQAFICoIBAggBQi9jb21tZW50LXJlcGxpZXMtaXRlbS1VZ3hJYmw2dTMwRXZSbnZaOFc1NEFhQUJBZw%3D%3D" } }, { "id": "UgxihacXvVekVWlT82V4AaABAg", "postId": "Ip5EiqbuBpE", "parentId": null, "text": "\"claude, add SteamOS to mac. make no mistakes\"", "createdAt": null, "author": { "id": "UCOAorxe7DJuiwVLll6zVtsA", "username": "Packolotl", "displayName": null, "avatarUrl": "https://yt3.ggpht.com/iLmno1yTVmN34ROM7E_X4E1tCo07DiM6C4YWi2D91Tl-QMJA8skQHmL31OFhCAV7OqGrKPZ1-5g=s88-c-k-c0x00ffffff-no-rj", "verified": false, "url": "https://www.youtube.com/@Packolotl" }, "likes": 6300, "replies": 42, "ext": { "publishedText": "1 day ago", "edited": false, "pinned": false, "byCreator": false, "repliesToken": "Eg0SC0lwNUVpcWJ1QnBFGAYygwEaUBIaVWd4aWhhY1h2VmVrVldsVDgyVjRBYUFCQWciAggAKhhVQ1h1cVNCbEhBRTZYdy15ZUpBMFR1bncyC0lwNUVpcWJ1QnBFQAFICoIBAggBQi9jb21tZW50LXJlcGxpZXMtaXRlbS1VZ3hpaGFjWHZWZWtWV2xUODJWNEFhQUJBZw%3D%3D" } } ], "pagination": { "nextCursor": "Eg0SC0lwNUVpcWJ1QnBFGAYygAMK1gJnZXRfcmFua2VkX3N0cmVhbXMtLUNxVUJDSUFFRlJlMzBUZ2FtZ0VLbFFFSTJGOFFnQVFZQnlLS0FadUtBdmtybkNaR1VNc2Iwcy1XS0lPYWtVQ25OTW1IYUk5NWdMMkZPS19WcmQzYzhHckhBcXc1RmlNakpVQTZWSXJnLVFKQ3RYcjlqcUJQeWxHeVVDcVRiVElxQWZvWTJ1UTkxQnR6Wkg0R0NlS2o1NVNDWU5nc3hSUXZKOWwyZXp6MXZnMWRJWXZmSGszdGpPaC1FX2VTZ0M2WE11SlE0bUxjUW1QTFd1MTRmLVB1VjBfMDdwT0MtQkFVRWdjSWhDQVFGQmdCRWdVSXdDQVlBQklGQ0lrZ0dBQVNC…", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/youtube/post/comments": { "get": { "tags": [ "YouTube" ], "summary": "A video's comments, top or newest first, about 20 a page.", "description": "With their likes, reply counts and a token for their replies. 1 credit a page.", "operationId": "youtubePostComments", "parameters": [ { "name": "url", "in": "query", "description": "The video's link.", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The video's id, instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "sort", "in": "query", "description": "`top` (the default) or `newest`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_YouTubeComment" }, "example": { "data": [ { "id": "UgxIbl6u30EvRnvZ8W54AaABAg", "postId": "Ip5EiqbuBpE", "parentId": null, "text": "Buy the brand new Tech Sling and earphone pouch and get a $30 LTT Gift card!\n\nUS: https://www.lttstore.com/products/tech-sling-earphone-pouch-free-30-gift-card-bundle\nGlobal: https://global.lttstore.com/products/tech-sling-earphone-pouch-30-gift-card-bundle", "createdAt": null, "author": { "id": "UCXuqSBlHAE6Xw-yeJA0Tunw", "username": "LinusTechTips", "displayName": null, "avatarUrl": "https://yt3.ggpht.com/gnvYLhXy8FAlPXZ2RTrkrgj-5kyt0vdE2FUGVOiKGdEZIa-wN5A-7nwZBlWJLzUMmoh1NWAU=s88-c-k-c0x00ffffff-no-rj", "verified": true, "url": "https://www.youtube.com/@LinusTechTips" }, "likes": 41, "replies": 1, "ext": { "publishedText": "1 day ago", "edited": false, "pinned": true, "byCreator": true, "repliesToken": "Eg0SC0lwNUVpcWJ1QnBFGAYygwEaUBIaVWd4SWJsNnUzMEV2Um52WjhXNTRBYUFCQWciAggAKhhVQ1h1cVNCbEhBRTZYdy15ZUpBMFR1bncyC0lwNUVpcWJ1QnBFQAFICoIBAggBQi9jb21tZW50LXJlcGxpZXMtaXRlbS1VZ3hJYmw2dTMwRXZSbnZaOFc1NEFhQUJBZw%3D%3D" } }, { "id": "UgxihacXvVekVWlT82V4AaABAg", "postId": "Ip5EiqbuBpE", "parentId": null, "text": "\"claude, add SteamOS to mac. make no mistakes\"", "createdAt": null, "author": { "id": "UCOAorxe7DJuiwVLll6zVtsA", "username": "Packolotl", "displayName": null, "avatarUrl": "https://yt3.ggpht.com/iLmno1yTVmN34ROM7E_X4E1tCo07DiM6C4YWi2D91Tl-QMJA8skQHmL31OFhCAV7OqGrKPZ1-5g=s88-c-k-c0x00ffffff-no-rj", "verified": false, "url": "https://www.youtube.com/@Packolotl" }, "likes": 6300, "replies": 42, "ext": { "publishedText": "1 day ago", "edited": false, "pinned": false, "byCreator": false, "repliesToken": "Eg0SC0lwNUVpcWJ1QnBFGAYygwEaUBIaVWd4aWhhY1h2VmVrVldsVDgyVjRBYUFCQWciAggAKhhVQ1h1cVNCbEhBRTZYdy15ZUpBMFR1bncyC0lwNUVpcWJ1QnBFQAFICoIBAggBQi9jb21tZW50LXJlcGxpZXMtaXRlbS1VZ3hpaGFjWHZWZWtWV2xUODJWNEFhQUJBZw%3D%3D" } } ], "pagination": { "nextCursor": "Eg0SC0lwNUVpcWJ1QnBFGAYygAMK1gJnZXRfcmFua2VkX3N0cmVhbXMtLUNxVUJDSUFFRlJlMzBUZ2FtZ0VLbFFFSTJGOFFnQVFZQnlLS0FadUtBdmtybkNaR1VNc2Iwcy1XS0lPYWtVQ25OTW1IYUk5NWdMMkZPS19WcmQzYzhHckhBcXc1RmlNakpVQTZWSXJnLVFKQ3RYcjlqcUJQeWxHeVVDcVRiVElxQWZvWTJ1UTkxQnR6Wkg0R0NlS2o1NVNDWU5nc3hSUXZKOWwyZXp6MXZnMWRJWXZmSGszdGpPaC1FX2VTZ0M2WE11SlE0bUxjUW1QTFd1MTRmLVB1VjBfMDdwT0MtQkFVRWdjSWhDQVFGQmdCRWdVSXdDQVlBQklGQ0lrZ0dBQVNC…", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.youtube.postComments({ url: \"https://www.youtube.com/watch?v=Ip5EiqbuBpE\", sort: \"top\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.youtube.post_comments(url=\"https://www.youtube.com/watch?v=Ip5EiqbuBpE\", sort=\"top\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/youtube/post/comments \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://www.youtube.com/watch?v=Ip5EiqbuBpE\" \\\n --data-urlencode \"sort=top\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_YouTubeComment": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/YouTubeComment" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "YouTubeComment": { "allOf": [ { "type": "object", "description": "A comment or a reply.", "required": [ "id", "postId", "text", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "edited", "pinned", "byCreator" ], "properties": { "byCreator": { "type": "boolean", "description": "Written by the video's channel." }, "edited": { "type": "boolean" }, "pinned": { "type": "boolean", "description": "Pinned by the channel." }, "publishedText": { "type": [ "string", "null" ], "description": "When it was written, as YouTube writes it (`1 day ago`): YouTube gives no exact\ntime." }, "repliesToken": { "type": [ "string", "null" ], "description": "What `/v1/youtube/post/comment/replies` takes as `token`: its replies, when it has." } } }, { "type": "object", "description": "What only this platform has." } ] }, "id": { "type": "string" }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "parentId": { "type": [ "string", "null" ], "description": "The comment this replies to; absent on a top-level comment." }, "postId": { "type": "string" }, "replies": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "text": { "type": "string" } } }, { "type": "object", "description": "A comment, or a reply." } ] }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Post Related (/docs/api-reference/youtube/post-related) The videos YouTube suggests beside one, about 20 a page. `GET https://api.socialapi.sh/v1/youtube/post/related` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.youtube.postRelated({ url: "https://www.youtube.com/watch?v=Ip5EiqbuBpE" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.youtube.post_related(url="https://www.youtube.com/watch?v=Ip5EiqbuBpE") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/youtube/post/related \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://www.youtube.com/watch?v=Ip5EiqbuBpE" ``` **Response** ```json { "data": [ { "id": "Yb9r-EMxrbw", "url": "https://www.youtube.com/watch?v=Yb9r-EMxrbw", "text": null, "createdAt": null, "author": { "id": "UCH_7doiCkWeq0v3ycWE5lDw", "username": "any_austin", "displayName": "Any Austin", "avatarUrl": null, "verified": false, "url": "https://www.youtube.com/@any_austin" }, "stats": { "views": null, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://i.ytimg.com/vi/Yb9r-EMxrbw/hqdefault_custom_2.jpg?sqp=CPCkm9gG-oaymwEcCNACELwBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLAUWL53cSLK1iQAHwsjdmwx1fGL2Q", "width": null, "height": null, "durationSeconds": 920 } ], "hashtags": [], "mentions": [], "ext": { "kind": "video", "title": "Grand Theft Auto VI is Full of Things You’d Never Notice", "durationSeconds": 920, "publishedText": "19h ago", "category": null, "keywords": [], "chapters": [], "music": [], "liveNow": false, "unlisted": false, "familySafe": null, "membersOnly": false, "channelSubscribers": null } }, { "id": "cc5C8hRblBY", "url": "https://www.youtube.com/watch?v=cc5C8hRblBY", "text": null, "createdAt": null, "author": { "id": "UCBJycsmduvYEL83R_U4JriQ", "username": "mkbhd", "displayName": "Marques Brownlee", "avatarUrl": null, "verified": false, "url": "https://www.youtube.com/@mkbhd" }, "stats": { "views": null, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://i.ytimg.com/vi/cc5C8hRblBY/hqdefault.jpg?sqp=-oaymwEcCNACELwBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLBpvxa62pJALVQ27VncG_7iYcVZCA", "width": null, "height": null, "durationSeconds": 1296 } ], "hashtags": [], "mentions": [], "ext": { "kind": "video", "title": "I'm Starting Over", "durationSeconds": 1296, "publishedText": "1d ago", "category": null, "keywords": [], "chapters": [], "music": [], "liveNow": false, "unlisted": false, "familySafe": null, "membersOnly": false, "channelSubscribers": null } } ], "pagination": { "nextCursor": "CBQSDRILSXA1RWlxYnVCcEUYACrkFDJzNkw2d3pFRHdyQkR3b0Q4ajRBQ2czQ1Bnb0l2TnZHbVlUXzJ0OWhDZ1B5UGdBS0RjSS1DZ2lXcU82aW9kNlE1M0VLQV9JLUFBb053ajRLQ0xUZjdQZjNtUG5SS3dvRDhqNEFDZzdDUGdzSS1mYXdxLXJpM3VtUUFRb0Q4ajRBQ2czQ1Bnb0lnSi1yaloyaG9mMUNDZ1B5UGdBS0RzSS1Dd2pZaDQ3dWpfSEcxN2NCQ2dQeVBnQUtEc0ktQ3dqTzNNR2xqSkQ2bkx3QkNnUHlQZ0FLRGNJLUNnamxxOS1TdjhyQTNRZ0tBX0ktQUFvTndqNEtDTVdBMC1Da3JQSG5JUW9EOGo0QUNnN0NQZ3NJc0pDeHlf…", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/youtube/post/related": { "get": { "tags": [ "YouTube" ], "summary": "The videos YouTube suggests beside one, about 20 a page.", "description": "1 credit a page.", "operationId": "youtubePostRelated", "parameters": [ { "name": "url", "in": "query", "description": "The video's link.", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The video's id, instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_YouTubePost" }, "example": { "data": [ { "id": "Yb9r-EMxrbw", "url": "https://www.youtube.com/watch?v=Yb9r-EMxrbw", "text": null, "createdAt": null, "author": { "id": "UCH_7doiCkWeq0v3ycWE5lDw", "username": "any_austin", "displayName": "Any Austin", "avatarUrl": null, "verified": false, "url": "https://www.youtube.com/@any_austin" }, "stats": { "views": null, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://i.ytimg.com/vi/Yb9r-EMxrbw/hqdefault_custom_2.jpg?sqp=CPCkm9gG-oaymwEcCNACELwBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLAUWL53cSLK1iQAHwsjdmwx1fGL2Q", "width": null, "height": null, "durationSeconds": 920 } ], "hashtags": [], "mentions": [], "ext": { "kind": "video", "title": "Grand Theft Auto VI is Full of Things You’d Never Notice", "durationSeconds": 920, "publishedText": "19h ago", "category": null, "keywords": [], "chapters": [], "music": [], "liveNow": false, "unlisted": false, "familySafe": null, "membersOnly": false, "channelSubscribers": null } }, { "id": "cc5C8hRblBY", "url": "https://www.youtube.com/watch?v=cc5C8hRblBY", "text": null, "createdAt": null, "author": { "id": "UCBJycsmduvYEL83R_U4JriQ", "username": "mkbhd", "displayName": "Marques Brownlee", "avatarUrl": null, "verified": false, "url": "https://www.youtube.com/@mkbhd" }, "stats": { "views": null, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://i.ytimg.com/vi/cc5C8hRblBY/hqdefault.jpg?sqp=-oaymwEcCNACELwBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLBpvxa62pJALVQ27VncG_7iYcVZCA", "width": null, "height": null, "durationSeconds": 1296 } ], "hashtags": [], "mentions": [], "ext": { "kind": "video", "title": "I'm Starting Over", "durationSeconds": 1296, "publishedText": "1d ago", "category": null, "keywords": [], "chapters": [], "music": [], "liveNow": false, "unlisted": false, "familySafe": null, "membersOnly": false, "channelSubscribers": null } } ], "pagination": { "nextCursor": "CBQSDRILSXA1RWlxYnVCcEUYACrkFDJzNkw2d3pFRHdyQkR3b0Q4ajRBQ2czQ1Bnb0l2TnZHbVlUXzJ0OWhDZ1B5UGdBS0RjSS1DZ2lXcU82aW9kNlE1M0VLQV9JLUFBb053ajRLQ0xUZjdQZjNtUG5SS3dvRDhqNEFDZzdDUGdzSS1mYXdxLXJpM3VtUUFRb0Q4ajRBQ2czQ1Bnb0lnSi1yaloyaG9mMUNDZ1B5UGdBS0RzSS1Dd2pZaDQ3dWpfSEcxN2NCQ2dQeVBnQUtEc0ktQ3dqTzNNR2xqSkQ2bkx3QkNnUHlQZ0FLRGNJLUNnamxxOS1TdjhyQTNRZ0tBX0ktQUFvTndqNEtDTVdBMC1Da3JQSG5JUW9EOGo0QUNnN0NQZ3NJc0pDeHlf…", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.youtube.postRelated({ url: \"https://www.youtube.com/watch?v=Ip5EiqbuBpE\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.youtube.post_related(url=\"https://www.youtube.com/watch?v=Ip5EiqbuBpE\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/youtube/post/related \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://www.youtube.com/watch?v=Ip5EiqbuBpE\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_YouTubePost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/YouTubePost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "YouTubePost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "kind", "keywords", "chapters", "music", "liveNow", "unlisted", "membersOnly" ], "properties": { "category": { "type": [ "string", "null" ], "description": "YouTube's category (`Science & Technology`)." }, "channelSubscribers": { "type": [ "string", "null" ], "description": "The channel's subscribers, as YouTube writes them (`16.9M subscribers`)." }, "chapters": { "type": "array", "items": { "$ref": "#/components/schemas/YouTubeChapter" } }, "durationSeconds": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "familySafe": { "type": [ "boolean", "null" ], "description": "Suitable for all ages, as YouTube rates it." }, "keywords": { "type": "array", "items": { "type": "string" }, "description": "The tags its uploader gave it." }, "kind": { "$ref": "#/components/schemas/YouTubePostKind" }, "liveNow": { "type": "boolean", "description": "Live now." }, "membersOnly": { "type": "boolean", "description": "For the channel's members only." }, "music": { "type": "array", "items": { "$ref": "#/components/schemas/YouTubeSong" }, "description": "Songs credited in its description." }, "publishedText": { "type": [ "string", "null" ], "description": "When it was published, as YouTube writes it in lists (`3 days ago`): a list gives\nno exact time, which `createdAt` is on `/post`." }, "title": { "type": [ "string", "null" ], "description": "The video's title (`text` is its description)." }, "unlisted": { "type": "boolean", "description": "Unlisted: reachable by its link only." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A video, a Short, a live stream or a community post." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "YouTubeSong": { "type": "object", "description": "A song a video uses, as its description credits it.", "required": [ "title" ], "properties": { "album": { "type": [ "string", "null" ] }, "artist": { "type": [ "string", "null" ] }, "title": { "type": "string" } } }, "YouTubePostKind": { "type": "string", "description": "What a video is.", "enum": [ "video", "short", "live", "community" ] }, "YouTubeChapter": { "type": "object", "description": "A chapter of a video.", "required": [ "title", "startSeconds" ], "properties": { "startSeconds": { "type": "integer", "format": "int64", "minimum": 0 }, "title": { "type": "string" } } }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Post Transcript (/docs/api-reference/youtube/post-transcript) A video's captions as text. `GET https://api.socialapi.sh/v1/youtube/post/transcript` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.youtube.postTranscript({ url: "https://www.youtube.com/watch?v=Ip5EiqbuBpE", language: "en" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.youtube.post_transcript(url="https://www.youtube.com/watch?v=Ip5EiqbuBpE", language="en").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/youtube/post/transcript \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://www.youtube.com/watch?v=Ip5EiqbuBpE" \ --data-urlencode "language=en" ``` **Response** ```json { "data": { "postId": "Ip5EiqbuBpE", "language": "en", "generated": true, "languages": [ "en" ], "text": "Did you know that you can play any game,\neven PC games, on Mac for free?\nWell, okay, not any game. And you still\nhave to buy the software,\nnot to mention a Mac. But thanks to a\nnew open source program called FX Steam\nLauncher, you can now run Steam OS on\nApple Silicon, unlocking buckets of\ngames that were previously impossible to\nrun, either due to macOS not supporting\n32-bit apps anymore or devel…", "cues": [ { "startSeconds": 0, "endSeconds": 7.1, "text": "Did you know that you can play any game," }, { "startSeconds": 1.8, "endSeconds": 7.1, "text": "even PC games, on Mac for free?" }, { "startSeconds": 7.8, "endSeconds": 12.5, "text": "Well, okay, not any game. And you still" } ] } } ``` **OpenAPI** ```json { "paths": { "/v1/youtube/post/transcript": { "get": { "tags": [ "YouTube" ], "summary": "A video's captions as text.", "description": "The uploader's captions in the language asked for, else YouTube's own in the language\nspoken, as timed lines and as plain text, with every language the video has. 5\ncredits.", "operationId": "youtubePostTranscript", "parameters": [ { "name": "url", "in": "query", "description": "The video's link.", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The video's id, instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "language", "in": "query", "description": "A language code (`en`, `de`, `pt-BR`): its captions when the video has them, else\nthose in the language spoken.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_YouTubeTranscript" }, "example": { "data": { "postId": "Ip5EiqbuBpE", "language": "en", "generated": true, "languages": [ "en" ], "text": "Did you know that you can play any game,\neven PC games, on Mac for free?\nWell, okay, not any game. And you still\nhave to buy the software,\nnot to mention a Mac. But thanks to a\nnew open source program called FX Steam\nLauncher, you can now run Steam OS on\nApple Silicon, unlocking buckets of\ngames that were previously impossible to\nrun, either due to macOS not supporting\n32-bit apps anymore or devel…", "cues": [ { "startSeconds": 0, "endSeconds": 7.1, "text": "Did you know that you can play any game," }, { "startSeconds": 1.8, "endSeconds": 7.1, "text": "even PC games, on Mac for free?" }, { "startSeconds": 7.8, "endSeconds": 12.5, "text": "Well, okay, not any game. And you still" } ] } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.youtube.postTranscript({ url: \"https://www.youtube.com/watch?v=Ip5EiqbuBpE\", language: \"en\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.youtube.post_transcript(url=\"https://www.youtube.com/watch?v=Ip5EiqbuBpE\", language=\"en\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/youtube/post/transcript \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://www.youtube.com/watch?v=Ip5EiqbuBpE\" \\\n --data-urlencode \"language=en\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_YouTubeTranscript": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/YouTubeTranscript" } } }, "YouTubeTranscript": { "type": "object", "description": "A video's captions as text.", "required": [ "postId", "language", "generated", "languages", "text", "cues" ], "properties": { "cues": { "type": "array", "items": { "$ref": "#/components/schemas/YouTubeCue" } }, "generated": { "type": "boolean", "description": "Generated by YouTube's speech recognition, rather than the uploader's." }, "language": { "type": "string", "description": "The track's language (`en`)." }, "languages": { "type": "array", "items": { "type": "string" }, "description": "Every language the video has captions in." }, "postId": { "type": "string" }, "text": { "type": "string", "description": "The captions as plain text, one cue a line." } } }, "YouTubeCue": { "type": "object", "required": [ "startSeconds", "endSeconds", "text" ], "properties": { "endSeconds": { "type": "number", "format": "double" }, "startSeconds": { "type": "number", "format": "double" }, "text": { "type": "string" } } } } } } ``` # Post (/docs/api-reference/youtube/post) One video or Short with its views, likes and chapters. `GET https://api.socialapi.sh/v1/youtube/post` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.youtube.post({ url: "https://www.youtube.com/watch?v=Ip5EiqbuBpE" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.youtube.post(url="https://www.youtube.com/watch?v=Ip5EiqbuBpE").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/youtube/post \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "url=https://www.youtube.com/watch?v=Ip5EiqbuBpE" ``` **Response** ```json { "data": { "id": "Ip5EiqbuBpE", "url": "https://www.youtube.com/watch?v=Ip5EiqbuBpE", "text": "Buy the brand new Tech Sling and earphone pouch and get a $30 LTT Gift card!\n\nUS: https://www.lttstore.com/products/tech-sling-earphone-pouch-free-30-gift-card-bundle\nGlobal: https://global.lttstore.com/products/tech-sling-earphone-pouch-30-gift-card-bundle\n\nApple Macs are very powerful machines. But not all developers port their games over to MacOS. That's why we tried out FX Steam Launcher, a pr…", "createdAt": "2026-11-23T17:00:11.000Z", "author": { "id": "UCXuqSBlHAE6Xw-yeJA0Tunw", "username": "LinusTechTips", "displayName": "Linus Tech Tips", "avatarUrl": "https://yt3.ggpht.com/gnvYLhXy8FAlPXZ2RTrkrgj-5kyt0vdE2FUGVOiKGdEZIa-wN5A-7nwZBlWJLzUMmoh1NWAU=s176-c-k-c0x00ffffff-no-rj", "verified": true, "url": "https://www.youtube.com/@LinusTechTips" }, "stats": { "views": 2100423, "likes": 24789, "comments": 1300, "shares": null, "saves": null, "engagementRate": 0.0124 }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://i.ytimg.com/vi_webp/Ip5EiqbuBpE/maxresdefault.webp", "width": null, "height": null, "durationSeconds": 1149 } ], "hashtags": [], "mentions": [], "ext": { "kind": "video", "title": "Mac Gaming is Solved But Not By Apple", "durationSeconds": 1149, "publishedText": null, "category": "Science & Technology", "keywords": [ "FX Steam Launcher", "SteamOS on Mac", "play Steam games on Mac" ], "chapters": [ { "title": "Why we lyin", "startSeconds": 0 }, { "title": "Is this new tech?", "startSeconds": 84 }, { "title": "ITS WORKING!!!", "startSeconds": 170 } ], "music": [], "liveNow": false, "unlisted": false, "familySafe": true, "membersOnly": false, "channelSubscribers": "16.9M subscribers" } } } ``` **OpenAPI** ```json { "paths": { "/v1/youtube/post": { "get": { "tags": [ "YouTube" ], "summary": "One video or Short with its views, likes and chapters.", "description": "Title, description, channel, views, likes, comments, length, publish time, category,\ntags, chapters and the songs it credits. 1 credit.", "operationId": "youtubePost", "parameters": [ { "name": "url", "in": "query", "description": "The video's link (`https://www.youtube.com/watch?v=dQw4w9WgXcQ`, a Short's or a\n`youtu.be` one).", "required": false, "schema": { "type": "string" } }, { "name": "id", "in": "query", "description": "The video's id, instead of `url`.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_YouTubePost" }, "example": { "data": { "id": "Ip5EiqbuBpE", "url": "https://www.youtube.com/watch?v=Ip5EiqbuBpE", "text": "Buy the brand new Tech Sling and earphone pouch and get a $30 LTT Gift card!\n\nUS: https://www.lttstore.com/products/tech-sling-earphone-pouch-free-30-gift-card-bundle\nGlobal: https://global.lttstore.com/products/tech-sling-earphone-pouch-30-gift-card-bundle\n\nApple Macs are very powerful machines. But not all developers port their games over to MacOS. That's why we tried out FX Steam Launcher, a pr…", "createdAt": "2026-11-23T17:00:11.000Z", "author": { "id": "UCXuqSBlHAE6Xw-yeJA0Tunw", "username": "LinusTechTips", "displayName": "Linus Tech Tips", "avatarUrl": "https://yt3.ggpht.com/gnvYLhXy8FAlPXZ2RTrkrgj-5kyt0vdE2FUGVOiKGdEZIa-wN5A-7nwZBlWJLzUMmoh1NWAU=s176-c-k-c0x00ffffff-no-rj", "verified": true, "url": "https://www.youtube.com/@LinusTechTips" }, "stats": { "views": 2100423, "likes": 24789, "comments": 1300, "shares": null, "saves": null, "engagementRate": 0.0124 }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://i.ytimg.com/vi_webp/Ip5EiqbuBpE/maxresdefault.webp", "width": null, "height": null, "durationSeconds": 1149 } ], "hashtags": [], "mentions": [], "ext": { "kind": "video", "title": "Mac Gaming is Solved But Not By Apple", "durationSeconds": 1149, "publishedText": null, "category": "Science & Technology", "keywords": [ "FX Steam Launcher", "SteamOS on Mac", "play Steam games on Mac" ], "chapters": [ { "title": "Why we lyin", "startSeconds": 0 }, { "title": "Is this new tech?", "startSeconds": 84 }, { "title": "ITS WORKING!!!", "startSeconds": 170 } ], "music": [], "liveNow": false, "unlisted": false, "familySafe": true, "membersOnly": false, "channelSubscribers": "16.9M subscribers" } } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.youtube.post({ url: \"https://www.youtube.com/watch?v=Ip5EiqbuBpE\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.youtube.post(url=\"https://www.youtube.com/watch?v=Ip5EiqbuBpE\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/youtube/post \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"url=https://www.youtube.com/watch?v=Ip5EiqbuBpE\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_YouTubePost": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/YouTubePost" } } }, "YouTubePost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "kind", "keywords", "chapters", "music", "liveNow", "unlisted", "membersOnly" ], "properties": { "category": { "type": [ "string", "null" ], "description": "YouTube's category (`Science & Technology`)." }, "channelSubscribers": { "type": [ "string", "null" ], "description": "The channel's subscribers, as YouTube writes them (`16.9M subscribers`)." }, "chapters": { "type": "array", "items": { "$ref": "#/components/schemas/YouTubeChapter" } }, "durationSeconds": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "familySafe": { "type": [ "boolean", "null" ], "description": "Suitable for all ages, as YouTube rates it." }, "keywords": { "type": "array", "items": { "type": "string" }, "description": "The tags its uploader gave it." }, "kind": { "$ref": "#/components/schemas/YouTubePostKind" }, "liveNow": { "type": "boolean", "description": "Live now." }, "membersOnly": { "type": "boolean", "description": "For the channel's members only." }, "music": { "type": "array", "items": { "$ref": "#/components/schemas/YouTubeSong" }, "description": "Songs credited in its description." }, "publishedText": { "type": [ "string", "null" ], "description": "When it was published, as YouTube writes it in lists (`3 days ago`): a list gives\nno exact time, which `createdAt` is on `/post`." }, "title": { "type": [ "string", "null" ], "description": "The video's title (`text` is its description)." }, "unlisted": { "type": "boolean", "description": "Unlisted: reachable by its link only." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A video, a Short, a live stream or a community post." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "YouTubeSong": { "type": "object", "description": "A song a video uses, as its description credits it.", "required": [ "title" ], "properties": { "album": { "type": [ "string", "null" ] }, "artist": { "type": [ "string", "null" ] }, "title": { "type": "string" } } }, "YouTubePostKind": { "type": "string", "description": "What a video is.", "enum": [ "video", "short", "live", "community" ] }, "YouTubeChapter": { "type": "object", "description": "A chapter of a video.", "required": [ "title", "startSeconds" ], "properties": { "startSeconds": { "type": "integer", "format": "int64", "minimum": 0 }, "title": { "type": "string" } } }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Profile Community (/docs/api-reference/youtube/profile-community) A channel's community posts, 10 a page. `GET https://api.socialapi.sh/v1/youtube/profile/community` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.youtube.profileCommunity({ handle: "LinusTechTips" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.youtube.profile_community(handle="LinusTechTips") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/youtube/profile/community \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=LinusTechTips" ``` **Response** ```json { "data": [ { "id": "UgkxKEltTHuMPh3O9wcRik3GPcX_lA3qrgpK", "url": "https://www.youtube.com/post/UgkxKEltTHuMPh3O9wcRik3GPcX_lA3qrgpK", "text": null, "createdAt": null, "author": { "id": "UCXuqSBlHAE6Xw-yeJA0Tunw", "username": "LinusTechTips", "displayName": "Linus Tech Tips", "avatarUrl": "https://yt3.googleusercontent.com/gnvYLhXy8FAlPXZ2RTrkrgj-5kyt0vdE2FUGVOiKGdEZIa-wN5A-7nwZBlWJLzUMmoh1NWAU=s76-c-k-c0x00ffffff-no-rj-mo", "verified": false, "url": "https://www.youtube.com/@LinusTechTips" }, "stats": { "views": null, "likes": 72000, "comments": 1700, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://yt3.ggpht.com/zVAwOyb82eQ120Ds-IIjYtICWtlyGpqOBMTf3Q6zX7ea6Nm7d_4S3FqyerrYVeZNpQCltlXJWvZGAoU=s1080-c-fcrop64=1,00000000ffffffff-rw-nd-v1", "thumbnailUrl": null, "width": null, "height": null, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "kind": "community", "title": null, "durationSeconds": null, "publishedText": "12 days ago", "category": null, "keywords": [], "chapters": [], "music": [], "liveNow": false, "unlisted": false, "familySafe": null, "membersOnly": false, "channelSubscribers": null } }, { "id": "Ugkx-yl7UncP7NXnKWUhWxo_OvnIEUVp2jIa", "url": "https://www.youtube.com/post/Ugkx-yl7UncP7NXnKWUhWxo_OvnIEUVp2jIa", "text": "They've locked Jensen in the back", "createdAt": null, "author": { "id": "UCXuqSBlHAE6Xw-yeJA0Tunw", "username": "LinusTechTips", "displayName": "Linus Tech Tips", "avatarUrl": "https://yt3.googleusercontent.com/gnvYLhXy8FAlPXZ2RTrkrgj-5kyt0vdE2FUGVOiKGdEZIa-wN5A-7nwZBlWJLzUMmoh1NWAU=s76-c-k-c0x00ffffff-no-rj-mo", "verified": false, "url": "https://www.youtube.com/@LinusTechTips" }, "stats": { "views": null, "likes": 41000, "comments": 485, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://yt3.ggpht.com/n65gr-PC-LrGAcz5PHHcHyxHMs_qf7dr-TGRISu2DTHsUjICvfm6laod5si-cg-xkwBu7gV_HyauVWQ=s1079-c-fcrop64=1,001e0000ffe1ffff-rw-nd-v1", "thumbnailUrl": null, "width": null, "height": null, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "kind": "community", "title": null, "durationSeconds": null, "publishedText": "2 weeks ago", "category": null, "keywords": [], "chapters": [], "music": [], "liveNow": false, "unlisted": false, "familySafe": null, "membersOnly": false, "channelSubscribers": null } } ], "pagination": { "nextCursor": "4qmFsgKBARIYVUNYdXFTQmxIQUU2WHcteWVKQTBUdW53GkxFZ1Z3YjNOMGM2b0RLQW9rVVRKb1ExSkdVWHBXYXpWcVpXMTRVMVZxUWxkVlJrcElWbTVTYVdWclNrVlNWVVpDS0FyeUJnUUtBa29BmgIWYmFja3N0YWdlLWl0ZW0tc2VjdGlvbg%3D%3D", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/youtube/profile/community": { "get": { "tags": [ "YouTube" ], "summary": "A channel's community posts, 10 a page.", "description": "Text, images, likes and comment counts. 1 credit a page.", "operationId": "youtubeProfileCommunity", "parameters": [ { "name": "handle", "in": "query", "description": "The channel's handle, with or without `@`.", "required": false, "schema": { "type": "string" } }, { "name": "channelId", "in": "query", "description": "The channel's id, instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "The channel's link, instead of either.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_YouTubePost" }, "example": { "data": [ { "id": "UgkxKEltTHuMPh3O9wcRik3GPcX_lA3qrgpK", "url": "https://www.youtube.com/post/UgkxKEltTHuMPh3O9wcRik3GPcX_lA3qrgpK", "text": null, "createdAt": null, "author": { "id": "UCXuqSBlHAE6Xw-yeJA0Tunw", "username": "LinusTechTips", "displayName": "Linus Tech Tips", "avatarUrl": "https://yt3.googleusercontent.com/gnvYLhXy8FAlPXZ2RTrkrgj-5kyt0vdE2FUGVOiKGdEZIa-wN5A-7nwZBlWJLzUMmoh1NWAU=s76-c-k-c0x00ffffff-no-rj-mo", "verified": false, "url": "https://www.youtube.com/@LinusTechTips" }, "stats": { "views": null, "likes": 72000, "comments": 1700, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://yt3.ggpht.com/zVAwOyb82eQ120Ds-IIjYtICWtlyGpqOBMTf3Q6zX7ea6Nm7d_4S3FqyerrYVeZNpQCltlXJWvZGAoU=s1080-c-fcrop64=1,00000000ffffffff-rw-nd-v1", "thumbnailUrl": null, "width": null, "height": null, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "kind": "community", "title": null, "durationSeconds": null, "publishedText": "12 days ago", "category": null, "keywords": [], "chapters": [], "music": [], "liveNow": false, "unlisted": false, "familySafe": null, "membersOnly": false, "channelSubscribers": null } }, { "id": "Ugkx-yl7UncP7NXnKWUhWxo_OvnIEUVp2jIa", "url": "https://www.youtube.com/post/Ugkx-yl7UncP7NXnKWUhWxo_OvnIEUVp2jIa", "text": "They've locked Jensen in the back", "createdAt": null, "author": { "id": "UCXuqSBlHAE6Xw-yeJA0Tunw", "username": "LinusTechTips", "displayName": "Linus Tech Tips", "avatarUrl": "https://yt3.googleusercontent.com/gnvYLhXy8FAlPXZ2RTrkrgj-5kyt0vdE2FUGVOiKGdEZIa-wN5A-7nwZBlWJLzUMmoh1NWAU=s76-c-k-c0x00ffffff-no-rj-mo", "verified": false, "url": "https://www.youtube.com/@LinusTechTips" }, "stats": { "views": null, "likes": 41000, "comments": 485, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "image", "url": "https://yt3.ggpht.com/n65gr-PC-LrGAcz5PHHcHyxHMs_qf7dr-TGRISu2DTHsUjICvfm6laod5si-cg-xkwBu7gV_HyauVWQ=s1079-c-fcrop64=1,001e0000ffe1ffff-rw-nd-v1", "thumbnailUrl": null, "width": null, "height": null, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "kind": "community", "title": null, "durationSeconds": null, "publishedText": "2 weeks ago", "category": null, "keywords": [], "chapters": [], "music": [], "liveNow": false, "unlisted": false, "familySafe": null, "membersOnly": false, "channelSubscribers": null } } ], "pagination": { "nextCursor": "4qmFsgKBARIYVUNYdXFTQmxIQUU2WHcteWVKQTBUdW53GkxFZ1Z3YjNOMGM2b0RLQW9rVVRKb1ExSkdVWHBXYXpWcVpXMTRVMVZxUWxkVlJrcElWbTVTYVdWclNrVlNWVVpDS0FyeUJnUUtBa29BmgIWYmFja3N0YWdlLWl0ZW0tc2VjdGlvbg%3D%3D", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.youtube.profileCommunity({ handle: \"LinusTechTips\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.youtube.profile_community(handle=\"LinusTechTips\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/youtube/profile/community \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=LinusTechTips\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_YouTubePost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/YouTubePost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "YouTubePost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "kind", "keywords", "chapters", "music", "liveNow", "unlisted", "membersOnly" ], "properties": { "category": { "type": [ "string", "null" ], "description": "YouTube's category (`Science & Technology`)." }, "channelSubscribers": { "type": [ "string", "null" ], "description": "The channel's subscribers, as YouTube writes them (`16.9M subscribers`)." }, "chapters": { "type": "array", "items": { "$ref": "#/components/schemas/YouTubeChapter" } }, "durationSeconds": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "familySafe": { "type": [ "boolean", "null" ], "description": "Suitable for all ages, as YouTube rates it." }, "keywords": { "type": "array", "items": { "type": "string" }, "description": "The tags its uploader gave it." }, "kind": { "$ref": "#/components/schemas/YouTubePostKind" }, "liveNow": { "type": "boolean", "description": "Live now." }, "membersOnly": { "type": "boolean", "description": "For the channel's members only." }, "music": { "type": "array", "items": { "$ref": "#/components/schemas/YouTubeSong" }, "description": "Songs credited in its description." }, "publishedText": { "type": [ "string", "null" ], "description": "When it was published, as YouTube writes it in lists (`3 days ago`): a list gives\nno exact time, which `createdAt` is on `/post`." }, "title": { "type": [ "string", "null" ], "description": "The video's title (`text` is its description)." }, "unlisted": { "type": "boolean", "description": "Unlisted: reachable by its link only." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A video, a Short, a live stream or a community post." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "YouTubeSong": { "type": "object", "description": "A song a video uses, as its description credits it.", "required": [ "title" ], "properties": { "album": { "type": [ "string", "null" ] }, "artist": { "type": [ "string", "null" ] }, "title": { "type": "string" } } }, "YouTubePostKind": { "type": "string", "description": "What a video is.", "enum": [ "video", "short", "live", "community" ] }, "YouTubeChapter": { "type": "object", "description": "A chapter of a video.", "required": [ "title", "startSeconds" ], "properties": { "startSeconds": { "type": "integer", "format": "int64", "minimum": 0 }, "title": { "type": "string" } } }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Profile Lives (/docs/api-reference/youtube/profile-lives) A channel's live streams, on now and past, 30 a page. `GET https://api.socialapi.sh/v1/youtube/profile/lives` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.youtube.profileLives({ handle: "LinusTechTips" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.youtube.profile_lives(handle="LinusTechTips") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/youtube/profile/lives \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=LinusTechTips" ``` **Response** ```json { "data": [ { "id": "Z1sqWFs86uU", "url": "https://www.youtube.com/watch?v=Z1sqWFs86uU", "text": null, "createdAt": null, "author": { "id": "UCXuqSBlHAE6Xw-yeJA0Tunw", "username": "LinusTechTips", "displayName": null, "avatarUrl": null, "verified": false, "url": "https://www.youtube.com/@LinusTechTips" }, "stats": { "views": 1400000, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://i.ytimg.com/vi/Z1sqWFs86uU/hq720.jpg?sqp=-oaymwEcCNAFEJQDSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLCgaMBoZiNxupMBAHn3tecnOERLkw", "width": null, "height": null, "durationSeconds": 13091 } ], "hashtags": [], "mentions": [], "ext": { "kind": "video", "title": "Building the Rarest PC", "durationSeconds": 13091, "publishedText": "Streamed 2 months ago", "category": null, "keywords": [], "chapters": [], "music": [], "liveNow": false, "unlisted": false, "familySafe": null, "membersOnly": false, "channelSubscribers": null } }, { "id": "o4ub_WOWFoo", "url": "https://www.youtube.com/watch?v=o4ub_WOWFoo", "text": null, "createdAt": null, "author": { "id": "UCXuqSBlHAE6Xw-yeJA0Tunw", "username": "LinusTechTips", "displayName": null, "avatarUrl": null, "verified": false, "url": "https://www.youtube.com/@LinusTechTips" }, "stats": { "views": 730000, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://i.ytimg.com/vi/o4ub_WOWFoo/hq720.jpg?sqp=-oaymwEcCNAFEJQDSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLCN7VE949dhPfZMxJc946DBwMIuBw", "width": null, "height": null, "durationSeconds": 14025 } ], "hashtags": [], "mentions": [], "ext": { "kind": "video", "title": "I Love The Steam Machine More Already - WAN Show June 26, 2026", "durationSeconds": 14025, "publishedText": "Streamed 4 months ago", "category": null, "keywords": [], "chapters": [], "music": [], "liveNow": false, "unlisted": false, "familySafe": null, "membersOnly": false, "channelSubscribers": null } } ], "pagination": { "nextCursor": "4qmFsgL9DBIYVUNYdXFTQmxIQUU2WHcteWVKQTBUdW53GuAMOGdiRUNSckJDWEstQ1RxN0NRb2tObVJtTm1Rek0ySXRNREF3TUMweU5EbG1MVGxrWWprdFpEUm1OVFEzWmpBeU5qZ3dFcEFKUVdOV09GWmtWM1ZUWTFaaldqaFZRMnhzU0dVMFlXczJWRWxhVjFaUE9IUlNPV3gyUkhweE5XSXdhVTExT1VOVlZVNVBTM0JCU2pkTWVuRldlamREUVZoMVkxcDFaekYwUWs1cE1qUlhXRkJqWlhsdlIyaFJWVXh1Y2tseFQxRmhSVE5SVmsxQmRsTnZPVWxFYzBoRlVEaHplVXRYVjFCeFYySlpZbkl3Y2w5U05EUTBWVEZaVG1kWmJXRkdaME4y…", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/youtube/profile/lives": { "get": { "tags": [ "YouTube" ], "summary": "A channel's live streams, on now and past, 30 a page.", "description": "Latest, most popular or oldest first. 1 credit a page.", "operationId": "youtubeProfileLives", "parameters": [ { "name": "handle", "in": "query", "description": "The channel's handle, with or without `@`.", "required": false, "schema": { "type": "string" } }, { "name": "channelId", "in": "query", "description": "The channel's id, instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "The channel's link, instead of either.", "required": false, "schema": { "type": "string" } }, { "name": "sort", "in": "query", "description": "`latest` (the default), `popular` or `oldest`.", "required": false, "schema": { "type": "string", "description": "The order of a channel's videos, Shorts or past streams.", "enum": [ "latest", "popular", "oldest" ] } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_YouTubePost" }, "example": { "data": [ { "id": "Z1sqWFs86uU", "url": "https://www.youtube.com/watch?v=Z1sqWFs86uU", "text": null, "createdAt": null, "author": { "id": "UCXuqSBlHAE6Xw-yeJA0Tunw", "username": "LinusTechTips", "displayName": null, "avatarUrl": null, "verified": false, "url": "https://www.youtube.com/@LinusTechTips" }, "stats": { "views": 1400000, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://i.ytimg.com/vi/Z1sqWFs86uU/hq720.jpg?sqp=-oaymwEcCNAFEJQDSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLCgaMBoZiNxupMBAHn3tecnOERLkw", "width": null, "height": null, "durationSeconds": 13091 } ], "hashtags": [], "mentions": [], "ext": { "kind": "video", "title": "Building the Rarest PC", "durationSeconds": 13091, "publishedText": "Streamed 2 months ago", "category": null, "keywords": [], "chapters": [], "music": [], "liveNow": false, "unlisted": false, "familySafe": null, "membersOnly": false, "channelSubscribers": null } }, { "id": "o4ub_WOWFoo", "url": "https://www.youtube.com/watch?v=o4ub_WOWFoo", "text": null, "createdAt": null, "author": { "id": "UCXuqSBlHAE6Xw-yeJA0Tunw", "username": "LinusTechTips", "displayName": null, "avatarUrl": null, "verified": false, "url": "https://www.youtube.com/@LinusTechTips" }, "stats": { "views": 730000, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://i.ytimg.com/vi/o4ub_WOWFoo/hq720.jpg?sqp=-oaymwEcCNAFEJQDSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLCN7VE949dhPfZMxJc946DBwMIuBw", "width": null, "height": null, "durationSeconds": 14025 } ], "hashtags": [], "mentions": [], "ext": { "kind": "video", "title": "I Love The Steam Machine More Already - WAN Show June 26, 2026", "durationSeconds": 14025, "publishedText": "Streamed 4 months ago", "category": null, "keywords": [], "chapters": [], "music": [], "liveNow": false, "unlisted": false, "familySafe": null, "membersOnly": false, "channelSubscribers": null } } ], "pagination": { "nextCursor": "4qmFsgL9DBIYVUNYdXFTQmxIQUU2WHcteWVKQTBUdW53GuAMOGdiRUNSckJDWEstQ1RxN0NRb2tObVJtTm1Rek0ySXRNREF3TUMweU5EbG1MVGxrWWprdFpEUm1OVFEzWmpBeU5qZ3dFcEFKUVdOV09GWmtWM1ZUWTFaaldqaFZRMnhzU0dVMFlXczJWRWxhVjFaUE9IUlNPV3gyUkhweE5XSXdhVTExT1VOVlZVNVBTM0JCU2pkTWVuRldlamREUVZoMVkxcDFaekYwUWs1cE1qUlhXRkJqWlhsdlIyaFJWVXh1Y2tseFQxRmhSVE5SVmsxQmRsTnZPVWxFYzBoRlVEaHplVXRYVjFCeFYySlpZbkl3Y2w5U05EUTBWVEZaVG1kWmJXRkdaME4y…", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.youtube.profileLives({ handle: \"LinusTechTips\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.youtube.profile_lives(handle=\"LinusTechTips\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/youtube/profile/lives \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=LinusTechTips\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_YouTubePost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/YouTubePost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "YouTubePost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "kind", "keywords", "chapters", "music", "liveNow", "unlisted", "membersOnly" ], "properties": { "category": { "type": [ "string", "null" ], "description": "YouTube's category (`Science & Technology`)." }, "channelSubscribers": { "type": [ "string", "null" ], "description": "The channel's subscribers, as YouTube writes them (`16.9M subscribers`)." }, "chapters": { "type": "array", "items": { "$ref": "#/components/schemas/YouTubeChapter" } }, "durationSeconds": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "familySafe": { "type": [ "boolean", "null" ], "description": "Suitable for all ages, as YouTube rates it." }, "keywords": { "type": "array", "items": { "type": "string" }, "description": "The tags its uploader gave it." }, "kind": { "$ref": "#/components/schemas/YouTubePostKind" }, "liveNow": { "type": "boolean", "description": "Live now." }, "membersOnly": { "type": "boolean", "description": "For the channel's members only." }, "music": { "type": "array", "items": { "$ref": "#/components/schemas/YouTubeSong" }, "description": "Songs credited in its description." }, "publishedText": { "type": [ "string", "null" ], "description": "When it was published, as YouTube writes it in lists (`3 days ago`): a list gives\nno exact time, which `createdAt` is on `/post`." }, "title": { "type": [ "string", "null" ], "description": "The video's title (`text` is its description)." }, "unlisted": { "type": "boolean", "description": "Unlisted: reachable by its link only." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A video, a Short, a live stream or a community post." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "YouTubeSong": { "type": "object", "description": "A song a video uses, as its description credits it.", "required": [ "title" ], "properties": { "album": { "type": [ "string", "null" ] }, "artist": { "type": [ "string", "null" ] }, "title": { "type": "string" } } }, "YouTubePostKind": { "type": "string", "description": "What a video is.", "enum": [ "video", "short", "live", "community" ] }, "YouTubeChapter": { "type": "object", "description": "A chapter of a video.", "required": [ "title", "startSeconds" ], "properties": { "startSeconds": { "type": "integer", "format": "int64", "minimum": 0 }, "title": { "type": "string" } } }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Profile Playlists (/docs/api-reference/youtube/profile-playlists) A channel's playlists, 30 a page. `GET https://api.socialapi.sh/v1/youtube/profile/playlists` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.youtube.profilePlaylists({ handle: "LinusTechTips" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.youtube.profile_playlists(handle="LinusTechTips") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/youtube/profile/playlists \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=LinusTechTips" ``` **Response** ```json { "data": [ { "id": "PLXm3b2ZSqTsc", "name": "Home Security", "url": "https://www.youtube.com/playlist?list=PLXm3b2ZSqTsc", "coverUrl": "https://i.ytimg.com/vi/skdOVaiRq1c/hqdefault.jpg?sqp=-oaymwEXCOADEI4CSFryq4qpAwkIARUAAIhCGAE=&rs=AOn4CLD7odfCefib_H5TOgZvBrxCaHJ-Sw", "posts": 1, "ext": { "description": null, "views": null, "owner": null, "updatedText": null, "podcast": false } }, { "id": "PLPXG0FHDlqWU", "name": "Vibe Coding", "url": "https://www.youtube.com/playlist?list=PLPXG0FHDlqWU", "coverUrl": "https://i.ytimg.com/vi/DZSYaQmxBLM/hqdefault.jpg?sqp=-oaymwEXCOADEI4CSFryq4qpAwkIARUAAIhCGAE=&rs=AOn4CLBLKZ0RlZVrZ03Pi8oQE8fAq6jQOQ", "posts": 2, "ext": { "description": null, "views": null, "owner": null, "updatedText": null, "podcast": false } } ], "pagination": { "nextCursor": "4qmFsgJ4EhhVQ1h1cVNCbEhBRTZYdy15ZUpBMFR1bncaKkVnbHdiR0Y1YkdsemRITVlBeUFBTUFFNEFlb0RCME5uVGtSUmFsRSUzRJoCL2Jyb3dzZS1mZWVkVUNYdXFTQmxIQUU2WHcteWVKQTBUdW53cGxheWxpc3RzMTA0", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/youtube/profile/playlists": { "get": { "tags": [ "YouTube" ], "summary": "A channel's playlists, 30 a page.", "description": "With their video counts. 1 credit a page.", "operationId": "youtubeProfilePlaylists", "parameters": [ { "name": "handle", "in": "query", "description": "The channel's handle, with or without `@`.", "required": false, "schema": { "type": "string" } }, { "name": "channelId", "in": "query", "description": "The channel's id, instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "The channel's link, instead of either.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_YouTubePlaylist" }, "example": { "data": [ { "id": "PLXm3b2ZSqTsc", "name": "Home Security", "url": "https://www.youtube.com/playlist?list=PLXm3b2ZSqTsc", "coverUrl": "https://i.ytimg.com/vi/skdOVaiRq1c/hqdefault.jpg?sqp=-oaymwEXCOADEI4CSFryq4qpAwkIARUAAIhCGAE=&rs=AOn4CLD7odfCefib_H5TOgZvBrxCaHJ-Sw", "posts": 1, "ext": { "description": null, "views": null, "owner": null, "updatedText": null, "podcast": false } }, { "id": "PLPXG0FHDlqWU", "name": "Vibe Coding", "url": "https://www.youtube.com/playlist?list=PLPXG0FHDlqWU", "coverUrl": "https://i.ytimg.com/vi/DZSYaQmxBLM/hqdefault.jpg?sqp=-oaymwEXCOADEI4CSFryq4qpAwkIARUAAIhCGAE=&rs=AOn4CLBLKZ0RlZVrZ03Pi8oQE8fAq6jQOQ", "posts": 2, "ext": { "description": null, "views": null, "owner": null, "updatedText": null, "podcast": false } } ], "pagination": { "nextCursor": "4qmFsgJ4EhhVQ1h1cVNCbEhBRTZYdy15ZUpBMFR1bncaKkVnbHdiR0Y1YkdsemRITVlBeUFBTUFFNEFlb0RCME5uVGtSUmFsRSUzRJoCL2Jyb3dzZS1mZWVkVUNYdXFTQmxIQUU2WHcteWVKQTBUdW53cGxheWxpc3RzMTA0", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.youtube.profilePlaylists({ handle: \"LinusTechTips\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.youtube.profile_playlists(handle=\"LinusTechTips\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/youtube/profile/playlists \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=LinusTechTips\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_YouTubePlaylist": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/YouTubePlaylist" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "YouTubePlaylist": { "allOf": [ { "type": "object", "description": "A playlist, mix or collection of posts.", "required": [ "id", "name", "ext" ], "properties": { "coverUrl": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "podcast" ], "properties": { "description": { "type": [ "string", "null" ] }, "owner": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "podcast": { "type": "boolean", "description": "A podcast's show rather than a list of videos." }, "updatedText": { "type": [ "string", "null" ], "description": "When it was last updated, as YouTube writes it (`Updated today`)." }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, { "type": "object", "description": "What only this platform has." } ] }, "id": { "type": "string" }, "name": { "type": "string" }, "posts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "url": { "type": [ "string", "null" ] } } }, { "type": "object", "description": "A playlist, or a podcast's show." } ] }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Profile Podcasts (/docs/api-reference/youtube/profile-podcasts) A channel's podcasts. `GET https://api.socialapi.sh/v1/youtube/profile/podcasts` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.youtube.profilePodcasts({ handle: "LinusTechTips" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.youtube.profile_podcasts(handle="LinusTechTips") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/youtube/profile/podcasts \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=LinusTechTips" ``` **Response** ```json { "data": [ { "id": "PL8mG-RkN2uTw7PhlnAr4pZZz2QubIbujH", "name": "The WAN Show (Legacy)", "url": "https://www.youtube.com/playlist?list=PL8mG-RkN2uTw7PhlnAr4pZZz2QubIbujH", "coverUrl": "https://i.ytimg.com/pl_c/PL8mG-RkN2uTw7PhlnAr4pZZz2QubIbujH/studio_square_thumbnail.jpg?sqp=CMGEm9gG-oaymwEICNAFENAFSFqi85f_AwYIwe77sQY=&rs=AOn4CLA5mLWNCGH6YlA1xrF12WXEVHzPtw", "posts": 578, "ext": { "description": null, "views": null, "owner": null, "updatedText": null, "podcast": true } } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/youtube/profile/podcasts": { "get": { "tags": [ "YouTube" ], "summary": "A channel's podcasts.", "description": "Each a playlist of its episodes. 1 credit a page.", "operationId": "youtubeProfilePodcasts", "parameters": [ { "name": "handle", "in": "query", "description": "The channel's handle, with or without `@`.", "required": false, "schema": { "type": "string" } }, { "name": "channelId", "in": "query", "description": "The channel's id, instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "The channel's link, instead of either.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_YouTubePlaylist" }, "example": { "data": [ { "id": "PL8mG-RkN2uTw7PhlnAr4pZZz2QubIbujH", "name": "The WAN Show (Legacy)", "url": "https://www.youtube.com/playlist?list=PL8mG-RkN2uTw7PhlnAr4pZZz2QubIbujH", "coverUrl": "https://i.ytimg.com/pl_c/PL8mG-RkN2uTw7PhlnAr4pZZz2QubIbujH/studio_square_thumbnail.jpg?sqp=CMGEm9gG-oaymwEICNAFENAFSFqi85f_AwYIwe77sQY=&rs=AOn4CLA5mLWNCGH6YlA1xrF12WXEVHzPtw", "posts": 578, "ext": { "description": null, "views": null, "owner": null, "updatedText": null, "podcast": true } } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.youtube.profilePodcasts({ handle: \"LinusTechTips\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.youtube.profile_podcasts(handle=\"LinusTechTips\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/youtube/profile/podcasts \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=LinusTechTips\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_YouTubePlaylist": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/YouTubePlaylist" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "YouTubePlaylist": { "allOf": [ { "type": "object", "description": "A playlist, mix or collection of posts.", "required": [ "id", "name", "ext" ], "properties": { "coverUrl": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "podcast" ], "properties": { "description": { "type": [ "string", "null" ] }, "owner": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "podcast": { "type": "boolean", "description": "A podcast's show rather than a list of videos." }, "updatedText": { "type": [ "string", "null" ], "description": "When it was last updated, as YouTube writes it (`Updated today`)." }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, { "type": "object", "description": "What only this platform has." } ] }, "id": { "type": "string" }, "name": { "type": "string" }, "posts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "url": { "type": [ "string", "null" ] } } }, { "type": "object", "description": "A playlist, or a podcast's show." } ] }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Profile Posts (/docs/api-reference/youtube/profile-posts) A channel's videos, 30 a page. `GET https://api.socialapi.sh/v1/youtube/profile/posts` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.youtube.profilePosts({ handle: "LinusTechTips" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.youtube.profile_posts(handle="LinusTechTips") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/youtube/profile/posts \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=LinusTechTips" ``` **Response** ```json { "data": [ { "id": "qiLUvCt3k6g", "url": "https://www.youtube.com/watch?v=qiLUvCt3k6g", "text": null, "createdAt": null, "author": { "id": "UCXuqSBlHAE6Xw-yeJA0Tunw", "username": "LinusTechTips", "displayName": null, "avatarUrl": null, "verified": false, "url": "https://www.youtube.com/@LinusTechTips" }, "stats": { "views": null, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://i.ytimg.com/vi/qiLUvCt3k6g/hq720.jpg?sqp=-oaymwEgCNAFEJQDSFXyq4qpAxIIARUAAIhCGAFwAcABBrgC8xg=&rs=AOn4CLDyg9jZ3BhuZ79l1lOJnHNdn-lBCg", "width": null, "height": null, "durationSeconds": 4182 } ], "hashtags": [], "mentions": [], "ext": { "kind": "video", "title": "Linus is 3 hours late for WAN - Why is WAN Late Episode 28", "durationSeconds": 4182, "publishedText": "1 day ago", "category": null, "keywords": [], "chapters": [], "music": [], "liveNow": false, "unlisted": false, "familySafe": null, "membersOnly": true, "channelSubscribers": null } }, { "id": "dXo5AvXG8Ds", "url": "https://www.youtube.com/watch?v=dXo5AvXG8Ds", "text": null, "createdAt": null, "author": { "id": "UCXuqSBlHAE6Xw-yeJA0Tunw", "username": "LinusTechTips", "displayName": null, "avatarUrl": null, "verified": false, "url": "https://www.youtube.com/@LinusTechTips" }, "stats": { "views": null, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://i.ytimg.com/vi/dXo5AvXG8Ds/hq720.jpg?sqp=-oaymwEgCNAFEJQDSFXyq4qpAxIIARUAAIhCGAFwAcABBrgC8xg=&rs=AOn4CLAUb8fYnhWq_m-Dd_gEMTPmVQXyGA", "width": null, "height": null, "durationSeconds": 2112 } ], "hashtags": [], "mentions": [], "ext": { "kind": "video", "title": "Extras - AMD Upgrade Luke", "durationSeconds": 2112, "publishedText": "1 day ago", "category": null, "keywords": [], "chapters": [], "music": [], "liveNow": false, "unlisted": false, "familySafe": null, "membersOnly": true, "channelSubscribers": null } } ], "pagination": { "nextCursor": "4qmFsgK9ChIYVUNYdXFTQmxIQUU2WHcteWVKQTBUdW53GqAKOGdiUEJ4ck1CM3JKQnpyR0J3b2tObVF5WkRCaFptUXRNREF3TUMweVpXWm1MVGc1TWpRdE9UZzVPR1ppWWpjNU1tVTFFcHNIUVdOV09GWmtXRVppUkdSUU1rMVVSVE5WVHpGVFl6WlFOSEp0UVRGZlMxcG9Ra3BNUzFOVk9UUktabTV2YlRSTE1XaFNUSFV6WjBKVk5sWm9kWGRLZDBSeFEyeFNSMVZ2YzNWZlR5MVRjamh0VDJka2NYUm5jREpGUW5CVE9WRjNOekJtYVhsRVYyVjJOMjlEY1hOaU5sUmZhV3BVUzI5a1dIZExPRFZ5U0U1WFVtcFFXbXhXVFVKWU1rNUpkRXRV…", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/youtube/profile/posts": { "get": { "tags": [ "YouTube" ], "summary": "A channel's videos, 30 a page.", "description": "Latest, most popular or oldest first, each with its views, length and when it was\npublished (as YouTube writes it: `3 days ago`). 1 credit a page.", "operationId": "youtubeProfilePosts", "parameters": [ { "name": "handle", "in": "query", "description": "The channel's handle, with or without `@`.", "required": false, "schema": { "type": "string" } }, { "name": "channelId", "in": "query", "description": "The channel's id, instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "The channel's link, instead of either.", "required": false, "schema": { "type": "string" } }, { "name": "sort", "in": "query", "description": "`latest` (the default), `popular` or `oldest`.", "required": false, "schema": { "type": "string", "description": "The order of a channel's videos, Shorts or past streams.", "enum": [ "latest", "popular", "oldest" ] } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_YouTubePost" }, "example": { "data": [ { "id": "qiLUvCt3k6g", "url": "https://www.youtube.com/watch?v=qiLUvCt3k6g", "text": null, "createdAt": null, "author": { "id": "UCXuqSBlHAE6Xw-yeJA0Tunw", "username": "LinusTechTips", "displayName": null, "avatarUrl": null, "verified": false, "url": "https://www.youtube.com/@LinusTechTips" }, "stats": { "views": null, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://i.ytimg.com/vi/qiLUvCt3k6g/hq720.jpg?sqp=-oaymwEgCNAFEJQDSFXyq4qpAxIIARUAAIhCGAFwAcABBrgC8xg=&rs=AOn4CLDyg9jZ3BhuZ79l1lOJnHNdn-lBCg", "width": null, "height": null, "durationSeconds": 4182 } ], "hashtags": [], "mentions": [], "ext": { "kind": "video", "title": "Linus is 3 hours late for WAN - Why is WAN Late Episode 28", "durationSeconds": 4182, "publishedText": "1 day ago", "category": null, "keywords": [], "chapters": [], "music": [], "liveNow": false, "unlisted": false, "familySafe": null, "membersOnly": true, "channelSubscribers": null } }, { "id": "dXo5AvXG8Ds", "url": "https://www.youtube.com/watch?v=dXo5AvXG8Ds", "text": null, "createdAt": null, "author": { "id": "UCXuqSBlHAE6Xw-yeJA0Tunw", "username": "LinusTechTips", "displayName": null, "avatarUrl": null, "verified": false, "url": "https://www.youtube.com/@LinusTechTips" }, "stats": { "views": null, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://i.ytimg.com/vi/dXo5AvXG8Ds/hq720.jpg?sqp=-oaymwEgCNAFEJQDSFXyq4qpAxIIARUAAIhCGAFwAcABBrgC8xg=&rs=AOn4CLAUb8fYnhWq_m-Dd_gEMTPmVQXyGA", "width": null, "height": null, "durationSeconds": 2112 } ], "hashtags": [], "mentions": [], "ext": { "kind": "video", "title": "Extras - AMD Upgrade Luke", "durationSeconds": 2112, "publishedText": "1 day ago", "category": null, "keywords": [], "chapters": [], "music": [], "liveNow": false, "unlisted": false, "familySafe": null, "membersOnly": true, "channelSubscribers": null } } ], "pagination": { "nextCursor": "4qmFsgK9ChIYVUNYdXFTQmxIQUU2WHcteWVKQTBUdW53GqAKOGdiUEJ4ck1CM3JKQnpyR0J3b2tObVF5WkRCaFptUXRNREF3TUMweVpXWm1MVGc1TWpRdE9UZzVPR1ppWWpjNU1tVTFFcHNIUVdOV09GWmtXRVppUkdSUU1rMVVSVE5WVHpGVFl6WlFOSEp0UVRGZlMxcG9Ra3BNUzFOVk9UUktabTV2YlRSTE1XaFNUSFV6WjBKVk5sWm9kWGRLZDBSeFEyeFNSMVZ2YzNWZlR5MVRjamh0VDJka2NYUm5jREpGUW5CVE9WRjNOekJtYVhsRVYyVjJOMjlEY1hOaU5sUmZhV3BVUzI5a1dIZExPRFZ5U0U1WFVtcFFXbXhXVFVKWU1rNUpkRXRV…", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.youtube.profilePosts({ handle: \"LinusTechTips\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.youtube.profile_posts(handle=\"LinusTechTips\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/youtube/profile/posts \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=LinusTechTips\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_YouTubePost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/YouTubePost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "YouTubePost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "kind", "keywords", "chapters", "music", "liveNow", "unlisted", "membersOnly" ], "properties": { "category": { "type": [ "string", "null" ], "description": "YouTube's category (`Science & Technology`)." }, "channelSubscribers": { "type": [ "string", "null" ], "description": "The channel's subscribers, as YouTube writes them (`16.9M subscribers`)." }, "chapters": { "type": "array", "items": { "$ref": "#/components/schemas/YouTubeChapter" } }, "durationSeconds": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "familySafe": { "type": [ "boolean", "null" ], "description": "Suitable for all ages, as YouTube rates it." }, "keywords": { "type": "array", "items": { "type": "string" }, "description": "The tags its uploader gave it." }, "kind": { "$ref": "#/components/schemas/YouTubePostKind" }, "liveNow": { "type": "boolean", "description": "Live now." }, "membersOnly": { "type": "boolean", "description": "For the channel's members only." }, "music": { "type": "array", "items": { "$ref": "#/components/schemas/YouTubeSong" }, "description": "Songs credited in its description." }, "publishedText": { "type": [ "string", "null" ], "description": "When it was published, as YouTube writes it in lists (`3 days ago`): a list gives\nno exact time, which `createdAt` is on `/post`." }, "title": { "type": [ "string", "null" ], "description": "The video's title (`text` is its description)." }, "unlisted": { "type": "boolean", "description": "Unlisted: reachable by its link only." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A video, a Short, a live stream or a community post." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "YouTubeSong": { "type": "object", "description": "A song a video uses, as its description credits it.", "required": [ "title" ], "properties": { "album": { "type": [ "string", "null" ] }, "artist": { "type": [ "string", "null" ] }, "title": { "type": "string" } } }, "YouTubePostKind": { "type": "string", "description": "What a video is.", "enum": [ "video", "short", "live", "community" ] }, "YouTubeChapter": { "type": "object", "description": "A chapter of a video.", "required": [ "title", "startSeconds" ], "properties": { "startSeconds": { "type": "integer", "format": "int64", "minimum": 0 }, "title": { "type": "string" } } }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Profile Search (/docs/api-reference/youtube/profile-search) A search within one channel's videos, about 30 a page. `GET https://api.socialapi.sh/v1/youtube/profile/search` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.youtube.profileSearch({ handle: "LinusTechTips", query: "gpu" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.youtube.profile_search(handle="LinusTechTips", query="gpu") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/youtube/profile/search \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=LinusTechTips" \ --data-urlencode "query=gpu" ``` **Response** ```json { "data": [ { "id": "zA1WsB8uQmA", "url": "https://www.youtube.com/watch?v=zA1WsB8uQmA", "text": null, "createdAt": null, "author": { "id": "UCXuqSBlHAE6Xw-yeJA0Tunw", "username": "LinusTechTips", "displayName": "Linus Tech Tips", "avatarUrl": "https://yt3.googleusercontent.com/gnvYLhXy8FAlPXZ2RTrkrgj-5kyt0vdE2FUGVOiKGdEZIa-wN5A-7nwZBlWJLzUMmoh1NWAU=s68-c-k-c0x00ffffff-no-rj", "verified": false, "url": "https://www.youtube.com/@LinusTechTips" }, "stats": { "views": 2037803, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://i.ytimg.com/vi/zA1WsB8uQmA/hqdefault.jpg?sqp=-oaymwE2CNACELwBSFXyq4qpAygIARUAAIhCGABwAcABBvABAfgBtgiAAoAPigIMCAAQARhlIFYoTTAP&rs=AOn4CLAEVjVs1il9uyY6irP2Txh9ClyygQ", "width": null, "height": null, "durationSeconds": 79 } ], "hashtags": [], "mentions": [], "ext": { "kind": "video", "title": "You wanna build a Supercomputer? - NVIDIA NVLink", "durationSeconds": 79, "publishedText": "1 year ago", "category": null, "keywords": [], "chapters": [], "music": [], "liveNow": false, "unlisted": false, "familySafe": null, "membersOnly": false, "channelSubscribers": null } }, { "id": "H3Cnyj0I62c", "url": "https://www.youtube.com/watch?v=H3Cnyj0I62c", "text": "Check out https://www.youtube.com/@RingConnOfficial using our link! Gen 2 is 15% off for Halloween, October 30-31: https://bit.ly/4inH1fU\nSee our RingConn Gen2 Unboxing: https://www.youtube.com/wat...", "createdAt": null, "author": { "id": "UCXuqSBlHAE6Xw-yeJA0Tunw", "username": "LinusTechTips", "displayName": "Linus Tech Tips", "avatarUrl": "https://yt3.googleusercontent.com/gnvYLhXy8FAlPXZ2RTrkrgj-5kyt0vdE2FUGVOiKGdEZIa-wN5A-7nwZBlWJLzUMmoh1NWAU=s68-c-k-c0x00ffffff-no-rj", "verified": false, "url": "https://www.youtube.com/@LinusTechTips" }, "stats": { "views": 2461875, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://i.ytimg.com/vi/H3Cnyj0I62c/hqdefault.jpg?sqp=-oaymwEcCNACELwBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLDi3hws39Ue5FsO2CmsbR4MT_WdLw", "width": null, "height": null, "durationSeconds": 1695 } ], "hashtags": [], "mentions": [], "ext": { "kind": "video", "title": "I Doubled My GPU’s Memory (in a guy's basement)", "durationSeconds": 1695, "publishedText": "3 weeks ago", "category": null, "keywords": [], "chapters": [], "music": [], "liveNow": false, "unlisted": false, "familySafe": null, "membersOnly": false, "channelSubscribers": null } } ], "pagination": { "nextCursor": "4qmFsgJzEhhVQ1h1cVNCbEhBRTZYdy15ZUpBMFR1bncaJkNCNFNCbk5sWVhKamFEQUJPQUZnQVdvQWVnTkhRalM0QVFBJTNEWgNncHWaAilicm93c2UtZmVlZFVDWHVxU0JsSEFFNlh3LXllSkEwVHVud3NlYXJjaA%3D%3D", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/youtube/profile/search": { "get": { "tags": [ "YouTube" ], "summary": "A search within one channel's videos, about 30 a page.", "description": "1 credit a page.", "operationId": "youtubeProfileSearch", "parameters": [ { "name": "handle", "in": "query", "description": "The channel's handle, with or without `@`.", "required": false, "schema": { "type": "string" } }, { "name": "channelId", "in": "query", "description": "The channel's id, instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "The channel's link, instead of either.", "required": false, "schema": { "type": "string" } }, { "name": "query", "in": "query", "description": "What to search for in its videos.", "required": true, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_YouTubePost" }, "example": { "data": [ { "id": "zA1WsB8uQmA", "url": "https://www.youtube.com/watch?v=zA1WsB8uQmA", "text": null, "createdAt": null, "author": { "id": "UCXuqSBlHAE6Xw-yeJA0Tunw", "username": "LinusTechTips", "displayName": "Linus Tech Tips", "avatarUrl": "https://yt3.googleusercontent.com/gnvYLhXy8FAlPXZ2RTrkrgj-5kyt0vdE2FUGVOiKGdEZIa-wN5A-7nwZBlWJLzUMmoh1NWAU=s68-c-k-c0x00ffffff-no-rj", "verified": false, "url": "https://www.youtube.com/@LinusTechTips" }, "stats": { "views": 2037803, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://i.ytimg.com/vi/zA1WsB8uQmA/hqdefault.jpg?sqp=-oaymwE2CNACELwBSFXyq4qpAygIARUAAIhCGABwAcABBvABAfgBtgiAAoAPigIMCAAQARhlIFYoTTAP&rs=AOn4CLAEVjVs1il9uyY6irP2Txh9ClyygQ", "width": null, "height": null, "durationSeconds": 79 } ], "hashtags": [], "mentions": [], "ext": { "kind": "video", "title": "You wanna build a Supercomputer? - NVIDIA NVLink", "durationSeconds": 79, "publishedText": "1 year ago", "category": null, "keywords": [], "chapters": [], "music": [], "liveNow": false, "unlisted": false, "familySafe": null, "membersOnly": false, "channelSubscribers": null } }, { "id": "H3Cnyj0I62c", "url": "https://www.youtube.com/watch?v=H3Cnyj0I62c", "text": "Check out https://www.youtube.com/@RingConnOfficial using our link! Gen 2 is 15% off for Halloween, October 30-31: https://bit.ly/4inH1fU\nSee our RingConn Gen2 Unboxing: https://www.youtube.com/wat...", "createdAt": null, "author": { "id": "UCXuqSBlHAE6Xw-yeJA0Tunw", "username": "LinusTechTips", "displayName": "Linus Tech Tips", "avatarUrl": "https://yt3.googleusercontent.com/gnvYLhXy8FAlPXZ2RTrkrgj-5kyt0vdE2FUGVOiKGdEZIa-wN5A-7nwZBlWJLzUMmoh1NWAU=s68-c-k-c0x00ffffff-no-rj", "verified": false, "url": "https://www.youtube.com/@LinusTechTips" }, "stats": { "views": 2461875, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://i.ytimg.com/vi/H3Cnyj0I62c/hqdefault.jpg?sqp=-oaymwEcCNACELwBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLDi3hws39Ue5FsO2CmsbR4MT_WdLw", "width": null, "height": null, "durationSeconds": 1695 } ], "hashtags": [], "mentions": [], "ext": { "kind": "video", "title": "I Doubled My GPU’s Memory (in a guy's basement)", "durationSeconds": 1695, "publishedText": "3 weeks ago", "category": null, "keywords": [], "chapters": [], "music": [], "liveNow": false, "unlisted": false, "familySafe": null, "membersOnly": false, "channelSubscribers": null } } ], "pagination": { "nextCursor": "4qmFsgJzEhhVQ1h1cVNCbEhBRTZYdy15ZUpBMFR1bncaJkNCNFNCbk5sWVhKamFEQUJPQUZnQVdvQWVnTkhRalM0QVFBJTNEWgNncHWaAilicm93c2UtZmVlZFVDWHVxU0JsSEFFNlh3LXllSkEwVHVud3NlYXJjaA%3D%3D", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.youtube.profileSearch({ handle: \"LinusTechTips\", query: \"gpu\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.youtube.profile_search(handle=\"LinusTechTips\", query=\"gpu\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/youtube/profile/search \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=LinusTechTips\" \\\n --data-urlencode \"query=gpu\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_YouTubePost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/YouTubePost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "YouTubePost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "kind", "keywords", "chapters", "music", "liveNow", "unlisted", "membersOnly" ], "properties": { "category": { "type": [ "string", "null" ], "description": "YouTube's category (`Science & Technology`)." }, "channelSubscribers": { "type": [ "string", "null" ], "description": "The channel's subscribers, as YouTube writes them (`16.9M subscribers`)." }, "chapters": { "type": "array", "items": { "$ref": "#/components/schemas/YouTubeChapter" } }, "durationSeconds": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "familySafe": { "type": [ "boolean", "null" ], "description": "Suitable for all ages, as YouTube rates it." }, "keywords": { "type": "array", "items": { "type": "string" }, "description": "The tags its uploader gave it." }, "kind": { "$ref": "#/components/schemas/YouTubePostKind" }, "liveNow": { "type": "boolean", "description": "Live now." }, "membersOnly": { "type": "boolean", "description": "For the channel's members only." }, "music": { "type": "array", "items": { "$ref": "#/components/schemas/YouTubeSong" }, "description": "Songs credited in its description." }, "publishedText": { "type": [ "string", "null" ], "description": "When it was published, as YouTube writes it in lists (`3 days ago`): a list gives\nno exact time, which `createdAt` is on `/post`." }, "title": { "type": [ "string", "null" ], "description": "The video's title (`text` is its description)." }, "unlisted": { "type": "boolean", "description": "Unlisted: reachable by its link only." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A video, a Short, a live stream or a community post." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "YouTubeSong": { "type": "object", "description": "A song a video uses, as its description credits it.", "required": [ "title" ], "properties": { "album": { "type": [ "string", "null" ] }, "artist": { "type": [ "string", "null" ] }, "title": { "type": "string" } } }, "YouTubePostKind": { "type": "string", "description": "What a video is.", "enum": [ "video", "short", "live", "community" ] }, "YouTubeChapter": { "type": "object", "description": "A chapter of a video.", "required": [ "title", "startSeconds" ], "properties": { "startSeconds": { "type": "integer", "format": "int64", "minimum": 0 }, "title": { "type": "string" } } }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Profile Shorts (/docs/api-reference/youtube/profile-shorts) A channel's Shorts, about 48 a page. `GET https://api.socialapi.sh/v1/youtube/profile/shorts` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.youtube.profileShorts({ handle: "LinusTechTips", sort: "popular" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.youtube.profile_shorts(handle="LinusTechTips", sort="popular") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/youtube/profile/shorts \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=LinusTechTips" \ --data-urlencode "sort=popular" ``` **Response** ```json { "data": [ { "id": "MlB-g4Ckf5I", "url": "https://www.youtube.com/shorts/MlB-g4Ckf5I", "text": null, "createdAt": null, "author": { "id": "UCXuqSBlHAE6Xw-yeJA0Tunw", "username": "LinusTechTips", "displayName": null, "avatarUrl": null, "verified": false, "url": "https://www.youtube.com/@LinusTechTips" }, "stats": { "views": 43000000, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://i.ytimg.com/vi/MlB-g4Ckf5I/frame0.jpg", "width": null, "height": null, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "kind": "short", "title": "this old laptop is still insane", "durationSeconds": null, "publishedText": null, "category": null, "keywords": [], "chapters": [], "music": [], "liveNow": false, "unlisted": false, "familySafe": null, "membersOnly": false, "channelSubscribers": null } }, { "id": "2I9Qk0sB68o", "url": "https://www.youtube.com/shorts/2I9Qk0sB68o", "text": null, "createdAt": null, "author": { "id": "UCXuqSBlHAE6Xw-yeJA0Tunw", "username": "LinusTechTips", "displayName": null, "avatarUrl": null, "verified": false, "url": "https://www.youtube.com/@LinusTechTips" }, "stats": { "views": 29000000, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://i.ytimg.com/vi/2I9Qk0sB68o/frame0.jpg", "width": null, "height": null, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "kind": "short", "title": "I Spilled Liquid on my PC...now what?", "durationSeconds": null, "publishedText": null, "category": null, "keywords": [], "chapters": [], "music": [], "liveNow": false, "unlisted": false, "familySafe": null, "membersOnly": false, "channelSubscribers": null } } ], "pagination": { "nextCursor": "4qmFsgK_DhIYVUNYdXFTQmxIQUU2WHcteWVKQTBUdW53GqIOOGdiVENoclFDbExOQ2pMS0Nnb2tObVJpTVdJM01HWXRNREF3TUMweU5XUTVMV0kyT1RJdE1UUmpNVFJsWlRsaE5XUTBFcDhLUVdOV09GWmtWMHBDZUhaeFJGOWxOMGRaT1VKUlUwVk1SbEpxVUd0alJrZDNZWGxNVlhCVFRubFRjRkZ3Ym1abVdFNWFkWE5JWDFvME5tbG5lbnBpUW1JdGNXbE1lRWs0YWpWM1N6Rm5RVVpDUVU1TVRVaG9Oa1ZzYkVsNFFqUnFSMnBuU3pSak55MTFMVGg1Ym1Wb1NIbE1VSG8yTlY4d01uSlFWVFJ0VlZoUU9XNHlWRmRKT1dOd2RGOTJWR2w0…", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/youtube/profile/shorts": { "get": { "tags": [ "YouTube" ], "summary": "A channel's Shorts, about 48 a page.", "description": "Latest, most popular or oldest first, each with its views. 1 credit a page.", "operationId": "youtubeProfileShorts", "parameters": [ { "name": "handle", "in": "query", "description": "The channel's handle, with or without `@`.", "required": false, "schema": { "type": "string" } }, { "name": "channelId", "in": "query", "description": "The channel's id, instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "The channel's link, instead of either.", "required": false, "schema": { "type": "string" } }, { "name": "sort", "in": "query", "description": "`latest` (the default), `popular` or `oldest`.", "required": false, "schema": { "type": "string", "description": "The order of a channel's videos, Shorts or past streams.", "enum": [ "latest", "popular", "oldest" ] } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_YouTubePost" }, "example": { "data": [ { "id": "MlB-g4Ckf5I", "url": "https://www.youtube.com/shorts/MlB-g4Ckf5I", "text": null, "createdAt": null, "author": { "id": "UCXuqSBlHAE6Xw-yeJA0Tunw", "username": "LinusTechTips", "displayName": null, "avatarUrl": null, "verified": false, "url": "https://www.youtube.com/@LinusTechTips" }, "stats": { "views": 43000000, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://i.ytimg.com/vi/MlB-g4Ckf5I/frame0.jpg", "width": null, "height": null, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "kind": "short", "title": "this old laptop is still insane", "durationSeconds": null, "publishedText": null, "category": null, "keywords": [], "chapters": [], "music": [], "liveNow": false, "unlisted": false, "familySafe": null, "membersOnly": false, "channelSubscribers": null } }, { "id": "2I9Qk0sB68o", "url": "https://www.youtube.com/shorts/2I9Qk0sB68o", "text": null, "createdAt": null, "author": { "id": "UCXuqSBlHAE6Xw-yeJA0Tunw", "username": "LinusTechTips", "displayName": null, "avatarUrl": null, "verified": false, "url": "https://www.youtube.com/@LinusTechTips" }, "stats": { "views": 29000000, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://i.ytimg.com/vi/2I9Qk0sB68o/frame0.jpg", "width": null, "height": null, "durationSeconds": null } ], "hashtags": [], "mentions": [], "ext": { "kind": "short", "title": "I Spilled Liquid on my PC...now what?", "durationSeconds": null, "publishedText": null, "category": null, "keywords": [], "chapters": [], "music": [], "liveNow": false, "unlisted": false, "familySafe": null, "membersOnly": false, "channelSubscribers": null } } ], "pagination": { "nextCursor": "4qmFsgK_DhIYVUNYdXFTQmxIQUU2WHcteWVKQTBUdW53GqIOOGdiVENoclFDbExOQ2pMS0Nnb2tObVJpTVdJM01HWXRNREF3TUMweU5XUTVMV0kyT1RJdE1UUmpNVFJsWlRsaE5XUTBFcDhLUVdOV09GWmtWMHBDZUhaeFJGOWxOMGRaT1VKUlUwVk1SbEpxVUd0alJrZDNZWGxNVlhCVFRubFRjRkZ3Ym1abVdFNWFkWE5JWDFvME5tbG5lbnBpUW1JdGNXbE1lRWs0YWpWM1N6Rm5RVVpDUVU1TVRVaG9Oa1ZzYkVsNFFqUnFSMnBuU3pSak55MTFMVGg1Ym1Wb1NIbE1VSG8yTlY4d01uSlFWVFJ0VlZoUU9XNHlWRmRKT1dOd2RGOTJWR2w0…", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.youtube.profileShorts({ handle: \"LinusTechTips\", sort: \"popular\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.youtube.profile_shorts(handle=\"LinusTechTips\", sort=\"popular\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/youtube/profile/shorts \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=LinusTechTips\" \\\n --data-urlencode \"sort=popular\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_YouTubePost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/YouTubePost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "YouTubePost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "kind", "keywords", "chapters", "music", "liveNow", "unlisted", "membersOnly" ], "properties": { "category": { "type": [ "string", "null" ], "description": "YouTube's category (`Science & Technology`)." }, "channelSubscribers": { "type": [ "string", "null" ], "description": "The channel's subscribers, as YouTube writes them (`16.9M subscribers`)." }, "chapters": { "type": "array", "items": { "$ref": "#/components/schemas/YouTubeChapter" } }, "durationSeconds": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "familySafe": { "type": [ "boolean", "null" ], "description": "Suitable for all ages, as YouTube rates it." }, "keywords": { "type": "array", "items": { "type": "string" }, "description": "The tags its uploader gave it." }, "kind": { "$ref": "#/components/schemas/YouTubePostKind" }, "liveNow": { "type": "boolean", "description": "Live now." }, "membersOnly": { "type": "boolean", "description": "For the channel's members only." }, "music": { "type": "array", "items": { "$ref": "#/components/schemas/YouTubeSong" }, "description": "Songs credited in its description." }, "publishedText": { "type": [ "string", "null" ], "description": "When it was published, as YouTube writes it in lists (`3 days ago`): a list gives\nno exact time, which `createdAt` is on `/post`." }, "title": { "type": [ "string", "null" ], "description": "The video's title (`text` is its description)." }, "unlisted": { "type": "boolean", "description": "Unlisted: reachable by its link only." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A video, a Short, a live stream or a community post." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "YouTubeSong": { "type": "object", "description": "A song a video uses, as its description credits it.", "required": [ "title" ], "properties": { "album": { "type": [ "string", "null" ] }, "artist": { "type": [ "string", "null" ] }, "title": { "type": "string" } } }, "YouTubePostKind": { "type": "string", "description": "What a video is.", "enum": [ "video", "short", "live", "community" ] }, "YouTubeChapter": { "type": "object", "description": "A chapter of a video.", "required": [ "title", "startSeconds" ], "properties": { "startSeconds": { "type": "integer", "format": "int64", "minimum": 0 }, "title": { "type": "string" } } }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Profile (/docs/api-reference/youtube/profile) A channel with its subscribers, videos and views. `GET https://api.socialapi.sh/v1/youtube/profile` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data } = await client.youtube.profile({ handle: "LinusTechTips" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) data = client.youtube.profile(handle="LinusTechTips").data ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/youtube/profile \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "handle=LinusTechTips" ``` **Response** ```json { "data": { "id": "UCXuqSBlHAE6Xw-yeJA0Tunw", "username": "LinusTechTips", "displayName": "Linus Tech Tips", "bio": "Linus Tech Tips is a passionate team of \"professionally curious\" experts in consumer technology and video production who aim to educate and entertain.\n\nSponsorship Inquiries: partnerships@linusmediagroup.com", "avatarUrl": "https://yt3.googleusercontent.com/gnvYLhXy8FAlPXZ2RTrkrgj-5kyt0vdE2FUGVOiKGdEZIa-wN5A-7nwZBlWJLzUMmoh1NWAU=s160-c-k-c0x00ffffff-no-rj", "url": "https://www.youtube.com/@LinusTechTips", "verified": true, "private": false, "followers": 16900000, "following": null, "likes": null, "posts": 8011, "externalUrl": "https://www.lttstore.com/", "createdAt": "2008-11-24T00:00:00.000Z", "ext": { "views": 10045352646, "country": "Canada", "bannerUrl": "https://yt3.googleusercontent.com/U_7GWetO6k4sq3pAkbFEIIWzZLKcIJlGJqNz6NQAhgqF6DVD5pllwWF6trSUWEIRn4MkhNlhy9Y=w2560-fcrop64=1,00005a57ffffa5a8-k-c0xffffffff-no-nd-rj", "links": [ { "title": "lttstore.com", "url": "https://www.lttstore.com/" }, { "title": "Floatplane", "url": "https://www.floatplane.com/ltt" }, { "title": "Labs", "url": "https://www.lttlabs.com/" } ], "subscribersText": "16.9M subscribers" } } } ``` **OpenAPI** ```json { "paths": { "/v1/youtube/profile": { "get": { "tags": [ "YouTube" ], "summary": "A channel with its subscribers, videos and views.", "description": "Name, handle, description, avatar, banner, subscribers (rounded, as YouTube shows\nthem), videos, total views, country, links and when it joined. 1 credit.", "operationId": "youtubeProfile", "parameters": [ { "name": "handle", "in": "query", "description": "The channel's handle, with or without `@`.", "required": false, "schema": { "type": "string" } }, { "name": "channelId", "in": "query", "description": "The channel's id (`UCX6OQ3DkcsbYNE6H8uQQuVA`), instead of `handle`.", "required": false, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "The channel's link, instead of either.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item_YouTubeProfile" }, "example": { "data": { "id": "UCXuqSBlHAE6Xw-yeJA0Tunw", "username": "LinusTechTips", "displayName": "Linus Tech Tips", "bio": "Linus Tech Tips is a passionate team of \"professionally curious\" experts in consumer technology and video production who aim to educate and entertain.\n\nSponsorship Inquiries: partnerships@linusmediagroup.com", "avatarUrl": "https://yt3.googleusercontent.com/gnvYLhXy8FAlPXZ2RTrkrgj-5kyt0vdE2FUGVOiKGdEZIa-wN5A-7nwZBlWJLzUMmoh1NWAU=s160-c-k-c0x00ffffff-no-rj", "url": "https://www.youtube.com/@LinusTechTips", "verified": true, "private": false, "followers": 16900000, "following": null, "likes": null, "posts": 8011, "externalUrl": "https://www.lttstore.com/", "createdAt": "2008-11-24T00:00:00.000Z", "ext": { "views": 10045352646, "country": "Canada", "bannerUrl": "https://yt3.googleusercontent.com/U_7GWetO6k4sq3pAkbFEIIWzZLKcIJlGJqNz6NQAhgqF6DVD5pllwWF6trSUWEIRn4MkhNlhy9Y=w2560-fcrop64=1,00005a57ffffa5a8-k-c0xffffffff-no-nd-rj", "links": [ { "title": "lttstore.com", "url": "https://www.lttstore.com/" }, { "title": "Floatplane", "url": "https://www.floatplane.com/ltt" }, { "title": "Labs", "url": "https://www.lttlabs.com/" } ], "subscribersText": "16.9M subscribers" } } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data } = await client.youtube.profile({ handle: \"LinusTechTips\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\ndata = client.youtube.profile(handle=\"LinusTechTips\").data" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/youtube/profile \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"handle=LinusTechTips\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "Item_YouTubeProfile": { "type": "object", "description": "One item, as every single-item endpoint answers: `{ \"data\": … }`.", "required": [ "data" ], "properties": { "data": { "$ref": "#/components/schemas/YouTubeProfile" } } }, "YouTubeProfile": { "allOf": [ { "type": "object", "description": "An account.", "required": [ "id", "username", "url", "verified", "private", "ext" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "bio": { "type": [ "string", "null" ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "displayName": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "links" ], "properties": { "bannerUrl": { "type": [ "string", "null" ] }, "country": { "type": [ "string", "null" ], "description": "The country it states." }, "links": { "type": "array", "items": { "$ref": "#/components/schemas/YouTubeLink" }, "description": "The links on its about panel." }, "subscribersText": { "type": [ "string", "null" ], "description": "The subscriber count as YouTube writes it (`16.9M subscribers`): YouTube shows a\nvisitor only a rounded figure, which `followers` is." }, "views": { "type": [ "integer", "null" ], "format": "int64", "description": "Views of all its videos.", "minimum": 0 } } }, { "type": "object", "description": "What only this platform has." } ] }, "externalUrl": { "type": [ "string", "null" ], "description": "The link in the bio." }, "followers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "following": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "id": { "type": "string", "description": "The platform's id for the account." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "description": "Likes the account's posts received in total.", "minimum": 0 }, "posts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "private": { "type": "boolean" }, "url": { "type": "string", "description": "The profile's page." }, "username": { "type": "string", "description": "The handle, without `@`." }, "verified": { "type": "boolean" } } }, { "type": "object", "description": "A YouTube channel." } ] }, "YouTubeLink": { "type": "object", "description": "A link on a channel's about panel.", "required": [ "url" ], "properties": { "title": { "type": [ "string", "null" ] }, "url": { "type": "string" } } }, "Timestamp": { "type": "string", "format": "date-time" } } } } ``` # Search Channels (/docs/api-reference/youtube/search-channels) Channels matching a query, about 20 a page. `GET https://api.socialapi.sh/v1/youtube/search/channels` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.youtube.searchChannels({ query: "coffee" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.youtube.search_channels(query="coffee") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/youtube/search/channels \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "query=coffee" ``` **Response** ```json { "data": [ { "id": "UCxCZqbizSsnntlz6w0fN8hA", "username": "Coffee89921_", "displayName": "Coffee林芊妤", "bio": "Valerielam0921@gmail.com (work contact) and I am qualified yoga instructor in HK too", "avatarUrl": "https://yt3.googleusercontent.com/ytc/AIdro_nebiuIIn1KBfWTsSuoRnGgLudg1WbiGqk4QZohcRvEj6g=s176-c-k-c0x00ffffff-no-rj-mo", "url": "https://www.youtube.com/@Coffee89921_", "verified": true, "private": false, "followers": 1870000, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": null, "ext": { "views": null, "country": null, "bannerUrl": null, "links": [], "subscribersText": "1.87M subscribers" } }, { "id": "UCb5ObxghlOD37c-st_5Msdw", "username": "coffeecircle", "displayName": "Coffee Circle", "bio": "Das ist der offizielle Youtube Kanal von Coffee Circle, Kaffeerösterei und Onlineshop für richtig guten Kaffee und ausgesuchtes ...", "avatarUrl": "https://yt3.googleusercontent.com/ytc/AIdro_lPXLLTAm749JLAEoO2_54jcgqdDgQaRN9vujm0seXPBkk=s176-c-k-c0x00ffffff-no-rj-mo", "url": "https://www.youtube.com/@coffeecircle", "verified": false, "private": false, "followers": 18400, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": null, "ext": { "views": null, "country": null, "bannerUrl": null, "links": [], "subscribersText": "18.4K subscribers" } } ], "pagination": { "nextCursor": "Eu8FEgZjb2ZmZWUa5AVFZ0lRQWtnVWdnRVlWVU40UTFweFltbDZVM051Ym5Sc2VqWjNNR1pPT0doQmdnRVlWVU5pTlU5aWVHZG9iRTlFTXpkakxYTjBYelZOYzJSM2dnRVlWVU5GYTNWdlowVTFOM2hoWXpsRlVGb3pSVnAzVjBsbmdnRVlWVU5OWm5aTVdtSlRTMUZ3ZVY5MFdVOHRXVlZtY1RSM2dnRVlWVU5CVERsbVMyUjNTRkp5WVVOWVNGVmtjV1JXWmpCbmdnRVlWVU4xVW1ONFRVeDFjVWhLWlhWUWVVeE5NMmN6UjNCM2dnRVlWVU53Ukhwd1lWVlVZa2xyWkdwclExbzVjRzFtVFhKQmdnRVlWVU4zYUhGQ1YwVlNlazlhT0RoMFFq…", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/youtube/search/channels": { "get": { "tags": [ "YouTube" ], "summary": "Channels matching a query, about 20 a page.", "description": "With their handles and subscribers. 1 credit a page.", "operationId": "youtubeSearchChannels", "parameters": [ { "name": "query", "in": "query", "description": "What to search for.", "required": true, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_YouTubeProfile" }, "example": { "data": [ { "id": "UCxCZqbizSsnntlz6w0fN8hA", "username": "Coffee89921_", "displayName": "Coffee林芊妤", "bio": "Valerielam0921@gmail.com (work contact) and I am qualified yoga instructor in HK too", "avatarUrl": "https://yt3.googleusercontent.com/ytc/AIdro_nebiuIIn1KBfWTsSuoRnGgLudg1WbiGqk4QZohcRvEj6g=s176-c-k-c0x00ffffff-no-rj-mo", "url": "https://www.youtube.com/@Coffee89921_", "verified": true, "private": false, "followers": 1870000, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": null, "ext": { "views": null, "country": null, "bannerUrl": null, "links": [], "subscribersText": "1.87M subscribers" } }, { "id": "UCb5ObxghlOD37c-st_5Msdw", "username": "coffeecircle", "displayName": "Coffee Circle", "bio": "Das ist der offizielle Youtube Kanal von Coffee Circle, Kaffeerösterei und Onlineshop für richtig guten Kaffee und ausgesuchtes ...", "avatarUrl": "https://yt3.googleusercontent.com/ytc/AIdro_lPXLLTAm749JLAEoO2_54jcgqdDgQaRN9vujm0seXPBkk=s176-c-k-c0x00ffffff-no-rj-mo", "url": "https://www.youtube.com/@coffeecircle", "verified": false, "private": false, "followers": 18400, "following": null, "likes": null, "posts": null, "externalUrl": null, "createdAt": null, "ext": { "views": null, "country": null, "bannerUrl": null, "links": [], "subscribersText": "18.4K subscribers" } } ], "pagination": { "nextCursor": "Eu8FEgZjb2ZmZWUa5AVFZ0lRQWtnVWdnRVlWVU40UTFweFltbDZVM051Ym5Sc2VqWjNNR1pPT0doQmdnRVlWVU5pTlU5aWVHZG9iRTlFTXpkakxYTjBYelZOYzJSM2dnRVlWVU5GYTNWdlowVTFOM2hoWXpsRlVGb3pSVnAzVjBsbmdnRVlWVU5OWm5aTVdtSlRTMUZ3ZVY5MFdVOHRXVlZtY1RSM2dnRVlWVU5CVERsbVMyUjNTRkp5WVVOWVNGVmtjV1JXWmpCbmdnRVlWVU4xVW1ONFRVeDFjVWhLWlhWUWVVeE5NMmN6UjNCM2dnRVlWVU53Ukhwd1lWVlVZa2xyWkdwclExbzVjRzFtVFhKQmdnRVlWVU4zYUhGQ1YwVlNlazlhT0RoMFFq…", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.youtube.searchChannels({ query: \"coffee\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.youtube.search_channels(query=\"coffee\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/youtube/search/channels \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"query=coffee\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_YouTubeProfile": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/YouTubeProfile" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "YouTubeProfile": { "allOf": [ { "type": "object", "description": "An account.", "required": [ "id", "username", "url", "verified", "private", "ext" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "bio": { "type": [ "string", "null" ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "displayName": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "links" ], "properties": { "bannerUrl": { "type": [ "string", "null" ] }, "country": { "type": [ "string", "null" ], "description": "The country it states." }, "links": { "type": "array", "items": { "$ref": "#/components/schemas/YouTubeLink" }, "description": "The links on its about panel." }, "subscribersText": { "type": [ "string", "null" ], "description": "The subscriber count as YouTube writes it (`16.9M subscribers`): YouTube shows a\nvisitor only a rounded figure, which `followers` is." }, "views": { "type": [ "integer", "null" ], "format": "int64", "description": "Views of all its videos.", "minimum": 0 } } }, { "type": "object", "description": "What only this platform has." } ] }, "externalUrl": { "type": [ "string", "null" ], "description": "The link in the bio." }, "followers": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "following": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "id": { "type": "string", "description": "The platform's id for the account." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "description": "Likes the account's posts received in total.", "minimum": 0 }, "posts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "private": { "type": "boolean" }, "url": { "type": "string", "description": "The profile's page." }, "username": { "type": "string", "description": "The handle, without `@`." }, "verified": { "type": "boolean" } } }, { "type": "object", "description": "A YouTube channel." } ] }, "YouTubeLink": { "type": "object", "description": "A link on a channel's about panel.", "required": [ "url" ], "properties": { "title": { "type": [ "string", "null" ] }, "url": { "type": "string" } } }, "Timestamp": { "type": "string", "format": "date-time" } } } } ``` # Search Playlists (/docs/api-reference/youtube/search-playlists) Playlists matching a query, about 20 a page. `GET https://api.socialapi.sh/v1/youtube/search/playlists` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.youtube.searchPlaylists({ query: "coffee" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.youtube.search_playlists(query="coffee") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/youtube/search/playlists \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "query=coffee" ``` **Response** ```json { "data": [ { "id": "PL2Fx5UhWTfRLt5lhYOSvqOhXfVNaadFiK", "name": "Coffee林芊妤 站立式Cardio 全身燃脂運動(按難度排)", "url": "https://www.youtube.com/playlist?list=PL2Fx5UhWTfRLt5lhYOSvqOhXfVNaadFiK", "coverUrl": "https://i.ytimg.com/vi/Wx5pgfStY3w/hq720.jpg?sqp=-oaymwEXCNAFEJQDSFryq4qpAwkIARUAAIhCGAE=&rs=AOn4CLCg8u6qZ3JjpUzHiSX8_3avKCBlMA", "posts": 16, "ext": { "description": null, "views": null, "owner": null, "updatedText": null, "podcast": false } }, { "id": "RDCLAK5uy_kuj0ZF7ijSaRt3ZlJ3iv2YOWBjp9zyF1Q", "name": "Coffee Shop Indie", "url": "https://www.youtube.com/playlist?list=RDCLAK5uy_kuj0ZF7ijSaRt3ZlJ3iv2YOWBjp9zyF1Q", "coverUrl": "https://i9.ytimg.com/s_p/RDCLAK5uy_kuj0ZF7ijSaRt3ZlJ3iv2YOWBjp9zyF1Q/maxresdefault.jpg?sqp=CPCkm9gGir7X7AMICKrikdcGEAE=&rs=AOn4CLDxTTAZ4wK29GSE81C4O8PWPiWA7w&v=1793356074", "posts": 100, "ext": { "description": null, "views": null, "owner": null, "updatedText": null, "podcast": false } } ], "pagination": { "nextCursor": "EuMHEgZjb2ZmZWUa2AdFZ0lRQTBnVWdnRWlVRXd5Um5nMVZXaFhWR1pTVEhRMWJHaFpUMU4yY1U5b1dHWldUbUZoWkVacFM0SUJLMUpFUTB4QlN6VjFlVjlyZFdvd1drWTNhV3BUWVZKME0xcHNTak5wZGpKWlQxZENhbkE1ZW5sR01WR0NBU0pRVEZORVJXZHdhV0kyWTFwUlVWbERiMnBTYmxwUmEwVkhWREZaTms1QlRXaElnZ0VpVUV3MFQzWlRVemt0ZFU0d04zcHZRbWhrV1RJM0xXbHVSa2R2VTJkeWJWY3hiSUlCRFZCTVpVOWFaRXB0U0RKSlVqQ0NBU0pRVEVaTk0zWm1XVGs1VjA1U1dHY3dZek5CV0ZKNVIxOUVOWFZ6UjFodVRX…", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/youtube/search/playlists": { "get": { "tags": [ "YouTube" ], "summary": "Playlists matching a query, about 20 a page.", "description": "1 credit a page.", "operationId": "youtubeSearchPlaylists", "parameters": [ { "name": "query", "in": "query", "description": "What to search for.", "required": true, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_YouTubePlaylist" }, "example": { "data": [ { "id": "PL2Fx5UhWTfRLt5lhYOSvqOhXfVNaadFiK", "name": "Coffee林芊妤 站立式Cardio 全身燃脂運動(按難度排)", "url": "https://www.youtube.com/playlist?list=PL2Fx5UhWTfRLt5lhYOSvqOhXfVNaadFiK", "coverUrl": "https://i.ytimg.com/vi/Wx5pgfStY3w/hq720.jpg?sqp=-oaymwEXCNAFEJQDSFryq4qpAwkIARUAAIhCGAE=&rs=AOn4CLCg8u6qZ3JjpUzHiSX8_3avKCBlMA", "posts": 16, "ext": { "description": null, "views": null, "owner": null, "updatedText": null, "podcast": false } }, { "id": "RDCLAK5uy_kuj0ZF7ijSaRt3ZlJ3iv2YOWBjp9zyF1Q", "name": "Coffee Shop Indie", "url": "https://www.youtube.com/playlist?list=RDCLAK5uy_kuj0ZF7ijSaRt3ZlJ3iv2YOWBjp9zyF1Q", "coverUrl": "https://i9.ytimg.com/s_p/RDCLAK5uy_kuj0ZF7ijSaRt3ZlJ3iv2YOWBjp9zyF1Q/maxresdefault.jpg?sqp=CPCkm9gGir7X7AMICKrikdcGEAE=&rs=AOn4CLDxTTAZ4wK29GSE81C4O8PWPiWA7w&v=1793356074", "posts": 100, "ext": { "description": null, "views": null, "owner": null, "updatedText": null, "podcast": false } } ], "pagination": { "nextCursor": "EuMHEgZjb2ZmZWUa2AdFZ0lRQTBnVWdnRWlVRXd5Um5nMVZXaFhWR1pTVEhRMWJHaFpUMU4yY1U5b1dHWldUbUZoWkVacFM0SUJLMUpFUTB4QlN6VjFlVjlyZFdvd1drWTNhV3BUWVZKME0xcHNTak5wZGpKWlQxZENhbkE1ZW5sR01WR0NBU0pRVEZORVJXZHdhV0kyWTFwUlVWbERiMnBTYmxwUmEwVkhWREZaTms1QlRXaElnZ0VpVUV3MFQzWlRVemt0ZFU0d04zcHZRbWhrV1RJM0xXbHVSa2R2VTJkeWJWY3hiSUlCRFZCTVpVOWFaRXB0U0RKSlVqQ0NBU0pRVEVaTk0zWm1XVGs1VjA1U1dHY3dZek5CV0ZKNVIxOUVOWFZ6UjFodVRX…", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.youtube.searchPlaylists({ query: \"coffee\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.youtube.search_playlists(query=\"coffee\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/youtube/search/playlists \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"query=coffee\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_YouTubePlaylist": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/YouTubePlaylist" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "YouTubePlaylist": { "allOf": [ { "type": "object", "description": "A playlist, mix or collection of posts.", "required": [ "id", "name", "ext" ], "properties": { "coverUrl": { "type": [ "string", "null" ] }, "ext": { "allOf": [ { "type": "object", "required": [ "podcast" ], "properties": { "description": { "type": [ "string", "null" ] }, "owner": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "podcast": { "type": "boolean", "description": "A podcast's show rather than a list of videos." }, "updatedText": { "type": [ "string", "null" ], "description": "When it was last updated, as YouTube writes it (`Updated today`)." }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, { "type": "object", "description": "What only this platform has." } ] }, "id": { "type": "string" }, "name": { "type": "string" }, "posts": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "url": { "type": [ "string", "null" ] } } }, { "type": "object", "description": "A playlist, or a podcast's show." } ] }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Search Suggestions (/docs/api-reference/youtube/search-suggestions) What the search box suggests for a few letters. `GET https://api.socialapi.sh/v1/youtube/search/suggestions` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.youtube.searchSuggestions({ query: "coffee" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.youtube.search_suggestions(query="coffee") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/youtube/search/suggestions \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "query=coffee" ``` **Response** ```json { "data": [ { "text": "coffeezilla" }, { "text": "coffee" } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/youtube/search/suggestions": { "get": { "tags": [ "YouTube" ], "summary": "What the search box suggests for a few letters.", "description": "About 10 searches. 1 credit.", "operationId": "youtubeSearchSuggestions", "parameters": [ { "name": "query", "in": "query", "description": "The first letters of a search.", "required": true, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_Suggestion" }, "example": { "data": [ { "text": "coffeezilla" }, { "text": "coffee" } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.youtube.searchSuggestions({ query: \"coffee\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.youtube.search_suggestions(query=\"coffee\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/youtube/search/suggestions \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"query=coffee\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_Suggestion": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Suggestion" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "Suggestion": { "type": "object", "description": "A search suggestion.", "required": [ "text" ], "properties": { "text": { "type": "string" } } } } } } ``` # Search (/docs/api-reference/youtube/search) Videos matching a query, about 20 a page. `GET https://api.socialapi.sh/v1/youtube/search` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.youtube.search({ query: "coffee", uploaded: "month" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.youtube.search(query="coffee", uploaded="month") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/youtube/search \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "query=coffee" \ --data-urlencode "uploaded=month" ``` **Response** ```json { "data": [ { "id": "CLsCU_JX1eU", "url": "https://www.youtube.com/watch?v=CLsCU_JX1eU", "text": "Thanks to Cometeer for sponsoring this video. Get $20 off your first order, go to https://cometeer.com/speeed On Garm, \"Humanity ...", "createdAt": null, "author": { "id": "UC_mmaVYaFmlfdxuKb6U69Yw", "username": "SpeeedCo", "displayName": "Speeed", "avatarUrl": "https://yt3.ggpht.com/LjPimlGIsIMecxBblUySP5XIjFSOvNLR3A45NQkHLwGpwxDIkwDGKAwWzJbrfZj4Ejg72qdVfA=s68-c-k-c0x00ffffff-no-rj", "verified": false, "url": "https://www.youtube.com/@SpeeedCo" }, "stats": { "views": 3412534, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://i.ytimg.com/vi/CLsCU_JX1eU/hq720.jpg?sqp=-oaymwEcCNAFEJQDSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLBDo5LLTeXHRnOlGhn1JIcfeyIZpA", "width": null, "height": null, "durationSeconds": 2527 } ], "hashtags": [], "mentions": [], "ext": { "kind": "video", "title": "I Tried Every Way to Make Coffee", "durationSeconds": 2527, "publishedText": "10 days ago", "category": null, "keywords": [], "chapters": [], "music": [], "liveNow": false, "unlisted": false, "familySafe": null, "membersOnly": false, "channelSubscribers": null } }, { "id": "SoavyxuOalY", "url": "https://www.youtube.com/watch?v=SoavyxuOalY", "text": "Raw America host British Chris breaks down this major FAFO as an ICE agent's coffee shop business closes after he gets ...", "createdAt": null, "author": { "id": "UCyeAtCy_GiWYkWGWmgoiyiA", "username": "RawAmericaMedia", "displayName": "Raw America", "avatarUrl": "https://yt3.ggpht.com/bTnKiEROqBV-rmxak5UCqz6Xg8H5vALInZ7hlzr7hMVsB_pfqCA8L1hvBZkVjGQ3MEYXyB-G=s68-c-k-c0x00ffffff-no-rj", "verified": false, "url": "https://www.youtube.com/@RawAmericaMedia" }, "stats": { "views": 10208, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://i.ytimg.com/vi/SoavyxuOalY/hq720.jpg?sqp=-oaymwEcCNAFEJQDSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLA6TDNComLsUqyQoPEkSqPTEAY3sw", "width": null, "height": null, "durationSeconds": 502 } ], "hashtags": [], "mentions": [], "ext": { "kind": "video", "title": "Chicago coffee shop gets SHUT DOWN after owner EXPOSED as ICE AGENT!", "durationSeconds": 502, "publishedText": "16 hours ago", "category": null, "keywords": [], "chapters": [], "music": [], "liveNow": false, "unlisted": false, "familySafe": null, "membersOnly": false, "channelSubscribers": null } } ], "pagination": { "nextCursor": "EpcDEgZjb2ZmZWUajANFZ1FJQkJBQlNCU0NBUXREVEhORFZWOUtXREZsVllJQkMxTnZZWFo1ZUhWUFlXeFpnZ0VMVkY5dlVYaHBkVmRRVkZXQ0FRdFlSMDVxUTE5alMwdG1TWUlCQzFOc1VXWXROSHBRVGxOUmdnRUxRbFZrUjBWNVNHeG1aR3VDQVFzMlRIcFFRVkprVDJsbFo0SUJDM1Y1YkdwekxVVXlWbWhaZ2dFTFNYb3hZalJaYWw5VFRIZUNBUXRCYkVwUk4wVnZRbWcwZDRJQkMwWjBMUzB4YUhWSWIxQnJnZ0VMUlZKdGJuWnBZVXB3VUVtQ0FRdFlWVVZ5TmxkM1VtWmpRWUlCQzBGUGJrMUJhelZzUW10bmdnRUxlRzlqT1dsMWNE…", "hasMore": true } } ``` **OpenAPI** ```json { "paths": { "/v1/youtube/search": { "get": { "tags": [ "YouTube" ], "summary": "Videos matching a query, about 20 a page.", "description": "Filtered by type (videos, Shorts, live), upload date, length and features (HD, 4K,\nsubtitles…), by relevance or views; each with its views, length and channel. 1 credit\na page.", "operationId": "youtubeSearch", "parameters": [ { "name": "query", "in": "query", "description": "What to search for.", "required": true, "schema": { "type": "string" } }, { "name": "type", "in": "query", "description": "`videos` (the default), `shorts` or `live`.", "required": false, "schema": { "type": "string", "description": "What a search finds.", "enum": [ "videos", "shorts", "live" ] } }, { "name": "sort", "in": "query", "description": "`relevance` (the default) or `popular` (the most viewed first).", "required": false, "schema": { "type": "string", "description": "The order of a search.", "enum": [ "relevance", "popular" ] } }, { "name": "uploaded", "in": "query", "description": "`today`, `week`, `month` or `year`.", "required": false, "schema": { "type": "string", "description": "When the videos a search finds were uploaded.", "enum": [ "today", "week", "month", "year" ] } }, { "name": "duration", "in": "query", "description": "`short` (under 3 minutes), `medium` (3 to 20) or `long` (over 20).", "required": false, "schema": { "type": "string", "description": "How long the videos a search finds may be.", "enum": [ "short", "medium", "long" ] } }, { "name": "features", "in": "query", "description": "Features the videos must have, comma-separated: `hd`, `4k`, `hdr`, `subtitles`,\n`creative_commons`, `360`.", "required": false, "schema": { "type": "string" } }, { "name": "cursor", "in": "query", "description": "`nextCursor` of the previous page.", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_YouTubePost" }, "example": { "data": [ { "id": "CLsCU_JX1eU", "url": "https://www.youtube.com/watch?v=CLsCU_JX1eU", "text": "Thanks to Cometeer for sponsoring this video. Get $20 off your first order, go to https://cometeer.com/speeed On Garm, \"Humanity ...", "createdAt": null, "author": { "id": "UC_mmaVYaFmlfdxuKb6U69Yw", "username": "SpeeedCo", "displayName": "Speeed", "avatarUrl": "https://yt3.ggpht.com/LjPimlGIsIMecxBblUySP5XIjFSOvNLR3A45NQkHLwGpwxDIkwDGKAwWzJbrfZj4Ejg72qdVfA=s68-c-k-c0x00ffffff-no-rj", "verified": false, "url": "https://www.youtube.com/@SpeeedCo" }, "stats": { "views": 3412534, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://i.ytimg.com/vi/CLsCU_JX1eU/hq720.jpg?sqp=-oaymwEcCNAFEJQDSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLBDo5LLTeXHRnOlGhn1JIcfeyIZpA", "width": null, "height": null, "durationSeconds": 2527 } ], "hashtags": [], "mentions": [], "ext": { "kind": "video", "title": "I Tried Every Way to Make Coffee", "durationSeconds": 2527, "publishedText": "10 days ago", "category": null, "keywords": [], "chapters": [], "music": [], "liveNow": false, "unlisted": false, "familySafe": null, "membersOnly": false, "channelSubscribers": null } }, { "id": "SoavyxuOalY", "url": "https://www.youtube.com/watch?v=SoavyxuOalY", "text": "Raw America host British Chris breaks down this major FAFO as an ICE agent's coffee shop business closes after he gets ...", "createdAt": null, "author": { "id": "UCyeAtCy_GiWYkWGWmgoiyiA", "username": "RawAmericaMedia", "displayName": "Raw America", "avatarUrl": "https://yt3.ggpht.com/bTnKiEROqBV-rmxak5UCqz6Xg8H5vALInZ7hlzr7hMVsB_pfqCA8L1hvBZkVjGQ3MEYXyB-G=s68-c-k-c0x00ffffff-no-rj", "verified": false, "url": "https://www.youtube.com/@RawAmericaMedia" }, "stats": { "views": 10208, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://i.ytimg.com/vi/SoavyxuOalY/hq720.jpg?sqp=-oaymwEcCNAFEJQDSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLA6TDNComLsUqyQoPEkSqPTEAY3sw", "width": null, "height": null, "durationSeconds": 502 } ], "hashtags": [], "mentions": [], "ext": { "kind": "video", "title": "Chicago coffee shop gets SHUT DOWN after owner EXPOSED as ICE AGENT!", "durationSeconds": 502, "publishedText": "16 hours ago", "category": null, "keywords": [], "chapters": [], "music": [], "liveNow": false, "unlisted": false, "familySafe": null, "membersOnly": false, "channelSubscribers": null } } ], "pagination": { "nextCursor": "EpcDEgZjb2ZmZWUajANFZ1FJQkJBQlNCU0NBUXREVEhORFZWOUtXREZsVllJQkMxTnZZWFo1ZUhWUFlXeFpnZ0VMVkY5dlVYaHBkVmRRVkZXQ0FRdFlSMDVxUTE5alMwdG1TWUlCQzFOc1VXWXROSHBRVGxOUmdnRUxRbFZrUjBWNVNHeG1aR3VDQVFzMlRIcFFRVkprVDJsbFo0SUJDM1Y1YkdwekxVVXlWbWhaZ2dFTFNYb3hZalJaYWw5VFRIZUNBUXRCYkVwUk4wVnZRbWcwZDRJQkMwWjBMUzB4YUhWSWIxQnJnZ0VMUlZKdGJuWnBZVXB3VUVtQ0FRdFlWVVZ5TmxkM1VtWmpRWUlCQzBGUGJrMUJhelZzUW10bmdnRUxlRzlqT1dsMWNE…", "hasMore": true } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.youtube.search({ query: \"coffee\", uploaded: \"month\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.youtube.search(query=\"coffee\", uploaded=\"month\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/youtube/search \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"query=coffee\" \\\n --data-urlencode \"uploaded=month\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_YouTubePost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/YouTubePost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "YouTubePost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "kind", "keywords", "chapters", "music", "liveNow", "unlisted", "membersOnly" ], "properties": { "category": { "type": [ "string", "null" ], "description": "YouTube's category (`Science & Technology`)." }, "channelSubscribers": { "type": [ "string", "null" ], "description": "The channel's subscribers, as YouTube writes them (`16.9M subscribers`)." }, "chapters": { "type": "array", "items": { "$ref": "#/components/schemas/YouTubeChapter" } }, "durationSeconds": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "familySafe": { "type": [ "boolean", "null" ], "description": "Suitable for all ages, as YouTube rates it." }, "keywords": { "type": "array", "items": { "type": "string" }, "description": "The tags its uploader gave it." }, "kind": { "$ref": "#/components/schemas/YouTubePostKind" }, "liveNow": { "type": "boolean", "description": "Live now." }, "membersOnly": { "type": "boolean", "description": "For the channel's members only." }, "music": { "type": "array", "items": { "$ref": "#/components/schemas/YouTubeSong" }, "description": "Songs credited in its description." }, "publishedText": { "type": [ "string", "null" ], "description": "When it was published, as YouTube writes it in lists (`3 days ago`): a list gives\nno exact time, which `createdAt` is on `/post`." }, "title": { "type": [ "string", "null" ], "description": "The video's title (`text` is its description)." }, "unlisted": { "type": "boolean", "description": "Unlisted: reachable by its link only." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A video, a Short, a live stream or a community post." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "YouTubeSong": { "type": "object", "description": "A song a video uses, as its description credits it.", "required": [ "title" ], "properties": { "album": { "type": [ "string", "null" ] }, "artist": { "type": [ "string", "null" ] }, "title": { "type": "string" } } }, "YouTubePostKind": { "type": "string", "description": "What a video is.", "enum": [ "video", "short", "live", "community" ] }, "YouTubeChapter": { "type": "object", "description": "A chapter of a video.", "required": [ "title", "startSeconds" ], "properties": { "startSeconds": { "type": "integer", "format": "int64", "minimum": 0 }, "title": { "type": "string" } } }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ``` # Trending (/docs/api-reference/youtube/trending) What is trending in a country, about 20 videos. `GET https://api.socialapi.sh/v1/youtube/trending` **TypeScript** ```typescript import { SocialAPI } from "@socialapihq/sdk"; const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY }); const { data, pagination } = await client.youtube.trending({ country: "us" }); ``` **Python** ```python import os from socialapihq import SocialAPI client = SocialAPI(api_key=os.environ["SOCIALAPI_API_KEY"]) page = client.youtube.trending(country="us") ``` **cURL** ```bash curl -G https://api.socialapi.sh/v1/youtube/trending \ -H "Authorization: Bearer $SOCIALAPI_API_KEY" \ --data-urlencode "country=us" ``` **Response** ```json { "data": [ { "id": "1lOvAvBlzSM", "url": "https://www.youtube.com/watch?v=1lOvAvBlzSM", "text": null, "createdAt": null, "author": { "id": "UCRI7hheejBbWS6etTNwMT0g", "username": "", "displayName": "Anuel AA", "avatarUrl": null, "verified": false, "url": "https://www.youtube.com/channel/UCRI7hheejBbWS6etTNwMT0g" }, "stats": { "views": 14000000, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://i.ytimg.com/vi/1lOvAvBlzSM/hqdefault.jpg?sqp=-oaymwEcCNACELwBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLC9aaDpdo1563UzBwONSm_s8Imb1w", "width": null, "height": null, "durationSeconds": 265 } ], "hashtags": [], "mentions": [], "ext": { "kind": "video", "title": "Anuel AA | SE TOCO EL T*TITO CON MI GL*CK (Video Oficial)", "durationSeconds": 265, "publishedText": "4 days ago", "category": null, "keywords": [], "chapters": [], "music": [], "liveNow": false, "unlisted": false, "familySafe": null, "membersOnly": false, "channelSubscribers": null } }, { "id": "LJC7mgjp5FQ", "url": "https://www.youtube.com/watch?v=LJC7mgjp5FQ", "text": null, "createdAt": null, "author": { "id": "UCqECaJ8Gagnn7YCbPEzWH6g", "username": "", "displayName": "Taylor Swift and CMA", "avatarUrl": null, "verified": false, "url": "https://www.youtube.com/channel/UCqECaJ8Gagnn7YCbPEzWH6g" }, "stats": { "views": 6700000, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://i.ytimg.com/vi/LJC7mgjp5FQ/hqdefault.jpg?sqp=-oaymwEcCNACELwBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLDBhBILu6Abo1lHBzCtxXDoZTFkgQ", "width": null, "height": null, "durationSeconds": 189 } ], "hashtags": [], "mentions": [], "ext": { "kind": "video", "title": "Taylor Swift - I Knew It, I Knew You x Our Song (Live From The 60th CMA Awards)", "durationSeconds": 189, "publishedText": "6 days ago", "category": null, "keywords": [], "chapters": [], "music": [], "liveNow": false, "unlisted": false, "familySafe": null, "membersOnly": false, "channelSubscribers": null } } ], "pagination": { "nextCursor": null, "hasMore": false } } ``` **OpenAPI** ```json { "paths": { "/v1/youtube/trending": { "get": { "tags": [ "YouTube" ], "summary": "What is trending in a country, about 20 videos.", "description": "YouTube's own chart of the country's trending videos, in rank. 1 credit.", "operationId": "youtubeTrending", "parameters": [ { "name": "country", "in": "query", "description": "The country, as a two-letter code (`us`, the default).", "required": false, "schema": { "type": "string" } }, { "name": "maxAge", "in": "query", "description": "How old a cached answer may be, in seconds; 0 always fetches. Default and\nmost: the endpoint's cache lifetime.", "required": false, "schema": { "type": "integer", "format": "int64", "minimum": 0 } } ], "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/List_YouTubePost" }, "example": { "data": [ { "id": "1lOvAvBlzSM", "url": "https://www.youtube.com/watch?v=1lOvAvBlzSM", "text": null, "createdAt": null, "author": { "id": "UCRI7hheejBbWS6etTNwMT0g", "username": "", "displayName": "Anuel AA", "avatarUrl": null, "verified": false, "url": "https://www.youtube.com/channel/UCRI7hheejBbWS6etTNwMT0g" }, "stats": { "views": 14000000, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://i.ytimg.com/vi/1lOvAvBlzSM/hqdefault.jpg?sqp=-oaymwEcCNACELwBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLC9aaDpdo1563UzBwONSm_s8Imb1w", "width": null, "height": null, "durationSeconds": 265 } ], "hashtags": [], "mentions": [], "ext": { "kind": "video", "title": "Anuel AA | SE TOCO EL T*TITO CON MI GL*CK (Video Oficial)", "durationSeconds": 265, "publishedText": "4 days ago", "category": null, "keywords": [], "chapters": [], "music": [], "liveNow": false, "unlisted": false, "familySafe": null, "membersOnly": false, "channelSubscribers": null } }, { "id": "LJC7mgjp5FQ", "url": "https://www.youtube.com/watch?v=LJC7mgjp5FQ", "text": null, "createdAt": null, "author": { "id": "UCqECaJ8Gagnn7YCbPEzWH6g", "username": "", "displayName": "Taylor Swift and CMA", "avatarUrl": null, "verified": false, "url": "https://www.youtube.com/channel/UCqECaJ8Gagnn7YCbPEzWH6g" }, "stats": { "views": 6700000, "likes": null, "comments": null, "shares": null, "saves": null, "engagementRate": null }, "media": [ { "kind": "video", "url": null, "thumbnailUrl": "https://i.ytimg.com/vi/LJC7mgjp5FQ/hqdefault.jpg?sqp=-oaymwEcCNACELwBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLDBhBILu6Abo1lHBzCtxXDoZTFkgQ", "width": null, "height": null, "durationSeconds": 189 } ], "hashtags": [], "mentions": [], "ext": { "kind": "video", "title": "Taylor Swift - I Knew It, I Knew You x Our Song (Live From The 60th CMA Awards)", "durationSeconds": 189, "publishedText": "6 days ago", "category": null, "keywords": [], "chapters": [], "music": [], "liveNow": false, "unlisted": false, "familySafe": null, "membersOnly": false, "channelSubscribers": null } } ], "pagination": { "nextCursor": null, "hasMore": false } } } } }, "4XX": { "description": "Refused, free of charge: `error` says why, `code` what kind (`NOT_FOUND`, `PRIVATE`, `INVALID_REQUEST`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`…).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } }, "5XX": { "description": "The platform or our side failed, free of charge; try again.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorBody" } } } } }, "security": [ { "apiKey": [] } ], "x-codeSamples": [ { "lang": "typescript", "label": "TypeScript", "source": "import { SocialAPI } from \"@socialapihq/sdk\";\n\nconst client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });\n\nconst { data, pagination } = await client.youtube.trending({ country: \"us\" });" }, { "lang": "python", "label": "Python", "source": "import os\n\nfrom socialapihq import SocialAPI\n\nclient = SocialAPI(api_key=os.environ[\"SOCIALAPI_API_KEY\"])\n\npage = client.youtube.trending(country=\"us\")" }, { "lang": "bash", "label": "cURL", "source": "curl -G https://api.socialapi.sh/v1/youtube/trending \\\n -H \"Authorization: Bearer $SOCIALAPI_API_KEY\" \\\n --data-urlencode \"country=us\"" } ] } } }, "components": { "schemas": { "ErrorBody": { "type": "object", "description": "The body of every error response.", "required": [ "error", "code" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "error": { "type": "string", "description": "What went wrong, for people. May change; branch on `code`." }, "param": { "type": [ "string", "null" ], "description": "The request field the error is about, when there is one." } } }, "ErrorCode": { "type": "string", "description": "Machine-readable error codes: the contract clients branch on. The message next to it\nis for people and may change.", "enum": [ "INVALID_REQUEST", "UNAUTHENTICATED", "FORBIDDEN", "REVERIFICATION_REQUIRED", "NOT_FOUND", "METHOD_NOT_ALLOWED", "CONFLICT", "LIMIT_REACHED", "INSUFFICIENT_CREDITS", "KEY_CREDIT_LIMIT_REACHED", "RATE_LIMITED", "INVALID_WEBHOOK", "UPSTREAM_UNAVAILABLE", "PRIVATE", "SUSPENDED", "ENDPOINT_UNAVAILABLE", "INTERNAL_ERROR" ] }, "List_YouTubePost": { "type": "object", "description": "A page of a list, as every list endpoint answers: `{ \"data\": [...], \"pagination\": … }`.", "required": [ "data", "pagination" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/YouTubePost" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } }, "Pagination": { "type": "object", "required": [ "hasMore" ], "properties": { "hasMore": { "type": "boolean" }, "nextCursor": { "type": [ "string", "null" ], "description": "Send it back as `cursor` for the next page; absent on the last page." } } }, "YouTubePost": { "allOf": [ { "type": "object", "description": "A post: a video, a photo set, a text post.", "required": [ "id", "url", "stats", "media", "hashtags", "mentions", "ext" ], "properties": { "author": { "oneOf": [ { "$ref": "#/components/schemas/Author" }, { "type": "null" } ] }, "createdAt": { "oneOf": [ { "$ref": "#/components/schemas/Timestamp" }, { "type": "null" } ] }, "ext": { "allOf": [ { "type": "object", "required": [ "kind", "keywords", "chapters", "music", "liveNow", "unlisted", "membersOnly" ], "properties": { "category": { "type": [ "string", "null" ], "description": "YouTube's category (`Science & Technology`)." }, "channelSubscribers": { "type": [ "string", "null" ], "description": "The channel's subscribers, as YouTube writes them (`16.9M subscribers`)." }, "chapters": { "type": "array", "items": { "$ref": "#/components/schemas/YouTubeChapter" } }, "durationSeconds": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "familySafe": { "type": [ "boolean", "null" ], "description": "Suitable for all ages, as YouTube rates it." }, "keywords": { "type": "array", "items": { "type": "string" }, "description": "The tags its uploader gave it." }, "kind": { "$ref": "#/components/schemas/YouTubePostKind" }, "liveNow": { "type": "boolean", "description": "Live now." }, "membersOnly": { "type": "boolean", "description": "For the channel's members only." }, "music": { "type": "array", "items": { "$ref": "#/components/schemas/YouTubeSong" }, "description": "Songs credited in its description." }, "publishedText": { "type": [ "string", "null" ], "description": "When it was published, as YouTube writes it in lists (`3 days ago`): a list gives\nno exact time, which `createdAt` is on `/post`." }, "title": { "type": [ "string", "null" ], "description": "The video's title (`text` is its description)." }, "unlisted": { "type": "boolean", "description": "Unlisted: reachable by its link only." } } }, { "type": "object", "description": "What only this platform has." } ] }, "hashtags": { "type": "array", "items": { "type": "string" }, "description": "Hashtags in the text, without `#`." }, "id": { "type": "string" }, "media": { "type": "array", "items": { "$ref": "#/components/schemas/Media" } }, "mentions": { "type": "array", "items": { "type": "string" }, "description": "Accounts mentioned, without `@`." }, "stats": { "$ref": "#/components/schemas/PostStats" }, "text": { "type": [ "string", "null" ], "description": "The caption or text." }, "url": { "type": "string" } } }, { "type": "object", "description": "A video, a Short, a live stream or a community post." } ] }, "PostStats": { "type": "object", "properties": { "comments": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "engagementRate": { "type": [ "number", "null" ], "format": "double", "description": "Likes, comments and shares over views, to four places (`0.0523` is 5.23%);\nabsent without views." }, "likes": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "saves": { "type": [ "integer", "null" ], "format": "int64", "description": "Saves or bookmarks.", "minimum": 0 }, "shares": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 }, "views": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "Media": { "type": "object", "description": "One video, image or sound of a post. URLs are the platform's own and usually expire.", "required": [ "kind" ], "properties": { "durationSeconds": { "type": [ "number", "null" ], "format": "double" }, "height": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "kind": { "$ref": "#/components/schemas/MediaKind" }, "thumbnailUrl": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "width": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } } }, "MediaKind": { "type": "string", "enum": [ "video", "image", "audio" ] }, "YouTubeSong": { "type": "object", "description": "A song a video uses, as its description credits it.", "required": [ "title" ], "properties": { "album": { "type": [ "string", "null" ] }, "artist": { "type": [ "string", "null" ] }, "title": { "type": "string" } } }, "YouTubePostKind": { "type": "string", "description": "What a video is.", "enum": [ "video", "short", "live", "community" ] }, "YouTubeChapter": { "type": "object", "description": "A chapter of a video.", "required": [ "title", "startSeconds" ], "properties": { "startSeconds": { "type": "integer", "format": "int64", "minimum": 0 }, "title": { "type": "string" } } }, "Timestamp": { "type": "string", "format": "date-time" }, "Author": { "type": "object", "description": "An account as it appears on someone else's post or comment.", "required": [ "id", "username", "verified", "url" ], "properties": { "avatarUrl": { "type": [ "string", "null" ] }, "displayName": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" }, "verified": { "type": "boolean" } } } } } } ```