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.

Endpoints Used

The integration uses live SEC Event Intelligence endpoints available through RapidAPI subscriptions.

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.

No investment advice. These recipes move public SEC filing metadata into automation tools. They do not provide recommendations, ratings, signals, or personalized financial guidance. The starter workflow file is available at /downloads/sec-filings-prefect-flow.py.