@bluvo/sdk-ts
Version:
Bluvo SDK for TypeScript
79 lines (52 loc) • 3.8 kB
Markdown
# .PricesApi
All URIs are relative to *https://api-bluvo.com*
Method | HTTP request | Description
------------- | ------------- | -------------
[**candlesticks**](PricesApi.md#candlesticks) | **GET** /v0/price/candles/{asset}/{quote} | Candlesticks
# **candlesticks**
> Array<Array<any>> candlesticks()
Fetch historical candlestick (OHLCV) data for a given asset and quote currency. You may optionally filter the data using query parameters: \'since\' and \'until\' for the time range, \'exchange\' to specify the data source, and \'granularity\' to set the time interval for each candlestick.
### Example
```typescript
import { createConfiguration, PricesApi } from '';
import type { PricesApiCandlesticksRequest } from '';
const configuration = createConfiguration();
const apiInstance = new PricesApi(configuration);
const request: PricesApiCandlesticksRequest = {
// The asset symbol to retrieve candlestick data for (e.g. BTC, ETH).
asset: "asset_example",
// The quote currency used in the trading pair (e.g. USDT).
quote: "USDT",
// Optional. The start timestamp (in UNIX milliseconds) for the candlestick data range. (optional)
since: 0,
// Optional. The end timestamp (in UNIX milliseconds) for the candlestick data range. (optional)
until: 0,
// Optional. The exchange from which to retrieve candlestick data. Defaults to \'binance\'. (optional)
exchange: "binance",
// Optional. The time interval for each candlestick. Allowed values include \'1m\', \'15m\', \'30m\', \'1h\', \'4h\', \'1d\'. (optional)
granularity: "1h",
};
const data = await apiInstance.candlesticks(request);
console.log('API called successfully. Returned data:', data);
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**asset** | [**string**] | The asset symbol to retrieve candlestick data for (e.g. BTC, ETH). | defaults to undefined
**quote** | [**'USDT'**]**Array<'USDT'>** | The quote currency used in the trading pair (e.g. USDT). | defaults to undefined
**since** | [**number**] | Optional. The start timestamp (in UNIX milliseconds) for the candlestick data range. | (optional) defaults to undefined
**until** | [**number**] | Optional. The end timestamp (in UNIX milliseconds) for the candlestick data range. | (optional) defaults to undefined
**exchange** | [**'binance' | 'kraken' | 'bitget' | 'bitmart' | 'bybit' | 'coinbase' | 'cryptocom' | 'gateio' | 'kraken' | 'kucoin' | 'okx'**]**Array<'binance' | 'kraken' | 'bitget' | 'bitmart' | 'bybit' | 'coinbase' | 'cryptocom' | 'gateio' | 'kraken' | 'kucoin' | 'okx'>** | Optional. The exchange from which to retrieve candlestick data. Defaults to \'binance\'. | (optional) defaults to undefined
**granularity** | [**'1h'**]**Array<'1h'>** | Optional. The time interval for each candlestick. Allowed values include \'1m\', \'15m\', \'30m\', \'1h\', \'4h\', \'1d\'. | (optional) defaults to undefined
### Return type
**Array<Array<any>>**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Successful response | - |
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)