1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "action": "demo",
12 "operation": "profile",
13 "location_id": "chatswood-nsw",
14 "use_advanced_scope": false,
15 "scope_template": `{
16 "type": "circle",
17 "latitude": -33.796,
18 "longitude": 151.181,
19 "k_ring": 3
20}`,
21 "dry_run": false,
22 "area_request": {
23 "areas": [
24 {
25 "area_id": "chatswood",
26 "name": "Chatswood",
27 "state": "NSW"
28 }
29 ],
30 "field_sets": [
31 "profile_complete"
32 ],
33 "max_atomic_runs": 24,
34 "business_cap_usd": "24.00",
35 "buyer_budget_usd": "50.00",
36 "allow_partial": false,
37 "idempotency_key": "my-area-plan-1"
38 }
39};
40
41
42const run = await client.actor("trustats/trugrid-au").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