Twitter Get UerByIdOrNameLookUp

Twitter Get UerByIdOrNameLookUp

by twitterapi

Fetch public Twitter user data by username or ID. A simple, automated scraper for profile information without using the official API.

1,267 runs
11 users
Try This Actor

Opens on Apify.com

About Twitter Get UerByIdOrNameLookUp

Need to pull Twitter profile data without the API hassle? This actor is for you. It's a straightforward scraper that takes a Twitter username or numeric ID and returns the public user information you'd see on their profile page. I've used it to quickly verify account details, gather basic public metrics for lists, and check profile changes over time. You feed it a handle like @twitter or an ID string, and it fetches the available public data. It handles the lookup logic so you don't have to manually parse Twitter's front-end or deal with their developer API limits for simple tasks. It's particularly handy for one-off checks, populating databases with core user attributes, or automating checks as part of a larger workflow. Just set your target, run it, and get a structured data output with the user's info. It does the simple job of a targeted profile lookup well.

What does this actor do?

Twitter Get UerByIdOrNameLookUp 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

  1. Click "Try This Actor" to open it on Apify
  2. Create a free Apify account if you don't have one
  3. Configure the input parameters as needed
  4. Run the actor and download your results

Documentation

Twitter Get UserByIdOrNameLookUp

An Apify Actor for scraping data from a single Twitter user profile page. It takes a Twitter handle or user ID as input, fetches the page, and extracts profile data using Cheerio for parsing. The scraped data is stored in an Apify dataset for easy access and integration.

Key Features

  • Apify SDK: Built using the toolkit for developing and running Apify Actors.
  • Input Schema: Uses a defined schema to validate input, such as the target Twitter username or ID.
  • Structured Storage: Outputs data to an Apify Dataset, keeping it organized and accessible.
  • Axios & Cheerio: Uses Axios for reliable HTTP requests and Cheerio for fast HTML parsing and data extraction on static pages.
  • Customizable: The provided code is a template; you can modify the Cheerio selectors to scrape different data points from the profile page.

Input / Output

Input: The Actor requires an input object containing the target twitterHandle or userId. The exact field name is defined by the Actor's input schema.

Example input (JSON):

{
  "twitterHandle": "apify"
}

Output: The scraped data is saved to the Actor's default dataset. The default template extracts page headings (h1-h6), but for this Twitter Actor, the code is modified to extract profile details like display name, bio, follower count, etc. You can access the results via the Apify console, API, or integrations.

How to Use

Running the Actor

  1. Build or Access the Actor: Find the "Twitter Get UserByIdOrNameLookUp" Actor in the Apify console or build it from the provided template code.
  2. Configure Input: Provide the target Twitter username or user ID in the input field.
  3. Run: Start the Actor. It will fetch the profile page, parse it, and store the results.

How It Works (Code Flow)

  1. Actor.getInput() retrieves the configured input (the Twitter handle/user ID).
  2. axios.get(url) fetches the HTML of the Twitter profile page.
  3. cheerio.load(response.data) loads the HTML into Cheerio for parsing.
  4. Parsing Logic: The script uses Cheerio selectors to find and extract specific data points from the page structure. You will need to adjust these selectors to target Twitter's profile elements.
    javascript // Example: The template extracts headings. For Twitter, you'd change selectors. // $("h1, h2, h3").each(...) // Original template code // $('[data-testid="UserName"]').text() // Example for Twitter display name
  5. Actor.pushData(profileData) stores the extracted profile information into the dataset.

Local Development

To modify or run the Actor locally, use the Apify CLI:

  1. Install CLI:
    bash npm -g install apify-cli
    or
    bash brew install apify-cli
  2. Pull the Actor: Use the Actor's unique name or ID from the Apify console.
    bash apify pull <ActorId>

Resources

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 UerByIdOrNameLookUp now on Apify. Free tier available with no credit card required.

Start Free Trial

Actor Information

Developer
twitterapi
Pricing
Paid
Total Runs
1,267
Active Users
11
Apify Platform

Apify provides a cloud platform for web scraping, data extraction, and automation. Build and run web scrapers in the cloud.

Learn more about Apify

Need Professional Help?

Couldn't solve your problem? Hire a verified specialist on Fiverr to get it done quickly and professionally.

Find a Specialist

Trusted by millions | Money-back guarantee | 24/7 Support