Skip to the content
EnrichedNowDocs

    Type to search every page.

    Menu

    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.

    Inputs of x.profile
    FieldTypeDescription
    usernamerequiredstringThe 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.

    Record fields of x.profile
    FieldTypeNotes
    usernamestringThe account's handle, without the @, as X writes it.
    urlstringThe profile's address.
    user_idstring or nullX's numeric id of the account.
    namestring or nullThe display name.
    biostring or nullThe profile's bio text; null when the account wrote none.
    locationstring or nullThe location the account wrote on its profile, as written.
    websitestring or nullThe link on the profile, in full; null when there is none.
    verifiedboolean or nullTrue when the profile carries a verification badge.
    verified_typestring or nullThe kind of badge when X states one: Business or Government; null for an individual's badge or none.
    protectedboolean or nullTrue when the account's posts are shown only to followers it approved.
    follower_countinteger or nullNumber of followers.
    following_countinteger or nullNumber of accounts this one follows.
    post_countinteger or nullNumber of posts the account has published.
    media_countinteger or nullNumber of the account's posts that carry a photo or a video.
    created_atstring (date-time) or nullWhen the account was created, in UTC.
    avatar_urlstring or nullThe profile picture.
    banner_urlstring or nullThe banner image across the top of the profile; null when there is none.
    affiliationstring or nullThe organisation whose badge the profile shows beside its name, when it shows one.
    recent_postsarray of objectThe 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[])stringX's id of the post.
    url (in recent_posts[])stringThe post's address.
    text (in recent_posts[])string or nullThe 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 nullWhen the post was published, in UTC.
    language (in recent_posts[])string or nullThe language X detects in the text, e.g. en; null when the page does not say.
    author_username (in recent_posts[])string or nullThe handle of the account that posted it, without the @.
    author_name (in recent_posts[])string or nullThat account's display name.
    author_id (in recent_posts[])string or nullX's numeric id of that account.
    author_verified (in recent_posts[])boolean or nullTrue when that account carries a verification badge.
    like_count (in recent_posts[])integer or nullNumber of likes.
    reply_count (in recent_posts[])integer or nullNumber of replies.
    repost_count (in recent_posts[])integer or nullNumber of reposts.
    quote_count (in recent_posts[])integer or nullNumber of posts that quote this one.
    bookmark_count (in recent_posts[])integer or nullNumber of bookmarks; null where the page does not state it.
    view_count (in recent_posts[])integer or nullNumber of views; null where the page does not state it.
    hashtags (in recent_posts[])array of stringThe hashtags written in the text, without the #, in order.
    mentions (in recent_posts[])array of stringThe handles the text mentions, without the @, in order.
    urls (in recent_posts[])array of stringThe full addresses of the links in the text, in order.
    media (in recent_posts[])array of objectThe 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[])stringThe photo, or the preview image of a video or GIF.
    video_url (in recent_posts[].media[])string or nullThe video file with the highest bitrate (MP4), for a video or GIF.
    duration_ms (in recent_posts[].media[])integer or nullLength of a video in milliseconds.
    width (in recent_posts[].media[])integer or nullWidth in pixels of the original.
    height (in recent_posts[].media[])integer or nullHeight in pixels of the original.
    alt_text (in recent_posts[].media[])string or nullThe description the author gave the image, when there is one.
    quoted_post_id (in recent_posts[])string or nullThe id of the post this one quotes, when it quotes one.
    possibly_sensitive (in recent_posts[])boolean or nullTrue 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_atstring (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=BBCWorld

    Install 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:

    JSON
    {
      "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.

    JSON
    {
      "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.

    JSON
    {
      "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.