Pinbar AI Enterprise API

Pinbar AI API Documentation

Integrate your historical trade data with your own tools, dashboards, and workflows. Our RESTful API provides read-only programmatic access to trades, analytics, and real-time webhooks.

API Access Scope

The Pinbar AI API provides read-only access to historical trades, analytics, psychology metrics, and derived insights.

The API cannot:

  • Place, modify, or cancel trades
  • Access funds or balances
  • Execute broker actions
  • Provide trading signals or recommendations

Real-time

Webhooks for instant trade notifications

Secure

OAuth 2.0 & API key authentication

RESTful

Standard REST architecture

Documented

Comprehensive docs & examples

Quick Start

Security Notice

All API keys shown in examples are placeholders. Never expose real API keys in client-side code, public repositories, or frontend applications. API keys must be stored securely on the server.

1

Authentication

All API requests require authentication using a Bearer token. You can generate API keys from your dashboard settings.

Important: API keys must be stored securely on the server. Do not embed API keys in frontend or client-side applications.

JavaScript
// Authentication using API Key
const headers = {
  'Authorization': 'Bearer YOUR_API_KEY',
  'Content-Type': 'application/json'
};

// Base URL: Your project's edge function endpoint
const response = await fetch('https://api.pinbar.ai/functions/v1/export-trades', {
  method: 'GET',
  headers: headers
});
2

Fetch Your Trades

Retrieve your trade history with optional date range and symbol filters.

JavaScript
// Fetch trades with date filtering
const response = await fetch(
  'https://api.pinbar.ai/functions/v1/export-trades?from=2024-01-01&to=2024-01-31&format=json',
  {
    method: 'GET',
    headers: {
      'Authorization': 'Bearer YOUR_JWT_TOKEN'
    }
  }
);

const data = await response.json();
console.log(data.trades);
3

Get Analytics

Access aggregated performance metrics including win rate, P&L, and strategy analysis.

JavaScript
// Export trades as CSV
const response = await fetch(
  'https://api.pinbar.ai/functions/v1/export-trades?format=csv&status=closed',
  {
    method: 'GET',
    headers: {
      'Authorization': 'Bearer YOUR_JWT_TOKEN'
    }
  }
);

const csvData = await response.text();
// Save or process CSV data

API Endpoints

GET
/functions/v1/export-trades

Export trades with filtering (JSON or CSV)

format
from
to
status
limit
offset
POST
/functions/v1/firm-trade-ingestion

Ingest trades via webhook (Enterprise)

trades[]
external_user_id
POST
/functions/v1/firm-token-exchange

Exchange firm JWT for Pinbar session (SSO)

firm_id
external_user_id
token
POST
/functions/v1/firm-webhook-dispatch

Dispatch webhook events to firm endpoints

firm_id
event_type
payload
GET
/functions/v1/health-monitor

System health check (admin only)

Real-time Webhooks

Get instant notifications when trades are completed, positions change, or analytics are updated.

Supported Events

  • trade.completed
    When a trade is fully closed
  • trade.opened
    When a new position is opened
  • position.updated
    When position P&L changes
  • alert.triggered
    When behavior alert fires

Webhook Reliability & Security

  • • Webhooks are retried up to 3 times on delivery failure using exponential backoff
  • • Each webhook payload includes a signature header for verification
  • • Consumers must implement idempotency handling to avoid duplicate processing
Webhook Payload
// Webhook payload example
{
  "event": "trade.completed",
  "timestamp": "2024-01-15T10:30:00Z",
  "signature": "sha256=REDACTED_SIGNATURE_EXAMPLE",
  "data": {
    "trade_id": "tr_abc123",
    "symbol": "NIFTY24JAN21000CE",
    "side": "BUY",
    "quantity": 50,
    "entry_price": 150.50,
    "exit_price": 175.25,
    "pnl": 1237.50,
    "emotion_tag": "confident",
    "behaviour_tag": "disciplined"
  }
}

Rate Limits

Rate limits are enforced for system stability and fair usage. Limits may change based on plan, usage patterns, or system load.

PlanRequests/min
Standard60
Pro300
EnterpriseCustom

Security

  • TLS 1.3 Encryption

    All API traffic is encrypted in transit

  • API Key Rotation

    Rotate keys without downtime

  • IP Whitelisting

    Restrict access by IP (Enterprise)

Who This API Is For

Intended for

  • • Enterprises and institutions
  • • Advanced users building internal dashboards
  • • Analytics, reporting, and compliance workflows

Not intended for

  • • Automated trading systems
  • • Signal generation
  • • Retail trading bots
  • • Strategy execution engines

Non-Advisory Use

All analytics, psychology metrics, behavior tags, and insights exposed via the Pinbar AI API are observational and informational only.

They do not constitute trading advice, investment recommendations, or financial guidance.

The API is intended for self-analysis, reporting, and internal dashboards only.

Ready to Integrate?

Pinbar AI API access is available for Enterprise customers. Contact our team to discuss your integration needs.