1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "enableTopCoins": true,
12 "vsCurrency": "usd",
13 "topCoinsLimit": 10,
14 "topCoinsOrder": "market_cap_desc",
15 "topCoinsFetchFullDetails": false,
16 "enableCoinSearch": false,
17 "searchQueries": [
18 "bitcoin",
19 "ethereum",
20 "solana"
21 ],
22 "coinSearchMaxResults": 10,
23 "coinSearchFetchFullDetails": false,
24 "enableCoinDetails": false,
25 "coinIds": [],
26 "coinUrls": [],
27 "enableTrending": false,
28 "enableExchanges": false,
29 "exchangesLimit": 10,
30 "enableScrapeByUrl": false,
31 "scrapeUrls": [
32 "https://www.coingecko.com/en/coins/bitcoin"
33 ],
34 "webhookFormat": "json",
35 "proxyConfiguration": {
36 "useApifyProxy": true,
37 "apifyProxyGroups": [
38 "RESIDENTIAL"
39 ]
40 }
41};
42
43
44const run = await client.actor("b2b_leads/coingecko-real-time-data-scraper").call(input);
45
46
47console.log('Results from dataset');
48console.log(`πΎ Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
49const { items } = await client.dataset(run.defaultDatasetId).listItems();
50items.forEach((item) => {
51 console.dir(item);
52});
53
54