Scraper APIX
x.post
One public X (Twitter) post: text, time, author, like, reply, repost, quote and view counts, links and media.
- Id
x.post- Version
- 1
- Billed per
- request — 1 unit for a charged run
- Runs
- within one request
Start it with POST /v1/scrapers/x.post/runs. How runs work is in Running a scraper; what a run costs is in Usage and units.
Inputs
The fields of input. A field that is not listed here is refused.
| Field | Type | Description |
|---|---|---|
url | string | The post's address, e.g. https://x.com/jack/status/20 (a twitter.com address works too).Limit: at most 2048 characters. |
post_id | string | The post's id instead: the digits at the end of its address.Limit: at most 20 characters. |
Record fields
Every record of a run has these fields. A value that is not known is null — never an empty string and never 0.
| Field | Type | Notes |
|---|---|---|
id | string | X's id of the post. |
url | string | The post's address. |
text | string or null | The post's text as written. Links appear in X's short form (t.co); urls gives where they lead. |
created_at | string (date-time) or null | When the post was published, in UTC. |
language | string or null | The language X detects in the text, e.g. en; null when the page does not say. |
author_username | string or null | The handle of the account that posted it, without the @. |
author_name | string or null | That account's display name. |
author_id | string or null | X's numeric id of that account. |
author_verified | boolean or null | True when that account carries a verification badge. |
like_count | integer or null | Number of likes. |
reply_count | integer or null | Number of replies. |
repost_count | integer or null | Number of reposts. |
quote_count | integer or null | Number of posts that quote this one. |
bookmark_count | integer or null | Number of bookmarks; null where the page does not state it. |
view_count | integer or null | Number of views; null where the page does not state it. |
hashtags | array of string | The hashtags written in the text, without the #, in order. |
mentions | array of string | The handles the text mentions, without the @, in order. |
urls | array of string | The full addresses of the links in the text, in order. |
media | array of object | The post's photos, videos and GIFs, in order. |
type (in media[]) | "photo" | "video" | "animated_gif" | photo, video or animated_gif. |
url (in media[]) | string | The photo, or the preview image of a video or GIF. |
video_url (in media[]) | string or null | The video file with the highest bitrate (MP4), for a video or GIF. |
duration_ms (in media[]) | integer or null | Length of a video in milliseconds. |
width (in media[]) | integer or null | Width in pixels of the original. |
height (in media[]) | integer or null | Height in pixels of the original. |
alt_text (in media[]) | string or null | The description the author gave the image, when there is one. |
quoted_post_id | string or null | The id of the post this one quotes, when it quotes one. |
possibly_sensitive | boolean or null | True when X marks the post's media as possibly sensitive. |
fetched_at | string (date-time) | When the page was read, in UTC. |
Example request
# Start a run and wait up to 60 seconds for it to finish
curl -X POST "https://api.enrichednow.com/v1/scrapers/x.post/runs?wait=60" \
-H "Authorization: Bearer $ENRICHEDNOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{"input":{"url":"https://x.com/jack/status/20"}}'
# Read its records, with the id the first call answered
curl "https://api.enrichednow.com/v1/runs/$RUN_ID/records?limit=100" \
-H "Authorization: Bearer $ENRICHEDNOW_API_KEY"from enrichednow import EnrichedNow
client = EnrichedNow() # reads ENRICHEDNOW_API_KEY
# Start a run, wait for it to end, and get its records
result = client.scrape("x.post", {
"url": "https://x.com/jack/status/20",
})
print(result.run.id, result.run.status, result.run.record_count)
# Read its records: pages are fetched as you go
for record in result.records:
print(record)Install it with pip install enrichednow, then save as run.py and run python3 run.py
import EnrichedNow from "enrichednow";
const client = new EnrichedNow(); // reads ENRICHEDNOW_API_KEY
// Start a run, wait for it to end, and get its records
const { run, records } = await client.scrape("x.post", {
url: "https://x.com/jack/status/20",
});
console.log(run.id, run.status, run.record_count);
// Read its records: pages are fetched as you go
for await (const record of records) console.log(record);Install it with npm install enrichednow, then save as run.mjs and run node run.mjs
package main
import (
"context"
"fmt"
"log"
"time"
enrichednow "github.com/enrichednow/enrichednow-go"
)
func main() {
client, err := enrichednow.NewClient() // reads ENRICHEDNOW_API_KEY
if err != nil {
log.Fatal(err)
}
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute)
defer cancel()
// Start a run, wait for it to end, and get its records
run, records, err := client.Scrape(ctx, "x.post", map[string]any{"url": "https://x.com/jack/status/20"})
if err != nil {
log.Fatal(err)
}
fmt.Println(run.ID, run.Status, run.RecordCount)
// Read its records: pages are fetched as you go
for records.Next() {
fmt.Println(string(records.Current()))
}
if err := records.Err(); err != nil {
log.Fatal(err)
}
}Install it with go get github.com/enrichednow/enrichednow-go@latest, then save as run.go and run go run run.go
import com.enrichednow.EnrichedNowClient;
import com.enrichednow.ScrapeResult;
import java.util.Map;
public class Run {
public static void main(String[] args) {
EnrichedNowClient client = EnrichedNowClient.fromEnv(); // reads ENRICHEDNOW_API_KEY
// Start a run, wait for it to end, and get its records
ScrapeResult result = client.scrape("x.post", Map.of("url", "https://x.com/jack/status/20"));
System.out.println(result.run().id() + " " + result.run().status() + " " + result.run().recordCount());
// Read its records: pages are fetched as you go
for (Map<String, Object> record : result.records()) {
System.out.println(record);
}
}
}Add com.enrichednow:enrichednow-java:0.4.0 to your Maven or Gradle build, then save as Run.java
enrichednow run x.post --input url=https://x.com/jack/status/20Install it with curl -fsSL https://raw.githubusercontent.com/enrichednow/enrichednow-cli/main/install.sh | sh
It starts a run with this scraper’s example input, waits for it to finish and reads its records a page at a time. The key is read from ENRICHEDNOW_API_KEY.
The body on its own:
{
"input": {
"url": "https://x.com/jack/status/20"
}
}Example response
The run, once it has ended. A run that has not ended within wait comes back with 202 and the status queued or running.
{
"id": "run_841742f37553189ff9c27ba1",
"scraper_id": "x.post",
"scraper_version": 1,
"status": "ok",
"reason": null,
"input": {
"url": "https://x.com/jack/status/20"
},
"record_count": 1,
"units": 1,
"units_per_request": 1,
"units_per_record": null,
"units_per_page": null,
"diagnostics": {
"requests": 1,
"bytes": 259214,
"wall_ms": 885,
"facts": {}
},
"created_at": "2026-11-16T22:37:50.170950Z",
"started_at": "2026-11-16T22:37:50.178331Z",
"finished_at": "2026-11-16T22:37:51.066313Z"
}Its records, from GET /v1/runs/{id}/records. The record is a real one: this scraper's own parser read it from a page recorded from the site.
{
"records": [
{
"id": "20",
"url": "https://x.com/jack/status/20",
"text": "just setting up my twttr",
"created_at": "2006-03-21T20:50:14Z",
"language": "en",
"author_username": "jack",
"author_name": "jack",
"author_id": "12",
"author_verified": true,
"like_count": 325022,
"reply_count": 19260,
"repost_count": 126409,
"quote_count": 8040,
"bookmark_count": 25558,
"view_count": null,
"hashtags": [],
"mentions": [],
"urls": [],
"media": [],
"quoted_post_id": null,
"possibly_sensitive": null,
"fetched_at": "2026-11-19T18:07:42.682944Z"
}
],
"next_cursor": null
}A run does not always end ok. Results and statuses lists every status and the reasons every scraper shares; the reasons of the X scrapers are in their own section there.