Home / Guides / XBRL & financials
XBRL & financials

Stock screener API on SEC fundamentals: screen every filer by XBRL data

Screen every SEC filer on up to five conditions on revenue, profit, assets, cash flow, debt or a ratio of two of them, for a calendar year or quarter, with the tag and accession behind each value.

Most screeners start from market prices and a vendor's own database. /v1/screener starts from the filings: it holds the latest values of about 40 XBRL concepts for every filer, for the last four calendar years and eight quarters, and returns the companies that meet your conditions. Every value comes with the XBRL tag and the accession of the filing it came from.

Setup

import os
import requests

H = {"Authorization": "Bearer " + os.environ["SECFEED_KEY"]}
BASE = "https://secfeedapi.com/v1"

A first screen with GET

Conditions are a comma list such as Revenue>1e9. A concept can be a ratio of two concepts, GrossProfit/Revenue. period is a calendar year (CY2025) or quarter (CY2026Q2).

r = requests.get(BASE + "/screener", headers=H, params={
    "conditions": "Revenue>1e9,GrossProfit/Revenue>0.6", "period": "CY2025", "size": 5}).json()
print(r["total"], r["hasMore"])
for c in r["companies"]:
    v = c["values"]
    print(c["ticker"], c["company"][:28], f"{v['Revenue']['value']/1e9:.1f}", f"{v['GrossProfit/Revenue']['value']:.1%}")

Output from a real run:

126 True
MSFT MICROSOFT CORPORATION 281.7 68.8%
NVDA NVIDIA CORP 215.9 71.1%
JNJ Johnson & Johnson 94.2 67.9%
AVGO Broadcom Inc. 63.9 67.8%
CSCO CISCO SYSTEMS, INC. 56.7 64.9%

126 filers had more than $1 billion of revenue and a gross margin above 60% in calendar 2025. Results sort by the first condition, largest first; page with from. values.<condition>.from[] lists the tag and accession behind each number, so you can open the filing.

More conditions with POST

POST a JSON body for longer screens. Up to five conditions; Revenue and Debt are aliases that cover the usual alternative tags.

body = {"period": "CY2025", "sort": "Revenue", "size": 5, "conditions": [
    {"concept": "Revenue", "op": ">", "value": 5e8},
    {"concept": "NetIncomeLoss/Revenue", "op": ">", "value": 0.25},
    {"concept": "NetIncomeLoss/Revenue", "op": "<", "value": 1},
    {"concept": "Debt", "op": "<", "value": 1e9}]}
r = requests.post(BASE + "/screener", headers=H, json=body).json()
print(r["total"])
for c in r["companies"]:
    v = c["values"]
    print(c["ticker"], c["company"][:30], f"{v['Revenue']['value']/1e9:.1f}", f"{v['NetIncomeLoss/Revenue']['value']:.1%}", f"{v['Debt']['value']/1e6:,.0f}")
32
VRTX VERTEX PHARMACEUTICALS INC / M 12.0 32.9% 0
FTNT FORTINET, INC. 6.8 27.3% 497
FSLR First Solar, Inc. 5.2 29.3% 283
RMD ResMed Inc. 5.1 27.2% 404
HOOD Robinhood Markets, Inc. 4.5 42.1% 0

The upper bound on the margin is there on purpose. Without it, a company with a one-off gain or a tiny revenue line shows a net margin of thousands of percent and tops the list. Raw XBRL values need sanity bounds like that.

Which concepts you can use

c = requests.get(BASE + "/screener/concepts", headers=H).json()
print(len(c["concepts"]), c["aliases"])
38 {'Revenue': ['Revenues', 'RevenueFromContractWithCustomerExcludingAssessedTax', 'SalesRevenueNet'], 'Debt': ['LongTermDebt', 'LongTermDebtNoncurrent']}

The list covers the income statement, cash flow (operating cash flow, capex, buybacks, dividends), the balance sheet (assets, liabilities, equity, cash, inventory, goodwill, debt) and share counts.

Limits

  • No prices, so no P/E, market cap or dividend yield.
  • Values are raw XBRL from the latest filing for each period, not restated, and a company that does not tag a concept is left out of a screen on it.
  • The SEC calendarises fiscal periods: a company with a June year end appears in the calendar year its fiscal year mostly covers.

More xbrl & financials guides

Run this guide with your own key

Free key, no card needed. Every example on this page works on the free plan.

Get free API key →