HTTP service that captures screenshots of the cryexc footprint chart using a headless Chromium browser. A single GET /api/screenshot request returns a PNG of the configured chart, ready for use in dashboards, bots, or alerting pipelines.
- Launches a headless Chromium instance via go-rod
- Navigates to the cryexc footprint widget with chart settings embedded in URL params
- Waits for the
public/footprintnetwork response (confirming data has loaded) before capturing - Returns the screenshot as
image/png
| Method | Path | Description |
|---|---|---|
GET |
/api/screenshot |
Capture and return a PNG screenshot |
GET |
/status |
Health check — returns {"ok": true} |
The screenshot endpoint accepts an optional ?delay=N query param (seconds) to override the default 2s post-load render wait.
| Flag | Default | Description |
|---|---|---|
--port |
19847 |
Port to listen on |
--cryexc-url |
(built-in) | Full cryexc URL; configurable params below override it |
--tick-size |
25 |
Footprint tick size in USD |
--history |
3h |
History window as a duration (1h, 90m, 2h30m) |
--viewport |
2560x1440 |
Browser viewport as WxH |
--prefetch-browser |
— | Download the headless browser binary and exit |
go run . --tick-size 25 --history 3hThen capture a screenshot:
curl -o screenshot.png http://localhost:19847/api/screenshot./run_test.sh # unit tests
./run_test.sh live # end-to-end tests against the real cryexc site
./run_test.sh all # bothLive tests save the captured screenshot to testdata/screenshot.png.
docker build -t cryexc-snap .
docker run -p 19847:19847 cryexc-snapThe image prefetches the headless browser at build time so the container starts cleanly with no network dependency at runtime.
A Kubernetes Deployment and Service manifest is provided in k8s/. The --cryexc-url flag can be overridden via the CRYEXC_URL environment variable defined in the manifest.
