Skip to main content
This guide shows how to build a Python agent that monitors a portfolio of court cases, pays per query automatically, and sends alerts when new filings appear.

The pattern

Full example

Environment variables

Stop conditions

Build stop conditions into your agent. An agent monitoring a closed case will continue querying and paying $0.99 per cycle indefinitely. Check for case closure status and implement logic to remove cases from your portfolio when they are resolved.

Deploying for passive monitoring

Running the script on your laptop requires your machine to stay on. For always-on monitoring, deploy to a cloud platform:
  • Railway (railway.app) — simple Python deployment, same platform as DocketLayer’s normalization service
  • Render (render.com) — background worker hosting with a free tier
  • Fly.io (fly.io) — lightweight and inexpensive for small scripts
On any platform, set your environment variables through the platform’s secrets management — never include them in your deployed code.