1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "listings": [
12 {
13 "product_id": "EXAMPLE-1",
14 "brand": "Example Beauty",
15 "title": "Lip Oil Dupe for Dior!! Viral TikTok Made Me Buy It Lip Gloss, Best Seller",
16 "description": "Before and after: plumper lips overnight, guaranteed results. Order on our website www.examplebeauty.com for 20% off."
17 },
18 {
19 "product_id": "EXAMPLE-2",
20 "brand": "Example Basics",
21 "title": "Example Basics Men's Cotton Crew Neck T-Shirt, Black, Large",
22 "description": "Made from 100% combed ring-spun cotton jersey, this crew neck tee has a relaxed fit that sits just below the hip. Taped shoulder seams and a double-stitched hem help it keep its shape wash after wash. The ribbed collar lies flat and resists stretching. Fabric weight is 5.3 oz per square yard, heavy enough to be opaque but light enough for warm days. Size Large measures 22 in across the chest and 29 in from shoulder to hem. Machine wash cold with like colors and tumble dry low; expect less than 3% shrinkage. Tagless neck label for comfort."
23 }
24 ]
25};
26
27
28const run = await client.actor("ultimatemc/tiktok-shop-listing-policy-checker").call(input);
29
30
31console.log('Results from dataset');
32console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
33const { items } = await client.dataset(run.defaultDatasetId).listItems();
34items.forEach((item) => {
35 console.dir(item);
36});
37
38