Home / Tutorials / Financial data
Financial data

Export SEC financial statements to Excel

Download any 10-K or 10-Q's financial statements as an .xlsx workbook, one sheet per statement, with no spreadsheet library on your side.

Analysts often want statements in Excel, not JSON. /v1/financial-statements/xlsx builds a workbook from a filing's XBRL: one sheet per statement, concepts as rows and periods as columns.

Download the workbook

import os
import zipfile
import requests

BASE = "https://secfeedapi.com"
HEADERS = {"Authorization": f"Bearer {os.environ['SECFEED_KEY']}"}

r = requests.get(f"{BASE}/v1/financial-statements/xlsx", params={"accessionNo": "0000320193-25-000079", "cik": 320193},
                 headers=HEADERS, timeout=120)
r.raise_for_status()
open("aapl-fy2025.xlsx", "wb").write(r.content)
print(r.headers["Content-Type"])
print(len(r.content), "bytes")

# peek at the sheet names without any third-party library
import re
with zipfile.ZipFile("aapl-fy2025.xlsx") as z:
    wb = z.read("xl/workbook.xml").decode()
    print(re.findall(r'<sheet name="([^"]+)"', wb))

Output:

application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
9361 bytes
['CoverPage', 'AuditorInformation', 'StatementsOfIncome', 'StatementsOfComprehensiveIncome', 'BalanceSheets', 'ConsolidatedBalanceSheets', 'StatementsOfShareholdersEquity', 'StatementsOfCashFlows']

The workbook mirrors the statements in the filing: the cover page, auditor information, income statement, comprehensive income, balance sheets, shareholders equity and cash flows. The example reads sheet names with zipfile only to show what is inside; you do not need any library to save and open the file.

What each sheet contains

  • Rows are XBRL concepts in the order the company presents them.
  • Columns are the reporting periods in the filing, for example three fiscal years on a 10-K income statement and two year end dates on a balance sheet.
  • Numbers are written as numbers, so you can sum and chart them right away.

Find the accession number

Any filing search gives you accessionNo and cik. For example, to export the latest 10-Q of a company:

res = requests.get(f"{BASE}/v1/filings", params={"query": "cik:320193 AND filedAt:[2025-01-01 TO *]", "size": 200},
                   headers=HEADERS, timeout=120).json()
f = next(x for x in res["filings"] if x["formType"] == "10-Q")  # newest first
params = {"accessionNo": f["accessionNo"], "cik": f["cik"]}

Read it in pandas

import pandas as pd
sheets = pd.read_excel("aapl-fy2025.xlsx", sheet_name=None)  # needs openpyxl
income = sheets["StatementsOfIncome"]

Next steps

More financial data tutorials

Run this tutorial with your own key

500 free API calls a month. Every example on this page works on the free plan.

Get free API key →