1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "queries": [
12 "web scraping tools"
13 ],
14 "engines": [
15 "duckduckgo",
16 "bing"
17 ],
18 "maxResultsPerQuery": 10,
19 "country": "US",
20 "language": "en",
21 "region": "",
22 "safeSearch": "moderate",
23 "deduplicate": true,
24 "relevanceGuard": "on",
25 "ddgDeepPaging": false,
26 "residentialFallback": true,
27 "maxConcurrency": 4,
28 "maxRunSecs": 240,
29 "proxyConfiguration": {
30 "useApifyProxy": true
31 }
32};
33
34
35const run = await client.actor("insight.solutions/web-search-api").call(input);
36
37
38console.log('Results from dataset');
39console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
40const { items } = await client.dataset(run.defaultDatasetId).listItems();
41items.forEach((item) => {
42 console.dir(item);
43});
44
45