1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "pages": [
12 {
13 "url": "https://example.com/en",
14 "alternates": [
15 {
16 "hreflang": "en",
17 "href": "https://example.com/en"
18 },
19 {
20 "hreflang": "fr",
21 "href": "https://example.com/fr"
22 }
23 ]
24 },
25 {
26 "url": "https://example.com/fr",
27 "alternates": [
28 {
29 "hreflang": "fr",
30 "href": "https://example.com/fr"
31 }
32 ]
33 }
34 ]
35};
36
37
38const run = await client.actor("garnet_precipice/my-actor").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