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 ],
22 "fetchDetails": true,
23 "fetchVcard": false,
24 "freeConsultationOnly": false,
25 "topRatedOnly": false,
26 "maxItems": 20,
27 "proxy": {
28 "useApifyProxy": true,
29 "apifyProxyGroups": [
30 "RESIDENTIAL"
31 ],
32 "apifyProxyCountry": "US"
33 }
34};
35
36
37const run = await client.actor("abotapi/justia-lawyer-scraper").call(input);
38
39
40console.log('Results from dataset');
41console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
42const { items } = await client.dataset(run.defaultDatasetId).listItems();
43items.forEach((item) => {
44 console.dir(item);
45});
46
47