Skip to content
ChangelogNew

Social: read YouTube, Instagram and Threads through the API

Social
A SOCIAL request on POST /v1/async/task for the YouTube search wireless earbuds review, and the first video in the response with its channel, 62,618 views and 957 likes

Search YouTube, Instagram and Threads and read videos, posts, comments, profiles and YouTube captions as JSON from any API key, for 0.5 credits a completed request.

What you get

  • platform youtube: search results, the newest uploads for a query, a video’s watch page, comments with their replies, a channel, a channel’s videos, Shorts or live streams, and captions.
  • platform instagram: posts and reels for a keyword, a public profile with its 12 most recent posts, one post or reel, and its comments.
  • platform threads: posts for a keyword, a public profile with its recent posts, one post, and its replies.
  • Counts as numbers, such as viewCount, likeCount, commentCount and followerCount, with publishedAt times, so you compare posts without parsing text like 62K.

How it works

Send taskType SOCIAL to POST /v1/async/task with a platform and an action. search, the default, takes query. The other actions take videoId, channel, username or postUrl, and you can paste the page URL there.

Social reads public pages. On Instagram that is the 12 most recent posts of a profile and about a dozen comments of a post, and on Threads about 10 replies a post. A page that does not exist or that needs a signed-in viewer ends the task with PAGE_UNAVAILABLE.

A YouTube video search ordered by relevance returns nextPageToken for the next page. transcript returns the caption text and timed segments in the languages you list, and translateTo asks YouTube to translate them. The read_social tool on the querying.ai MCP server runs the same reads from Claude Code, Codex, Cursor and other MCP clients.

Where it helps

  • Track the views, likes and comments on your brand’s videos and your competitors’ videos, day by day.
  • Read the comments and replies under a launch on YouTube, Instagram and Threads, and list what people ask.
  • Pass a review video’s transcript with its timestamps to your model, and find where it names your product.
  • Put what creators say on YouTube and Threads next to what ChatGPT and Google AI Mode answer for the same query.

Send a request

Send the request with your API key in the Authorization header.

curl -X POST https://api.querying.ai/v1/async/task \
  -H "Authorization: Bearer $QUERYING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "taskType": "SOCIAL",
    "payload": {
      "platform": "youtube",
      "action": "search",
      "query": "wireless earbuds review",
      "limit": 10
    }
  }'

Request fields

taskTypestringRequired
The engine to run, such as CHATGPT or GOOGLE.
payload.platformstringRequired
The platform to read: youtube, instagram or threads.
payload.actionstring
What to read, such as search, video, comments or transcript. Default search. Each platform lists its actions in the docs.
payload.querystring
The search query for search and recent, written the way a viewer types it into the platform’s search box.
payload.limitinteger
Results to return. A YouTube search takes 1 to 50, default 10.
webhook.urlstring
An HTTPS address on your server. The finished task is posted there the moment it completes.

Response

A finished task looks like this, trimmed for length.

JSON
{
  "success": true,
  "task": {
    "id": "…",
    "taskType": "SOCIAL",
    "status": "COMPLETED",
    "createdAt": "…"
  },
  "credits": { "creditsToCharge": 0.5, "creditsCharged": 0.5 },
  "response": {
    "platform": "youtube",
    "action": "search",
    "query": "wireless earbuds review",
    "order": "relevance",
    "returnedCount": 10,
    "videos": [
      {
        "position": 1,
        "videoId": "YdJh6QdOGME",
        "url": "https://www.youtube.com/watch?v=YdJh6QdOGME",
        "title": "Earbuds Awards 2026 - Best Bluetooth Earbuds by Category!",
        "channelTitle": "Mike O'Brien",
        "channelHandle": "@MikeOBrienMedia",
        "publishedAt": "2026-11-17T15:39:37Z",
        "durationSeconds": 995,
        "viewCount": 62618,
        "likeCount": 957
      },
      "…"
    ],
    "nextPageToken": "eyJyIjpbIllkSmg2UWRPR01FIl19"
  }
}
task.statusstring
QUEUED, PROCESSING, then COMPLETED with the answer or FAILED with error.
credits.creditsChargedinteger
Credits charged for the finished task. A failed task charges 0.
response.returnedCountinteger
The number of products in products.
response.videosarray
Videos in YouTube’s order: position, videoId, url, title, the channel, publishedAt, durationSeconds, viewCount and likeCount.

Receive the result

The request returns the task right away with status QUEUED. Poll GET /v1/async/task/{id} until status is COMPLETED or FAILED, or add webhook.url and the finished task arrives at your server with the same task, credits and response. Results stay available for 24 hours after a task finishes.

curl https://api.querying.ai/v1/async/task/$TASK_ID \
  -H "Authorization: Bearer $QUERYING_API_KEY"

Pricing

Each completed request uses 0.5 credits, on every platform and every action. Only completed requests are charged. Plans and credits: https://querying.ai/pricing

More updates

Stay in the loop

Get new product updates in your inbox.

RSS feed