1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "contactEmail": "you@example.com",
12 "mode": "filings",
13 "companies": [
14 "AAPL"
15 ],
16 "formTypes": [
17 "10-K",
18 "10-Q",
19 "8-K"
20 ],
21 "maxFilingsPerCompany": 10,
22 "maxItems": 50,
23 "maxTokensPerSection": 0,
24 "maxHoldingsPerFiling": 0,
25 "statements": [
26 "income",
27 "balance",
28 "cashflow"
29 ],
30 "periods": "both",
31 "yearsBack": 5,
32 "monitorName": "default",
33 "stateStoreName": "sec-edgar-monitor-state",
34 "lookbackDaysFirstRun": 3,
35 "maxRequestsPerSecond": 8,
36 "proxyConfiguration": {
37 "useApifyProxy": false
38 }
39};
40
41
42const run = await client.actor("tiger19935/sec-edgar-scraper").call(input);
43
44
45console.log('Results from dataset');
46console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
47const { items } = await client.dataset(run.defaultDatasetId).listItems();
48items.forEach((item) => {
49 console.dir(item);
50});
51
52