1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "offers": [
12 {
13 "id": "EXAMPLE-TRIAL",
14 "title": "Example streaming free trial",
15 "offerText": "Start your free trial today! Cancel anytime."
16 },
17 {
18 "id": "EXAMPLE-GYM",
19 "title": "Example gym membership",
20 "offerText": "Membership $39.99/month, renews automatically until you cancel. To cancel, call our member services line or send a letter to your club."
21 },
22 {
23 "id": "EXAMPLE-INTRO",
24 "title": "Example meal kit intro offer",
25 "offerText": "Introductory price $1 for the first 3 months! Renews automatically monthly until you cancel. Cancel online in your account.",
26 "consentPrechecked": true
27 },
28 {
29 "id": "EXAMPLE-APP",
30 "title": "Example app subscription",
31 "offerText": "Start your 7-day free trial. After the trial, you'll be charged $9.99 per month. Your subscription renews automatically every month until you cancel. Cancel anytime online in Account settings; cancellation takes effect at the end of the current billing period.",
32 "consentText": "I agree to the automatic renewal terms above."
33 }
34 ]
35};
36
37
38const run = await client.actor("ultimatemc/auto-renewal-disclosure-checker").call(input);
39
40
41console.log('Results from dataset');
42console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
43const { items } = await client.dataset(run.defaultDatasetId).listItems();
44items.forEach((item) => {
45 console.dir(item);
46});
47
48