File size: 841 Bytes
b23cb24
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from apify_client import ApifyClient
import json

client = ApifyClient("apify_api_fKPm5qA9w1u7Gy00uWdJenHks0mCvj2rFeg5")

# Try with RESIDENTIAL proxies
run_input = {
    "directUrls": ["https://www.instagram.com/p/DVgO7VqlbyC/"],
    "resultsType": "details",
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"]
    }
}

print("Running Apify Actor apify/instagram-scraper WITH RESIDENTIAL PROXIES...")
run = client.actor("apify/instagram-scraper").call(run_input=run_input)

print("Fetching results...")
items = list(client.dataset(run["defaultDatasetId"]).iterate_items())
if items:
    with open("apify_debug_res.json", "w", encoding="utf-8") as f:
        json.dump(items[0], f, indent=2)
    print("Saved results to apify_debug_res.json")
else:
    print("No items found in dataset.")