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 "id": "W-1",
14 "title": "Frankenstein",
15 "creator": "James Whale",
16 "type": "film",
17 "year": 1931
18 },
19 {
20 "id": "W-2",
21 "title": "The Great Gatsby",
22 "creator": "F. Scott Fitzgerald",
23 "type": "book",
24 "year": 1925
25 },
26 {
27 "id": "W-3",
28 "title": "Heebie Jeebies",
29 "creator": "Louis Armstrong and His Hot Five",
30 "type": "sound_recording",
31 "year": 1926
32 },
33 {
34 "id": "W-4",
35 "title": "Beloved",
36 "creator": "Toni Morrison",
37 "type": "book",
38 "year": 1987
39 }
40 ]
41};
42
43
44const run = await client.actor("robot-supply-store/us-public-domain-checker").call(input);
45
46
47console.log('Results from dataset');
48console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
49const { items } = await client.dataset(run.defaultDatasetId).listItems();
50items.forEach((item) => {
51 console.dir(item);
52});
53
54