Handles API

Use case

Social listening and brand monitoring with an API

Brand monitoring on X takes three kinds of call: GET /v1/x/search/tweets for keyword searches, /v1/x/users/{handle}/mentions for posts that mention an account, and the replies and quotes endpoints for a single post. Each live call costs 2 credits, so 1,000 checks cost 2,000 credits.

Updated by the Handles API team

The four endpoints behind a listening loop

A brand monitor on X needs four reads: a keyword search, the mentions of your account, the replies to one post and the quote posts of one post. All four are live X reads at 2 credits per call and share one post format.

EndpointWhat it findsCredits
GET /v1/x/search/tweetsPosts matching X advanced search, with operators such as from:, to:, since:, until:, filter:, min_faves: and lang:2
GET /v1/x/users/{handle}/mentionsPosts that mention an account, newest first, with the account's own posts left out2
GET /v1/x/tweets/{id}/repliesDirect replies to one post2
GET /v1/x/tweets/{id}/quotesQuote posts of one post2
All four return a list of posts under data.tweets and an opaque cursor under meta.page.next_cursor.
These endpoints need the scrape:live scope. It is a sensitive scope, it is not granted to keys by default, and calls made with it are audited. See authentication and keep the key on your server.

Writing brand queries with X advanced search

The search endpoint passes your query to X advanced search unchanged, so any operator that works in the X search box works here. A good brand query names the brand, removes your own posts and limits the language.

  • "Example Co" -from:exampleco lang:en finds English posts that name the brand and skips the brand's own account.
  • to:exampleco finds posts addressed to the support account.
  • examplecoapp.com min_faves:10 since:2026-11-01 finds posts that link the domain and have drawn some attention.
Example search (curl)
curl "https://api.handlesapi.com/v1/x/search/tweets?query=%22Example%20Co%22%20-from%3Aexampleco%20lang%3Aen&limit=50" \
  -H "Authorization: Bearer $HANDLES_API_KEY"
Example search (Node)
const res = await fetch("https://api.handlesapi.com/v1/x/search/tweets?query=%22Example%20Co%22%20-from%3Aexampleco%20lang%3Aen&limit=50", {
  headers: { Authorization: `Bearer ${process.env.HANDLES_API_KEY}` },
});
const { data, meta } = await res.json();
Example search (Python)
import os
import requests

res = requests.get(
    "https://api.handlesapi.com/v1/x/search/tweets?query=%22Example%20Co%22%20-from%3Aexampleco%20lang%3Aen&limit=50",
    headers={"Authorization": f"Bearer {os.environ['HANDLES_API_KEY']}"},
    timeout=30,
)
body = res.json()

Use the default Latest tab for anything you count. Top is ranked by X and partial on purpose, so a total under Top undercounts volume.

A polling loop that dedupes by post id

This API answers requests and does not push events, so monitoring means polling: run the search on a schedule and keep only the posts you have not seen. The loop below dedupes on tweet_id, pages with the cursor until it reaches a known post, and retries 503.

Node.js, polling every 5 minutes (example)
const BASE = "https://api.handlesapi.com/v1";
const headers = { Authorization: `Bearer ${process.env.HANDLES_API_KEY}` };
const QUERY = '"Example Co" -from:exampleco lang:en';
const MAX_PAGES = 3;
const seen = new Set(); // persist these ids in a database in production

async function getJson(url, tries = 3) {
  for (let i = 1; i <= tries; i++) {
    const res = await fetch(url, { headers, signal: AbortSignal.timeout(30_000) });
    if (res.status === 503) {
      await new Promise((r) => setTimeout(r, 2000 * i)); // upstream busy, retry
      continue;
    }
    if (!res.ok) throw new Error(`HTTP ${res.status}`);
    return res.json();
  }
  throw new Error("X is unavailable right now");
}

async function check() {
  const fresh = [];
  let cursor = null;
  for (let page = 0; page < MAX_PAGES; page++) {
    const url = new URL(`${BASE}/x/search/tweets`);
    url.searchParams.set("query", QUERY);
    url.searchParams.set("limit", "50");
    if (cursor) url.searchParams.set("cursor", cursor);

    const { data, meta } = await getJson(url);
    let known = 0;
    for (const tweet of data.tweets) {
      if (seen.has(tweet.tweet_id)) known++;
      else { seen.add(tweet.tweet_id); fresh.push(tweet); }
    }
    cursor = meta.page.next_cursor;
    if (known > 0 || !cursor) break; // reached posts we already have
  }
  return fresh;
}

for (;;) {
  try {
    for (const t of await check()) console.log(t.created_at, t.author.handle, t.url);
  } catch (err) {
    console.error("check failed:", err.message);
  }
  await new Promise((r) => setTimeout(r, 5 * 60_000));
}

Cursors are X's own and expire, so use each one on the next call and do not store it. Deduping on the id is safer than remembering a position. The pagination guide covers the cursor contract, and errors lists which codes are worth a retry.

Replies and quote posts on one post

Replies and quotes are read per post, so run them for the posts that matter, such as a launch announcement or a complaint that is spreading. Both endpoints re-check every row against the parent id, so you get replies to that post only, not the whole conversation.

Replies and quote posts (example post id)
curl "https://api.handlesapi.com/v1/x/tweets/2125915027819446402/replies?limit=20" \
  -H "Authorization: Bearer $HANDLES_API_KEY"

curl "https://api.handlesapi.com/v1/x/tweets/2125915027819446402/quotes?limit=20" \
  -H "Authorization: Bearer $HANDLES_API_KEY"

The mentions endpoint works the same way for an account: pass a handle with or without the @, and the account's own posts are excluded.

What a post looks like in the response

Every listening endpoint returns posts in one shape, with the text, engagement counters, flags for replies, quotes and reposts, and a full author object. This capture is from the timeline endpoint, which uses the same post format as search, mentions, replies and quotes.

curl "https://api.handlesapi.com/v1/x/users/nasa/tweets?limit=2" \
  -H "Authorization: Bearer $HANDLES_API_KEY"
200 OK1788 ms · 2 credits
{
  "data": {
    "tweets": [
      {
        "tweet_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...",
        "created_at": "2026-11-26T11:30:14+00:00",
        "lang": "en",
        "source": null,
        "likes": 833,
        "retweets": 151,
        "replies": 73,
        "quotes": 16,
        "bookmarks": 50,
        "views": 276360,
        "is_reply": false,
        "is_retweet": false,
        "is_quote": false,
        "conversation_id": "2125915027819446402",
        "in_reply_to_tweet_id": null,
        "quoted_tweet_id": null,
        "retweeted_tweet_id": null,
        "hashtags": [],
        "mentions": [
          "Space_Station"
        ],
        "links": [
          "https://x.com/i/broadcasts/2onVBonVMMWjaV"
        ],
        "media": [],
        "author": {
          "user_id": "11348282",
          "handle": "NASA",
          "display_name": "NASA",
          "bio": "Making the seemingly impossible, possible. ✨",
          "followers": 92086892,
          "following": 115,
          "tweets": 74588,
          "media_count": 28267,
          "likes_given": 17125,
          "is_verified": false,
          "is_blue_verified": true,
          "is_protected": false,
          "location": "Pale Blue Dot",
          "avatar_url": "https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB_400x400.jpg",
          "header_url": "https://pbs.twimg.com/profile_banners/11348282/1788992290",
          "created_at": "2007-12-19T20:20:32+00:00",
          "profile_url": "https://x.com/NASA"
        }
      },
      {
        "tweet_id": "2125691860706333095",
        "url": "https://x.com/NASA/status/2125691860706333095",
        "text": "RT @NASASolarSystem: The thick atmosphere.\nThe rivers and lakes.\nThe sweeping dunes.\nThe complex...",
        "created_at": "2026-11-25T20:43:27+00:00",
        "lang": "en",
        "source": "Twitter for iPhone",
        "likes": 0,
        "retweets": 368,
        "replies": 0,
        "quotes": 0,
        "bookmarks": 0,
        "views": 48738,
        "is_reply": false,
        "is_retweet": true,
        "is_quote": false,
        "conversation_id": "2125691860706333095",
        "in_reply_to_tweet_id": null,
        "quoted_tweet_id": null,
        "retweeted_tweet_id": "2125681297859166579",
        "hashtags": [],
        "mentions": [
          "NASASolarSystem"
        ],
        "links": [],
        "media": [],
        "author": {
          "user_id": "11348282",
          "handle": "NASA",
          "display_name": "NASA",
          "bio": "Making the seemingly impossible, possible. ✨",
          "followers": 92086892,
          "following": 115,
          "tweets": 74588,
          "media_count": 28267,
          "likes_given": 17125,
          "is_verified": false,
          "is_blue_verified": true,
          "is_protected": false,
          "location": "Pale Blue Dot",
          "avatar_url": "https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB_400x400.jpg",
          "header_url": "https://pbs.twimg.com/profile_banners/11348282/1788992290",
          "created_at": "2007-12-19T20:20:32+00:00",
          "profile_url": "https://x.com/NASA"
        }
      }
    ],
    "has_next_page": false
  },
  "meta": {
    "page": {
      "limit": 2,
      "next_cursor": null,
      "count": 2
    },
    "source": "live:xlookup",
    "request_id": "req_503bc38c7610cc00",
    "generated_at": "2026-11-26T13:54:58.874Z",
    "took_ms": 1696
  }
}

Real response from the live API, captured Nov 26, 2026. Long strings and arrays are shortened.

Each author comes with the post, so counting verified or large accounts among your mentioners needs no second call.

Turning results into alerts

The API returns posts and counters, so the monitoring logic is yours. Store tweet_id, created_at, text, the counters and the author, then decide what deserves a human.

  • Alert on reach. Compare views and likes with a threshold, or add min_faves: to the query so only posts with traction come back.
  • Alert on the author. Each post carries the author's follower count and verification flags, so a large account can outrank a loud one.
  • Route by type. The is_reply, is_quote and is_retweet flags separate conversation from amplification.
  1. Get a key from the signup page and confirm it has the scrape:live scope.
  2. Run one search in curl to check the query returns what you expect. It costs 2 credits.
  3. Move the query into the loop above and persist the seen ids.

What 1,000 checks cost

One check is one live call, so 1,000 checks use 2,000 credits. The table shows what that costs on each plan.

PlanMonthly priceCredits1,000 catalog reads1,000 live reads
Handles API Starter$2915,000$1.93$3.87
Handles API Pro$9975,000$1.32$2.64
Handles API Business$299300,000$1.00$1.99
Handles API Scale$7991,200,000$0.67$1.33
Plan price divided by included credits. A catalog read costs 1 credit, a live read 2 credits. The Free trial is 100 credits once, no card.

Your schedule decides the monthly total. These figures count one query over 30 days with one page per check, and each extra query or page multiplies them.

ScheduleChecks per monthCredits per monthSmallest plan that fits
Every 15 minutes2,8805,760Starter
Every 5 minutes8,64017,280Pro
Every minute43,20086,400Business
Example: one query, one page per check, no retries. A check that returns nothing still uses a call.

The same job on the official X API

The official X API reads a post for $0.005, so the same monitoring costs depend on how many posts each check returns. The price list is on the X pricing page, as of November 2026.

Posts returned per checkOfficial X API, 1,000 checksHandles API, 1,000 checks
1 post$5.002,000 credits, the same at any size
5 posts$25.002,000 credits, the same at any size
20 posts$100.002,000 credits, the same at any size
100 posts$500.002,000 credits, the same at any size
Example, assuming every returned post is new. The official API bills a resource once per 24 hour UTC window, so overlapping polls cost less than this. Official prices from docs.x.com.

The official bill grows with every post returned and is zero for an empty check. We bill per request, so a busy query is cheap and a quiet one still costs 2 credits a check. The official API is also the right tool if you need to reply or act as your brand. The X API pricing guide has the full price list and rate limits.

Limits to know before you build

  • Search exists for X only. For Instagram, TikTok, YouTube and the other platforms the catalog holds profile data, not keyword search over posts.
  • Live calls take 2 to 25 seconds and can return 503 under load. Set a 30 second timeout and retry 503, but never cache a 503 as an empty result.
  • The X search index is not an archive. An empty list means the post is not in the index, not that it was never posted.
  • The service is read-only. It cannot reply, like or message anyone, and it cannot see protected accounts or private posts.
  • The scrape:live scope is not on keys by default and must be enabled.

To go from brand mentions to the people behind them, see influencer analytics. The X API page lists every X endpoint, and the Twitter scraper guide compares this route with building your own. Start with the 100 free credits, which cover 50 checks.

Frequently asked questions

What is a social listening API?
A social listening API returns public posts that match a keyword, a mention or a conversation, so your own code can track a brand. Handles API does this for X: advanced search, mentions of an account, replies to a post and quote posts. It returns the posts and their counters. Sentiment scoring is a step you add yourself.
Can I monitor Instagram or TikTok keywords the same way?
No. Keyword and mention search exists only for X. For Instagram, TikTok, YouTube and the other platforms the catalog holds profile data such as followers and engagement, but it does not search the text of posts. Use the catalog to track accounts you already know about.
How often should I poll for new mentions?
Pick the slowest schedule your use case tolerates. A live call takes 2 to 25 seconds and costs 2 credits, so polling every minute is rarely worth it. Every 5 to 15 minutes is a common starting point, and a 15 minute schedule for one query costs about 5,760 credits over 30 days.
How much does it cost to monitor a brand on X?
Each check is one live call at 2 credits, so 1,000 checks cost 2,000 credits. Paging through more results adds one call per page. Plan prices divide into that, so the dollar cost depends on your plan, and the table on this page lists it for every paid plan.
Does the search see every post on X?
No. The search runs on X's own index, which is not an archive and leaves some posts out, so an empty result means the post is not in the index, not that it was never written. Use the Latest tab for anything you count, because Top is ranked by X and deliberately partial.
Why does my X call return 403?
A 403 means the key lacks the scope the endpoint needs, and the missing scope is named in error.details. Live X endpoints require scrape:live. It is a sensitive scope that keys do not receive by default, and calls made with it are audited. Enable it for your monitoring key and keep that key on your server only.