1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "input": [
12 {
13 "symbol": "AAPL",
14 "region": "US",
15 "range": "1y",
16 "interval": "1d",
17 "comparisons": "MSFT,GOOGL"
18 },
19 {
20 "symbol": "TSLA",
21 "region": "US",
22 "range": "1d",
23 "interval": "1m",
24 "comparisons": "AAPL,AMZN"
25 },
26 {
27 "symbol": "AMZN",
28 "region": "US",
29 "period1": 1556816400,
30 "period2": 1588342800
31 }
32 ]
33};
34
35
36const run = await client.actor("axesso_data/yahoo-finance-historical-data-scraper").call(input);
37
38
39console.log('Results from dataset');
40console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
41const { items } = await client.dataset(run.defaultDatasetId).listItems();
42items.forEach((item) => {
43 console.dir(item);
44});
45
46