1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = { "requests": [
9 {
10 "url": "https://api.github.com/repos/apify/apify-sdk-js",
11 "method": "GET",
12 "headers": { "Accept": "application/vnd.github+json" },
13 },
14 {
15 "url": "https://httpbin.org/post",
16 "method": "POST",
17 "headers": { "Content-Type": "application/json" },
18 "body": "{\"name\": \"John\", \"email\": \"john@example.com\"}",
19 "bodyType": "json",
20 "auth": {
21 "type": "bearer",
22 "token": "YOUR_TOKEN_HERE",
23 },
24 },
25 ] }
26
27
28run = client.actor("automation-lab/http-request-builder").call(run_input=run_input)
29
30
31print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
32for item in client.dataset(run["defaultDatasetId"]).iterate_items():
33 print(item)
34
35