1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "works": [
12 {
13 "title": "Frankenstein",
14 "authors": [
15 {
16 "name": "Mary Shelley",
17 "deathYear": 1851
18 }
19 ],
20 "publicationYear": 1818,
21 "publicationCountry": "GB",
22 "workType": "literary"
23 },
24 {
25 "title": "Animal Farm",
26 "authors": [
27 "George Orwell"
28 ],
29 "publicationYear": 1945,
30 "publicationCountry": "GB"
31 }
32 ],
33 "countries": [
34 "AU",
35 "US",
36 "MX",
37 "GB"
38 ]
39};
40
41
42const run = await client.actor("geeky_goth_gamer/public-domain-checker").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