What looks wrong?

We say this article was researched and checked. If it is wrong, we want the counter-example.

Skip to content
Ingrid Kovarová

Nov 20, 202614 min read

There is no per-call price on Binance's API, a free programmatic interface for market data, trading and account management that anyone can connect to scripts or to workflow tools such as Activepieces.

You pay nothing to send requests; the limits on those requests are where integrations fail.

This follows the documentation at developers.binance.com, checked on 20 November 2026.

You can read public market data such as prices and order books, place and cancel orders, and query your own balances and trade history.

Trading and account calls need a key tied to a specific user, so a leaked key is a leaked account.

Learn Binance's free REST and WebSocket API

REST, WebSocket and FIX: which to use

Binance has three API protocols:

  • REST is request and response: your script asks, Binance answers, and each ask counts against your limits.
  • WebSocket holds one connection open and Binance pushes updates to you, so you stop polling for data that changes constantly.
  • FIX is a separate protocol aimed at trading firms that already run FIX infrastructure; most builders can ignore it.

A completed flow run showing trigger and step execution with HTTP request details and success status

You don't hire for the polling job; you describe it.

Tell the built-in chat in Activepieces what to fetch and how often, and it publishes the same flow a builder would have assembled by hand, under the same RBAC and audit logs as every flow a person wrote.

Each run leaves a trace anyone on the team can read, which is where you will look the first time a 429 arrives, and Binance's weight limits bind it exactly as they bind a cron job.

This takes minutes, not a project: automate it in Activepieces free.

Get access: account, API key and permission settings

To get access you need a verified Binance account and a key created in API Management. Whoever creates that key owns what it can do.

Public market data needs no key at all, so you can start reading prices before any of this. Checked 20 November 2026.

Do it in this order, and a mistake does not reach live funds:

  1. Verify the account.
  2. Open API Management.
  3. Create a key and choose its type: HMAC, RSA or Ed25519.
  4. Set permissions, read-only first.
  5. Whitelist the server's IP.
  6. Test on the testnet before going live.

A numbered checklist card of six steps beside a laptop showing an API Management page, with a key icon, a read-only…

Create the key and pick a key type

Name the key after the system that will use it, not after yourself, so the next engineer can tell what breaks if you revoke it.

HMAC uses a shared secret. RSA and Ed25519 use a public and private pair, so Binance holds only the public half, and a leak on its side exposes nothing you can sign with. Choose before you write signing code, because switching later means rewriting it.

Two setups side by side: one identical HMAC shared secret key held by both Binance and a script; and an RSA or Ed25519 pair…

Restrict permissions and whitelist IPs

4 permissions start switched off, according to Binance's API key security guide. A new key is therefore inert until someone makes a deliberate choice. When setting up API key permissions:

  • Start with reading only.
  • Add trading when a strategy needs it.
  • Leave withdrawals off unless the integration moves funds out.

Most Binance API key permissions start switched off

Then bind the key to your server's IP. Binance refuses a stolen key used from any other address, so the leak stays contained.

Run every new code path against the Spot testnet before it touches a live key. Mistakes there cost nothing.

Make your first signed and unsigned REST request

Start with a plain curl GET to a public endpoint. A signed request adds your API key in a header, a timestamp, and an HMAC signature over the query string.

Two base URLs matter here. Production Spot is https://api.binance.com, and the testnet from the previous section uses https://testnet.binance.vision. Keep the base URL in one configuration value so that switching environments never means editing request code.

For endpoints with security type NONE, no key is needed. Check connectivity first, then ask for a price:

curl "https://api.binance.com/api/v3/ping"
curl "https://api.binance.com/api/v3/ticker/price?symbol=BTCUSDT"

If ping returns an empty JSON object, you reached the API. The second call returns the symbol and its latest price. Every response, even this cheap one, counts against your weight, so log the usage headers from the first call.

Signed requests

Call GET /api/v3/account and the rules change, because it is security type USER_DATA. Binance's docs define the types this way:

  • NONE: public, no key.
  • MARKET_DATA and USER_STREAM: the X-MBX-APIKEY header only.
  • TRADE and USER_DATA: the header plus a valid signature.

recvWindow is an optional query parameter that sets how long the server will accept your timestamp.

Build the full query string, such as timestamp=...&recvWindow=.... Compute an HMAC-SHA256 of it using your secret key as the key, hex-encode the result, and append it as signature.

Sign exactly the bytes you send, because any reordering or re-encoding after signing invalidates it. The secret never travels in the request, and it should never appear in your logs.

Binance rate limits are weight-based, not per-request

A single heavy request can use up more of your allowance than dozens of light ones, because Binance does not count calls; it counts cost.

The table shows the three limit types the docs define, and each has its own counter, its own header and its own consequence.

A single heavy request can use up more of your allowance than dozens of light ones, because Binance does not count calls; it counts cost.

Limit type What it counts Current limit and interval Usage header On breach
REQUEST_WEIGHT Summed weight of requests, where each endpoint has its own cost Read from the rateLimits array in exchangeInfo A weight header per interval, such as the one-minute weight header HTTP 429, then a 418 IP ban if you keep sending
ORDERS Orders placed, counted separately from weight Read from rateLimits in exchangeInfo An order-count header per interval HTTP 429 on the order endpoints
RAW_REQUESTS Every request, regardless of its weight Read from rateLimits in exchangeInfo No usage header of its own that you can rely on HTTP 429, with the same escalation to a ban

Fetch exchangeInfo at startup and have your client read the limits from it, rather than copying a value into a config file that goes stale.

Track Binance API weight and order count usage

Pass a deeper order book or more symbols and the weight climbs, since every endpoint carries a weight and some scale with the parameters you pass.

Review weights whenever a new call is added, because a harmless-looking change to a polling loop can multiply your spend without adding a single request.

A client can be well inside its weight budget and still get refused for placing too many orders, because ORDERS is a separate counter. A bot that retries failed orders aggressively will exhaust it first, so retry logic needs its own cap.

Log the usage values on every call, not only on failures. The header reading just before a 429 is the evidence an on-call engineer needs. Throttle your client from these headers before the limit is reached, not after.

Activepieces workflow builder with HTTP request step selected and its settings panel open showing method, URL, headers, and…

429 versus 418 ban

Exceed a limit and you get a 429, which means you must back off; keep sending after that and you get a 418, which means your IP is now banned. Repeat offences lead to longer bans, so the docs describe escalating durations.

Treat the first 429 as a hard stop: honour the retry delay the response gives you, pause every worker sharing that IP, and alert a person.

You can follow the rest of this with the builder open. Start free, no card.

The strongest case against building on REST polling

Polling is retrying on a schedule, and serious builders argue that makes REST the wrong foundation: every poll spends request weight whether or not anything changed.

Their remedy is WebSocket streams for market data, the user data stream for account events, and a wrapper library such as CCXT. CCXT is an open-source package that talks to many exchanges and handles request signing for you.

For market data they are right. With a pushed price there is no polling loop, and a loop that asks for the same ticker every second is exactly how you reach a ban.

At the orders, the argument stops short. Streams drop connections, miss events during reconnects and deliver updates out of order, so something has to be the record you trust after a gap. That record is REST.

A person checking one neat, long receipt roll against a fast river of loose paper slips, some out of order, with visible…

A wrapper also hides the weight accounting you still own.

The pattern in the table is that streams carry what changes constantly and REST carries what must be right.

Job Best channel Why Weight cost
Market prices WebSocket stream Pushed on change, so no polling loop None against REST weight
Order book WebSocket stream Incremental updates keep a local copy current One REST snapshot to start, then none
Order placement REST You need an immediate accepted or rejected answer Spent on every call, plus order-rate limits
Order status reconciliation User data stream, confirmed by REST Events can be missed, so REST settles disputes Spent only when you query a gap
Account balances User data stream Balance changes arrive as they happen One REST call at start and after each reconnect

Handle common Binance API errors

Before launch, give six REST failures a handler. The table, drawn from Binance's errors page, shows which failures you retry, which you fix, and which you must never retry blindly.

Code Meaning Usual cause Fix Handling pattern
-1021 Timestamp outside recvWindow Clock drift Sync the clock Resync, then retry once
-1022 Invalid signature Wrong secret or payload mismatch Sign the exact sent string Don't retry; alert
-2015 Invalid key, IP or permissions Key, IP allowlist or scope mismatch Check all three Don't retry; alert owner
-1003 Too many requests Request weight exceeded Cut call volume Back off, then reduce rate
HTTP 429/418 Limit hit; 418 means IP banned Ignoring 429 Honor Retry-After Pause the whole client
5xx Execution status unknown Timeout or server fault Query the order Reconcile before resubmitting

Only some of these are transient, so the handler has to branch on the code rather than retry everything.

Error by error

When -1021 appears, your request timestamp fell outside the receive window, which usually points to a drifting server clock. Sync time and retry once. -1022 is deterministic: the signed string differs from what was sent, so retrying only repeats the failure.

One code covers three causes for -2015, so check the key, the IP allowlist and the key's permissions in turn.

When an order times out or returns a 5xx, that doesn't mean it failed. Query the order by client order ID before resubmitting, or you risk a duplicate fill.

Call Binance endpoints without code in Activepieces

From a scheduled flow in Activepieces you can call Binance's public endpoints, and signed endpoints too if you add a step that computes the signature. It doesn't lift the rate limits or take over your signing duties.

The weight budget you just worked out still applies, and someone still owns the key.

That ownership question comes first. When a scheduled flow starts failing at 2am on a Tuesday, the person paged is whoever built it, so name that person in the flow description before you run anything.

What the HTTP step does

In the screenshot, a typical flow has a schedule trigger set to run daily, a Code action that decides what to fetch, and an HTTP action that makes the request.

For Binance, the HTTP step is the part that matters. It sends a plain request to any endpoint you give it, which suits price checks, alerts and balance logging.

Because it's a generic step, it knows nothing about weights, so a schedule that fires too often will earn you the same 429 and the same IP ban as a script would.

Activepieces workflow builder showing a three-step AI agent flow with a sidebar panel displaying available AI agent options.

Sign private Binance API requests with HMAC

For signed endpoints you need an extra step. Binance expects an HMAC signature over the query string, so a Code action sits before the HTTP step and produces it.

That keeps the secret in your hands, and it means a flow that reads balances is only as safe as the place its key is stored.

Binance API key checklist before your first run

Before the first scheduled run on Monday:

  1. Create an API key with read-only permissions, so a leaked flow cannot trade or withdraw.
  2. Whitelist the IP address your Activepieces instance calls from, so the key is useless elsewhere.
  3. Point the flow at the testnet first, so mistakes cost nothing.
  4. Log the weight headers from every response, so you see the budget being spent before it runs out.
  5. Add a back-off branch for 429, so the flow slows down instead of provoking a 418.

Frequently asked questions

Settle these before the first scheduled run, because each answer decides who is accountable when the integration misbehaves.

Is the Binance API free to use?

Yes. Binance doesn't charge for API access, and the public market-data endpoints cost nothing to call. What you pay for is trading: orders placed through the API incur the same fees as orders placed in the app.

Free access also doesn't mean unlimited access. The weight-based limits and IP bans described earlier apply to every caller, so a free integration still needs an owner who watches its request budget.

Does Binance API work in the United States?

Not through Binance.com for most purposes. Binance.com restricts users in the United States, and requests from US addresses may be refused or the account may be limited. US residents are directed to Binance.US, which has its own API.

Check the current terms for your jurisdiction before you build, because a deployment on a US-hosted server can fail even when your own account is in good standing.

Can I use the Binance API without KYC?

Only for public data. Market-data endpoints such as prices and order books need no key and no account.

Anything tied to an account, including balances, orders and key creation, requires a registered account, and which identity-verification steps apply depends on your region and Binance's current rules.

Don't plan a production trading workflow around skipping verification. Confirm the requirements in Binance's own documentation first.

What's the difference between Binance.com and Binance.US APIs?

They are separate exchanges that run separate APIs. Each has its own accounts, its own API keys and its own base URL, so a key from one won't authenticate against the other.

Available markets, products and rules also differ. Pick the platform your legal entity is allowed to use, then read that platform's documentation for its limits rather than assuming the two match.

Share

Build it

Set this up in minutes.

No code required. Connect your accounts, and Activepieces runs it from there.

Start free Talk to sales