What you get#
Onekey exposes X as 18 endpoints behind one API key: 8 endpoints return one record (data is an object) and 10 endpoints return a list (data is an array). Every answer uses the same envelope (success, data, metadata, error), the cost is reported in metadata.credits_charged, and fields are mapped onto the unified schema so the code you write for X also works for the rest of the social networks category.
Endpoints#
| Endpoint | What it does | Parameters | Credits | Status |
|---|---|---|---|---|
ai_search | AI-assisted search across X posts, returning matching posts. | query* | 3 | beta needs a pack |
community | Get X community details. | url* | 2 | beta needs a pack |
community_tweets | List X community tweets. | url* | 2 | beta needs a pack |
followers | Followers of an X user (first page). | handle* | 2 | stable may need a pack |
following | Accounts followed by an X user (first page). | user_id*, query_id | 5 | beta needs a pack |
oembed | oEmbed for a public tweet: author, embed text and date (official publish.twitter.com). | id* | 1 | stable |
profile | Fetch an X (Twitter) user's public profile. | handle* | 2 | beta may need a pack |
profile_full | X (X) profile, recent posts, and computed analytics in one call. | handle* | 2 | beta needs a pack |
retweeters | Accounts that retweeted a tweet (first page). | id*, query_id, cursor | 3 | beta needs a pack |
search | Search recent tweets by keyword or hashtag. | q* | 2 | stable may need a pack |
search_users | Search X users. | query*, cursor | 2 | beta needs a pack |
status | A tweet with full engagement counts (likes, replies, reposts, bookmarks, quotes, views). | id* | 1 | stable may need a pack |
thread | The conversation thread around a tweet (author's self-thread / replies chain). | id* | 2 | stable may need a pack |
tweet | A single public tweet via X syndication: text, author, likes, reply count, date. | id* | 1 | stable may need a pack |
tweet_transcript | Get X video transcript. | url* | 2 | beta needs a pack |
user | Public profile for an X handle: followers, following, bio, avatar. | handle* | 1 | stable may need a pack |
user_media | List X user media tweets. | handle*, cursor | 2 | beta needs a pack |
user_tweets | Recent tweets posted by an X user. | handle* | 2 | stable may need a pack |
A * marks a required parameter. Each endpoint name links to its reference page with the full parameter table, caching window and a recorded response.
Make a request#
This calls x.oembed (1 credit, stable). Replace YOUR_API_KEY with your key; sign up, no card. 1,000 free credits cover the open-platform endpoints. Hard-to-reach platforms (X, TikTok, Instagram, Reddit, and others marked on their page) need a verified email and a purchased pack.
curl "https://api.onekey.dev/v1/x/oembed?id=20" \
-H "x-api-key: YOUR_API_KEY"Fields you get back#
These unified fields come back from X, with the same names as on every other platform. The count is how many of its 18 mapped endpoints return the field; a field the source lacks is null, never missing. 5 platform-specific fields (ext.<name>) come on top, documented on each endpoint page.
| Field | Type | Endpoints |
|---|---|---|
author.username | string | 15 |
content.text | string | 14 |
author.displayName | string | 13 |
author.id | string | 12 |
author.followers | integer | 11 |
author.avatarUrl | URL | 10 |
engagement.comments | integer | 10 |
author.verified | boolean | 9 |
engagement.likes | integer | 9 |
content.createdAt | ISO 8601 date | 8 |
content.id | string | 8 |
content.url | URL | 8 |
engagement.shares | integer | 7 |
engagement.views | integer | 7 |
content.language | string | 6 |
author.following | integer | 4 |
author.url | URL | 4 |
engagement.bookmarks | integer | 4 |
engagement.quotes | integer | 4 |
content.title | string | 3 |
media.thumbnailUrl | URL | 3 |
author.bio | string | 1 |
author.contentCount | integer | 1 |
entity.createdAt | ISO 8601 date | 1 |
entity.description | string | 1 |
entity.id | string | 1 |
entity.name | string | 1 |
entity.url | URL | 1 |
media.durationSeconds | number | 1 |
The full schema is in Unified schema.
Pricing#
X calls cost 1 to 5 credits, flat per endpoint. Free when served from cache (0.2 credit for a cached response over 100 KB). Invalid, failed or not-found calls are not charged. See pricing for credit packs.