API Reference

Technical documentation for TradeAlert.Pro webhook API. Learn about endpoint specifications, request/response formats, rate limits, and error handling.

Webhook Endpoint

Your unique webhook URL is displayed in your dashboard after account creation. It follows this format:

POST https://api.tradealert.pro/webhook/{user_id}/{api_key}

Security Note

Keep your webhook URL private. The user_id and api_key are unique to your account. Anyone with this URL can trigger phone calls to your number.

Request Format

HTTP Method

TradingView sends webhooks via POST requests with application/json content type.

Request Headers

HeaderValueDescription
Content-Typeapplication/jsonJSON payload
User-AgentTradingView-WebhookIdentifies TradingView

Simple Text Payload

The simplest format is plain text. This is what gets read in the phone call:

Bitcoin crossed above $50,000 - long signal triggered

In your TradingView alert message field, enter the text you want to hear.

JSON Payload

For structured data, send JSON with a message field:

{
  "message": "Bitcoin crossed above $50,000",
  "ticker": "BTCUSD",
  "price": 50000,
  "action": "BUY",
  "strategy": "Breakout",
  "timestamp": "2024-10-28T14:30:00Z"
}

TradeAlert.Pro extracts the message field for the phone call. Additional fields are stored in your call history for reference.

TradingView Placeholders

TradingView supports dynamic placeholders that are replaced with real-time values:

PlaceholderDescriptionExample
{{ticker}}SymbolBTC/USD
{{close}}Close price49832.50
{{open}}Open price49500.00
{{high}}High price50100.00
{{low}}Low price49200.00
{{volume}}Volume125432
{{time}}Bar timestamp2024-10-28 14:30
{{interval}}Timeframe15

Example with Placeholders:

{{ticker}} broke resistance at {{close}} with volume {{volume}}

Becomes:

"BTC/USD broke resistance at 50000 with volume 125432"

Response Format

Success Response

HTTP/1.1 200 OK
Content-Type: application/json

{
  "success": true,
  "message": "Alert received and call initiated",
  "call_id": "call_abc123xyz789",
  "timestamp": "2024-10-28T14:30:15Z"
}

Error Responses

Status CodeErrorDescription
400Bad RequestInvalid payload format
401UnauthorizedInvalid webhook URL/credentials
403ForbiddenAccount suspended or limit exceeded
429Too Many RequestsRate limit exceeded
500Internal Server ErrorServer-side error

Example Error Response:

HTTP/1.1 403 Forbidden
Content-Type: application/json

{
  "success": false,
  "error": "Monthly call limit exceeded",
  "limit": 3,
  "used": 3,
  "resets_at": "2024-11-01T00:00:00Z"
}

Rate Limits

TradingView Webhook Limits

TradingView imposes the following rate limits on webhook calls:

  • 60 webhooks per minute per TradingView account
  • 500 webhooks per hour per TradingView account

If you exceed these limits, TradingView will queue or drop excess webhooks. Design your alerts to stay well below these thresholds.

TradeAlert.Pro Limits

PlanMonthly LimitBurst Limit
Free3 calls/month1 call/minute
PremiumUnlimited10 calls/minute

Rate Limit Tips

  • • Use "Once Per Bar Close" frequency in TradingView to reduce alert volume
  • • Avoid "Every Time" frequency unless absolutely necessary
  • • Monitor your usage in the dashboard
  • • Set up only high-quality alerts to avoid noise

Message Length Limits

  • Maximum message length: 500 characters
  • Recommended length: 50-100 characters for clarity
  • Messages longer than 500 characters will be truncated
  • Keep messages concise for best phone call experience

Phone Call Behavior

Call Flow

  1. Webhook received and validated (< 100ms)
  2. Phone call initiated (< 500ms)
  3. Phone rings (1-5 seconds depending on carrier)
  4. Message played when answered (text-to-speech)
  5. Call ends after message completes
  6. If unanswered and SMS backup enabled, SMS sent (5-10 seconds)

Call Retry Logic

  • We attempt the call once
  • If phone is busy/unreachable, SMS backup is sent (if enabled)
  • No automatic retries to avoid duplicate alerts
  • Call status is logged in your dashboard

Webhook Testing

Using cURL

Test your webhook endpoint with cURL:

curl -X POST https://api.tradealert.pro/webhook/{user_id}/{api_key} \
  -H "Content-Type: application/json" \
  -d '{"message": "Test alert from cURL"}'

Using Dashboard

The easiest way to test is through your dashboard:

  1. Log in to your dashboard
  2. Click "Send Test Call"
  3. Your phone will ring within 1-2 seconds
  4. Verify the call appears in your call history

Best Practices

Message Design

  • Start with ticker/symbol: "BTC/USD..."
  • Include action: "long entry", "stop loss hit", "target reached"
  • Add price context: "at $50,000"
  • Keep under 20 words for clarity
  • Avoid special characters that don't speak well

Alert Frequency

  • Use "Once Per Bar Close" for strategy signals
  • Use "Only Once" for one-time levels
  • Avoid "Every Time" to prevent spam
  • Test on demo first before going live

Error Handling

  • Check your dashboard for webhook delivery status
  • Enable SMS backup as a failsafe
  • Monitor your monthly usage to avoid hitting limits
  • Set up critical alerts with multiple notification methods

Security

Webhook URL Protection

  • Never share your webhook URL publicly
  • Don't commit webhook URLs to public repositories
  • Regenerate your URL if compromised
  • Each URL is unique and tied to your account

HTTPS Only

All webhook requests must use HTTPS. Unencrypted HTTP requests are rejected.

Support & Troubleshooting

Having issues with the API? Check our Troubleshooting Guide or review Frequently Asked Questions.

Ready to Get Started?

Sign up for a free account and get 3 calls per month - no credit card required.

Create Free Account