Prefect flow recipe
SEC API Prefect Flow
A copy-ready Prefect flow starter for data teams that want observable SEC filing polling tasks through RapidAPI without building or hosting a separate EDGAR ingest service.
GET /v1/sec/watchlist/changes?tickers=AAPL,MSFT,NVDA&since=2026-07-01&limit=25
from prefect import flow, task
from prefect.blocks.system import Secret
@task(retries=2, retry_delay_seconds=30)
def fetch_sec_watchlist(tickers: str, since: str):
rapidapi_key = Secret.load("sec-event-intelligence-rapidapi-key").get()
# Call GET /v1/sec/watchlist/changes and return normalized filing rows.
@flow(name="sec-event-intelligence-watchlist")
def sec_event_intelligence_watchlist(
tickers: str = "AAPL,MSFT,NVDA",
since: str = "2026-07-01",
):
return fetch_sec_watchlist(tickers, since)
if __name__ == "__main__":
sec_event_intelligence_watchlist()
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.
- Create a Prefect Secret block named sec-event-intelligence-rapidapi-key, or set RAPIDAPI_KEY in the worker environment.
- Run the flow locally first, then create a Prefect deployment and schedule for the watchlist cadence.
- Send returned filing rows into downstream tasks for alerts, warehouses, object storage, or data quality checks.
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 Prefect integration?
No. It is a standard Python flow starter using Prefect flow and task decorators with the live RapidAPI endpoint.
Where should the RapidAPI key be stored?
Use a Prefect Secret block or a protected worker environment variable. Do not commit the RapidAPI key in flow source.
/downloads/sec-filings-prefect-flow.py.