1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "tools": [
12 {
13 "inputSchema": {
14 "type": "object",
15 "properties": {
16 "query": {
17 "type": "string"
18 },
19 "filter": {
20 "type": "object",
21 "properties": {
22 "limit": {
23 "type": "integer"
24 }
25 },
26 "required": []
27 }
28 },
29 "required": [
30 "query"
31 ]
32 }
33 }
34 ]
35};
36
37
38const run = await client.actor("salim-operator-labs/my-actor-1").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