1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "results": [
10 {
11 "keyword": "best running shoes",
12 "rank": 1,
13 "url": "https://nike.com/running-shoes",
14 "title": "Best Running Shoes | Nike",
15 },
16 {
17 "keyword": "best running shoes",
18 "rank": 2,
19 "url": "https://adidas.com/running",
20 "title": "Running Shoes | adidas",
21 },
22 {
23 "keyword": "best running shoes",
24 "rank": 3,
25 "url": "https://runnersworld.com/gear/best-running-shoes",
26 "title": "The Best Running Shoes, Tested - Runner's World",
27 },
28 {
29 "keyword": "marathon training plan",
30 "rank": 1,
31 "url": "https://adidas.com/training/marathon",
32 "title": "Marathon Training Plan | adidas",
33 },
34 {
35 "keyword": "marathon training plan",
36 "rank": 2,
37 "url": "https://runnersworld.com/training/marathon-plan",
38 "title": "Marathon Training Plan - Runner's World",
39 },
40 {
41 "keyword": "marathon training plan",
42 "rank": 3,
43 "url": "https://nike.com/marathon",
44 "title": "Marathon Guide | Nike",
45 },
46 ],
47 "brandMap": {
48 "Nike": ["nike.com"],
49 "adidas": ["adidas.com"],
50 "Runner's World": ["runnersworld.com"],
51 },
52 "yourBrand": "Nike",
53}
54
55
56run = client.actor("that_red_bird/serp-share-of-voice").call(run_input=run_input)
57
58
59print(f"๐พ Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
60for item in client.dataset(run.default_dataset_id).iterate_items():
61 print(item)
62
63