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 "includeDetails": true,
32 "includeReviews": false,
33 "onlyNewOrChanged": false,
34 "requestDelayMs": 300,
35 "maxConcurrency": 3,
36 "proxyConfiguration": {
37 "useApifyProxy": true,
38 "apifyProxyGroups": [
39 "RESIDENTIAL"
40 ]
41 }
42};
43
44
45const run = await client.actor("getascraper/plugshare-scraper").call(input);
46
47
48console.log('Results from dataset');
49console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
50const { items } = await client.dataset(run.defaultDatasetId).listItems();
51items.forEach((item) => {
52 console.dir(item);
53});
54
55