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