Best Twitter Scraper avatar
Best Twitter Scraper
Try for free

No credit card required

View all Actors
Best Twitter Scraper

Best Twitter Scraper

zhangzhenhu/best-twitter-scraper
Try for free

No credit card required

Twitter scraper that scrapes the latest Twitter content of any user. Since you need to be logged in to Twitter to crawl, you need to provide a Twitter account. Twitter 抓取器,可以抓取任意用户最新的Twitter内容。 因为需要先登录 Twitter 才能抓取,所以需要提供一个 Twitter 的账号。

The code examples below show how to run the Actor and get its results. To run the code, you need to have an Apify account. Replace <YOUR_API_TOKEN> in the code with your API token, which you can find under Settings > Integrations in Apify Console. Learn more

Node.js

Python

curl

1import { ApifyClient } from 'apify-client';
2
3// Initialize the ApifyClient with your Apify API token
4const client = new ApifyClient({
5    token: '<YOUR_API_TOKEN>',
6});
7
8// Prepare Actor input
9const input = {
10    "login_user": "HuZhang18851",
11    "login_password": "r7pkkp22",
12    "names": [
13        "elonmusk"
14    ],
15    "tweet_urls": [],
16    "search_urls": []
17};
18
19(async () => {
20    // Run the Actor and wait for it to finish
21    const run = await client.actor("zhangzhenhu/best-twitter-scraper").call(input);
22
23    // Fetch and print Actor results from the run's dataset (if any)
24    console.log('Results from dataset');
25    console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
26    const { items } = await client.dataset(run.defaultDatasetId).listItems();
27    items.forEach((item) => {
28        console.dir(item);
29    });
30})();
31
32// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs
Developer
Maintained by Community
Actor metrics
  • 82 monthly users
  • 91.7% runs succeeded
  • 52.0 days response time
  • Created in Aug 2023
  • Modified 8 months ago
Categories