GraphQL API

Overview

Cassandre GraphQL API allows you to query your data (balances, strategies, orders, trades and positions).

Installation

To deploy the GraphQL API on your bot, just add this spring boot starter to your pom:

<dependency>
    <groupId>tech.cassandre.trading.bot</groupId>
    <artifactId>cassandre-trading-bot-spring-boot-starter-api-graphql</artifactId>
    <version>5.0.6</version>
</dependency>
1
2
3
4
5

Access the API with GraphiQL

Start your bot and open a browser to http://localhost:8080/graphiqlopen in new window. GraphiQL is a query editor that comes out of the box with the DGS frameworkopen in new window we are using.

For example, you can try to enter this query to display all your strategies:

query {
    strategies{ strategyId name }
}
1
2
3

Secure your API

To secure your API with a key, add this property: cassandre.trading.bot.api.graphql.key in your applications.properties.

API Documentation

You can view the API documentation at this address.