Skip to main content

Gunbot REST API

The Gunbot REST API enables you to programmatically interact with Gunbot, allowing automation and integration with your own applications and services. It gives you a single API with which you can control trading operations on many exchanges.

Base URL​

All API endpoints use the following base URL:

http://your-gunbot-instance.com:3000/api/v1/
https://your-gunbot-instance.com:3000/api/v1/

Replace your-gunbot-instance.com with the actual domain or IP of your Gunbot instance. The port is identical to the GUI port for your Gunbot instance. When not using the API on localhost, make sure to configure https.

Authentication​

The API uses token-based authentication. Before accessing protected endpoints, authenticate and obtain a token.

Data Format​

  • The API accepts and returns data in JSON format.
  • It uses standard HTTP response codes to indicate request outcomes.

Response Codes​

  • 200 OK: The request was successful.
  • 400 Bad Request: The request was invalid or cannot be processed.
  • 401 Unauthorized: Authentication failed, or the user lacks necessary permissions.
  • 500 Internal Server Error: A server-side error occurred.

Gunbot Workflow​

To automate trading for any pair using the API, follow these steps - similar to when using Gunbot in any other way:

  1. Add the trading pair to the configuration with a valid strategy.
  2. Start the core to activate trading operations.

After completing these steps, you can access API endpoints for market data and trading actions. Gunbot will actively monitor and execute strategies for the specified pairs.

Except for API endpoints that place orders or fetch pair lists, the returned data comes from Gunbot core directly.