Have a question?

Contact Us

How to scrape Twitter?

7 min read

ata on the internet. With over 200 million active users sharing opinions, trends, and real-time information every day, scraping Twitter gives businesses and developers a powerful edge for market research, brand monitoring, sentiment analysis, and competitive intelligence.

But scraping Twitter isn’t straightforward. The platform has strong anti-bot protections that block most traditional scraping approaches. That’s where ScrapingBot’s Twitter Scraper API comes in — it handles all the complexity for you, so you can collect public data from Twitter profiles and search results in JSON format, without getting blocked.

In this guide, you’ll learn:

  • What data you can collect from Twitter (X) with ScrapingBot
  • How to set up the Twitter Scraper API step by step
  • How to scrape Twitter profiles and hashtags with real code examples

How to Scrape Twitter (X) in 2026: Profiles, Hashtags & Search Results

What data can you collect with our Twitter Scraper?

Twitter profiles

Profile name, profile image, profile background image, number of tweets, account verification, profile bio, number followed, number of followers, latest posts data (text, time, ID, replies, retweets, likes, views, media)

TRY FOR FREE SCRAPER TWITTER PROFILES

Twitter search results

From a keyword or a hashtag: Username, tweet URL, created time, ID, other hashtags, user mentions, source, geo coordinates, reply count, quote count, conversation ID, retweeted, possibly sensitive, language, media data (links, expanded URL, type, width and height)

How to start scraping X (Twitter)?

ScrapingBot is here to help you scrape Twitter profiles and hashtags as easily and efficiently as possible.

Try for Free Twitter Scraper

1 - Create an account :

Want to start scraping Twitter right now? No problem, ScrapingBot offersFREE access with 100 credits per month to get started. No payment information required, and no any engagement. If you already have an account, just log in.

2. Configure your scraping :

Once your account has been created, go to Documentation, to the “Data Scraper API” section to be able to start scraping what you want.

Setting up the endpoint is a two-step process with two API calls. It’s a little longer than usual because social networks have many protections to avoid robots and get scraped. These two calls make it possible to recover the data without being blocked.

Step 1 : Get your Response ID

First, you must make a first POST request to get the ResponseID which will be used later. To do this, you must enter the following parameters in the body, then run a first API call:

  • scraper: (“twitterProfile” to scrape Twitter profiles, or “twitterSearch” to scrape Twitter search resultss)
    • If you chose twitterProfile as a scraper:
      • url: Add the URL of the Twitter profile you want to scrape
    • f you chose twitterSearch as a scraper:
      • search: Enter the keyword or hashtag you want to retrieve search results data from

Here is the Request Endpoint:

http://api.scraping-bot.io/scrape/data-scraper

Step 2 : Configure your second request

Now that you have your responseId, you will be able to configure a GET request to ask for the response.:

Here is the Request Endpoint:

http://api.scraping-bot.io/scrape/data-scraper-response?responseId=xxxx&scraper=name

Complete the Response Endpoint with these parameters:

  • responseId : Insert here the Response ID that you had with the POST API call
  • scraper: You must fill in the same as that used previously for the POST API call (“”twitterProfile” or “twitterSearch””)

When it’s ready, execute the API call. The result you will get will tell you if the scraping is ready to use or not. If it’s not, you will get this pending message:

{"status": "pending","message": "Scraping is not finished for this request, try again in a few"}

In this case, you have to try again until it’s ready.

Looking for something more specific?

Start using ScrapingBot

Ready to Unlock Web Data?
Data is only useful once it’s accessible. Let us do the heavy lifting so you can focus on insights.