Skip to main content
This Node.js example polls three issuers for Form 8-K and 8-K/A records. Its output is a review queue, not a statement about the importance of a filing. The local state file makes it runnable on one machine; use durable shared state before running more than one worker.

Prerequisites

  • Node.js 18+.
  • SECAPI_API_KEY with access to filing search.
  • A writable directory for state.json.

1. Create the polling job

Create monitor-filings.mjs:

2. Run it and inspect the record

The first run can emit already-filed records because it starts with no saved accessions. Each queue entry should contain ticker, form, filing date, accession number, filing URL when returned, and request ID. Use the filing URL and accession to read the original disclosure before routing it to a person or another system.

Failure modes and deployment notes

  • 401 or 403 means the process did not send a valid entitled API key.
  • 502 filing_search_failed is a search-path failure, not an empty result; use bounded retry and retain the request ID.
  • Continue while hasMore is true using the returned nextCursor; a page is not complete history.
  • Deduplicate on accession number in durable storage, overlap polling windows, and record delivery status separately from discovery.

Next step

Use Build a Filing Monitor when the signed-in organization should deliver monitor.match events to a webhook receiver.