A live demand dataset you can query, not just browse
Use the API layer when you want structured access to the same monthly dataset shown in the dashboard. Authentication starts with an API key, then the agent bootstrap route hands back the protected query and SSE endpoint map.
Bootstrap first
Create a key and call /api/agent/bootstrap first to confirm access and fetch the protected endpoint map.
Monthly backed-up dataset
The API sits on top of the same D1-backed monthly snapshot pipeline used by the product, not on top of ad hoc page scraping.
JSON for pull, SSE for stream
Use the protected /api/agent/query endpoints for direct reads and /api/agent/sse when you want agents or tools to consume rows incrementally.
Built for analysis workflows
The shape is optimized for category discovery, revenue scanning, pain-point clustering, and gig-level inspection.
Overview endpoints
Start here when you need month-level summaries and category-level context before drilling into individual gigs.
Search and detail endpoints
Use these when you need filtered snapshots, one-record inspection, or history for a single gig.
Analysis and streaming endpoints
Use these when you want repeated pain points, streaming rows, or agent-friendly consumption.
Data model behind the API
The page should explain that the API is reliable because the data is layered, versioned by month, and backed by D1.
Raw layer
One source export per category, preserved monthly as the backup layer.
Normalized layer
Cleaned snapshots, category rollups, and LLM-ready fields for service, pain point, price, orders, and revenue.
Serving layer
A protected app-layer gateway sits in front of the Cloudflare D1 Worker so external agents authenticate with your key instead of hitting the raw Worker URL.
Getting started
Keep the first path simple for technical users.
Create a key and call /api/agent/bootstrap first to confirm access and fetch the protected endpoint map.
Use /api/agent/query/months, /api/agent/query/stats, and /api/agent/query/category-rollups to narrow the market you care about.
Switch to /api/agent/query/pain-points, /api/agent/query/snapshot, /api/agent/query/gig-history, or /api/agent/sse when you need deeper analysis.