Welcome to the Sintra API docs. It's here that you can find information on the endpoints we offer as well as how to authenticate, how we return errors and rate limiting. Please do get in touch if you have any questions or suggestions.
The Sintra API base url is: https://api.sintra.fi/v1
You do not need to authenticate if you're on the Starter plan. The following only applies to the Pro plan.
API keys are split into two parts separated with a .
character. The first part is the id
and the second part is the token
. The token is used to check against the encrypted value we store in our database.
You can either send your id
as the username and the token
as the password or send the whole apiKey
as the username.
Please keep the API key safe (especially the token part) and do not share with anyone. We will ask for the
id
if you need to request email support.
Your API key must be included in every API request using Basic Authentication.
Method | Procedure |
Basic Authentication using username only | Use the |
Basic Authentication using username and password | Use the |
Sintra uses conventional HTTP response codes to indicate the success or failure of an API request. Codes in the 2xx
range indicate success. Codes in the 4xx
range indicate an error due to an invalid request in some way. Codes in the 5xx
range indicate an error on our end and shouldn't happen very often.
Parameter | Type | Description |
status_code |
| HTTP status code for the error |
message |
| Human readable string describing the problem |
type |
| Type of error e.g. "UnauthorizedError" or "NotFoundError" |
code |
| Some error responses may include a |
The Starter plan allows 10 requests per minute and the Pro plan allows 250 requests per one minute period.
Limits are based on IP address. By providing a valid API Key, you are automatically assigned the higher rate limit.
If the limit is reached on either plan then a 429 error is returned and you will need to wait before being able to make more requests.
Please inspect the response headers for details on when you can make another request.
An Exchange represents a crypto exchange that Sintra receives trade data from.
This endpoint lists all crypto exchanges that Sintra connects to.
Bitcoin transaction fees.
This endpoint lists the latest Bitcoin transactions fees in vB. The response is an array of fees ranging from the lowest to the highest.
This endpoint retrieves the Bitcoin fee history. History is on an hourly basis.
This endpoint requires authentication.
Query Parameters
date timestamp
A timestamp without milliseconds. This value specifies the upper date range for the price history with all prices being before this value.
sort string
Sort the data by date in "asc" or "desc" order (default "asc").
limit number
Limit the number of results returned (default 10, max 25).
A Pair is a base currency (btc only) and supported quote currency.
This endpoint retrieves a single Pair. You can use this endpoint to get price stats about the pair such as open and close price.
URL Parameters
pair string
A supported Pair (e.g. btcusd).
Query Parameters
date timestamp
A timestamp without milliseconds. Results will be based on a 24 hour period from this value. If omitted, then the current day will be used and the "close" value will be the latest price.
This endpoint lists supported Pairs.
A price represents the amount needed in a quote currency to purchase a single unit of the base currency (i.e. 1 BTC). We use volume-weighted data provided by multiple exchanges to return the price in any supported currency.
This endpoint retrieves the price for the specified pair.
URL Parameters
pair string
A Pair (e.g. btcusd). If you provide an unsupported quote currency then we will return Coinbase's current spot price.
This endpoint lists prices for all supported currencies.
Always check for the existence of the currency key (usd, gbp etc) in the response object. This is because there can be a delay before the price for each currency is available.
This endpoint retrieves the price history for a single supported currency.
This endpoint requires authentication.
URL Parameters
pair string
A supported Pair (e.g. btcusd).
Query Parameters
interval string
Price interval. One of "minute", "hour" or "day" (default "minute").
date timestamp
A timestamp without milliseconds. This value specifies the upper date range for the price history with all prices being before this value.
sort string
Sort the data by date in "asc" or "desc" order (default "asc").
limit number
Limit the number of results returned (default 10, max 25).
A Session is required to authenticate a connection to the websocket server.
Create a sessionId
which can be used to authenticate a websocket server connection. Sessions last for 10 minutes before expiring. You will need to create another sessionId
if you need to reconnect to the websocket server. Existing connections will persist after expiry.
This endpoint requires authentication.
Websockets allow for a bi-directional connection between your application and Sintra. Using this connection, we can send data directly to you at regular intervals.
The websocket endpoint is: wss://api.sintra.fi/ws
Starter Plan | Pro Plan | |
Auth Required | No | Yes (see below) |
Update Frequency | 10 seconds | 1 second |
If you connect to the websocket server with a valid sessionId
then you will receive 1 second prices updates. If not then the updates will be every 10 seconds.
To get a valid sessionId
you need to make a POST
request to the /sessions
endpoint (see Sessions section above).
To pass your sessionId
when connecting to the websocket server, pass the value as a query parameter in your connection string: wss://api.sintra.fi/ws?sessionId=<sessionId>
Websocket errors are events sent by the Sintra websocket server but have a dedicated section here.
Parameter | Type | Description |
event |
| Can be used by clients to detect errors - always "error". |
data.message |
| Human readable string describing the problem |
data.type |
| Type of error e.g. "ConnectionError" or "AuthenticationError" |
data.code |
| Some error responses may include a |
Sintra will push events to your app as and when they happen. Events are sent as stringified JSON data which your application will need to handle.
The connection event occurs when your application successfully connects to the Sintra websocket server.
The data event occurs at regular intervals and depends on your chosen price plan.