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 "https://www.bbb.org/us/ny/new-york/category/home-improvement",
13 "https://www.bbb.org/us/ny/new-york/categories",
14 "https://www.bbb.org/us/ny/new-york/profile/home-builders/jf-hughes-builders-inc-0121-87134180",
15 "https://www.bbb.org/search?find_country=USA&find_entity=66005-000&find_id=1099_2800-400-1100&find_latlng=40.762801%2C-73.977818&find_loc=New%20York%2C%20NY&find_text=Clean%20Up%20Services&find_type=Category&page=1&sort=Relevance"
16 ],
17 "maxItems": 50,
18 "endPage": 1,
19 "extendOutputFunction": ($) => { return {} },
20 "proxy": {
21 "useApifyProxy": true
22 }
23};
24
25
26const run = await client.actor("epctex/bbb-scraper").call(input);
27
28
29console.log('Results from dataset');
30console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
31const { items } = await client.dataset(run.defaultDatasetId).listItems();
32items.forEach((item) => {
33 console.dir(item);
34});
35
36