Bitsgap logo
 Search
Bitsgap API: Run Your Own Trading Algorithm on 17 Exchanges

Bitsgap API: Run Your Own Trading Algorithm on 17 Exchanges

Setting up your own trading automation used to mean a week of work. Read one exchange's API docs, implement its signing scheme, handle its quirks, then repeat for the next exchange. Add a server, add reconnect logic, add a way to test without losing money. The Bitsgap API removes that week. One key pair covers 17 exchanges, the demo venues are already there, and the connection to your exchange is the one your bots already use. Across accounts that have set it up, the median time from creating a

Setting up your own trading automation used to mean a week of work. Read one exchange's API docs, implement its signing scheme, handle its quirks, then repeat for the next exchange. Add a server, add reconnect logic, add a way to test without losing money.

The Bitsgap API removes that week. One key pair covers 17 exchanges, the demo venues are already there, and the connection to your exchange is the one your bots already use. Across accounts that have set it up, the median time from creating a key to a first successful signed request is 13 minutes. The API is included free on every plan, including the free one.

What a trading API actually is

An API is a fixed list of commands one program can send to another. A trading API is that list for a market: read a price, read a balance, place an order, cancel an order, close a position. Your program sends a command, the server does the work, and sends back an answer. Everything you can do by clicking in Bitsgap, your code can do on its own schedule.

Bitsgap's version is built around one idea called a topic — a named thing you want. price, balance, orders, order_place. You name the topic, pass its parameters, and get back either a single snapshot or a live stream of updates.

json

{"topic": "price", "params": {"em": 101, "pair": "BTC_USDT"}}

The rest of the protocol is which topics exist and what parameters each one takes. There is no separate endpoint per action and no second format to learn once you go deeper.

Why not go straight to the exchange

You can, and for a single venue that is a reasonable choice. Three things change once the count goes above one.

Every exchange has its own signing scheme, so a second venue means a second implementation from scratch. Every exchange needs its own key, stored and rotated separately. And most give you nowhere realistic to test, so new code meets real money on its first run.

Through Bitsgap it is one key pair, one signing scheme and a demo venue that behaves like the live one. Your algorithm also sits in the same account as your GRID, DCA and COMBO bots, so your positions show up in one place instead of two systems each holding half the picture.

Thirteen minutes, step by step

1. Create an account. Free plan, no card. The API is included on every plan, so nothing here needs upgrading.

2. Generate a key. Account menu → API keys → Create new key. Give it a name and an expiry, then Generate. Default lifetime is three years.

3. Save the private key. It appears once, as a PEM file. Download it and store it the way you'd store an exchange key. If it's lost it cannot be recovered, only replaced.

4. Check your signing works offline. The official examples include a signing_offline test that needs no key and no network. Run it first. Most integration problems are signature problems, and this catches them before anything else is in the way.

5. Run the walkthrough against demo. The examples ship for Go, Rust, Python and TypeScript, and they default to demo exchanges. One command takes you through connection, market data, balances, a spot order, a futures order and order history. No real money is involved at any point.

6. Point it at a real exchange. Change one number — the em exchange ID — and the same code runs live.

How to set it up without writing the code yourself

You do not have to build the integration by hand.

The full protocol reference is public and machine-readable, and four complete reference implementations sit next to it. Give that documentation to any AI coding assistant and describe what you want in plain language: watch the funding rate on three pairs, and when it turns negative on all three, close my long positions. You get back a working script pointed at the demo venue, which you can run and adjust before it touches a real balance.

That 13-minute median holds because the difficult parts already exist in four languages, including Ed25519 signing, canonical request strings and reconnect logic, which leaves you writing the trading rule and nothing else.

The market keeps expanding faster than any manual process can follow, so time spent on plumbing has become the most expensive part of the setup.

Two channels, one topic list

Bitsgap API: Run Your Own Trading Algorithm on 17 Exchanges-2

Both channels take the same topics with the same parameters. REST is for a program that wakes up, asks one question and goes back to sleep. WebSocket is for one that stays awake and reacts.

Over REST, a command's response confirms the task was accepted rather than completed. The execution result arrives through a WebSocket subscription on orders, positions or balance, or by asking those topics again. The rate-limit counter is shared between both channels, so switching transport does not buy extra budget.

What you get access to

Bitsgap API: Run Your Own Trading Algorithm on 17 Exchanges-3

Call conf_enums first. It returns the reference tables that turn exchange names into the numeric em IDs every other topic expects — Binance is 2, Binance demo is 101. The manual topic returns the live catalog of every topic with its current rate limits, so your code can read the limits instead of hard-coding them.

One field worth using from day one: apiid. It is your own tag on an order, up to 250 characters, and it comes back on every future report of that order. Put a strategy name and version in it. When two of your programs trade the same pair, that tag is the only thing telling you which one placed what.

Is the Bitsgap API safe to connect?

Bitsgap's connection to your exchange does not change. It is trade-only and has never had withdrawal rights. The API adds a separate connection between your program and Bitsgap, signed with an Ed25519 key pair you generate and control. Ed25519 is a signature scheme rather than a password: you hold the private half, Bitsgap stores only the public half, and the secret never crosses the network. Requests cannot be replayed, because each one carries a fresh nonce and a timestamp that expires in ten seconds. Revoke the key and every open session drops immediately.

The limits, in numbers

Bitsgap API: Run Your Own Trading Algorithm on 17 Exchanges-4

Two of these shape how you build. Rate counters are shared across REST and WebSocket per topic, so a polling loop eats the budget a live subscription needs. And exceeding the per-connection message rate closes the socket rather than rejecting the message, so reconnect logic needs backoff, a fresh auth frame and a re-subscribe.

Three things break first attempts, in this order: an unsynchronised clock, a reused nonce, and re-serialising the request body after signing it. The payload is signed byte for byte, so a reordered key or an extra space produces a different signature. Send the exact string you signed.

Test it without spending anything

Demo exchanges behave like the real ones. Orders, fills, positions, balances, all with no real money in the path. demo_market_reset wipes the account back to its starting state, so you can run a strategy into the ground and restart in one command.

The API is free on every plan, including the $0 Free plan. No card, no upgrade, no trial clock. Create an account, generate a key, and start signing requests today.


FAQ

What is the Bitsgap API? A public API that lets your own program read market data and place trades on any exchange connected to your Bitsgap account. REST and WebSocket channels share one topic list, authenticated with an Ed25519 key pair you generate and control.

Is the Bitsgap API free? Yes. It is included on every plan, including the free one, at no extra cost.

Do I need to know how to code? You need to be able to run a script. Writing it is largely optional: the protocol reference and four complete reference implementations are public, so an AI coding assistant can produce a working integration from a plain-language description.

Which programming languages are supported? Any language that can make an HTTPS request and compute an Ed25519 signature. Official runnable examples ship in Go, Rust, Python and TypeScript.

Can the API withdraw my funds? No. Bitsgap connects to your exchange with a trade-only key that has never had withdrawal rights, and the API does not change that. It adds a separate signed channel between your program and Bitsgap, revocable at any time.

REST or WebSocket — which should I use? REST for one-off questions and scheduled scripts. WebSocket for anything that needs to react to price movement or track order state live.

Can I test without real money? Yes. The official examples default to demo exchanges, and the demo account can be reset to its starting balances at any time.

How long does setup take? The median time from creating an API key to a first successful signed request is 13 minutes, measured across Bitsgap accounts that have connected one. [Add measurement window before publish]

Want more profit with crypto?

Bitsgap’s automated bots help crypto traders effortlessly make profits 24/7.

Start free trial

*7-days PRO plan trial. No credit card required

Try Bitsgap’s PRO plan free for 7 days, pick a plan later

Done in 3 steps and trades for you.

All your data is secured with high-end encryption