Webhooks

Webhooks make it easy for algorithmic traders to integrate notifications into their automated trading systems. Rather than receiving an alert via SMS or email, TrendSpider can be configured to send an HTTP POST request to any URL.

It’s easy to get started using web hooks:

  1. Click on your name in the upper right corner of the screen.
  2. Select Account & Settings.
  3. Check the Webhook box under Email and SMS.
  4. Input the URL where POST requests should be sent.

Webhooks Options

Webhooks send a POST request with a body equal to each alert’s description. If the description contains valid JSON, the content-type header is set to application/json, otherwise it’s set to text/plain. The Alert dialog will display “valid JSON” below the description field if the field contains valid JSON.

Webhook Alerts Dialog

The Webhook supports three variables in descriptions:

  • %alert_name% returns the name of the alert.
  • %alert_symbol% returns the symbol.
  • %alert_note% returns the notes for the alert.

An example POST request might look like this:

HTTP POST https://webhook.site/1902dc91-ffdb-4322-9c65-5df94cec5f34?symbol=AAPL
Content-Type: application/json
X-requester: trendspider
X-reason: alert-webhook

{"event":"alert_triggered","which":"Alert Name","other_param":42}

The requests timeout after five seconds. All Webhooks are sent from a specific host with the IP address 3.12.143.24, which can be whitelisted to maximize reliability.