xAutoDM LogoxAutoDM
    Twitter APITwitter GuideDeveloper

    How to Scrape Twitter (X) Data With an API in 2026

    How to scrape X (Twitter) data with an API in 2026: pull a profile's followers, search results, and tweet repliers as clean JSON from one endpoint, with curl, Node, and Python examples.

    Sarthak Gupta
    4 min read
    How to Scrape Twitter (X) Data With an API in 2026
    Contents

    To scrape X (Twitter) data with an API in 2026, you send one authenticated POST request describing what you want (a profile's followers, a search query, or a tweet's repliers) and get back clean JSON. No headless browser, no proxy rotation, no HTML parsing. This guide shows the exact request in curl, Node.js, and Python using the XAutoDM API.

    The official X API priced most builders out, and raw scraping of a login-walled platform is a maintenance treadmill. A purpose-built X data API sits in the middle: the public data you need, one key, usage-based pricing.

    What you can pull

    The XAutoDM API exposes X's public data through a single

    scrapes
    endpoint. You choose a
    source_type
    and pass a
    source_value
    :

    • followers / following of any handle
    • repliers to a tweet (everyone who replied)
    • retweeters of a tweet
    • search results for a keyword or advanced query
    • list_members of a public List

    Every result is a profile object with the fields that matter for outreach: handle, name, bio, follower counts, verified status, and

    canDm
    (whether the account accepts direct messages).

    Authentication

    You need an API key. The XAutoDM API is in early access, so you request a key on the API page and authenticate with a bearer token:

    Authorization: Bearer xad_live_...

    Scrape a profile's followers (curl)

    curl -X POST https://app.xautodm.com/api/v1/scrapes \ -H "Authorization: Bearer xad_live_..." \ -H "Content-Type: application/json" \ -d '{ "source_type": "followers", "source_value": "https://x.com/naval", "count": 500, "filters": { "canDmOnly": true } }'

    The

    filters.canDmOnly
    flag is the important one. A large share of any follower list has DMs closed, so filtering server-side means you only get (and only pay to process) accounts you can actually reach.

    The same call in Node.js

    const res = await fetch("https://app.xautodm.com/api/v1/scrapes", { method: "POST", headers: { "Authorization": "Bearer xad_live_...", "Content-Type": "application/json", }, body: JSON.stringify({ source_type: "search", source_value: "growth marketing agency", count: 200, filters: { canDmOnly: true }, }), }); const { data } = await res.json(); console.log(data.length, "profiles");

    Swap

    source_type
    to
    search
    and
    source_value
    to a keyword, and the same endpoint returns people posting about that topic, ready to filter and message.

    And in Python

    import requests resp = requests.post( "https://app.xautodm.com/api/v1/scrapes", headers={"Authorization": "Bearer xad_live_..."}, json={ "source_type": "repliers", "source_value": "https://x.com/user/status/1234567890", "count": 200, "filters": {"canDmOnly": True}, }, ) for profile in resp.json()["data"]: print(profile["username"], profile["followers"], profile["canDm"])

    Here

    source_type: repliers
    pulls everyone who replied to a specific tweet, which is one of the highest-intent lead sources on X: they already engaged with the exact topic.

    What the response looks like

    Each profile comes back as structured JSON, roughly:

    { "username": "someone", "name": "Some One", "bio": "Founder, building in public", "followers": 4213, "verified": false, "canDm": true }

    Clean fields, no scraping glue code. You filter, dedupe, and load them straight into your CRM or outreach flow.

    Pagination and pacing

    Ask for what you need with

    count
    and page through large sources rather than pulling everything at once. Two things to keep in mind: verified-follower and search sources return smaller pages than raw follower lists, and every request draws from your credit wallet, so filter server-side and only fetch what you will use.

    From data to booked calls

    Scraping is step one. The reason to pull DM-able X leads is to reach them, and the same platform closes the loop: the XAutoDM API can send paced, personalized DMs and run follow-up sequences under the same key and safety rails. Before you build a sender, read our guide on X DM limits so your outreach stays under the caps, and see the full API overview for early access.

    Want the endpoint and a key? Request early access on the XAutoDM API page. No official X API needed.

    XAutoDM
    Trusted across 10,000+ campaigns

    Your next customer is already on X.

    Find the people talking about what you sell, message them on a safe schedule, and turn the replies into booked calls.

    • Scrape leads from any tweet, keyword or X List
    • Auto-DM new followers and people who engage
    • Follow-ups that stop the moment someone replies
    • Safe daily limits and warm-up, built in
    • Every reply tracked through to a booked call
    Start for free

    Free Test plan · no credit card.

    Related posts

    Ready to automate your Twitter DMs?

    Start sending personalized DM campaigns to your target audience today. Get higher response rates and more leads than cold emails.

    No credit card required Safe daily sending limits Setup in 5 minutes