AI agents can now integrate directly with Alphabots for order placement and portfolio insights. Here's everything you need to know.
Alphabots provides two main integration methods for AI agents:
| Method | Protocol | Best For |
|---|---|---|
| Webhook API | HTTP POST | Order placement, simple integrations |
| MCP Server | MCP Protocol | Portfolio data, analysis, rich market data |
Both methods can be used together — use webhooks for execution and MCP for insights.
Your webhook URL has this format:
https://algoexestaging.alphabots.in/api/v1/signal/webhook-handler/{YOUR_UUID}
Replace {YOUR_UUID} with your actual UUID from Alphabots portal.
All orders are sent as JSON with this structure:
{
"order": [{
"type": "ENTRY",
"symbol": "NSE:NIFTY25APRFUT",
"quantity": 1,
"side": "B",
"ordertype": "MARKET",
"segment": "FUT",
"product": "N"
}]
}
| Field | Type | Valid Values | Required | Description |
|---|---|---|---|---|
type |
string | ENTRY, EXIT |
Yes | Order type |
symbol |
string | NSE:SYMBOL-EQ, etc. |
Yes | Trading symbol with exchange prefix |
quantity |
number | Any positive integer | Yes | Number of shares or lots |
side |
string | B, S |
Yes | Buy or Sell |
ordertype |
string | MARKET, LIMIT, STOP, STOPLIMIT |
Yes | Execution type |
segment |
string | EQ, FUT, OPT |
ENTRY only | Equity, Future, Options |
product |
string | I, D, N |
ENTRY only | Intraday, Delivery, Normal |
limit_price |
number | Any positive number | LIMIT, STOPLIMIT | Price for limit orders |
stop_price |
number | Any positive number | STOP, STOPLIMIT | Stop loss price |
NSE:SBIN-EQ
NSE:RELIANCE-EQ
BSE:TCS-EQ
NSE:NIFTY25APRFUT # Nifty April 2025
NSE:BANKNIFTY25APRFUT # BankNifty April 2025
NSE:NIFTY25APR24200CE # Nifty 24200 Call
NSE:NIFTY25APR24200PE # Nifty 24200 Put
curl -X POST https://algoexestaging.alphabots.in/api/v1/signal/webhook-handler/YOUR_UUID \
-H "Content-Type: application/json" \
-d '{
"order": [{
"type": "ENTRY",
"symbol": "NSE:NIFTY25APRFUT",
"quantity": 1,
"side": "B",
"ordertype": "MARKET",
"segment": "FUT",
"product": "N"
}]
}'
MCP (Model Context Protocol) is a standard for AI agents to access external tools and data. The Alphabots MCP server provides:
# Install globally via npm
npm install -g alphabots-mcp-server@1.0.12
# Or run directly with npx (no install needed)
npx alphabots-mcp-server@1.0.12
Edit ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"alphabots": {
"command": "npx",
"args": ["alphabots-mcp-server@1.0.12"],
"env": {
"mcp_token": "YOUR_MCP_TOKEN_HERE"
}
}
}
}
| Tool | Description | Use Case |
|---|---|---|
get_portfolio_summary |
Complete portfolio overview with P&L | Daily checks, performance review |
get_broker_insights |
Broker-specific analytics and stats | Broker comparison, execution quality |
get_holdings |
List all current holdings with details | Position review, rebalancing |
analyze_options |
CE/PE options analysis with Greeks | Options strategy optimization |
get_advanced_analysis |
Deep portfolio metrics and trends | Portfolio health, risk analysis |
get_weekly_expiry_options |
Weekly options positions and exposure | Weekly expiry planning |
import requests
class AlphabotsTrader:
def __init__(self, webhook_uuid):
self.webhook_url = f"https://algoexestaging.alphabots.in/api/v1/signal/webhook-handler/{webhook_uuid}"
def place_entry(self, symbol, quantity, side, ordertype="MARKET", segment="EQ", product="N"):
"""Place an entry order"""
order = {
"order": [{
"type": "ENTRY",
"symbol": symbol,
"quantity": quantity,
"side": side,
"ordertype": ordertype,
"segment": segment,
"product": product
}]
}
return requests.post(self.webhook_url, json=order)
# Usage
trader = AlphabotsTrader("YOUR_UUID")
result = trader.place_entry(
symbol="NSE:NIFTY25APRFUT",
quantity=1,
side="B",
ordertype="MARKET",
segment="FUT",
product="I"
)
const fetch = require('node-fetch');
const url = 'https://algoexestaging.alphabots.in/api/v1/signal/webhook-handler/YOUR_UUID';
const order = {
order: [{
type: 'ENTRY',
symbol: 'NSE:NIFTY25APRFUT',
quantity: 1,
side: 'B',
ordertype: 'MARKET',
segment: 'FUT',
product: 'I'
}]
};
fetch(url, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(order)
}).then(r => r.json()).then(console.log);
Always validate orders before sending:
def validate_order(order):
required = ['type', 'symbol', 'quantity', 'side', 'ordertype']
for field in required:
if field not in order:
return False, f"Missing field: {field}"
if not order['symbol'].startswith(('NSE:', 'BSE:')):
return False, "Symbol must have NSE: or BSE: prefix"
if order['quantity'] <= 0:
return False, "Quantity must be positive"
return True, "Valid"
def safe_place_order(order, max_retries=3):
for attempt in range(max_retries):
try:
response = requests.post(webhook_url, json=order, timeout=10)
if response.status_code == 200:
return True, response.json()
elif response.status_code == 429:
time.sleep(5 * (attempt + 1)) # Backoff
except requests.RequestException as e:
if attempt < max_retries - 1:
time.sleep(5)
return False, "Max retries exceeded"
Ensure symbol format: NSE: or BSE: prefix, -EQ suffix for equity
Re-copy UUID from Alphabots portal, verify webhook is enabled
Connect broker in Alphabots portal, verify credentials
https://algoexestaging.alphabots.in/api/v1/signal/webhook-handler/{UUID}
ENTRY — Open new positionEXIT — Close existing positionI — IntradayD — DeliveryN — NormalMARKET — Execute immediatelyLIMIT — At specific priceSTOP — Trigger at stop priceEQ — EquityFUT — FuturesOPT — OptionsFull documentation available in SKILLS.md file on the public repo