LangChain tool recipe
SEC API LangChain Tool
A copy-ready LangChain tool starter for agent builders who want structured SEC filing watchlist data through RapidAPI without building a separate EDGAR retrieval service.
from langchain.tools import tool
@tool
def sec_watchlist_changes(tickers: str, since: str = "2026-07-01", limit: int = 25) -> dict:
"""Fetch SEC filing changes for a comma-separated ticker watchlist."""
# Call GET /v1/sec/watchlist/changes through RapidAPI and return structured rows.
return {"tickers": tickers, "since": since, "limit": limit}
# Pass sec_watchlist_changes into create_agent(..., tools=[sec_watchlist_changes]).
Workflow Setup
This recipe shows how to move SEC filing data into automation tools using live HTTPS endpoints and standard API credentials.
- Subscribe on RapidAPI and copy the generated RapidAPI key.
- Store the key as RAPIDAPI_KEY in the app, worker, notebook, or agent runtime environment.
- Import the starter tool and pass sec_watchlist_changes into LangChain create_agent with your chosen model.
- Use the tool for filing lookup, compliance Q&A, portfolio watchlists, or workflow triage where live SEC filing metadata is needed.
Endpoints Used
The integration uses live SEC Event Intelligence endpoints available through RapidAPI subscriptions.
GET /v1/sec/watchlist/changesGET /v1/sec/changesGET /v1/sec/forms/{accessionNo}/summary
Integration FAQ
Is this an official LangChain integration?
No. It is a standard LangChain tool starter using the public tool decorator pattern with the live RapidAPI endpoint.
Can this be used without LangSmith or LangGraph?
Yes. The starter is a plain LangChain tool function. Observability and graph orchestration are optional choices in the surrounding app.
/downloads/sec-filings-langchain-tool.py.