X

Get an X account's or community's posts

Fetch an account's newest posts, about 20 a page with next_cursor for older ones; or, with community_url, the latest posts in a community, one window. Each post has its text, created_at, public_metrics (likes, reposts, replies, quotes, bookmarks, views), media, hashtags and mentions.

Give exactly one of username or url or community_url to identify the source.

Costs 13 credits (3 with community_url), whether the answer is fetched or served from cache. A failed call is refunded automatically.

get/x/posts

Request

  • Base URL: https://api.scrapefield.com/v1
  • URL: https://api.scrapefield.com/v1/x/posts
  • Auth: one of:
    • HTTP bearer
    • none

Query parameters

usernamestring
Example:nasa

The account's username. A leading @ is fine.

urlstring

The account's profile URL.

community_urlstring
Example:https://x.com/i/communities/1471580197908586507

A community's URL, https://x.com/i/communities/<id>: its latest posts.

cursorstring

The meta.next_cursor from the previous page. Omit for the first page.

freshboolean

Skip the cache and fetch now. Charged normally. Not available on trial credits — buy any pack to unlock it.

demoboolean

With no key: a fixed demo answer in the same shape, charged nothing.

Response

The request succeeded.

Changes

No recorded changes to this operation across all 1 revision of this API.