Skip to main content

API Documentation

Everything you need to integrate StockAlert.pro into your applications

SDKs & Libraries

Official and community SDKs to accelerate your integration

Official SDKs

JavaScript/TypeScript

For Node.js and browser applications

v1.1.0 • Bundle size: ~43KB

Installation
npm install @stockalert/js-sdk
Quick Start
import { StockAlert } from '@stockalert/js-sdk';

const client = new StockAlert({
  apiKey: 'sk_your_api_key'
});

// List alerts
const alerts = await client.alerts.list({
  status: 'active',
  limit: 20
});

// Create alert
const alert = await client.alerts.create({
  symbol: 'AAPL',
  condition: 'price_above',
  threshold: 200,
  notification: 'email'
});

// Delete alert
await client.alerts.delete(alert.id);

Python

For Python 3.8+ applications with CLI support

v1.2.4 • Includes CLI tool

Installation
pip install stockalert
Quick Start
from stockalert import StockAlert

client = StockAlert(api_key='sk_your_api_key')

# List alerts
alerts = client.alerts.list(
    status='active',
    limit=20
)

# Create alert
alert = client.alerts.create(
    symbol='AAPL',
    condition='price_above',
    threshold=200,
    notification='email'
)

# Delete alert
client.alerts.delete(alert.id)
CLI Usage
# Set API key
export STOCKALERT_API_KEY=sk_your_api_key

# List alerts
stockalert list --status active

# Create alert
stockalert create AAPL price_above -t 200

# Delete alert
stockalert delete alert_id

SDK Features

Core Features

  • Full API coverage with type safety
  • Support for all 21 alert types
  • Automatic retry with exponential backoff
  • Built-in rate limit handling
  • Request/response logging
  • Webhook signature verification

Advanced Features

  • Async/await support
  • Pagination helpers
  • Error handling with custom exceptions
  • Configurable timeout and retries
  • Environment variable support

Integration Tools

n8n Integration

No-code automation with n8n workflows

Create powerful automation workflows without writing code using our official n8n node.

Features

  • • Create, update, and delete alerts
  • • Trigger workflows when alerts fire
  • • Integrate with 400+ other services
  • • Visual workflow builder
Installation

Install via n8n's Community Nodes:

n8n-nodes-stockalert

Slack App

Real-time stock alerts in your Slack workspace

Get stock alerts directly in Slack channels! Our official Slack app brings the full power of StockAlert.pro to your team's communication hub.

Features

  • • Real-time price alerts delivered to any channel
  • • Interactive slash commands (/stockalert)
  • • Rich message formatting with charts
  • • OAuth integration with your StockAlert.pro account
  • • Team collaboration features
Slash Commands
/stockalert help              # Show this help message
/stockalert test              # Send a test notification
/stockalert status            # Show integration status
/stockalert channel #channel  # Set notification channel
/stockalert apikey <key>      # Update your StockAlert.pro API key
/stockalert disconnect        # Remove StockAlert.pro connection

Direct API Usage

You can also integrate directly with our REST API without using an SDK. Here are examples in various languages:

cURL

curl -X POST https://stockalert.pro/api/public/v1/alerts \
  -H "X-API-Key: sk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"symbol": "AAPL", "condition": "price_above", "threshold": 200}'

Fetch (JavaScript)

const response = await fetch('https://stockalert.pro/api/public/v1/alerts', {
  method: 'POST',
  headers: {
    'X-API-Key': 'sk_your_api_key',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    symbol: 'AAPL',
    condition: 'price_above',
    threshold: 200
  })
});

const alert = await response.json();

See the Examples section for more code samples.