1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "url": "https://jsonplaceholder.typicode.com/todos/1",
10 "method": "GET",
11 "params": {},
12 "data": {},
13 "rowId": "",
14 "requests": [],
15 "urls": [],
16 "urlTemplate": "",
17 "templateValues": [],
18 "paginationMode": "none",
19 "maxPages": 1,
20 "pageParam": "",
21 "pageSize": 100,
22 "nextPagePath": "",
23 "stopWhenEmptyPath": "",
24 "maxConcurrency": 10,
25 "requestsPerSecond": 0,
26 "dedupeRequests": False,
27 "timeoutSecs": 30,
28 "maxRetries": 2,
29 "retryOnStatusCodes": [
30 408,
31 425,
32 429,
33 500,
34 502,
35 503,
36 504,
37 ],
38 "retryUnsafeMethods": False,
39 "followRedirects": True,
40 "maxRedirects": 5,
41 "ignoreTlsErrors": False,
42 "parseJson": True,
43 "extract": {},
44 "bodyMode": "auto",
45 "maxResponseBytes": 1000000,
46 "saveOversizedBodyToKeyValueStore": True,
47 "includeResponseHeaders": True,
48 "failOnErrorStatus": False,
49 "expectedStatusCodes": [],
50 "expectedBodyContains": "",
51 "authType": "none",
52 "proxyConfiguration": { "useApifyProxy": False },
53 "proxyRouting": "always",
54 "proxyRotation": "perRequest",
55 "clientProfile": "auto",
56 "callbackUrl": "",
57}
58
59
60run = client.actor("getascraper/http-request-runner").call(run_input=run_input)
61
62
63print(f"๐พ Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
64for item in client.dataset(run.default_dataset_id).iterate_items():
65 print(item)
66
67