1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "mode": "search",
12 "states": [
13 "California"
14 ],
15 "practiceAreas": [
16 "Personal Injury"
17 ],
18 "cities": [],
19 "startUrls": [
20 "https://lawyers.justia.com/lawyers/personal-injury/california",
21 "https://lawyers.justia.com/lawyers/family-law/new-york"
22 ],
23 "fetchDetails": true,
24 "fetchVcard": false,
25 "freeConsultationOnly": false,
26 "topRatedOnly": false,
27 "maxPages": 0,
28 "maxItems": 20,
29 "proxy": {
30 "useApifyProxy": true,
31 "apifyProxyGroups": [
32 "RESIDENTIAL"
33 ],
34 "apifyProxyCountry": "US"
35 },
36 "incrementalMode": false,
37 "emitUnchanged": false,
38 "emitExpired": false,
39 "ignoreFieldsForChanges": []
40};
41
42
43const run = await client.actor("abotapi/justia-lawyer-scraper").call(input);
44
45
46console.log('Results from dataset');
47console.log(`๐พ Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
48const { items } = await client.dataset(run.defaultDatasetId).listItems();
49items.forEach((item) => {
50 console.dir(item);
51});
52
53