1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "enableSearchLawyers": true,
12 "searchTasks": [
13 {
14 "practiceArea": "personal injury",
15 "state": "Florida",
16 "city": "Miami",
17 "maxResults": 10
18 },
19 {
20 "practiceArea": "criminal defense",
21 "state": "New York",
22 "maxResults": 10
23 }
24 ],
25 "searchMaxResultsPerTask": 10,
26 "searchDepth": 20,
27 "firmSearchTasks": [
28 {
29 "practiceArea": "personal injury",
30 "state": "Texas",
31 "city": "Houston",
32 "maxResults": 10
33 }
34 ],
35 "firmSearchMaxResultsPerTask": 10,
36 "firmSearchDepth": 10,
37 "enableLeadDetails": true,
38 "maxItems": 10000,
39 "proxyConfiguration": {
40 "useApifyProxy": true,
41 "apifyProxyGroups": [
42 "RESIDENTIAL"
43 ],
44 "apifyProxyCountry": "US"
45 }
46};
47
48
49const run = await client.actor("b2b_leads/findlaw-real-time-data-scraper").call(input);
50
51
52console.log('Results from dataset');
53console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
54const { items } = await client.dataset(run.defaultDatasetId).listItems();
55items.forEach((item) => {
56 console.dir(item);
57});
58
59