Extract 10-Q MD&A with the correct part and item
Find a quarterly SEC filing and extract Part I Item 2 management discussion using the actual primary document filename.
Resolve a 10-Q accession, confirm the primary filename in its document manifest, then request Part I Item 2. Retain the heuristic extraction metadata and remaining offset rather than treating a truncated page as the complete section.
Requirements: Node.js 22 or later; no dependencies. An API key from your dashboard, stored in the SEC_API_KEY environment variable.
Run the workflow
Save this as workflow.mjs and run node workflow.mjs. The production base URL is used by default. Keep credentials out of source control.
const key = process.env.SEC_API_KEY;
if (!key) throw new Error("Set SEC_API_KEY");
const base = process.env.SEC_API_BASE_URL || "https://sec-api.dev";
async function request(path, params) {
const response = await fetch(base + path + "?" + new URLSearchParams(params), {
headers: {Authorization: "Bearer " + key}
});
if (!response.ok) throw new Error("HTTP " + response.status + ": " + await response.text());
return response.json();
}
const cik = "320193";
const filings = await request("/api/v1/filings", {cik,form:"10-Q",limit:"1"});
const filing = filings.data[0];
if (!filing) throw new Error("No quarterly filing in this response");
const manifest = await request("/api/v1/documents", {cik,accession:filing.accessionNumber});
const document = filing.primaryDocument;
if (!manifest.data.some(item => item.name === document)) throw new Error("Primary document not in manifest");
const result = await request("/api/v1/extract", {
cik, accession:filing.accessionNumber, document,
form:"10-Q", part:"I", section:"2", limit:"10000", offset:"0"
});
console.log(JSON.stringify({text:result.data.text, section:result.data, pagination:result.pagination, provenance:result.meta}, null, 2));Why part matters for quarterly reports
A 10-Q contains items within separate parts. Requesting Part I Item 2 identifies management discussion; an unqualified item number could refer to another section. This workflow uses the exact 10-Q filter. It does not automatically include 10-Q/A amendments or substitute an annual report when the recent result is empty.
Resolve document identity before extracting
The filing response supplies the accession and primaryDocument filename. The manifest check verifies that the filename is actually listed in the filing archive. Keep the accession and SEC source URL with the extracted text so a reviewer can open the original document. Do not guess the filename from a ticker or reporting date; issuer naming conventions vary.
Review the section boundary and pagination
Extraction uses document headings rather than a manually certified section corpus. A table of contents or unusual formatting can affect boundaries. The API may return 422 when the requested section cannot be found; that is not proof the filing omitted a required disclosure. Review the returned method and source context, follow the pagination offset for longer text, and compare material excerpts with the original filing before quoting them.
Sources and further reading
The underlying SEC dataset behavior is documented in the official SEC API reference and SEC technical specifications. Response-field names shown here belong to the sec-api.dev endpoint contract. The scripts print actual results and do not embed fabricated filing or financial data.
All tutorials ←