1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "urls": [
10 "https://httpbin.org/get",
11 "https://example.com",
12 "https://api.ipify.org?format=json",
13 ],
14 "requests": [{
15 "url": "https://httpbin.org/post",
16 "method": "POST",
17 "body": { "hello": "world" },
18 "label": "post-example",
19 }],
20 "headers": {},
21 "proxyConfiguration": { "useApifyProxy": True },
22 "concurrency": 10,
23 "maxRetries": 2,
24 "retryOnStatuses": [
25 "403",
26 "429",
27 "500",
28 "502",
29 "503",
30 "504",
31 ],
32 "timeoutSecs": 30,
33 "maxBodyChars": 500000,
34 "maxItems": 0,
35}
36
37
38run = client.actor("seemuapps/http-request-runner").call(run_input=run_input)
39
40
41print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
42for item in client.dataset(run.default_dataset_id).iterate_items():
43 print(item)
44
45