Skip to main content
POST
Scrape an X profile's posts
Scrape an X profile’s posts. The profile or user is identified by its URL or username.

Request

Exactly one of profileUrl or username is required. A request that sets both, or none, fails with invalidRequest.

Response

If successful, the response body contains the standard envelope. data contains order, results and cursor. The following example is a real response, truncated: each list shows one item and long strings are cut.
For every field, see the response schema on this page.
Newest first, about 20 a page, with a pinned post on top of the first page. A repost comes back as the original post with isRepost set. For some profiles X shows about 100 popular posts in one page instead, and order says popular.

Optional parameters

Billing

Each successful request consumes 1 credit, regardless of the number of items returned. Requests that fail, or that return no items, are not billed.

Pagination

Results are paginated. To retrieve the next page, pass the value of data.cursor as cursor in a subsequent request. A response that omits cursor is the last page.
  • X X Profile: Accepts username. Scrape an X profile.
  • X X Post: Accepts postUrl. Scrape an X post.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

maxTextLength
integer

Cut every text value in the response to this many characters. A value that was cut ends with …, and a page whose text was cut has isTruncated set to true. A screenshot is never cut. Leave it out to get the full text.

Required range: x >= 1

Body

application/json
profileUrl
string

Link to the X profile, like https://x.com/nasa. Send this or username.

username
string

X profile handle, like nasa. Send this or profileUrl.

cursor
string

The cursor from the previous response. Send it as is.

Minimum string length: 1

Response

The data, and the credits this call used.

success
any
required
data
object
required
creditsUsed
integer
required
requestId
string
required