TrendSpider webhook alerts: setup, the 5-second timeout and retries
Short answer: TrendSpider sends an alert webhook once and cancels it after five seconds (TrendSpider: webhooks for alerts). Its alert webhook docs describe no retry, so if your endpoint is slow or down at that moment, the alert is lost. Answer fast, or put a queue that retries in front of your endpoint.
How TrendSpider webhooks work
- You set one webhook URL for your account under Account & Settings, by ticking Webhook under Email and SMS.
- The body is the alert's description. Valid JSON is sent as
application/json, anything else astext/plain. - Variables such as
%alert_symbol%,%alert_name%and%last_price%are filled in before sending. - Requests come from one IP address, 3.12.143.24, with the headers
X-requester: trendspiderandX-reason: alert-webhook. - Requests time out after five seconds.
Strategy Bots work a little differently: each Strategy Bot has its own entry and exit webhook, waits up to 7 seconds, and can retry a failed call a set number of times with 3 seconds between attempts. A 400 reply is not retried (TrendSpider: Strategy Bots).
Why alerts get lost
- Slow replies. Your endpoint does its work before it answers and goes past five seconds.
- Cold starts. A sleeping free-tier host or serverless function takes seconds to wake up.
- Restarts and deploys. While your app restarts, the request fails and is not sent again.
- Bad JSON. A typo turns the body into plain text, and your endpoint rejects it. Look for "valid JSON" under the description field.
Set it up with HoldAlarms
- Start a trial and copy the webhook URL from your dashboard. It looks like
https://api.holdalarms.com/hook/<your token>. - Add your own endpoint as a destination in HoldAlarms.
- In TrendSpider, open Account & Settings, tick Webhook and paste the HoldAlarms URL. For a Strategy Bot, paste it as the entry and exit webhook URL.
- Put the message your endpoint expects in the alert description or the Strategy Bot's Webhook Body, for example
{"ticker": "%alert_symbol%", "action": "buy", "price": "%last_price%"}. - Click "Send test alert" on the dashboard, then trigger one TrendSpider alert and check it under recent alerts.
Put values your endpoint needs in the message, not in the URL: query parameters on the HoldAlarms URL are not forwarded. If your endpoint only accepts 3.12.143.24, turn that filter off, because HoldAlarms has no fixed outbound IP addresses.
Full reference: Docs: TrendSpider setup.
What HoldAlarms does
We answer TrendSpider with HTTP 200 once the alert is queued, well inside its five seconds, then deliver it to your endpoint in the background. Your endpoint gets 10 seconds per attempt. If it fails, we retry up to 5 times, 2 to 60 seconds apart (permanent errors such as 401 or 403 aren't retried). Retries finish within about 3 minutes, or up to about 6 if your server asks for longer waits with Retry-After. After that the alert is parked in a dead-letter queue and you get an email.
Two honest limits: we add a hop, so HoldAlarms doesn't cut latency; and a delivered alert means your endpoint accepted it, not that your app finished processing it. Starter is €19/mo and Ops €49/mo.
Questions
How long does TrendSpider wait for a webhook response?
Five seconds for alert webhooks. Strategy Bot webhooks wait up to 7 seconds.
Does TrendSpider retry a failed alert webhook?
TrendSpider's alert webhook docs describe no retries. Strategy Bots have an optional setting to retry a failed webhook, with 3 seconds between attempts.
Does TrendSpider send JSON or plain text?
Both. The body is the alert description. If it is valid JSON, the content type is application/json, otherwise text/plain.
Can I keep my IP allowlist for 3.12.143.24?
Not with HoldAlarms in between. HoldAlarms has no fixed outbound IP addresses, so turn the IP filter off and check a secret in the message instead.
Does HoldAlarms reduce latency?
No. HoldAlarms adds a hop, so each alert reaches your endpoint slightly later than it would directly. What it gives you is more time for your endpoint to answer and 5 retries if it does not.
More guides
- TradingView webhook timeout
- Does TradingView retry webhooks?
- TradingView → HoldAlarms → TradersPost
- All guides
- All HoldAlarms questions
HoldAlarms is not affiliated with TrendSpider or TradingView. TrendSpider is a trademark of its owner. TradingView is a trademark of TradingView, Inc.