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.
https://api.scrapefield.com/v1/x/postshttps://api.scrapefield.com/v1/x/posts?username=FerrariIn your code
const params = new URLSearchParams({
"username": "nasa"
});
const res = await fetch(`https://api.scrapefield.com/v1/x/posts?${params}`, {
headers: { Authorization: `Bearer ${process.env.SCRAPEFIELD_KEY}` },
});
const { data, meta } = await res.json();
console.log(data, meta.credits_charged);Parameters
| Parameter | What it does |
|---|---|
username | The account's username, without the @. |
url | The account's profile URL. |
community_url | A community's URL, https://x.com/i/communities/<id>: its latest posts. |
cursor | The meta.next_cursor from the previous page. Omit for the first page. |
fresh | Skip the cache and fetch now. Charged normally. Not available on trial credits — buy any pack to unlock it. default false |
Response
Returns an array of x_post. This is the demo’s answer, the one the playground above returns, in full rather than abbreviated — including the fields that come back null, because a field is null when the platform does not show it and you should know which ones those are before you build on them. A call with your key returns the account you ask for.
{
"data": [
{
"id": "1964670745051766126",
"url": "https://x.com/bluedoorcoffee/status/1964670745051766126",
"text": "Three days of proofing and it finally behaved. #baking",
"created_at": "2026-09-04T12:08:48.000Z",
"lang": "en",
"author": {
"id": "135406766941239442",
"username": "bluedoorcoffee",
"name": "Bluedoorcoffee",
"profile_url": "https://x.com/bluedoorcoffee",
"profile_image_url": "https://cdn.example/x/CQN8RZXlRjtG.jpg",
"verified": false
},
"conversation_id": "1964670745051766126",
"referenced_tweets": [],
"public_metrics": {
"retweet_count": 648,
"reply_count": 17,
"like_count": 4913,
"quote_count": 24,
"bookmark_count": 85,
"impression_count": 338997
},
"media": [],
"hashtags": [
"baking"
],
"mentions": []
},
{
"id": "1979622433458399561",
"url": "https://x.com/bluedoorcoffee/status/1979622433458399561",
"text": "Three days of proofing and it finally behaved. #filmphoto",
"created_at": "2026-09-08T00:57:05.000Z",
"lang": "en",
"author": {
"id": "229660586826579451",
"username": "bluedoorcoffee",
"name": "Bluedoorcoffee",
"profile_url": "https://x.com/bluedoorcoffee",
"profile_image_url": "https://cdn.example/x/-zDYs-aMaG2v.jpg",
"verified": true
},
"conversation_id": "1979622433458399561",
"referenced_tweets": [],
"public_metrics": {
"retweet_count": 184,
"reply_count": 278,
"like_count": 2292,
"quote_count": 30,
"bookmark_count": 46,
"impression_count": 64176
},
"media": [],
"hashtags": [
"filmphoto"
],
"mentions": []
}
],
"meta": {
"request_id": "req_7f3ac1e94b2d40f8a1c6e5d2",
"credits_charged": 13,
"credits_remaining": 74218,
"cached": false,
"fetched_at": "2026-09-20T09:12:03Z",
"next_cursor": "eyJwIjoxLCJzIjoiYTNmOSJ9"
}
}Fields of x_post
A post on X: a post, a reply or a quote. Named after X's API v2.
| Field | What it is |
|---|---|
id | X's id for the post. |
url | The post on X. |
text | The whole text. Links stay as X shortens them. |
created_at | When it was posted. null when the source does not say. |
lang | The language X detected, e.g. en. |
author | Who posted it. |
author.id | X's numeric id for the account. |
author.username | Without the @. |
author.name | The display name. |
author.profile_url | The account on X. |
author.profile_image_url | The profile picture, at full size. |
author.verified | Whether the account has a checkmark. |
conversation_id | The first post of the thread it belongs to. |
referenced_tweets | The post it replies to, quotes or reposts, as X's API names them. |
referenced_tweets[].type | How this post refers to it: a reply, a quote or a repost. replied_to · quoted · retweeted |
referenced_tweets[].id | X's id for that post. |
public_metrics | null where the source does not give one. |
public_metrics.retweet_count | Reposts. |
public_metrics.reply_count | Replies. |
public_metrics.like_count | Likes. |
public_metrics.quote_count | Quotes. |
public_metrics.bookmark_count | Bookmarks. |
public_metrics.impression_count | Views. |
media | Photos and videos, in order. |
media[].type | null where the source does not say.photo · video · animated_gif |
media[].url | The image, or a video's preview image. |
hashtags | Without the #. |
mentions | Usernames, without the @. |
What it costs
13 credits (3 with community_url) per successful call, whether we fetch it or serve it from cache — you pay for the answer, not for how we produced it. Responses are cached for 1 hour and a cached one tells you when the data was actually fetched. A call we fail costs 0 and is refunded automatically.
On the smallest pack that is $10.14 per 1,000 calls; on the largest, $5.72. The full table.
What people build with it
Questions
How much does the X (Twitter) user tweets API cost?
From 3 to 13 credits a call, depending on what you ask for: $2.34 to $10.14 per 1,000 calls on the smallest pack, $1.32 to $5.72 on the largest. A call that fails costs nothing, and the refund is automatic. A cached answer costs the same as a fresh one. Credits are bought in packs and never expire; there is no subscription.
Do I need a X account, a login or cookies?
No. You need a key from us and nothing from X. We never take a customer's login, cookies or session, at any price, and no account of yours is ever at risk.
Can I try it without signing up?
Yes. Add demo=true and leave the key out, or press Send request in the playground on this page. The demo answers with a real answer about Ferrari, captured once a week, in exactly the shape a live call returns, whatever you ask, and charges nothing.
How fresh is the data?
An answer is kept for up to 1 hour, and a cached one says when it was fetched, in meta.fetched_at. Add fresh=true to fetch it again now, at the same price; it needs any purchase, not the trial.
What does it return?
A list of x_post objects. Its fields are named after X's API v2. A field is null when X does not show it, never missing. Every field is described on this page.
How do I get more than one page?
Pass meta.next_cursor back as cursor, and stop when it is null. Each page is a call, priced the same. A cursor lasts as long as the answer it belongs to is cached.
Can an AI agent call it?
Yes: it is the MCP tool get_x_posts on our MCP server, with the same parameters, answer and price. Without a key, the tool answers from the demo.