1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "startUrls": [],
12 "searchAreas": [
13 {
14 "latitude": 37.7749,
15 "longitude": -122.4194,
16 "radiusKm": 25,
17 "label": "San Francisco, CA"
18 }
19 ],
20 "maxItemsPerArea": 25,
21 "maxResults": 0,
22 "connectorTypes": [],
23 "fastChargersOnly": false,
24 "minKilowatts": 0,
25 "minPlugScore": 0,
26 "availableNowOnly": false,
27 "excludeUnderRepair": false,
28 "excludeComingSoon": false,
29 "networkIncludes": [],
30 "networkExcludes": [],
31 "nameOrNetwork": "",
32 "includeDetails": true,
33 "includeReviews": false,
34 "onlyNewOrChanged": false,
35 "requestDelayMs": 300,
36 "maxConcurrency": 3,
37 "proxyConfiguration": {
38 "useApifyProxy": true,
39 "apifyProxyGroups": [
40 "RESIDENTIAL"
41 ]
42 }
43};
44
45
46const run = await client.actor("getascraper/plugshare-scraper").call(input);
47
48
49console.log('Results from dataset');
50console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
51const { items } = await client.dataset(run.defaultDatasetId).listItems();
52items.forEach((item) => {
53 console.dir(item);
54});
55
56