1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "apiBaseUrl": "https://api.github.com",
10 "paths": [
11 "/",
12 "/rate_limit",
13 ],
14 "expectedAllowOrigins": ["https://app.example.com"],
15 "expectedDenyOrigins": [
16 "https://evil.example.com",
17 "null",
18 "http://attacker.example",
19 ],
20 "includeSubdomainProbe": True,
21 "methods": [
22 "GET",
23 "POST",
24 "PUT",
25 "DELETE",
26 ],
27 "requestHeaders": [
28 "authorization",
29 "content-type",
30 ],
31 "authorizationStatement": "I own this API, or I am authorized to test it. The Actor sends only OPTIONS and GET requests.",
32 "trackMatrix": True,
33 "matrixKey": "",
34 "timeoutSeconds": 15,
35 "maxConcurrency": 5,
36 "maxRequests": 900,
37 "maxRedirects": 0,
38}
39
40
41run = client.actor("kingii98/browser-api-cors-allowlist-and-credential-exposure-gate").call(run_input=run_input)
42
43
44print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
45for item in client.dataset(run.default_dataset_id).iterate_items():
46 print(item)
47
48