1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "searchTerms": ["from:elonmusk"],
10 "cookies": ["auth_token=304c9c4d0e13e6ccf682dfac3bdf213388b1f070;ph_phc_TXdpocbGVeZVm5VJmAsHTMrCofBQu3e0kN8HGMNGTVW_posthog=%7B%22distinct_id%22%3A%220194698a-e095-7869-940a-3a43aa499620%22%2C%22%24sesid%22%3A%5B1740811811087%2C%2201955075-4108-7ed6-92c0-21fe0dbf9f30%22%2C1740811616520%5D%7D;guest_id=v1%3A174230154202102158;ads_prefs=HBERAAA=;twid=u%3D1479073844589895680;auth_multi=1879891535053111296:feedf85e010b01c51d4e2a480cc783e83fa11ba1|1882133993115803648:b07bdae6b633c8f166f12369ba017c4916351cef|1881370916053270529:7561263540490652212f31b251f3a87e33d4aa9c;night_mode=2;__cf_bm=W4PqKoMtfTHfVf3J5vHyFVGH4O.UFLwELn5PZ5m95R4-1742300937-1.0.1.1-2tGbjg60z.6aT_1TcPfQy3tE7GmOuC21MJ1OcBdR5XP0cOMxdexOC7wUd_hKxHvD7vPDwJkCpOUpELVN7_LOwoRDi13IuyGvDluN74ajWKQ;ct0=1b3473505eed25605c2dc8c6802e3ad3cc792a97846f496481f55d6970390c6aba49dd40e8f7f96a3c902e328c1e8461e89d7429fdac2e61a65fdbd5f92f9716b23d1c730d1ca30df28c6eaedd25f54c;guest_id_ads=v1%3A174230154202102158;guest_id_marketing=v1%3A174230154202102158;kdt=O83gjfkTl8AaNp5z3JXyUGdr1k0xFZPBwD9myC97;personalization_id=v1_SkJRGfsm95VskQ4ujBPgEQ=="],
11 "nextCursor": "",
12 "sortBy": "Latest",
13 "onlyVerifiedUsers": False,
14 "onlyBuleVerifiedUsers": False,
15 "onlyImage": False,
16 "onlyVideo": False,
17 "onlyQuote": False,
18 "onlyReply": False,
19}
20
21
22run = client.actor("fastcrawler/tweet-fast-scraper").call(run_input=run_input)
23
24
25print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
26for item in client.dataset(run["defaultDatasetId"]).iterate_items():
27 print(item)
28
29