1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "keyword": "nature",
10 "Max_items": 1000,
11 "cookies": [
12 {
13 "name": "datr",
14 "value": "sL_rZ1VMWqwRVcCuWXiAQmZX",
15 "domain": ".instagram.com",
16 "path": "/",
17 "expires": 1778063286.150982,
18 "httpOnly": True,
19 "secure": True,
20 },
21 {
22 "name": "ig_did",
23 "value": "1C8AA31D-EA64-4F7A-BFB7-A5E4CFB044A2",
24 "domain": ".instagram.com",
25 "path": "/",
26 "expires": 1775039289.586829,
27 "httpOnly": True,
28 "secure": True,
29 },
30 {
31 "name": "mid",
32 "value": "Z-u_sAALAAFLVNABqbKzftY5QmVX",
33 "domain": ".instagram.com",
34 "path": "/",
35 "expires": 1778063286.151132,
36 "httpOnly": True,
37 "secure": True,
38 },
39 {
40 "name": "csrftoken",
41 "value": "K2icskn2peDTQSn8Fpc4d0UeXI5gvHUA",
42 "domain": ".instagram.com",
43 "path": "/",
44 "expires": 1774971325.552493,
45 "httpOnly": False,
46 "secure": True,
47 },
48 {
49 "name": "ds_user_id",
50 "value": "73139193689",
51 "domain": ".instagram.com",
52 "path": "/",
53 "expires": 1751297725.552724,
54 "httpOnly": False,
55 "secure": True,
56 },
57 {
58 "name": "sessionid",
59 "value": "73539491489%3A377qgGLgpVU9QO%3A18%3AAYdYA1n9adejJUjkr8k17j3-LCTLoeEC2wsBnd-_oA",
60 "domain": ".instagram.com",
61 "path": "/",
62 "expires": 1775039435.486017,
63 "httpOnly": True,
64 "secure": True,
65 },
66 {
67 "name": "wd",
68 "value": "1358x642",
69 "domain": ".instagram.com",
70 "path": "/",
71 "expires": 1744126523,
72 "httpOnly": False,
73 "secure": True,
74 "sameSite": "Lax",
75 },
76 {
77 "name": "rur",
78 "value": "\"RVA\\05473539498689\\0541775057726:01f7831497b9bd63ed547dedca6805d32284ae9700d432ff00bfdd136ae1c88416ec2841\"",
79 "domain": ".instagram.com",
80 "path": "/",
81 "expires": -1,
82 "httpOnly": True,
83 "secure": True,
84 "sameSite": "Lax",
85 },
86 ],
87}
88
89
90run = client.actor("coderx/instagram-hashtag-username-scraper").call(run_input=run_input)
91
92
93print("πΎ Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
94for item in client.dataset(run["defaultDatasetId"]).iterate_items():
95 print(item)
96
97