1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "startUrls": [{ "url": "https://www.instagram.com/p/example/" }],
10 "manualSession": """{
11 \"sessionid\": \"your_session_id_here\",
12 \"csrftoken\": \"your_csrf_token_here\",
13 \"ds_user_id\": \"your_user_id_here\",
14 \"mid\": \"your_mid_here\",
15 \"ig_did\": \"your_ig_did_here\",
16 \"datr\": \"your_datr_here\"
17}""",
18 "proxyConfiguration": {
19 "useApifyProxy": True,
20 "apifyProxyGroups": ["RESIDENTIAL"],
21 "apifyProxyCountry": "US",
22 },
23 "brightDataConfig": """{
24 \"host\": \"brd.superproxy.io\",
25 \"port\": 22225,
26 \"username\": \"your_username\",
27 \"password\": \"your_password\",
28 \"country\": \"US\"
29}""",
30}
31
32
33run = client.actor("clip-forge/instagram-post-scraper-pay-per-request").call(run_input=run_input)
34
35
36print("๐พ Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
37for item in client.dataset(run["defaultDatasetId"]).iterate_items():
38 print(item)
39
40