API Documentation
Use DrawdownAlerts data in your apps and spreadsheets
Choose the data you'd like to access
Select which endpoint you need:
API Setup
Get Your API Key
Both endpoints use the same API key. Generate yours to get started.
Get Your API KeySetup Endpoint & Request
Send a GET request with your ticker (e.g., AAPL) and API key:
β οΈ Use This EXACT URL
This is the complete API endpoint URL. Do not modify it or create your own URL structure:
https://drawdownalerts.com/api/dataAdd ?ticker=AAPL to the end of this URL
https://drawdownalerts.com/api/data?ticker=AAPL?ticker=AAPLReplace AAPL with your ticker
X-API-Key: your_api_keycurl -H "X-API-Key: YOUR_KEY" "https://drawdownalerts.com/api/data?ticker=AAPL"Get the Data
The API returns comprehensive data for the ticker you requested.
severityScore- Drawdown Severity Scoreβ’ (0 to 10+)currentPrice- Latest market pricealertStatus- WATCH, BUY, or STRONG BUY signals (based on your alert settings)- + More (see below for full list)
Response Data
Ticker Information
tickerStock or crypto symbol
companyNameFull company or asset name
assetTypeType of asset
urlLink to ticker page
Price Data
currentPriceLatest market price
allTimeHighHighest price ever
Drawdown Metrics
severityScoreDrawdown Severity Scoreβ’ (0 to 10+)
severityStatusStatus in plain English (12 levels)
currentDrawdownCurrent drawdown percentage
daysInDrawdownDays currently in drawdown
avgMaxDrawdownHistorical average max drawdown
avgDaysInDrawdownAverage duration of historical drawdowns
Alert Information
alertStatusWhether this ticker triggers your personal alert thresholds
Other Fields
dateLastUpdatedWhen data was last refreshed
requestsRemainingRequests left today
Full Example Response (AAPL)
{
"success": true,
"data": {
"ticker": "AAPL",
"companyName": "Apple Inc.",
"assetType": "stock",
"url": "https://drawdownalerts.com/ticker/AAPL",
"currentPrice": 226.50,
"allTimeHigh": 237.23,
"currentDrawdown": "-4.52%",
"daysInDrawdown": 23,
"severityScore": 0.89,
"severityStatus": "typical",
"avgMaxDrawdown": "-5.12%",
"avgDaysInDrawdown": 28,
"dateLastUpdated": "2025-11-11",
"alertStatus": {
"watchTriggered": false,
"buyTriggered": false,
"strongBuyTriggered": false,
"ultraBuyTriggered": false,
"userWatchThreshold": "elevated",
"userBuyThreshold": "strong",
"userStrongBuyThreshold": "very-large",
"userUltraBuyThreshold": "historic",
"alertNames": {
"watch": "Watch",
"buy": "Buy",
"strongBuy": "Strong Buy",
"ultraBuy": "Ultra Buy"
}
}
},
"requestsRemaining": 999
}Platform Integrations
Use DrawdownAlerts data in your favorite tools:
Google SheetsClick to expand
Setup:
- 1. Go to Extensions β Apps Script in your Google Sheet
- 2. Delete any existing code and paste the code below
- 3. Replace
YOUR_API_KEYon line 8 with your actual key - 4. Click Save (disk icon or Ctrl+S)
- 5. Go back to your sheet and use the formulas!
/**
* DrawdownAlerts Google Sheets Integration
* TESTED AND WORKING - Copy this entire code
*
* IMPORTANT: Replace YOUR_API_KEY on line 8 with your actual key from:
* https://drawdownalerts.com/account/api
*/
const API_KEY = 'YOUR_API_KEY';
const API_URL = 'https://drawdownalerts.com/api/data';
/**
* Get severity score: =SEVERITY("AAPL")
*/
function SEVERITY(ticker) {
const data = fetchData(ticker);
if (!data) return 'ERROR';
if (data.error) return data.error; // Show "Processing (retry in 1 min)"
return data.severityScore;
}
/**
* Get current price: =PRICE("AAPL")
*/
function PRICE(ticker) {
const data = fetchData(ticker);
if (!data) return 'ERROR';
if (data.error) return data.error; // Show "Processing (retry in 1 min)"
return data.currentPrice;
}
/**
* Get alert status: =ALERT("AAPL")
* Returns: ULTRA BUY, STRONG BUY, BUY, WATCH, or blank
*/
function ALERT(ticker) {
const data = fetchData(ticker);
if (!data) return 'ERROR';
if (data.error) return data.error; // Show "Processing (retry in 1 min)"
if (data.alertStatus.ultraBuyTriggered) return 'ULTRA BUY';
if (data.alertStatus.strongBuyTriggered) return 'STRONG BUY';
if (data.alertStatus.buyTriggered) return 'BUY';
if (data.alertStatus.watchTriggered) return 'WATCH';
return '';
}
/**
* Get drawdown percentage: =DRAWDOWN("AAPL")
*/
function DRAWDOWN(ticker) {
const data = fetchData(ticker);
if (!data) return 'ERROR';
if (data.error) return data.error; // Show "Processing (retry in 1 min)"
// currentDrawdown is now a string like "-4.52%", parse it
return parseFloat(data.currentDrawdown);
}
/**
* Get days in drawdown: =DAYSINDD("AAPL")
*/
function DAYSINDD(ticker) {
const data = fetchData(ticker);
if (!data) return 'ERROR';
if (data.error) return data.error;
return data.daysInDrawdown;
}
/**
* Internal function - fetches data from API
* DO NOT CALL DIRECTLY - use the functions above
*/
function fetchData(ticker) {
try {
const url = API_URL + '?ticker=' + ticker;
const response = UrlFetchApp.fetch(url, {
method: 'get',
headers: { 'X-API-Key': API_KEY },
muteHttpExceptions: true
});
const statusCode = response.getResponseCode();
if (statusCode === 200) {
const json = JSON.parse(response.getContentText());
return json.success ? json.data : null;
}
// Handle error responses with helpful messages
const json = JSON.parse(response.getContentText());
// Log helpful messages for each error code
if (statusCode === 202) {
Logger.log(ticker + ': Processing - retry in 1 min');
} else if (statusCode === 503) {
Logger.log(ticker + ': Data processing - retry in 1-2 min');
} else if (statusCode === 404) {
Logger.log(ticker + ': Not available - ' + (json.error || json.reason || 'Check ticker format'));
} else {
Logger.log(ticker + ': Error ' + statusCode);
}
// Return a clear error message instead of null
// This shows in the cell: "Processing (retry)" instead of "ERROR"
if (statusCode === 202 || statusCode === 503) {
return { error: 'Processing (retry in 1 min)' };
}
return null;
} catch (e) {
Logger.log(ticker + ': Exception - ' + e);
return null;
}
}β Available Formulas:
=SEVERITY("AAPL") β Get severity score (e.g., 2.43)=PRICE("MSFT") β Get current price (e.g., 428.50)=ALERT("BTC-USD") β Get alert status (WATCH/BUY/etc.)=DRAWDOWN("TSLA") β Get drawdown % (e.g., -12.5)=DAYSINDD("AAPL") β Get days in drawdown (e.g., 23)Drag formulas down to apply to your entire portfolio!
β οΈ Important: Google Sheets Formatting Issue
Problem: Google Sheets may auto-format integer fields like daysInDrawdown and avgDaysInDrawdown as percentages (e.g., showing 1735 as 173500%).
Solution: After writing data to your sheet, explicitly format these columns as plain numbers:
π All Available Data Fields:
When fetching data programmatically, the API returns all these fields. Use descriptive column headers in your sheet:
π‘ Tip: Use the descriptive names (right side) as your column headers for better readability!
Excel / Power BIClick to expand
Use Power Query or VBA to call the API. Here's what you need:
https://drawdownalerts.com/api/data?ticker=AAPLX-API-Key: your_keyTip: Search online for "Excel Power Query REST API" for step-by-step guides on connecting to REST APIs in Excel.
Understanding Alert Status
How alertStatus Flags Are Calculated
The API calculates alert triggers by comparing the current severityScore against your custom thresholds using numeric comparison:
Calculation Logic:
- 1. Each threshold status maps to a numeric value:
- β’ "elevated" = 3.0
- β’ "strong" = 5.0
- β’ "very-large" = 8.0
- β’ "historic" = 12.0
- 2. Compare: If
severityScore >= threshold, flag = true - 3. Return all applicable flags in
alertStatus
π Example:
Stock has severityScore: 5.3
Your thresholds: watch="elevated" (3.0), buy="strong" (5.0)
Result:
- β
watchTriggered: true(5.3 >= 3.0) - β
buyTriggered: true(5.3 >= 5.0) - β
strongBuyTriggered: false(5.3 < 8.0)
π‘ Note: Alert thresholds are customizable in your account settings. The API returns your personalized thresholds in userWatchThreshold, userBuyThreshold, etc.
Error Codes
API Status Codes & What They MeanClick to collapse
200Success
Data returned successfully. Everything worked!
202Processing - Retry in 1 Minute
We're fetching this ticker for you. Wait 60 seconds and try again.
What to do: Wait 1 minute, then make the same request again. The data will be ready!
400Missing Ticker Parameter
You forgot to include ?ticker=AAPL in the URL.
401Invalid API Key
Check that you copied your API key correctly from your settings.
403Ticker Not in Watchlist
Free through Advanced plans can only query watchlist tickers. Upgrade to Unlimited for any-ticker access.
404Ticker Not Available
This ticker either doesn't exist or failed to fetch after 5 attempts.
What to do: Double-check the ticker symbol. For crypto, use BTC-USD not BTC.
429Rate Limit Exceeded
You've used your daily limit. Limits: Free (500), Starter (2,000), Growth (5,000), Advanced (15,000), Unlimited (100,000). Resets at midnight ET.
503Data Still Processing
The ticker is in our database but data isn't ready yet.
What to do: Wait 1-2 minutes and try again.
Common Questions
What plan do I need?
All plans have API access:
- Free through Advanced: Query your watchlist tickers
- Unlimited: Query any ticker in our database
How many requests can I make?
10,000 per day. Resets at midnight Eastern Time. That's enough to track 1,000 stocks and refresh 10 times daily, or 500 stocks refreshed 20 times.
When does data update?
Every day at 5 PM Eastern Time. Refresh your data after 5 PM to get the latest.
Getting "ticker not found" errors?
Check your ticker format. For Bitcoin use BTC-USD not BTC.
Visit drawdownalerts.com/ticker/YOUR_TICKER and copy the exact format from the URL.