1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "schemaVersion": "1.0",
12 "requestId": "offer-normalize-20260804-001",
13 "rows": [
14 {
15 "entity": {
16 "entityId": "brand:demo-outfitters",
17 "brandName": "Demo Outfitters",
18 "legalName": null,
19 "domain": "demo.example",
20 "ticker": null,
21 "aliases": [],
22 "country": "US",
23 "sourceEntityIds": [
24 "prefill:demo-outfitters"
25 ]
26 },
27 "evidence": {
28 "evidenceType": "landing_page",
29 "sourceName": "demo_fixture",
30 "sourceRecordId": "offer-001",
31 "sourceUrl": "https://demo.example/offers/spring",
32 "observedAt": "2026-08-04T08:00:00Z",
33 "rawTitle": "Spring offer",
34 "rawTermsText": "20% off orders $50+ with code SPRING20. Ends 2026-09-30.",
35 "terms": {
36 "offerKind": "percent_off",
37 "percentOff": 20,
38 "minPurchaseAmount": {
39 "value": 50,
40 "currency": "USD"
41 },
42 "couponCode": "SPRING20",
43 "endAt": "2026-09-30T23:59:59Z"
44 },
45 "entityAttribution": {
46 "status": "verified_by_source",
47 "proofType": "first_party_domain",
48 "proofValue": "demo.example",
49 "sourceEntityId": "prefill:demo-outfitters",
50 "proofUrl": "https://demo.example/",
51 "proofDomain": "demo.example",
52 "merchantId": null,
53 "adAccountId": null,
54 "officialSourceId": null
55 },
56 "additionalUrls": []
57 }
58 }
59 ],
60 "options": {
61 "labels": "off",
62 "maxItems": 100
63 }
64};
65
66
67const run = await client.actor("zinin/us-brand-offer-evidence-normalizer").call(input);
68
69
70console.log('Results from dataset');
71console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
72const { items } = await client.dataset(run.defaultDatasetId).listItems();
73items.forEach((item) => {
74 console.dir(item);
75});
76
77