1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "auditInput": {
12 "audit": {
13 "audit_id": "fixture-normal",
14 "as_of_date": "2026-09-03",
15 "marketplace": "US",
16 "currency": "USD",
17 "source_note": "constructed fixture; no seller data"
18 },
19 "report": {
20 "report_type": "sponsored_products_search_term",
21 "start_date": "2026-08-01",
22 "end_date": "2026-08-20",
23 "conversion_lag_days": 7
24 },
25 "product": {
26 "vertical": "apparel",
27 "asin": "B0FIXTURE01",
28 "parent_asin": "B0PARENT01",
29 "category": "clothing_shoes_and_jewelry",
30 "apparel_segment": "tops",
31 "lifecycle": "evergreen",
32 "launch_stage": "growth",
33 "goal": "profit",
34 "price_per_order": 40,
35 "non_ad_variable_cost_per_order": 26,
36 "listing_status": "ready",
37 "featured_offer_status": "active",
38 "inventory_status": "in_stock",
39 "variation_health": "healthy",
40 "variation_theme": "size_color",
41 "cross_asin_orders_reviewed": true,
42 "variation_inventory": [
43 {
44 "child_asin": "B0FIXTURE01",
45 "size": "M",
46 "color": "black",
47 "inventory_status": "in_stock",
48 "listing_status": "ready",
49 "featured_offer_status": "active"
50 },
51 {
52 "child_asin": "B0FIXTURE02",
53 "size": "L",
54 "color": "black",
55 "inventory_status": "in_stock",
56 "listing_status": "ready",
57 "featured_offer_status": "active"
58 }
59 ]
60 },
61 "policy": {
62 "target_acos": 0.25,
63 "min_clicks_for_action": 10,
64 "min_orders_for_winner": 2,
65 "min_orders_for_expand": 2,
66 "max_clicks_without_order": 15,
67 "seasonal_replan_days": 14,
68 "high_bid_multiplier_warning": 4,
69 "allow_strategic_over_break_even": false,
70 "max_bid_change_pct": 20,
71 "max_budget_change_pct": 25
72 },
73 "rows": [
74 {
75 "row_id": "exact-winner",
76 "campaign_id": "c-1",
77 "ad_group_id": "g-1",
78 "targeting_text": "women black travel shirt",
79 "customer_search_term": "women black travel shirt",
80 "advertised_asin": "B0FIXTURE01",
81 "purchased_asin": "B0FIXTURE01",
82 "match_type": "exact",
83 "relevance": "relevant",
84 "impressions": 1000,
85 "clicks": 50,
86 "spend": 20,
87 "sales": 120,
88 "orders": 3,
89 "base_bid": 0.65,
90 "daily_budget": 20,
91 "placement_adjustment_pct": 20,
92 "audience_adjustment_pct": 0,
93 "video_adjustment_pct": 0,
94 "bidding_strategy": "down_only"
95 },
96 {
97 "row_id": "broad-winner",
98 "campaign_id": "c-2",
99 "ad_group_id": "g-2",
100 "targeting_text": "women travel top",
101 "customer_search_term": "women black travel shirt",
102 "advertised_asin": "B0FIXTURE01",
103 "purchased_asin": "B0FIXTURE02",
104 "match_type": "broad",
105 "relevance": "relevant",
106 "impressions": 800,
107 "clicks": 40,
108 "spend": 18,
109 "sales": 80,
110 "orders": 2,
111 "bidding_strategy": "fixed"
112 },
113 {
114 "row_id": "converting-over-limit",
115 "campaign_id": "c-3",
116 "ad_group_id": "g-3",
117 "targeting_text": "women casual top",
118 "customer_search_term": "women casual black top",
119 "advertised_asin": "B0FIXTURE01",
120 "purchased_asin": "B0FIXTURE01",
121 "match_type": "phrase",
122 "relevance": "relevant",
123 "impressions": 600,
124 "clicks": 30,
125 "spend": 30,
126 "sales": 80,
127 "orders": 2,
128 "base_bid": 1.1,
129 "daily_budget": 30,
130 "placement_adjustment_pct": 50,
131 "audience_adjustment_pct": 0,
132 "video_adjustment_pct": 0,
133 "bidding_strategy": "fixed"
134 },
135 {
136 "row_id": "irrelevant-query",
137 "campaign_id": "c-4",
138 "ad_group_id": "g-4",
139 "targeting_text": "women tops",
140 "customer_search_term": "free sewing pattern software",
141 "advertised_asin": "B0FIXTURE01",
142 "match_type": "broad",
143 "relevance": "irrelevant",
144 "impressions": 500,
145 "clicks": 20,
146 "spend": 10,
147 "sales": 0,
148 "orders": 0,
149 "bidding_strategy": "down_only"
150 },
151 {
152 "row_id": "low-evidence",
153 "campaign_id": "c-5",
154 "ad_group_id": "g-5",
155 "targeting_text": "women travel shirt",
156 "customer_search_term": "women travel shirt",
157 "advertised_asin": "B0FIXTURE01",
158 "match_type": "exact",
159 "relevance": "relevant",
160 "impressions": 200,
161 "clicks": 5,
162 "spend": 3,
163 "sales": 0,
164 "orders": 0,
165 "bidding_strategy": "fixed"
166 }
167 ]
168 }
169};
170
171
172const run = await client.actor("ysoserious_h/amazon-us-apparel-ppc-decision-auditor").call(input);
173
174
175console.log('Results from dataset');
176console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
177const { items } = await client.dataset(run.defaultDatasetId).listItems();
178items.forEach((item) => {
179 console.dir(item);
180});
181
182