X (Twitter)

The X (Twitter) API for mentions, replies, and DMs

Get every tweet that mentions you, manage the replies under your posts, and read and send DMs through the same unified API you use for every other platform. You bring your own X developer app (a ten-minute setup), which means your own rate-limit bucket instead of a shared one.

Free tier available
Instant API key
MCP server included

See it in action.

List mentions of your X account

api.social-api.ai
1curl "https://api.social-api.ai/v1/accounts/<x-account-id>/mentions?limit=10" \
2  -H "Authorization: Bearer <your-api-key>" | jq
3
4# Response
5{
6  "data": [
7    {
8      "id": "sapi_mnt_GXRM4BNTW7KFYSD3HAEV6QJZ2CLP9U",
9      "type": "mention",
10      "author": { "username": "someuser", "name": "Some User" },
11      "content": { "text": "@yourhandle just tried your API, love it" },
12      "received_at": "2026-03-20T18:00:00Z"
13    }
14  ],
15  "next_cursor": "..."
16}

Pull every tweet mentioning your account through the same GET /v1/accounts/{id}/mentions endpoint used for Instagram and Facebook mentions.

What you can do with X (Twitter).

Supported

Comments

Read replies on your tweets, reply back, and hide or delete your own replies. Liking a reply is not available; X removed like and unlike writes from self-serve API tiers.

Supported

Direct Messages

Read DM conversations and send messages through the same unified inbox you use for Instagram and Facebook messaging.

Supported

Mentions

Fetch tweets mentioning your authenticated account through a dedicated endpoint, scoped to that account.

Supported

Publishing

Text tweets today; media upload is not yet available through the connector.

The official API vs one API key.

Rate limits

the X API v2 (raw)

Per-app buckets you track yourself across every endpoint tier.

With SocialAPI.ai

Your own app's bucket, never shared with other customers. Platform throttling surfaces as a clear 429 that does not touch your SocialAPI.ai quota.

Data shape

the X API v2 (raw)

Tweet objects with expansions, includes arrays, and pagination tokens to stitch together.

With SocialAPI.ai

One normalized schema for mentions, replies, and DMs, identical to every other platform.

OAuth setup

the X API v2 (raw)

OAuth 2.0 with PKCE, token refresh, and scope management in your own code.

With SocialAPI.ai

Paste your app's Client ID and Secret once; account connection and token refresh are handled.

Multi-platform

the X API v2 (raw)

An X-only integration you maintain separately from Meta, Google, and the rest.

With SocialAPI.ai

The same /v1/inbox and /v1/posts endpoints cover X plus nine other platforms.

Good to know.

Posts are text-only today. Media upload, polls, and quote tweets are not yet available through the connector.

X does not expose a public edit endpoint to self-serve apps; editing is gated to Enterprise. UpdatePost returns 501 for X accounts, so delete and re-create when you need to change a tweet.

Liking or unliking a reply is not available. X removed like and unlike writes from all self-serve API tiers.

X is BYOK: you bring your own X developer app because X scopes rate limits per app. A shared SocialAPI.ai app would put every customer on the same quota.

Why developers love X (Twitter) on SocialAPI.ai

1

Mention tracking

Fetch every tweet mentioning your authenticated account through a dedicated endpoint, scoped to that account rather than your whole workspace. Poll it on a schedule to build brand monitoring, a support queue, or an automated triage workflow, the same way you would for Instagram or Facebook mentions.

2

Reply and thread management

Read the replies under your tweets, post a reply back, and hide or delete your own replies through the same comment endpoints used across every other platform. Liking a reply is not available: X removed like and unlike writes from its self-serve API tiers and reserved them for Enterprise.

3

Direct messages

List DM conversations, read message history, and send replies through the unified inbox endpoint, the same request and response shape you already use for Instagram and Facebook messaging. An X integration does not need its own code path.

4

Your own rate-limit bucket

X scopes API access per developer app, so every customer routed through one shared app would compete for the same quota. Bring your own X developer app, about ten minutes to set up, and your calls draw from a bucket only you use.

5

One schema, same as every other platform

Mentions, replies, and DMs on X come back in the same normalized schema used by Instagram, Facebook, LinkedIn, and every other connected platform. Build your inbox logic once and it works whether the event came from X or anywhere else.

Simple, honest pricing.

Reading comments, DMs, and mentions is free and unlimited on every plan. Paid plans start at $29/mo with unlimited posts and interactions. The free tier needs no credit card.

FAQ

Frequently asked questions.

Does X (Twitter) have a free API?

X's own API free tier is write-only: it lets you post but not read tweets, replies, mentions, or DMs, so a free X developer app cannot power a read-heavy integration on its own. X now prices paid access on usage rather than a flat monthly subscription, so cost scales with call volume. SocialAPI.ai's own plans start free and include X, but your X developer app still needs a paid X tier to read mentions and replies.

How do I get mentions from the X API?

Call GET /v1/accounts/{account_id}/mentions with your SocialAPI.ai API key and the ID of your connected X account. It returns tweets mentioning that account, newest first, in the same format used for mentions on Instagram and Facebook.

Can I send DMs through the X API?

Yes. List conversations and send messages through the same /v1/inbox/conversations endpoints used for Instagram and Facebook DMs. Your X developer app needs the dm.read and dm.write scopes enabled.

Why do I need my own X developer app?

X scopes rate limits per developer app, so every SocialAPI.ai customer sharing one app would compete for the same quota. Bringing your own app, about ten minutes to register and connect, gives you an independent rate-limit bucket aligned with whatever X access tier you are on.

Can I post tweets with images or video?

Not yet. The connector supports text-only tweets today, including threaded replies chained after the root tweet. Media upload is not implemented, so image and video attachments on a post are ignored.

Can AI agents read my X mentions?

Yes. The built-in MCP server exposes inbox reads, including mentions, as tools, so Claude and other MCP-capable agents can pull your X mentions and draft replies inside your existing approval flow.

Get started today

Ready to unify your social interactions?

Free tier available · No credit card required · Ships with MCP server

We use essential cookies for security, and analytics cookies with your consent. Privacy Policy.