DocsRecipesCrypto Price Alert

Recipe: Crypto Price Alert

Monitor the Bitcoin price and fire a webhook and a Discord message when it drops more than 10% between two checks. The source is CoinGecko's free simple/price endpoint, which needs no API key and returns plain numbers, so a percent threshold works on it directly. Swap bitcoin for any CoinGecko coin id (for example ethereum or solana) and update the JSONPath to match.

Create the monitor

POST /v1/monitors
curl -X POST https://api.verid.dev/v1/monitors \
  -H "Authorization: Bearer $VERID_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Bitcoin 10% Drop Alert",
    "url": "https://api.coingecko.com/api/v3/simple/price?ids=bitcoin&vs_currencies=usd&include_24hr_change=true",
    "schedule_interval_seconds": 3600,
    "extract_config": {
      "method": "json_path",
      "fields": {
        "price_usd": "$.bitcoin.usd",
        "change_24h": "$.bitcoin.usd_24h_change"
      }
    },
    "diff_predicate": {
      "type": "field_decreases_by_percent",
      "field": "price_usd",
      "threshold": 10
    },
    "deliveries": [
      { "type": "webhook", "url":        "https://your-app.com/hooks/crypto-alert" },
      { "type": "discord", "webhookUrl": "https://discord.com/api/webhooks/..." }
    ]
  }'

change_24h is extracted only so it travels in the alert as context. The predicate looks at price_usd alone. A Discord delivery takes webhookUrl; a plain webhook takes url. Deliveries per monitor depend on the plan: 1 on the trial, 2 on Lite, 3 on Starter, 10 on Pro and 25 on Scale, so keep just one of the two while you are on the trial.

How it decides to fire

The drop is measured against the previous successful check, not against a daily high. With an hourly schedule, the alert means "down at least 10% since an hour ago". For a slower slide, use a smaller threshold or a longer interval, or switch to field_decreases_by_absolute to alert on a fixed dollar move. The first check only records a baseline and never fires a percent predicate. See Predicates for every type.

Webhook payload

json
{
  "id": "uuid",
  "version": "2026-05-01",
  "monitor_id": "uuid",
  "run_id": "uuid",
  "fired_at": "2026-10-22T09:00:00Z",
  "diff": {
    "fields_changed": ["price_usd", "change_24h"],
    "before": { "price_usd": 68000, "change_24h": -1.2 },
    "after":  { "price_usd": 60500, "change_24h": -11.4 }
  },
  "monitor": {
    "url":  "https://api.coingecko.com/api/v3/simple/price?ids=bitcoin&vs_currencies=usd&include_24hr_change=true",
    "name": "Bitcoin 10% Drop Alert"
  }
}

diff.before and diff.after list only the fields that changed. The request carries a Verid-Signature header; verify it as shown on Webhooks.

Verify it worked

Trigger a run and inspect it
curl -X POST https://api.verid.dev/v1/monitors/$MONITOR_ID/run \
  -H "Authorization: Bearer $VERID_API_KEY" \
  -H "Content-Type: application/json" -d '{}'

curl "https://api.verid.dev/v1/monitors/$MONITOR_ID/runs?limit=1" \
  -H "Authorization: Bearer $VERID_API_KEY"

After a few seconds the latest run should show status: "success" and extracted.price_usd as a number such as 68000. You will not get an alert yet; that needs a second check with a real 10% drop.

Common failure

Percent predicates only work on numbers. CoinGecko returns numbers, but a price scraped from a web page as "$3,241.88" parses as NaN and never fires. Also watch the run budget: hourly checks use about 720 runs a month, more than the 200 runs in the 14-day trial, and CoinGecko's free tier rate-limits very frequent polling.

Or: use the template

The crypto-price-coingecko template sets up the same fields plus market cap, checks hourly and fires on a 2% drop:

POST /v1/monitors/from-template/crypto-price-coingecko
curl -X POST https://api.verid.dev/v1/monitors/from-template/crypto-price-coingecko \
  -H "Authorization: Bearer $VERID_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "My Bitcoin Alert",
    "url": "https://api.coingecko.com/api/v3/simple/price?ids=bitcoin&vs_currencies=usd"
  }'

For the full walkthrough - upside alerts, the webhook payload shape, and CoinGecko rate-limit tips - see the Crypto Price Alerts use case.