Skip to content

Commit 7eb5f8f

Browse files
committed
docs: Add batch metadata retrieval example to README
Add concise documentation for get_filing_metadatas_batch() method: - Shows example with multiple accession numbers - Highlights optimization (2 API calls for 3 filings) - Explains use case clearly without bloat Updated both index.ipynb notebook and README.md 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 1611078 commit 7eb5f8f

File tree

2 files changed

+43
-1
lines changed

2 files changed

+43
-1
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,24 @@ Alternatively, you can also use any of these to get the same answer:
178178
metadatas = dl.get_filing_metadatas(RequestedFilings(ticker_or_cik="NFLX"))
179179
metadatas = dl.get_filing_metadatas(RequestedFilings(limit=1, ticker_or_cik="NFLX", form_type="10-Q"))
180180

181+
Efficiently retrieve metadata for multiple specific accession numbers:
182+
183+
Useful when you've downloaded filings in bulk and want metadata for
184+
specific accession numbers without making individual requests or
185+
fetching all filings for each company.
186+
187+
``` python
188+
# Groups by CIK - makes only 2 API calls (one for AAPL, one for MSFT)
189+
metadatas = dl.get_filing_metadatas_batch([
190+
"AAPL/0000320193-23-000077",
191+
"AAPL/0000320193-24-000123",
192+
"MSFT/0000950170-24-087843",
193+
])
194+
print(f"Retrieved {len(metadatas)} filings with {len(set(m.cik for m in metadatas))} API calls")
195+
```
196+
197+
Retrieved 3 filings with 2 API calls
198+
181199
## Download the HTML files
182200

183201
After obtaining the Primary Document URL, for example from the metadata,

nbs/index.ipynb

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,30 @@
315315
"```"
316316
]
317317
},
318+
{
319+
"cell_type": "markdown",
320+
"metadata": {},
321+
"source": [
322+
"Efficiently retrieve metadata for multiple specific accession numbers:\n",
323+
"\n",
324+
"Useful when you've downloaded filings in bulk and want metadata for specific accession numbers without making individual requests or fetching all filings for each company."
325+
]
326+
},
327+
{
328+
"cell_type": "code",
329+
"execution_count": null,
330+
"metadata": {},
331+
"outputs": [],
332+
"source": [
333+
"# Groups by CIK - makes only 2 API calls (one for AAPL, one for MSFT)\n",
334+
"metadatas = dl.get_filing_metadatas_batch([\n",
335+
" \"AAPL/0000320193-23-000077\",\n",
336+
" \"AAPL/0000320193-24-000123\",\n",
337+
" \"MSFT/0000950170-24-087843\",\n",
338+
"])\n",
339+
"print(f\"Retrieved {len(metadatas)} filings with {len(set(m.cik for m in metadatas))} API calls\")"
340+
]
341+
},
318342
{
319343
"cell_type": "markdown",
320344
"metadata": {},
@@ -508,4 +532,4 @@
508532
},
509533
"nbformat": 4,
510534
"nbformat_minor": 4
511-
}
535+
}

0 commit comments

Comments
 (0)