1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "operation": "filings",
12 "companies": [
13 "AAPL"
14 ],
15 "formTypes": [
16 "10-K",
17 "10-Q",
18 "8-K"
19 ],
20 "includeAmendments": true,
21 "concepts": [
22 "Revenues",
23 "RevenueFromContractWithCustomerExcludingAssessedTax",
24 "NetIncomeLoss",
25 "Assets",
26 "EarningsPerShareDiluted"
27 ],
28 "periodType": "all",
29 "latestValueOnly": true,
30 "searchQuery": "\"artificial intelligence\"",
31 "managers": [
32 "1067983"
33 ],
34 "quarters": 1,
35 "maxResults": 100
36};
37
38
39const run = await client.actor("sian.agency/sec-edgar-scraper").call(input);
40
41
42console.log('Results from dataset');
43console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
44const { items } = await client.dataset(run.defaultDatasetId).listItems();
45items.forEach((item) => {
46 console.dir(item);
47});
48
49