Skip to main content

Gunbot REST API: What Developers Actually Need to Know

· 5 min read
@boekenbox

If you’ve ever messed around with coding your own trading tools, you already know the grind: endless hours wrestling with exchange APIs, debugging connectivity issues, and dealing with stale data feeds. Gunbot’s REST API steps in and says, “Hey, I’ll take care of the annoying stuff so you can focus on the fun part—building something that works the way you want.”

We've developed this API over the years and use it for our own GUI, now we've opened it up and fully documented it. The API is available in the current preview builds from v29.5.5 and above. This isn’t about reinventing the wheel; it’s about not wasting time rebuilding wheels you don’t have to. Let’s break it down.

Symbol image Gunbot REST API

Why Use the API?

First off, if you’re here, you probably already know Gunbot has a solid set of built-in features, including custom JS trading strategies. Those are great for a lot of scenarios, but what if you need more control over runtime? Like, say you want to hook up a machine learning model that predicts market swings or act on external triggers that aren’t baked into Gunbot’s core logic. That’s where the REST API makes sense—it lets you run your own show.

Let Gunbot Handle the Annoying Stuff

If you’ve ever tried coding a trading bot from scratch, you know how painful it is to set up reliable exchange connections. Every exchange has its quirks—rate limits, different order types, inconsistent data formats. Keeping everything synced is a headache, and it only gets worse as you add more exchanges.

Gunbot already nails this, as well as having proper charting for custom bots. When you’re working with the API, you’re building on a foundation that handles all the tedious exchange connectivity for you. It collects the data, formats it properly, and makes sure everything’s running smoothly. You just focus on the logic.

Build What You Need In A Trading Bot

This is where things get interesting. The API isn’t just about adding bells and whistles—it’s about creating tools that match your exact needs.

Custom Algorithms on Your Schedule

Gunbot’s custom strategies work well for most setups, but they’re tied to the bot’s execution cycle and must be codes with JavaScript. If you want something that runs independently or using a different programming language, like a sentiment tracker that reacts to Twitter spikes or an ML model crunching live data, you can do that with the API. You decide how often your code runs, what inputs it needs, and what outputs it generates.

Better Risk Controls

Risk management is a big deal, but most off-the-shelf solutions only cover the basics. The API lets you build safeguards that actually make sense for your approach:

  • Adjust position sizes dynamically based on your own risk models.
  • Create early warning systems tied to market conditions, like volatility spikes or liquidity drops.
  • Automate fail-safes that kick in before things go south; pause trades, hedge positions, or close out risky ones automatically.

This isn’t “set it and forget it.” It’s active risk management tailored to how you trade.

Integrate Everything

One of the coolest things about the API is how easily it integrates with other systems. You’re not locked into a single tool or workflow—you can hook Gunbot up to pretty much anything.

  • Bring in External Data: Pull in forex prices, economic indicators, or even weird niche stuff like NFT market activity or Telegram messages. If it’s got an API, you can probably use it.
  • Sync With Other Tools: Need to track trades for taxes? Want to send performance reports to a Slack channel? The API makes it easy to plug Gunbot into your existing stack.
  • Build Custom Dashboards: Let’s be real, sometimes you just want a clean interface that shows exactly what you care about and nothing else. The API lets you design your own dashboards, no compromises.

Why It’s Worth Your Time

At the end of the day, the Gunbot REST API isn’t about adding fluff to your trading setup. It’s about making your life easier as a developer. You don’t have to deal with the slog of exchange integrations or waste hours debugging stuff that shouldn’t be broken in the first place. Gunbot takes care of that so you can focus on the fun part: building tools that actually work.

If you’re the kind of person who looks at trading bots and thinks, “This is good, but I could make it better,” the API is for you. It’s not a silver bullet, but it gives you the freedom to innovate without getting bogged down in the basics.