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 "searchKeywords": [
13 "coffee shop"
14 ],
15 "maxResults": 5,
16 "country": "global",
17 "industry": "",
18 "locationText": "",
19 "sortOrder": "newest",
20 "minAskingPrice": 0,
21 "maxAskingPrice": 0,
22 "minRevenue": 0,
23 "maxRevenue": 0,
24 "minCashFlow": 0,
25 "maxCashFlow": 0,
26 "onlyDisclosedPrice": false,
27 "onlyDisclosedRevenue": false,
28 "onlyDisclosedCashFlow": false
29};
30
31
32const run = await client.actor("parsebird/businessesforsale-listings-scraper").call(input);
33
34
35console.log('Results from dataset');
36console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
37const { items } = await client.dataset(run.defaultDatasetId).listItems();
38items.forEach((item) => {
39 console.dir(item);
40});
41
42