1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "accountId": "000123",
10 "queries": [
11 {
12 "id": "q001",
13 "query": "blue running shoes",
14 "campaignId": "01",
15 "adGroupId": "001",
16 },
17 {
18 "id": "q002",
19 "query": "running shoes",
20 "campaignId": "01",
21 "adGroupId": "001",
22 },
23 {
24 "id": "q003",
25 "query": "shoes running",
26 "campaignId": "02",
27 "adGroupId": "002",
28 },
29 {
30 "id": "q004",
31 "query": "sidewalk CAFÉ",
32 "campaignId": "02",
33 "adGroupId": "002",
34 },
35 {
36 "id": "q005",
37 "query": "sidewalk cafe",
38 "campaignId": "02",
39 "adGroupId": "002",
40 },
41 {
42 "id": "q006",
43 "query": "free training",
44 "campaignId": "03",
45 "adGroupId": "003",
46 },
47 {
48 "id": "q007",
49 "query": "ski boots",
50 "campaignId": "01",
51 "adGroupId": "001",
52 },
53 {
54 "id": "q008",
55 "query": "shose",
56 "campaignId": "01",
57 "adGroupId": "001",
58 },
59 {
60 "id": "q009",
61 "query": "socks & shoes",
62 "campaignId": "01",
63 "adGroupId": "001",
64 },
65 {
66 "id": "q010",
67 "query": "very very cheap",
68 "campaignId": "01",
69 "adGroupId": "001",
70 },
71 ],
72 "negatives": [
73 {
74 "id": "n001",
75 "text": "running shoes",
76 "matchType": "broad",
77 "scope": "account",
78 },
79 {
80 "id": "n002",
81 "text": "running shoes",
82 "matchType": "phrase",
83 "scope": "campaign",
84 "campaignId": "01",
85 },
86 {
87 "id": "n003",
88 "text": "running shoes",
89 "matchType": "exact",
90 "scope": "adGroup",
91 "campaignId": "01",
92 "adGroupId": "001",
93 },
94 {
95 "id": "n004",
96 "text": "sidewalk café",
97 "matchType": "phrase",
98 "scope": "campaign",
99 "campaignId": "02",
100 },
101 {
102 "id": "n005",
103 "text": "free",
104 "matchType": "broad",
105 "scope": "sharedList",
106 "listId": "L01",
107 },
108 {
109 "id": "n006",
110 "text": "boots",
111 "matchType": "broad",
112 "scope": "campaign",
113 "campaignId": "99",
114 },
115 {
116 "id": "n007",
117 "text": "shoes*",
118 "matchType": "broad",
119 "scope": "campaign",
120 "campaignId": "01",
121 },
122 {
123 "id": "n008",
124 "text": "shoes",
125 "matchType": "broad",
126 "scope": "unknown",
127 },
128 {
129 "id": "n009",
130 "text": "socks & shoes",
131 "matchType": "exact",
132 "scope": "account",
133 },
134 {
135 "id": "n010",
136 "text": "very very",
137 "matchType": "phrase",
138 "scope": "campaign",
139 "campaignId": "01",
140 },
141 ],
142 "sharedListAttachments": [{
143 "listId": "L01",
144 "campaignId": "03",
145 }],
146}
147
148
149run = client.actor("h_murdock/negative-keyword-preflight").call(run_input=run_input)
150
151
152print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
153for item in client.dataset(run.default_dataset_id).iterate_items():
154 print(item)
155
156