MCP Server live — AI agents can now query 105M+ SEC facts. Connect your agent →
ValueinValuein
intermediate
8 min

S&P 500 Revenue Growth Screener

Find all S&P 500 companies with 3-year revenue CAGR above 20% using the references table.

SDKscreeningrevenueDuckDB
## Screen S&P 500 for Revenue Growth Use the `references` table to get the S&P 500 universe, then join to `fact` for revenue history.
python
from valuein_sdk import ValueinClient, ValueinError

try:
    with ValueinClient() as client:
        results = client.query("""
          WITH rev AS (
            SELECT 
              entity_id,
              MAX(CASE WHEN fiscal_year = 2024 THEN numeric_value END) AS rev_2024,
              MAX(CASE WHEN fiscal_year = 2021 THEN numeric_value END) AS rev_2021
            FROM fact
            WHERE standard_concept = 'TotalRevenue'
              AND fiscal_period = 'FY'
            GROUP BY entity_id
          )
          SELECT 
            r.symbol, r.name, r.sector,
            ROUND(rev.rev_2024 / 1e9, 2) AS rev_2024_bn,
            ROUND(
              POWER(rev.rev_2024 / NULLIF(rev.rev_2021, 0), 1.0/3) - 1,
              4
            ) AS cagr_3yr
          FROM rev
          JOIN references r USING (entity_id)
          WHERE r.is_sp500 = TRUE
            AND cagr_3yr > 0.20
          ORDER BY cagr_3yr DESC
          LIMIT 20
        """)
        print(results.to_string())
except ValueinError as e:
    print(f"Error: {e}")
Output
   symbol                    name        sector  rev_2024_bn  cagr_3yr
0    NVDA              NVIDIA Corp   Technology       130.50    0.5901
1    SMCI  Super Micro Computer     Technology        14.94    0.4823
2    DECK       Deckers Outdoor    Consumer         4.28    0.2312
...

Try it yourself

Get your API token and run this notebook against 105M+ real SEC EDGAR facts.