1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "sites": [
12 "www.nytimes.com",
13 "github.com",
14 "en.wikipedia.org",
15 "www.theguardian.com",
16 "apify.com"
17 ],
18 "userAgents": [
19 "Googlebot",
20 "Bingbot",
21 "GPTBot",
22 "ClaudeBot",
23 "CCBot",
24 "PerplexityBot",
25 "Google-Extended",
26 "Applebot-Extended"
27 ],
28 "testPaths": [
29 "/",
30 "/search?q=test",
31 "/api/"
32 ]
33};
34
35
36const run = await client.actor("adamplaenitz/robots-txt-checker").call(input);
37
38
39console.log('Results from dataset');
40console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
41const { items } = await client.dataset(run.defaultDatasetId).listItems();
42items.forEach((item) => {
43 console.dir(item);
44});
45
46