# X on Onekey > 18 endpoints for X (8 stable, 10 beta), 1 to 5 credits each. Category: Social networks. One key, one JSON shape. Base URL: https://api.onekey.dev Auth: header `x-api-key: `. Call shape: `GET /v1/{platform}/{endpoint}?{params}`. Every response is `{success, data, metadata, error}`; check `success` first. Cost is in `metadata.credits_charged`. Free when served from cache (0.2 credit for a cached response over 100 KB). Failed and not-found calls are refunded. Status: stable = verified against the live source; beta = not yet verified, fields may be missing. Access: 17 of 18 endpoints are marked "needs a pack" or "may need a pack": free-grant credits reach only the open fetch path; a verified email and a purchased pack unlock the rest. Page: https://onekey.dev/platforms/x Reference (Markdown): https://onekey.dev/docs/api/x.md All docs: https://onekey.dev/llms.txt ## Canonical fields returned Unified-schema fields (same names on every platform), with how many of the 18 mapped X endpoints return each: - `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 - plus 5 platform-specific fields under `ext.` ## Endpoints ### x.ai_search AI-assisted search across X posts, returning matching posts. - Price: 3 credits per fresh call. Status: beta. Access: needs a pack. Returns: a list. - Request: `GET https://api.onekey.dev/v1/x/ai_search?query=coffee` with header `x-api-key: YOUR_API_KEY` - Parameters: - `query` (string, required): Query - Fields returned: `content.id`, `content.url`, `content.title`, `content.text`, `content.createdAt`, `engagement.likes`, `engagement.comments`, `engagement.shares`, `engagement.views`, `media.thumbnailUrl`, `author.username` - Reference: https://onekey.dev/docs/api/x/ai_search.md ### x.community Get X community details. - Price: 2 credits per fresh call. Status: beta. Access: needs a pack. Returns: one record. - Request: `GET https://api.onekey.dev/v1/x/community?url=https%3A%2F%2Fx.com%2Fnasa%2Fstatus%2F1234567890123456789` with header `x-api-key: YOUR_API_KEY` - Parameters: - `url` (string, required): Url (URL) - Fields returned: `entity.id`, `entity.name`, `entity.description`, `entity.url`, `entity.createdAt`, `ext.memberCount` - Reference: https://onekey.dev/docs/api/x/community.md ### x.community_tweets List X community tweets. - Price: 2 credits per fresh call. Status: beta. Access: needs a pack. Returns: a list. - Request: `GET https://api.onekey.dev/v1/x/community_tweets?url=https%3A%2F%2Fx.com%2Fnasa%2Fstatus%2F1234567890123456789` with header `x-api-key: YOUR_API_KEY` - Parameters: - `url` (string, required): Url (URL) - Fields returned: `content.id`, `content.url`, `content.title`, `content.text`, `content.createdAt`, `engagement.likes`, `engagement.comments`, `engagement.shares`, `engagement.views`, `media.thumbnailUrl`, `author.username` - Reference: https://onekey.dev/docs/api/x/community_tweets.md ### x.followers Followers of an X user (first page). - Price: 2 credits per fresh call. Status: stable. Access: may need a pack. Returns: a list. - Request: `GET https://api.onekey.dev/v1/x/followers?handle=jack` with header `x-api-key: YOUR_API_KEY` - Parameters: - `handle` (string, required): X handle without @, e.g. jack - Fields returned: `author.id`, `author.username`, `author.displayName`, `author.followers`, `author.following`, `author.url`, `author.avatarUrl`, `content.text`, `author.verified` - Reference: https://onekey.dev/docs/api/x/followers.md ### x.following Accounts followed by an X user (first page). - Price: 5 credits per fresh call. Status: beta. Access: needs a pack. Returns: a list. - Request: `GET https://api.onekey.dev/v1/x/following?user_id=12` with header `x-api-key: YOUR_API_KEY` - Parameters: - `user_id` (string, required): X numeric user id (rest_id from x.user) - `query_id` (string, optional, default iSicc7LrzWGBgDPL0tM_TQ): GraphQL query id (drifts; override when X rotates it) - Fields returned: `author.id`, `author.username`, `author.displayName`, `author.followers`, `content.text` - Reference: https://onekey.dev/docs/api/x/following.md ### x.oembed oEmbed for a public tweet: author, embed text and date (official publish.twitter.com). - Price: 1 credit per fresh call. Status: stable. Returns: one record. - Request: `GET https://api.onekey.dev/v1/x/oembed?id=20` with header `x-api-key: YOUR_API_KEY` - Parameters: - `id` (string, required): Tweet (status) id - Fields returned: `content.url`, `author.displayName`, `author.url`, `content.text` - Reference: https://onekey.dev/docs/api/x/oembed.md ### x.profile Fetch an X (Twitter) user's public profile. - Price: 2 credits per fresh call. Status: beta. Access: may need a pack. Returns: one record. - Request: `GET https://api.onekey.dev/v1/x/profile?handle=jack` with header `x-api-key: YOUR_API_KEY` - Parameters: - `handle` (string, required): X handle, e.g. jack - Fields returned: `author.id`, `author.username`, `author.displayName`, `author.followers`, `author.following`, `engagement.comments`, `content.text`, `author.avatarUrl` - Reference: https://onekey.dev/docs/api/x/profile.md ### x.profile_full X (X) profile, recent posts, and computed analytics in one call. - Price: 2 credits per fresh call. Status: beta. Access: needs a pack. Returns: one record. - Request: `GET https://api.onekey.dev/v1/x/profile_full?handle=nasa` with header `x-api-key: YOUR_API_KEY` - Parameters: - `handle` (string, required): Handle - Fields returned: `author.id`, `author.username`, `author.displayName`, `author.bio`, `author.followers`, `author.following`, `author.contentCount`, `author.verified`, `author.avatarUrl`, `author.url`, `ext.recentPosts`, `ext.analytics` - Reference: https://onekey.dev/docs/api/x/profile_full.md ### x.retweeters Accounts that retweeted a tweet (first page). - Price: 3 credits per fresh call. Status: beta. Access: needs a pack. Returns: a list. - Request: `GET https://api.onekey.dev/v1/x/retweeters?id=20` with header `x-api-key: YOUR_API_KEY` - Parameters: - `id` (string, required): Tweet (status) id - `query_id` (string, optional, default X-XEqG5qHQSAwmvy20HzTQ): GraphQL query id (drifts; override when X rotates it) - `cursor` (string, optional): Opaque cursor from a previous response's `pagination.next_cursor`. Omit for the first page. - Fields returned: `author.id`, `author.username`, `author.displayName`, `author.followers` - Reference: https://onekey.dev/docs/api/x/retweeters.md ### x.search Search recent tweets by keyword or hashtag. - Price: 2 credits per fresh call. Status: stable. Access: may need a pack. Returns: a list. - Request: `GET https://api.onekey.dev/v1/x/search?q=nasa` with header `x-api-key: YOUR_API_KEY` - Parameters: - `q` (string, required): Search query (supports X search operators) - Fields returned: `content.id`, `content.text`, `content.url`, `content.createdAt`, `content.language`, `author.id`, `author.username`, `author.displayName`, `author.avatarUrl`, `author.followers`, `author.verified`, `engagement.likes`, `engagement.comments`, `engagement.shares`, `engagement.views`, `engagement.bookmarks`, `engagement.quotes` - Reference: https://onekey.dev/docs/api/x/search.md ### x.search_users Search X users. - Price: 2 credits per fresh call. Status: beta. Access: needs a pack. Returns: a list. - Request: `GET https://api.onekey.dev/v1/x/search_users?query=coffee` with header `x-api-key: YOUR_API_KEY` - Parameters: - `query` (string, required): Query - `cursor` (string, optional): Opaque cursor from a previous response's `pagination.next_cursor`. Omit for the first page. - Fields returned: `author.id`, `author.username`, `author.displayName`, `author.followers`, `author.verified`, `author.avatarUrl` - Reference: https://onekey.dev/docs/api/x/search_users.md ### x.status A tweet with full engagement counts (likes, replies, reposts, bookmarks, quotes, views). - Price: 1 credit per fresh call. Status: stable. Access: may need a pack. Returns: one record. - Request: `GET https://api.onekey.dev/v1/x/status?id=1519781379172495360` with header `x-api-key: YOUR_API_KEY` - Parameters: - `id` (string, required): Tweet (status) id - Fields returned: `content.id`, `content.text`, `content.url`, `content.createdAt`, `content.language`, `author.id`, `author.username`, `author.displayName`, `author.avatarUrl`, `author.followers`, `author.verified`, `engagement.likes`, `engagement.comments`, `engagement.shares`, `engagement.views`, `engagement.bookmarks`, `engagement.quotes` - Reference: https://onekey.dev/docs/api/x/status.md ### x.thread The conversation thread around a tweet (author's self-thread / replies chain). - Price: 2 credits per fresh call. Status: stable. Access: may need a pack. Returns: a list. - Request: `GET https://api.onekey.dev/v1/x/thread?id=1519781379172495360` with header `x-api-key: YOUR_API_KEY` - Parameters: - `id` (string, required): Tweet (status) id - Fields returned: `content.id`, `content.text`, `content.url`, `content.createdAt`, `content.language`, `author.id`, `author.username`, `author.displayName`, `author.avatarUrl`, `author.followers`, `author.verified`, `engagement.likes`, `engagement.comments`, `engagement.shares`, `engagement.views`, `engagement.bookmarks`, `engagement.quotes` - Reference: https://onekey.dev/docs/api/x/thread.md ### x.tweet A single public tweet via X syndication: text, author, likes, reply count, date. - Price: 1 credit per fresh call. Status: stable. Access: may need a pack. Returns: one record. - Request: `GET https://api.onekey.dev/v1/x/tweet?id=1519781379172495360` with header `x-api-key: YOUR_API_KEY` - Parameters: - `id` (string, required): Tweet (status) id - Fields returned: `content.id`, `content.text`, `content.createdAt`, `content.language`, `author.id`, `author.username`, `author.displayName`, `author.avatarUrl`, `author.verified`, `engagement.likes`, `engagement.comments` - Reference: https://onekey.dev/docs/api/x/tweet.md ### x.tweet_transcript Get X video transcript. - Price: 2 credits per fresh call. Status: beta. Access: needs a pack. Returns: one record. - Request: `GET https://api.onekey.dev/v1/x/tweet_transcript?url=https%3A%2F%2Fx.com%2Fnasa%2Fstatus%2F1234567890123456789` with header `x-api-key: YOUR_API_KEY` - Parameters: - `url` (string, required): Url (URL) - Fields returned: `content.text`, `content.language`, `media.durationSeconds` - Reference: https://onekey.dev/docs/api/x/tweet_transcript.md ### x.user Public profile for an X handle: followers, following, bio, avatar. - Price: 1 credit per fresh call. Status: stable. Access: may need a pack. Returns: one record. - Request: `GET https://api.onekey.dev/v1/x/user?handle=jack` with header `x-api-key: YOUR_API_KEY` - Parameters: - `handle` (string, required): X handle without @, e.g. jack - Fields returned: `author.id`, `author.username`, `author.displayName`, `author.followers`, `author.following`, `author.url`, `author.avatarUrl`, `author.verified`, `content.text`, `engagement.comments`, `engagement.likes`, `ext.joinedText`, `ext.location` - Reference: https://onekey.dev/docs/api/x/user.md ### x.user_media List X user media tweets. - Price: 2 credits per fresh call. Status: beta. Access: needs a pack. Returns: a list. - Request: `GET https://api.onekey.dev/v1/x/user_media?handle=nasa` with header `x-api-key: YOUR_API_KEY` - Parameters: - `handle` (string, required): Handle - `cursor` (string, optional): Opaque cursor from a previous response's `pagination.next_cursor`. Omit for the first page. - Fields returned: `content.id`, `content.url`, `content.title`, `content.text`, `content.createdAt`, `engagement.likes`, `engagement.comments`, `engagement.shares`, `engagement.views`, `media.thumbnailUrl`, `author.username` - Reference: https://onekey.dev/docs/api/x/user_media.md ### x.user_tweets Recent tweets posted by an X user. - Price: 2 credits per fresh call. Status: stable. Access: may need a pack. Returns: a list. - Request: `GET https://api.onekey.dev/v1/x/user_tweets?handle=NASA` with header `x-api-key: YOUR_API_KEY` - Parameters: - `handle` (string, required): X handle without @, e.g. jack - Fields returned: `content.id`, `content.text`, `content.url`, `content.createdAt`, `content.language`, `author.id`, `author.username`, `author.displayName`, `author.avatarUrl`, `author.followers`, `author.verified`, `engagement.likes`, `engagement.comments`, `engagement.shares`, `engagement.views`, `engagement.bookmarks`, `engagement.quotes` - Reference: https://onekey.dev/docs/api/x/user_tweets.md ## Sample request ```bash curl "https://api.onekey.dev/v1/x/oembed?id=20" \ -H "x-api-key: YOUR_API_KEY" ```