Twitter Get UserByScreenName V2
by twitterapi
Fetch detailed Twitter/X user profile data by screen name using the internal API. Get IDs, bios, stats, and more in JSON, perfect for data enrichment and automation.
Opens on Apify.com
About Twitter Get UserByScreenName V2
Need to pull Twitter profile data without the hassle of rate limits and API complexities? This actor is your straightforward solution. It taps into Twitter's internal GraphQL endpoint—the same one the web app uses—to fetch detailed user information just by their handle. You feed it a Twitter username, and it returns a clean JSON with the user's ID, display name, bio, follower counts, verification status, profile images, and more. I use it regularly because it bypasses a lot of the official API restrictions, making it reliable for building lists, enriching datasets, or powering social listening tools. It's headless and runs on Apify's infrastructure, so you can schedule it or integrate it into larger workflows without managing your own servers. If you're tired of wrestling with Twitter's API for basic profile scraping, this actor does the heavy lifting for you.
What does this actor do?
Twitter Get UserByScreenName V2 is a web scraping and automation tool available on the Apify platform. It's designed to help you extract data and automate tasks efficiently in the cloud.
Key Features
- Cloud-based execution - no local setup required
- Scalable infrastructure for large-scale operations
- API access for integration with your applications
- Built-in proxy rotation and anti-blocking measures
- Scheduled runs and webhooks for automation
How to Use
- Click "Try This Actor" to open it on Apify
- Create a free Apify account if you don't have one
- Configure the input parameters as needed
- Run the actor and download your results
Documentation
Twitter Get UserByScreenName V2
Overview
This Apify Actor scrapes a single Twitter/X user profile page to extract data. It takes a target profile URL as input, fetches the HTML using Axios, parses it with Cheerio, and outputs structured user data to a dataset. It's built on Apify's single-page JavaScript scraping template.
Key Features
- Apify SDK: Provides the foundation for building and running the Actor.
- Input Schema: Validates the required input (the target Twitter profile URL).
- Dataset Storage: Outputs structured, consistent JSON data for easy retrieval.
- Axios & Cheerio: Uses Axios for reliable HTTP requests and Cheerio for fast HTML parsing and data extraction.
- Customizable: The parsing logic can be edited to extract different data points from the profile page.
Input/Output
Input
The Actor requires a JSON input containing the URL of the Twitter/X user profile to scrape.
{
"url": "https://twitter.com/username"
}
Output
The scraped data is saved to an Apify dataset. By default, the template extracts page headings (h1-h6), but this Actor is configured to parse specific user profile information (like display name, handle, bio, follower count, etc.). Each item in the dataset is a JSON object containing the extracted fields.
How to Use
- Configure Input: In the Actor's console, provide the target Twitter profile URL in the input field.
- Run the Actor: Start the run. The Actor will fetch the page, parse it, and store the results.
- Get Results: After the run finishes, access the scraped user data from the Dataset tab in the console. You can view it as JSON, CSV, or via API.
Local Development
To modify or run the Actor locally:
- Install the Apify CLI:
bash npm -g install apify-cli - Pull the Actor to your machine using its unique name or ID:
bash apify pull <ActorId> - Edit the parsing logic in
main.js(particularly the Cheerio selectors) to tailor the data extraction.
How It Works (Code Flow)
Actor.getInput()retrieves the input configuration, including the target URL.axios.get(url)fetches the HTML of the Twitter profile page.cheerio.load(response.data)loads the HTML into a Cheerio instance for parsing.- The script uses Cheerio selectors (e.g.,
$('div[data-testid="UserName"]')) to find and extract specific user profile elements. Actor.pushData(userData)saves the structured extracted data to the dataset.
Resources
Categories
Common Use Cases
Market Research
Gather competitive intelligence and market data
Lead Generation
Extract contact information for sales outreach
Price Monitoring
Track competitor pricing and product changes
Content Aggregation
Collect and organize content from multiple sources
Ready to Get Started?
Try Twitter Get UserByScreenName V2 now on Apify. Free tier available with no credit card required.
Start Free TrialActor Information
- Developer
- twitterapi
- Pricing
- Paid
- Total Runs
- 573
- Active Users
- 17
Related Actors
Video Transcript Scraper: Youtube, X, Facebook, Tiktok, etc.
by invideoiq
Linkedin Profile Details Scraper + EMAIL (No Cookies Required)
by apimaestro
Twitter (X.com) Scraper Unlimited: No Limits
by apidojo
Content Checker
by jakubbalada
Apify provides a cloud platform for web scraping, data extraction, and automation. Build and run web scrapers in the cloud.
Learn more about ApifyNeed Professional Help?
Couldn't solve your problem? Hire a verified specialist on Fiverr to get it done quickly and professionally.
Trusted by millions | Money-back guarantee | 24/7 Support