Binance Monitor API
Real-time Binance Square posts. REST and WebSocket.
Authentication
Every request (REST and WebSocket) requires your API key. Pass it in one of two ways:
# Header option 1
Authorization: Bearer <your_api_key>
# Header option 2
X-Api-Key: <your_api_key>
REST Endpoints
GET /health
Public health check. No auth required.
| Status | Body |
|---|---|
| 200 | {"status":"ok","time":"..."} |
GET /v1/status
Returns your subscription details and current tracked count.
| Field | Type | Description |
|---|---|---|
tenant_id | string | Your tenant identifier |
name | string | Subscription name |
expires_at | RFC3339 | Subscription expiry date |
tracked_count | int | Accounts currently tracked |
max_tracked | int | Your plan's tracking limit |
ws_enabled | bool | Whether WebSocket access is active |
discord_enabled | bool | Whether Discord delivery is active |
GET /v1/list
List all Binance Square accounts you are currently tracking.
| Field | Type | Description |
|---|---|---|
tenant_id | string | Your tenant identifier |
tracked | object[ ] | Array of tracked profile objects (username, display_name, avatar_url, added_at) |
POST /v1/track
Start tracking a Binance Square account.
Request body: Content-Type: application/json
| Field | Type | Description | |
|---|---|---|---|
username | string | required | Binance Square username or profile URL |
channel_id | string | optional | Discord channel ID to route this account's posts to |
| Status | Meaning |
|---|---|
| 200 | Account added. Body: {"status":"ok","tracked":{...}} |
| 400 | Already tracked, limit reached, or account not found |
| 401 | Missing or invalid API key |
| 403 | Subscription expired |
// Example request
curl -X POST https://binance.1322.io/v1/track \
-H "Authorization: Bearer api_xxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"username":"demo_square_pub"}'
POST /v1/untrack
Stop tracking a Binance Square account.
| Field | Type | Description | |
|---|---|---|---|
username | string | required | Username to stop tracking |
| Status | Meaning |
|---|---|
| 200 | {"status":"ok","removed":true} |
| 400 | Account was not being tracked |
WebSocket
Connecting
Connect to the WebSocket stream to receive real-time post events for all accounts tracked on your subscription.
// URL: tenant_id and ws_key come from Discord bot or GET /v1/ws/status
wss://binance.1322.io/ws/<tenant_id>?key=<ws_key>
// Auth (any one):
// ?key=<ws_key> on the URL
// header X-WS-KEY: <ws_key>
// header Authorization: Bearer <ws_key>
// Use the WS key from /v1/ws/status — not your REST API key.
// Example (Node.js / browser)
const ws = new WebSocket(
"wss://binance.1322.io/ws/900000000000999998?key=ws_xxxxxxxxxxxxxxxx"
)
ws.onmessage = (e) => {
const event = JSON.parse(e.data)
// binance.post | binance.pin.update
console.log(event)
}
/v1/ws/status (returns ws_url when configured).
/ws/<tenant_id> path, expired subscription, or WS disabled. Check server logs: ws handshake rejected.
TypeScript types
Messages are { "type", "data" }. Use detected_at as the post event time. The main card has no published_at; quote and reply_to may include it and optional avatar_url for the quoted or replied-to author. tendency is bullish or bearish when set. content_type is commonly post, video, space, article, or live. New optional fields on embedded cards are additive and should not break clients that ignore unknown keys.
export type WsEventType = "binance.post" | "binance.pin.update"
// { type, data }; branch on type for post vs pin update.
export interface WsEnvelope {
type: WsEventType
data: BinancePost | PinUpdate
}
export interface BinancePost {
id: string
username: string
display_name?: string
avatar_url?: string
square_uid?: string // profile id when present
content_type?: string // often post | video | space | article | live; other strings possible
block_type?: string
title?: string // common on video posts
summary?: string
is_reply: boolean
is_sticky?: boolean // profile pin
is_featured?: boolean
parent_id?: string // if is_reply
reply_count?: number
like_count?: number
comment_count?:number
share_count?: number
view_count?: number
tendency?: "bullish" | "bearish" // omitted if neutral
bullish_ratio?: number
bearish_ratio?: number
coin_pairs?: string[]
hashtags?: string[]
mentions?: string[]
text?: string
web_link?: string
share_link?: string
links?: PostLink[]
resolved_links?: ResolvedLink[] // trade and cashtag links from text
media?: MediaItem[]
poll?: PostPoll
quote?: PostQuote // quoted card (separate from reply_to)
reply_to?: PostQuote // parent thread when is_reply
translation?: PostTranslation
live_replay?: SpaceLiveReplay
detected_at: string // RFC3339 event time
}
export interface PostLink {
url: string
kind?: string
domain?: string
label?: string
}
export interface ResolvedLink {
kind: "spot" | "spot_pair" | "futures" | "cashtag" | "hashtag" | string
label: string
url: string
raw?: string // e.g. ticker text
}
export interface MediaItem {
kind: "image" | "video" | "gif" | "other"
url: string
preview?: string // video thumbnail / cover when kind is video
mime_type?: string
width?: number
height?: number
duration_s?: number
scope?: "post" | "quote" | "quote_nested" | "reply_to"
}
export interface PostPollOption {
label?: string
value?: string
votes?: number
ratio?: number
}
export interface PostPoll {
question?: string
total_votes?: number
ends_at?: string
closed?: boolean
options?: PostPollOption[]
}
export interface PostQuote {
id?: string
username?: string
display_name?: string
avatar_url?: string // quoted / replied-to author when Binance sends it
text?: string
link?: string
published_at?: string // on quote/reply_to when present (main card uses detected_at)
tendency?: "bullish" | "bearish"
bullish_ratio?: number
bearish_ratio?: number
coin_pairs?: string[]
hashtags?: string[]
mentions?: string[]
links?: PostLink[]
media?: MediaItem[]
poll?: PostPoll
nested?: PostQuote
translation?: PostTranslation
live_replay?: SpaceLiveReplay
target_quote?: PostQuote // quoted card on the parent in a reply thread
}
export interface PostTranslation {
body?: string
source_language?: string
target_language?: string
need_translate?: boolean
}
export interface SpaceLiveReplay {
title?: string
duration_s?: number
replay_url?: string
status?: number
live_type?: number
live_status?: number
view_count?: number
audio_web_url?: string
content_type?: string
}
export interface PinUpdate {
username: string
display_name?: string
avatar_url?: string
square_uid?: string
added?: BinancePost[]
removed?: BinancePost[]
removed_ids?: string[]
note?: string // hint only; confirm on Square if needed
detected_at: string
}
Payload examples
Simple text post (demo publisher):
{
"type": "binance.post",
"data": {
"id": "900000000000000001",
"username": "demo_square_pub",
"display_name": "Demo Publisher",
"avatar_url": "https://public.bnbstatic.com/static/content/square/images/demo_avatar_256.png",
"content_type": "post",
"is_reply": false,
"reply_count": 42,
"like_count": 128,
"view_count": 9001,
"text": "Example post body for documentation only (not a real Square post).",
"web_link": "https://www.binance.com/en/square/post/900000000000000001",
"detected_at": "2026-03-26T00:08:16.105Z"
}
}
Post with coin pairs, resolved trade links, image and sentiment (pinned; demo account):
{
"type": "binance.post",
"data": {
"id": "900000000000000002",
"username": "demo_creator_01",
"display_name": "Demo Creator",
"content_type": "post",
"is_sticky": true,
"is_reply": false,
"tendency": "bearish",
"coin_pairs": ["ETHUSDT", "XRPUSDT"],
"text": "$XRP $ETH\nSpot: ETHUSDT\nFutures: ETHUSDT",
"web_link": "https://www.binance.com/en/square/post/900000000000000002",
"resolved_links": [
{ "kind": "spot_pair", "label": "ETH/USDT", "url": "https://www.binance.com/en/trade/ETH_USDT?contentId=900000000000000002&type=spot", "raw": "ETHUSDT" },
{ "kind": "futures", "label": "Futures: ETHUSDT","url": "https://www.binance.com/en/futures/ETHUSDT?contentId=900000000000000002", "raw": "ETHUSDT" },
{ "kind": "cashtag", "label": "$XRP", "url": "https://www.binance.com/en/trade/XRP_USDT?contentId=900000000000000002", "raw": "$XRP" }
],
"media": [
{ "kind": "image", "url": "https://public.bnbstatic.com/static/content/square/images/demo_chart_2000.jpg",
"width": 2000, "height": 2000, "scope": "post" }
],
"poll": {
"options": [
{ "label": "best", "value": "990001" },
{ "label": "best2", "value": "990002" },
{ "label": "best3", "value": "990003" }
]
},
"detected_at": "2026-03-26T00:08:16.075Z"
}
}
Quote post: demo publisher quoting a demo news card (bullish):
{
"type": "binance.post",
"data": {
"id": "900000000000000003",
"username": "demo_square_pub",
"display_name": "Demo Publisher",
"avatar_url": "https://public.bnbstatic.com/static/content/square/images/demo_avatar_256.png",
"content_type": "post",
"is_reply": false,
"tendency": "bullish",
"text": "👍",
"web_link": "https://www.binance.com/en/square/post/900000000000000003",
"quote": {
"id": "900000000000000004",
"display_name": "Demo News Desk",
"avatar_url": "https://public.bnbstatic.com/static/content/square/images/demo_avatar_256.png",
"text": "Example headline body for documentation (not a live news post).",
"link": "https://www.binance.com/en/square/post/900000000000000004",
"published_at": "2026-03-18T01:38:53Z",
"media": [
{ "kind": "image", "url": "https://public.bnbstatic.com/static/content/square/images/demo_chart_2000.jpg", "scope": "quote" }
]
},
"detected_at": "2026-03-21T11:03:58.032Z"
}
}
Reply with sentiment; parent has tickers and a quoted video (demo IDs only):
{
"type": "binance.post",
"data": {
"id": "900000000000000005",
"username": "demo_creator_01",
"display_name": "Demo Creator",
"content_type": "post",
"is_reply": true,
"parent_id": "900000000000000006",
"tendency": "bullish",
"text": "Bullish on this setup",
"web_link": "https://www.binance.com/en/square/post/900000000000000005",
"reply_to": {
"id": "900000000000000006",
"display_name": "Demo Creator",
"avatar_url": "https://public.bnbstatic.com/static/content/square/images/demo_avatar_256.png",
"tendency": "bearish",
"coin_pairs": ["BNBUSDT", "BTCUSDT"],
"text": "$BNB $BTC\nFutures: BTCUSDT",
"link": "https://www.binance.com/en/square/post/900000000000000006",
"published_at": "2026-03-27T00:09:26Z",
"media": [
{ "kind": "image", "url": "https://public.bnbstatic.com/static/content/square/images/demo_bnb_post_main.jpg",
"width": 1976, "height": 1568, "scope": "reply_to" }
],
"target_quote": {
"id": "900000000000000007",
"display_name": "Demo Creator",
"link": "https://www.binance.com/en/square/post/900000000000000007",
"published_at": "2026-03-26T19:34:21Z",
"media": [
{ "kind": "image", "url": "https://public.bnbstatic.com/static/content/square/images/demo_video_cover.png", "scope": "quote" },
{ "kind": "video", "url": "https://public.bnbstatic.com/video/pgc/ArticleContent/11111111-2222-4333-8444-555555555555.mp4",
"preview": "https://public.bnbstatic.com/static/content/square/images/demo_video_cover.png",
"width": 796, "height": 480, "duration_s": 33, "scope": "quote" }
]
}
},
"detected_at": "2026-03-27T00:10:01.930Z"
}
}
Video post: cover image then playable video (two media rows):
{
"type": "binance.post",
"data": {
"id": "900000000000000008",
"username": "demo_creator_01",
"display_name": "Demo Creator",
"content_type": "video",
"is_reply": false,
"title": "BTC outlook",
"web_link": "https://www.binance.com/en/square/post/900000000000000008",
"media": [
{
"kind": "image",
"url": "https://public.bnbstatic.com/image/pgc/<hash>.jpg",
"scope": "post"
},
{
"kind": "video",
"url": "https://public.bnbstatic.com/video/pgc/ArticleContent/<uuid>.mp4",
"preview": "https://public.bnbstatic.com/image/pgc/<hash>.jpg",
"mime_type": "video/mp4",
"width": 1080,
"height": 1920,
"duration_s": 14,
"scope": "post"
}
],
"detected_at": "2026-03-26T19:16:54.000Z"
}
}
Pin update including note:
{
"type": "binance.pin.update",
"data": {
"username": "demo_creator_01",
"display_name": "Demo Creator",
"square_uid": "uT_ExAmPlEUsErId00",
"added": [],
"removed": [],
"removed_ids": ["900000000000000009"],
"note": "Demo Creator still has 1 pinned post(s). A new pin likely replaced the removed one, but the newly pinned post is not included in this message. Check the profile for the full pin list.",
"detected_at": "2026-03-26T00:10:00Z"
}
}
Common Error Codes
| HTTP | Meaning |
|---|---|
401 | Missing or invalid API key |
403 | Subscription expired. Open a ticket at discord.gg/1322 |
429 | Rate limit exceeded. Back off and retry |
400 | Bad request. Body includes an error string explaining why |
500 | Internal error |