1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "actors": [
12 {
13 "actorId": "example-actor-id",
14 "ownerUsername": "example_owner",
15 "slug": "example-actor",
16 "name": "Example Actor",
17 "description": "Example URLs to structured records.",
18 "inputSchema": {
19 "type": "object",
20 "properties": {
21 "urls": {
22 "type": "array",
23 "items": {
24 "type": "string"
25 }
26 }
27 }
28 },
29 "outputContract": {
30 "type": "object",
31 "properties": {
32 "url": {
33 "type": "string"
34 },
35 "status": {
36 "type": "string"
37 }
38 }
39 },
40 "datasetSchema": null,
41 "provides": [
42 "example-extraction"
43 ],
44 "useCases": []
45 }
46 ]
47};
48
49
50const run = await client.actor("skilled_glee/echoempire-machine-foundry").call(input);
51
52
53console.log('Results from dataset');
54console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
55const { items } = await client.dataset(run.defaultDatasetId).listItems();
56items.forEach((item) => {
57 console.dir(item);
58});
59
60