Scrape Twitter Following List and Followers as JSON
Learn how to scrape Twitter following list data, followers, list members, and community members through structured MintAPI X endpoints with cursor-based workflows.
Key takeaways
- 01Follower and following workflows should return structured records, not scraped page fragments.
- 02MintAPI exposes focused X endpoints for following, followers, list members, list followers, and community members.
- 03Cursor handling, scoring, and enrichment should live in runtime code so agents and automations stay predictable.
The practical endpoint map
MintAPI exposes the social graph pieces as narrow X/Twitter endpoints. The starting point for this workflow is the Following endpoint for accounts a user follows and the Followers endpoint for latest followers on a user profile.
- `/api/twitter/following` accepts `screenname`, optional `rest_id`, and optional `cursor`.
- `/api/twitter/followers` accepts `screenname`, optional `cursor`, and optional `blue_verified` as `0` or `1`.
- `/api/twitter/list-members` returns members of a Twitter list by `list_id`.
- `/api/twitter/list-followers` returns followers of a Twitter list by `list_id`.
- `/api/twitter/community-members` returns members of a community by `community_id`.
For a broader view of the available X surface, use the Twitter API overview. It groups the profile, tweet, search, list, and community endpoints that are useful when a graph workflow needs more context.
Example: fetch a user's following list
For a human-operated backend job or automation, call the endpoint with a personal API key. The response includes a following array and a next_cursor when more pages are available.
1curl --request GET \2 --url 'https://api.mintapi.dev/api/twitter/following?screenname=elonmusk' \3 --header 'Authorization: Bearer YOUR_API_KEY'In application code, keep pagination explicit. Persist each returned cursor with the account and job run so the next request can continue from the same point.
1const response = await fetch(2 "https://api.mintapi.dev/api/twitter/following?screenname=elonmusk",3 {4 headers: {5 Authorization: `Bearer ${process.env.MINTAPI_API_KEY}`,6 },7 },8);910const data = await response.json();11const accounts = data.following ?? [];12const nextCursor = data.next_cursor;Example: scrape Twitter followers with filters
The followers endpoint is similar, but it exposes a follower list and supports blue_verified when a workflow wants to separate verified followers from the broader follower stream.
1const params = new URLSearchParams({2 screenname: "elonmusk",3 blue_verified: "0",4});56const response = await fetch(7 `https://api.mintapi.dev/api/twitter/followers?${params}`,8 {9 headers: {10 Authorization: `Bearer ${process.env.MINTAPI_API_KEY}`,11 },12 },13);1415const data = await response.json();16const followers = data.followers ?? [];This is a better fit for production than trying to scroll the public follower UI because the downstream shape is stable. Your enrichment or ranking code can work against known fields such as screen_name, user_id, followers_count, and friends_count.
Lists and communities are curated graph surfaces
A user's followers and following are broad. Lists and communities are more curated. If your use case is market research, creator discovery, source monitoring, or niche audience mapping, list members and community members may produce a cleaner seed set than a large profile follower export.
For lists, start with List members when you care about who belongs to the list. Use list followers when you care about who subscribes to that list. For communities, use the community members endpoint with community_id and follow the returned cursor when more members are available.
- Use following when the question is: which accounts does this profile pay attention to?
- Use followers when the question is: who recently follows this account?
- Use list members when the question is: who is intentionally included in this curated group?
- Use list followers when the question is: who subscribes to this curated group?
- Use community members when the question is: who belongs to this topic-specific X community?
Agent workflow: collect, score, then enrich
For agentic research, do not ask the model to browse X or invent pagination logic. Expose a small tool that calls the right endpoint, then let deterministic runtime code handle authentication, cursor storage, retries, and budget rules.
Agents that use x402 can call MintAPI through the documented request flow. The model can ask for a social graph retrieval, while the runtime handles payment and returns JSON to the agent.
1import {2 createAgentClient,3 createSignerResolver,4} from "@mintapi/gateway/client";56const signerResolver = createSignerResolver({7 signerResolversByFamily: {8 evm: async ({ network }) => resolveManagedEvmSigner(network),9 svm: async ({ network }) => resolveManagedSolanaSigner(network),10 },11});1213const client = createAgentClient({14 baseUrl: "https://api.mintapi.dev",15 getSigner: signerResolver,16});1718const following = await client.twitter.following({19 screenname: "elonmusk",20});2122const nextPage = await client.twitter.following({23 screenname: "elonmusk",24 cursor: following.next_cursor,25});What to store from a follower or following job
The useful output is rarely the raw response alone. Store normalized records, the source endpoint, the source account or list, and the cursor state. That gives you a repeatable collection job and a clean audit trail for later enrichment.
- Record identity fields such as `user_id`, `screen_name`, and display name.
- Record graph context such as whether the account came from followers, following, list members, or community members.
- Record numeric fields such as `followers_count` and `friends_count` for ranking.
- Persist `next_cursor` with the job state instead of burying it in logs.
- Run deeper calls such as user info, timelines, or search only after the first-pass graph has been scored.
Where this fits with other X workflows
Follower and following collection is one part of a larger research stack. If the next step is broader investigation, pair this workflow with Twitter API for agent research. If the goal is monitoring changes over time, continue with Twitter monitoring agents. For trend and amplification analysis, use social signal agents.
For the payment and tool abstraction behind these calls, read OpenAI tools plus a paid Twitter API and why MintAPI works well for agents.
Frequently asked questions
Read next
Next step
Explore the API surface behind the article.
Browse endpoint docs, pricing notes, and implementation examples for human and agent workflows.
Open docs