1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "items": [
12 {
13 "id": "tenerife",
14 "country": "ES",
15 "postcode": "38001"
16 },
17 {
18 "id": "ceuta",
19 "country": "ES",
20 "postcode": "51001"
21 },
22 {
23 "id": "helgoland",
24 "country": "DE",
25 "postcode": "27498"
26 },
27 {
28 "id": "belfast",
29 "country": "GB",
30 "postcode": "BT1"
31 },
32 {
33 "id": "lanzarote",
34 "country": "ES",
35 "lat": 29.035,
36 "lon": -13.63
37 }
38 ]
39};
40
41
42const run = await client.actor("fetchgrove/eu-special-territory-classifier").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