Skip to main content
Read public X data as JSON with POST /v1/social/x/{action}. {action} picks what to read. A completed request costs 0.5 credits.

Request

The request waits for the result, up to 290 seconds, and answers 200 with the result in response. A task still running answers 202; poll GET /v1/async/task/{id} or set webhook. See Async tasks.

Actions

tweetId takes a tweet ID or a tweet URL, such as https://x.com/NASA/status/1585341984679469056. postUrl and url take the same values. username takes a username, an @username or a profile URL, which url also takes.

Parameters

A request with a parameter of another action, a value outside the ones listed below, or a missing required field is refused when you submit it, with 400 VALIDATION_ERROR naming the field. profile:
  • limit: Optional integer from 1 to 20, default 20, the most tweets to return. X shows a profile’s newest tweets, about 5, so a profile returns that many.

Response example

Result fields

  • Every response echoes platform and action. profile carries returnedCount.
  • A tweet has tweetId, url, text, lang, createdAt, author (id, handle, displayName, verified, verifiedType, avatarUrl, followerCount), hashtags, mentions, links, media, likeCount, retweetCount, quoteCount, replyCount and bookmarkCount.
    • text is the full text of a long tweet, with short links opened to their addresses.
    • media lists each type with its url, previewUrl, width, height, durationMs for a video and altText when set. A video’s url is its highest quality file.
    • viewCount appears when X shows it. A reply adds inReplyTo with the handle and tweetId it answers, and a quote adds quotedTweet.
  • tweet returns tweet.
  • profile returns userId, username, displayName, url, bio, location, website, avatarUrl, bannerUrl, verified, verifiedType, protected, createdAt, followerCount, followingCount, tweetCount, mediaCount and tweets. Each tweet in tweets carries pinned, true for the tweet the profile pinned.
  • A tweet or account that does not exist, a deleted tweet, and a protected or suspended account end the task with PAGE_UNAVAILABLE. Only completed requests are charged.

HTML page

Set include.html to true and the result gains html, a link to the X page the answer was read from, saved as a file you can put in a report. html has status, url and expiresAt, described in HTML pages.
  • include.html works on tweet and profile.
  • The file is the HTML document X sent for the page, before any script ran. It starts with a note comment, Saved by querying.ai: the page X served for task <id> at <UTC time>, the page as X sent it, before any script ran, the address of the visit and its session ids masked.
  • Values that belong to the visit are replaced with zeros of the same length: cookie values, session, request and device ids, CSRF and other tokens, nonces and the signatures in media addresses. Because those signatures are masked, the image and video links in the file do not load. Content that depends on where the visit came from, such as the regional CDN host names in media addresses, stays as X sent it.
  • The document’s scripts are kept as text. The file is served with a Content-Security-Policy that runs no script and loads no outside resource.
  • X sends the main content as markup, so the opened file is readable.
  • tweet keeps the page at x.com/<user>/status/<id>, and profile keeps x.com/<user>.
  • The page costs nothing extra: the request is still 0.5 credits.
  • When the page cannot be kept, the answer is still returned and html is { "status": "failed", "error": "EVIDENCE_FAILED" }. Resubmit the task to try again.