xAutoDM LogoxAutoDM
    Twitter APITwitter MarketingTwitter Guide

    How to Auto-DM New Twitter (X) Followers With an API

    How to auto-DM new Twitter (X) followers with an API: poll your followers, diff against a seen set to find new ones, filter to DM-able accounts, and send a paced, personalized welcome DM.

    Sarthak Gupta
    3 min read
    How to Auto-DM New Twitter (X) Followers With an API
    Contents

    To auto-DM new X (Twitter) followers, you poll your followers on a schedule, diff the list against the followers you have already seen, filter the new ones to accounts that can receive a DM, and send each a paced, personalized welcome message. This guide shows the detection loop in code and how to send safely.

    Done right, this turns every new follower into a warm conversation. Done wrong, it is the fastest way to get an account flagged. The difference is filtering, personalization, and pacing.

    The workflow

    1. Poll your followers on an interval.
    2. Diff against a stored set of followers you already know, to find new ones.
    3. Filter the new ones to DM-able accounts that fit your customer profile.
    4. Send each a personalized welcome DM, paced and one message variant at a time.

    Detect new followers (Node.js)

    Scraping followers is a single request, and the seen-set diff finds the new ones:

    const known = new Set(); // persist across runs (DB / KV) async function findNewFollowers() { 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: "followers", source_value: "https://x.com/yourhandle", count: 500, filters: { canDmOnly: true }, }), }); const { data } = await res.json(); const fresh = data.filter((f) => !known.has(f.username)); fresh.forEach((f) => known.add(f.username)); return fresh; // new, DM-able followers only }

    Two details matter.

    filters.canDmOnly
    means you never queue someone who cannot receive a DM. And on the first run, seed
    known
    with your current followers and do not message them, or you will welcome your entire existing audience at once.

    Send the welcome DM

    Sending is the other half of the XAutoDM API, under the same key. Request the DM endpoint reference with your early-access key on the API page, then send one personalized message per new follower:

    for (const f of fresh) { await sendDm({ to: f.username, text: `Hey ${f.name.split(" ")[0]}, thanks for the follow. What are you working on right now?`, }); await sleep(jitter(60, 180)); // space sends out, seconds }

    Note the pacing. A short delay with jitter between sends keeps you under X's DM limits and away from the spam filter. Never send identical text at volume; personalize with the follower's name or bio and rotate a few variants.

    Keep it safe

    • Filter before you send: DM-able only, skip your do-not-contact list, skip poor-fit accounts.
    • Personalize every message: name or bio detail, no copy-paste.
    • No links in the first message: earn the reply first.
    • Pace and warm up: space sends across the day; ramp new accounts slowly.

    Let the platform run it

    You can wire this yourself, or let the managed side of XAutoDM handle the loop: it detects new followers, filters them, and sends paced, personalized DMs with follow-ups that stop on a reply, tracking each to a booked call. Either way, start with the data: see how to scrape X data with an API and request a key on the API page.

    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