tickerbot.io
View as markdown

Alert bot

Tickerbot is the stock market API designed for agents. A stock alert is a few queries on it, in sequence: test the condition as a scan, subscribe it, receive the webhook.

How it works

An alert bot watches the market and says something when a condition trips. Tickerbot does the watching: write the condition in SQL, point the delivery at your handler.

1. Test the condition

Run it as a scan first, same grammar the alert will use, to see who matches right now.

curl -X POST "https://api.tickerbot.io/v2/scan" \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "q": "volume_burst_3x AND change_1d_pct > 0.05 AND market_cap > 1e9" }'

2. Subscribe it

The same q becomes a webhook: evaluated continuously, POSTed to your endpoint when tickers enter or leave the match set.

curl -X POST "https://api.tickerbot.io/v2/scan/subscribe" \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "q": "volume_burst_3x AND change_1d_pct > 0.05 AND market_cap > 1e9",
        "target_url": "https://your-bot.example.com/hook" }'

Four delivery channels per subscription: webhook, discord, in_app, mobile_push. Pass discord_url instead of target_url and a formatted embed posts to your channel, no handler needed.

Show responseHide response
Response
{
  "id": "wh_fqqgu9F7bXI",
  "q": "volume_burst_3x AND change_1d_pct > 0.05 AND market_cap > 1e9",
  "channel": "webhook",
  "target_url": "https://your-bot.example.com/hook",
  "signing_secret": "whsec_…",
  "status": "active",
  …
}

3. Receive the delivery

Your bot is a webhook receiver, and the delivery is the contract: matches are the tickers that just tripped the condition, current_matches is everything matching now. Parse, say something, ack 200.

import express from 'express'
const app = express()
app.use(express.json())

app.post('/hook', (req, res) => {
  for (const row of req.body.matches) {
    const alert = `${row.ticker} up ${row.change_1d_pct.toFixed(1)}% at ${row.price}`
    console.log(alert)   // …or ping Slack, send an email, place a trade
  }
  res.sendStatus(200)
})

app.listen(3000)   // the server behind your target_url

The calls behind it

CallWhat it does here
POST /v2/scanTest the condition: same grammar the alert will use, evaluated right now
POST /v2/scan/subscribeAny SQL condition as an alert: fires when the match set changes