General API Information for Binance Open Platform

·

API Endpoints and Basics

Binance provides multiple base endpoints for API access, ensuring flexibility and performance optimization:

Key Notes:


HTTP Return Codes and Error Handling

HTTP Status Codes

| Code | Description |
|------|-------------|
| 4XX | Malformed requests (sender-side issue). |
| 403 | WAF (Web Application Firewall) limit violation. |
| 429 | Request rate limit exceeded. |
| 418 | IP banned due to repeated rate limit violations. |
| 5XX | Binance server errors (treat as UNKNOWN status). |

Error Payload Example

{
  "code": -1121,
  "msg": "Invalid symbol."
}

Endpoint Security and Request Types

Security Types

| Type | Description |
|------|-------------|
| NONE | Publicly accessible. |
| TRADE | Requires API key + HMAC signature. |
| USER_DATA | Requires API key + HMAC signature. |
| MARKET_DATA | Requires API key only. |

Request Methods


Rate Limits and IP Restrictions

General Limits

IP-Specific Rules


Signed Endpoints: HMAC and RSA Examples

HMAC-SHA256 Signature Steps

  1. Concatenate parameters:

    symbol=LTCBTC&side=BUY&type=LIMIT&timestamp=1499827319559  
  2. Generate signature:

    echo -n "payload" | openssl dgst -sha256 -hmac "API_SECRET"  
  3. Include in request:

    &signature=generated_hash  

RSA Key Example (PKCS#8)

  1. Sign payload:

    openssl dgst -sha256 -sign private_key.pem  
  2. Base64 + URL encode the output.

👉 Full HMAC/RSA Guide


FAQs

1. How do I avoid IP bans?

2. What’s the difference between api and sapi endpoints?

3. Why is my order rejected with a 429?

4. How are WebSocket limits enforced?


Final Notes


### Key SEO Adjustments:  
- **Keywords**: Binance API, rate limits, HMAC signature, WebSocket, error codes.