1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "includePostcodes": [
12 "T6R*"
13 ],
14 "excludePostcodes": [
15 "T6R 0A1"
16 ],
17 "countryCodes": [
18 "CA"
19 ],
20 "data": [
21 {
22 "title": "Synthetic kept lead",
23 "postalCode": "t6r 2v4",
24 "countryCode": "CA"
25 },
26 {
27 "title": "Synthetic excluded lead",
28 "postalCode": "T6R 0A1",
29 "countryCode": "CA"
30 },
31 {
32 "title": "Synthetic outside lead",
33 "postalCode": "T5J 0N3",
34 "countryCode": "CA"
35 },
36 {
37 "title": "Synthetic missing postcode",
38 "countryCode": "CA"
39 }
40 ]
41};
42
43
44const run = await client.actor("mrtronson/google-maps-postcode-filter").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