|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > Internet and Network > MCP. - MCP (Model-Context Protocol) server operations > BINANCE API - Cryptocurrency Trading |
The BINANCE.* commands provide access to the Binance cryptocurrency exchange API, allowing you to:
Query real-time cryptocurrency pricesCheck account balancesPlace buy/sell orders (MARKET and LIMIT)Cancel open ordersView order history
Feature |
Value |
API Base URL |
https://api.binance.com (Testnet: https://testnet.binance.vision) |
Authentication |
HMAC-SHA256 Signature |
Default Symbol |
BTCUSDT |
Available Commands
Command |
Purpose |
API Key Required |
Initialize the API (live or testnet) |
No |
|
Set your API Key |
N/A |
|
Set your API Secret |
N/A |
|
Get current price for a symbol |
No |
|
Get account balance (JSON) |
Yes |
|
Place a buy/sell order |
Yes |
|
Cancel an open order |
Yes |
|
Get list of open orders |
Yes |
Quick Start Example
; Initialize Binance API (use testnet for testing)
BINANCE.Init|1
; Set your API credentials
BINANCE.SetKey|your_api_key_here
BINANCE.SetSecret|your_api_secret_here
; Get current Bitcoin price
BINANCE.GetPrice|BTCUSDT|btcPrice
MSGBOX "BTC Price: $" & btcPrice
; Check account balance
BINANCE.GetBalance|balance
; Parse JSON response using PSJ commands...
Security Notes
Never commit API keys to version control. Use external configuration files.Use BINANCE.Init|1 for testnet (paper trading) during development.Enable IP restrictions on your Binance API keys.Use withdrawal whitelist features - never enable withdrawals for API keys used by scripts.
See Also
CloudTools Overview - Other cloud API integrationsPSJ.Parse - Parse JSON responses