Valyu Logo

Tutorial

How to Integrate SEC Filings into Your AI App (Complete 2025 Guide)

TL;DR

  • The fastest way to search and retrieve SEC filings in your AI application is through Valyu’s Search API
  • With 3 lines of code, you can access structured, sectioned 10-K, 10-Q, and 8-K filings (updated within 10 minutes of publication on EDGAR)
  • Query in natural language instead of accession numbers
  • Use them instantly with LangChain, Vercel AI SDK, or LlamaIndex

Why SEC Filings Matter for AI

SEC filings are the backbone of public company research. They’re used to power:

  • AI Investment research agents
  • AI Risk and compliance copilots
  • AI Financial forecasting tools
  • AI Competitive intelligence systems

By grounding answers in SEC Filings, you reduce hallucinations and build trust particularly if you are building applications for regulated industries.

What Makes SEC Filings Hard to Work With?

Before using Valyu, developers usually face:

  • Messy scraping from EDGAR’s raw HTML
  • No semantic structure, just long documents
  • Manual regex, brittle and error-prone
  • Slow, costly APIs from data vendors charging $10k+/mo
  • No section-level filtering or metadata

The Easy Way: Use Valyu’s SEC Filings Search API

Valyu indexes 10-K, 10-Q, and 8-K filings, returns them in clean structured JSON, and integrates seamlessly into your stack.

Minimal Setup (3 Lines of Code)

typescript
1import { Valyu } from 'valyu-js';
2
3const valyu = new Valyu({ apiKey: 'your-valyu-api-key' });
4
5const response = await valyu.search(
6 "Risk factors from 10-k Pfizer FY2021"
7);
8
9console.log(response);


Example Use Cases

  • Investment Research Copilot
    “Summarise the MD&A from Tesla’s 2023 10-K.”
  • Risk & Compliance Assistant
    “Show recent ESG disclosures from financial sector 10-Qs.”
  • Competitive Intelligence Tool
    “Find product mentions in Apple’s and Samsung’s 8-Ks.”

Benchmarks

Finance evaluation: Valyu reached 73% accuracy, Parallel 67%, Exa 63%, and Google 55% on financial questions.

Finance evaluation: Valyu reached 73% accuracy, Parallel 67%, Exa 63%, and Google 55% on financial questions.

Valyu offers the fastest and most structured access to SEC data for AI use cases.
For details on how we evaluate performance, see our Finance Benchmark blog post or browse the public benchmarks on GitHub.

Advanced Filtering: Get Only What You Need

Use query params like included_sources, date_range, and relevance_threshold to control results.

typescript
1const response = await valyu.search(
2 "Tesla 10-k MD&A section from latest filing",
3 {
4 included_sources: ["valyu/valyu-sec-filings"],
5 max_num_results: 5
6 }
7);

Tips:

  • For recent filings: Add time frame/recency into the search query
  • To narrow by company: Add ticker or full name in the query
  • Reduce token usage: max_num_results: 3–5
  • Full filings: response_length: "max"

Live Demo

Try searching SEC filings in natural language →
This demo extracts specific sections like:

  • Risk Factors
  • MD&A
  • Financial Statements

Best Practices for AI-Ready SEC Data

  • Chunk long responses before passing to LLMs
  • Pre-index high-usage filings in a vector DB for sub-second retrieval
  • Use relevance_threshold to reduce noise
  • Respect rate limits on high-throughput workloads

FAQ (Schema-Enabled)

Q: How fast are SEC filings indexed after they’re published?
A: Typically within 5–10 minutes of appearing on EDGAR.

Q: Can I retrieve the full filing?
A: Yes. Use response_length: "max", but note that full 10-Ks can exceed 100k tokens.

Q: Can I search specific sections like MD&A or Risk Factors?
A: Yes, Valyu returns filings segmented by item. You can retrieve just the MD&A, Financials, or other sections.

Q: Is coverage limited to the US?
A: For now, yes. We’re working on support for international filings.


Get Started with AI-Ready SEC Data

Valyu’s API makes SEC data instantly searchable, structured, and ready for LLM use.

Start building: