1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "tokens": [
12 {
13 "symbol": "BTC",
14 "priceHistory": [
15 {
16 "time": 1703000000000,
17 "price": 42000
18 },
19 {
20 "time": 1703003600000,
21 "price": 42500
22 },
23 {
24 "time": 1703007200000,
25 "price": 43200
26 },
27 {
28 "time": 1703010800000,
29 "price": 44100
30 }
31 ],
32 "volumeHistory": [
33 {
34 "time": 1703000000000,
35 "volume": 1500000
36 },
37 {
38 "time": 1703003600000,
39 "volume": 1800000
40 },
41 {
42 "time": 1703007200000,
43 "volume": 2200000
44 },
45 {
46 "time": 1703010800000,
47 "volume": 2800000
48 }
49 ],
50 "consensusData": {
51 "agreeingSources": 4,
52 "totalSources": 5,
53 "variancePercentage": 1.5,
54 "liquidityRank": 0.85
55 }
56 }
57 ]
58};
59
60
61const run = await client.actor("natalietdg/coinhawk-trending-engine").call(input);
62
63
64console.log('Results from dataset');
65console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
66const { items } = await client.dataset(run.defaultDatasetId).listItems();
67items.forEach((item) => {
68 console.dir(item);
69});
70
71