Scraper APIX
x.profile
A public X (Twitter) account's profile: names, bio, location, link, badge, follower, following and post counts, and its recent posts.
- Id
x.profile- Version
- 1
- Billed per
- request — 1 unit for a charged run
- Runs
- within one request
Start it with POST /v1/scrapers/x.profile/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 |
|---|---|---|
usernamerequired | string | The account's handle, e.g. NASA or @NASA, or its profile address (https://x.com/NASA).Limit: at most 200 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 |
|---|---|---|
username | string | The account's handle, without the @, as X writes it. |
url | string | The profile's address. |
user_id | string or null | X's numeric id of the account. |
name | string or null | The display name. |
bio | string or null | The profile's bio text; null when the account wrote none. |
location | string or null | The location the account wrote on its profile, as written. |
website | string or null | The link on the profile, in full; null when there is none. |
verified | boolean or null | True when the profile carries a verification badge. |
verified_type | string or null | The kind of badge when X states one: Business or Government; null for an individual's badge or none. |
protected | boolean or null | True when the account's posts are shown only to followers it approved. |
follower_count | integer or null | Number of followers. |
following_count | integer or null | Number of accounts this one follows. |
post_count | integer or null | Number of posts the account has published. |
media_count | integer or null | Number of the account's posts that carry a photo or a video. |
created_at | string (date-time) or null | When the account was created, in UTC. |
avatar_url | string or null | The profile picture. |
banner_url | string or null | The banner image across the top of the profile; null when there is none. |
affiliation | string or null | The organisation whose badge the profile shows beside its name, when it shows one. |
recent_posts | array of object | The account's own posts that the profile page carries for a visitor who is not signed in: a handful, a pinned post first and then newest first, without replies. Empty for a protected account. |
id (in recent_posts[]) | string | X's id of the post. |
url (in recent_posts[]) | string | The post's address. |
text (in recent_posts[]) | 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 (in recent_posts[]) | string (date-time) or null | When the post was published, in UTC. |
language (in recent_posts[]) | string or null | The language X detects in the text, e.g. en; null when the page does not say. |
author_username (in recent_posts[]) | string or null | The handle of the account that posted it, without the @. |
author_name (in recent_posts[]) | string or null | That account's display name. |
author_id (in recent_posts[]) | string or null | X's numeric id of that account. |
author_verified (in recent_posts[]) | boolean or null | True when that account carries a verification badge. |
like_count (in recent_posts[]) | integer or null | Number of likes. |
reply_count (in recent_posts[]) | integer or null | Number of replies. |
repost_count (in recent_posts[]) | integer or null | Number of reposts. |
quote_count (in recent_posts[]) | integer or null | Number of posts that quote this one. |
bookmark_count (in recent_posts[]) | integer or null | Number of bookmarks; null where the page does not state it. |
view_count (in recent_posts[]) | integer or null | Number of views; null where the page does not state it. |
hashtags (in recent_posts[]) | array of string | The hashtags written in the text, without the #, in order. |
mentions (in recent_posts[]) | array of string | The handles the text mentions, without the @, in order. |
urls (in recent_posts[]) | array of string | The full addresses of the links in the text, in order. |
media (in recent_posts[]) | array of object | The post's photos, videos and GIFs, in order. |
type (in recent_posts[].media[]) | "photo" | "video" | "animated_gif" | photo, video or animated_gif. |
url (in recent_posts[].media[]) | string | The photo, or the preview image of a video or GIF. |
video_url (in recent_posts[].media[]) | string or null | The video file with the highest bitrate (MP4), for a video or GIF. |
duration_ms (in recent_posts[].media[]) | integer or null | Length of a video in milliseconds. |
width (in recent_posts[].media[]) | integer or null | Width in pixels of the original. |
height (in recent_posts[].media[]) | integer or null | Height in pixels of the original. |
alt_text (in recent_posts[].media[]) | string or null | The description the author gave the image, when there is one. |
quoted_post_id (in recent_posts[]) | string or null | The id of the post this one quotes, when it quotes one. |
possibly_sensitive (in recent_posts[]) | boolean or null | True when X marks the post's media as possibly sensitive. |
fetched_at (in recent_posts[]) | string (date-time) | When the page was read, in UTC. |
fetched_at | string (date-time) | When the profile 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.profile/runs?wait=60" \
-H "Authorization: Bearer $ENRICHEDNOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{"input":{"username":"BBCWorld"}}'
# 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.profile", {"username": "BBCWorld"})
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.profile", { username: "BBCWorld" });
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.profile", map[string]any{"username": "BBCWorld"})
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.profile", Map.of("username", "BBCWorld"));
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.profile --input username=BBCWorldInstall 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": {
"username": "BBCWorld"
}
}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.profile",
"scraper_version": 1,
"status": "ok",
"reason": null,
"input": {
"username": "BBCWorld"
},
"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": [
{
"username": "BBCWorld",
"url": "https://x.com/BBCWorld",
"user_id": "742143",
"name": "BBC News (World)",
"bio": "News, features and analysis from the World's newsroom. Breaking news, follow @BBCBreaking. UK news, @BBCNews. Latest sports news @BBCSport",
"location": "London, UK",
"website": "http://www.bbc.com/news",
"verified": true,
"verified_type": "Business",
"protected": false,
"follower_count": 42365039,
"following_count": 17,
"post_count": 413114,
"media_count": 27349,
"created_at": "2007-02-01T07:44:29Z",
"avatar_url": "https://pbs.twimg.com/profile_images/1529107170448523264/q3VwEx38_normal.jpg",
"banner_url": "https://pbs.twimg.com/profile_banners/742143/1663658662",
"affiliation": "BBC News (UK)",
"recent_posts": [
{
"id": "2123109427188244685",
"url": "https://x.com/BBCWorld/status/2123109427188244685",
"text": "Minister criticises Belfast IT firm's notification delay over credit unions data breach https://t.co/l2kUaxTwOK",
"created_at": "2026-11-18T17:41:47Z",
"language": "en",
"author_username": "BBCWorld",
"author_name": "BBC News (World)",
"author_id": "742143",
"author_verified": true,
"like_count": 17,
"reply_count": 1,
"repost_count": 5,
"quote_count": 0,
"bookmark_count": 2,
"view_count": 37078,
"hashtags": [],
"mentions": [],
"urls": [
"https://bbc.in/4C9xfaf"
],
"media": [],
"quoted_post_id": null,
"possibly_sensitive": false,
"fetched_at": "2026-11-19T18:07:42.685306Z"
},
{
"id": "2123099226917707977",
"url": "https://x.com/BBCWorld/status/2123099226917707977",
"text": "Inside the old gas pipeline where Ukraine is fighting an underground war https://t.co/SRlTvnqLK1",
"created_at": "2026-11-18T17:01:15Z",
"language": "en",
"author_username": "BBCWorld",
"author_name": "BBC News (World)",
"author_id": "742143",
"author_verified": true,
"like_count": 64,
"reply_count": 11,
"repost_count": 17,
"quote_count": 0,
"bookmark_count": 4,
"view_count": 44791,
"hashtags": [],
"mentions": [],
"urls": [
"https://bbc.in/4jpeMzb"
],
"media": [],
"quoted_post_id": null,
"possibly_sensitive": false,
"fetched_at": "2026-11-19T18:07:42.685306Z"
}
],
"fetched_at": "2026-11-19T18:07:42.685306Z"
}
],
"next_cursor": null
}What was done to the record for this page, and nothing else — the API returns every value whole. A text that was cut ends with … [truncated].
- Shortened:
recent_posts: 5 items, the first 2 shown.
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.