1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "targets": [
12 {
13 "label": "New York Times ads.txt",
14 "domain": "nytimes.com",
15 "fileTypes": [
16 "ads_txt"
17 ],
18 "expectedAdSystems": [
19 "google.com",
20 "indexexchange.com"
21 ]
22 },
23 {
24 "label": "CNN ads.txt",
25 "domain": "cnn.com",
26 "fileTypes": [
27 "ads_txt"
28 ]
29 },
30 {
31 "label": "OpenX sellers.json",
32 "domain": "openx.com",
33 "fileTypes": [
34 "sellers_json"
35 ],
36 "sellersJsonUrl": "https://assets.openx.com/sellers.json"
37 }
38 ]
39};
40
41
42const run = await client.actor("defenestrator/ads-txt-sellers-json-drift-monitor").call(input);
43
44
45console.log('Results from dataset');
46console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
47const { items } = await client.dataset(run.defaultDatasetId).listItems();
48items.forEach((item) => {
49 console.dir(item);
50});
51
52