diff --git a/data-api/coinapi-marketdata-rest.yaml b/data-api/coinapi-marketdata-rest.yaml index dd166aa7de..33f773211a 100644 --- a/data-api/coinapi-marketdata-rest.yaml +++ b/data-api/coinapi-marketdata-rest.yaml @@ -1,7 +1,7 @@ openapi: 3.0.1 info: - title: Market Data - REST API - description: "\nThis section will provide necessary information about the `Market Data API` protocol. \n

\nThe Market Data REST API by CoinAPI is a web service for retrieving cryptocurrency market data. It supports different HTTP versions and offers secured and non-secured endpoints. The API requires authentication and uses rate limiting and concurrency limits. Data is provided in JSON format by default, but XML and CSV formats are also supported. The API also integrates with Excel, Google Sheets, and OpenOffice Calc for further data analysis.\n " + title: REST API + description: "\nRESTful endpoint provides the widest range of data, based on HTTP protocol which works in Request-Reply scheme.\n\nImplemented Standards:\n\n * [HTTP1.0](https://datatracker.ietf.org/doc/html/rfc1945)\n * [HTTP1.1](https://datatracker.ietf.org/doc/html/rfc2616)\n * [HTTP2.0](https://datatracker.ietf.org/doc/html/rfc7540)\n * [OpenAPI v3](https://www.openapis.org/)\n\n> **Note:** We adhere to the OpenAPI standards for documenting our API.\n\n## OpenAPI Specification\n\nTo access our API's OpenAPI specification, you can use the following link: [OpenAPI v3](https://raw.githubusercontent.com/coinapi/coinapi-sdk/master/data-api/coinapi-marketdata-rest.yaml)\n\nIf you need to import the OpenAPI file into software like Postman, simply copy and paste the link below:\n```shell\nhttps://raw.githubusercontent.com/coinapi/coinapi-sdk/master/data-api/coinapi-marketdata-rest.yaml\n```\n\n## Endpoints\n\nEnviroment | Encryption | Value \n--- | --- | ---\nProduction | Yes | `https://rest.coinapi.io/`\nProduction | No | `http://rest.coinapi.io/`\n\n:::info\n\nFor real-time market data streaming, you should use WebSockets. REST API only supports pooling, meaning you can periodically request the current market data state. In streaming, you subscribe and data or updates are delivered to you continuously.\n\n:::\n\n## General\n\nIf you want to learn how to authenticate to this API, you can find detailed instructions and guidance in\n[authentication section](/authentication) of this documentation.\n\n### HTTP Requests\n\nEach HTTP request must contain the header ``Accept: application/json`` as all our responses are in JSON format.\n\nWe encourage you to use the HTTP request header ``Accept-Encoding: deflate, gzip`` for all requests. \nThis will indicate to us that we can deliver compressed data to you which on your side should be decompressed transparently.\n\n:::tip\n\nBy allowing data compression you are lowering bandwidth requirements by approximately 80%. \nThis is important for requesting large amounts of data or using WebSocket Streaming API, \nas we can deliver data to you faster and more effectively.\n\n:::\n\n#### HTTP Success\n\nSuccessful HTTP responses have the status code `200` and the body in a format according to documentation of the requested resource.\n\n:::info\n\nYou should always check that your HTTP response status code is equal to 200, otherwise the requested was not successful.\n\n:::\n\n#### HTTP Errors\n\n> Error message is returned in JSON structured like this:\n\n```json\n{\n \"error\": \"Invalid API key\"\n}\n```\n\nAll HTTP requests with response status codes different to `200` must be considered as failed \nand you should expect additional JSON inside the body of the response with the error message encapsulated inside it as shown in the example.\nWe use the following error codes:\n\nError Code | Meaning\n---------- | -------\n400 | Bad Request -- There is something wrong with your request\n401 | Unauthorized -- Your API key is wrong\n403 | Forbidden -- Your API key doesnt't have enough privileges to access this resource\n429 | Too many requests -- You have exceeded your API key rate limits\n550 | No data -- You requested specific single item that we don't have at this moment.\n\n:::info\n\nGood practice is to store all error messages somewhere along with request data for further manual review.\n\n:::\n\n### Limits\n\nAny authenticated endpoint is providing (in HTTP response headers) information about the current state of the limits associated with API Key. In this section we will describe each limit.\n\n#### Request limit / APIKey\n\n```html\nX-RateLimit-Limit: 1000000\nX-RateLimit-Remaining: 999989\nX-RateLimit-Request-Cost: 1\nX-RateLimit-Reset: 2018-01-22T15:25:15.1234567Z\n```\n\nThe request limit define number of maximum requests that could be executed in the 24 hours period (sliding/rollowing window - always last 24 hours from specific moment) for your subscription.\n\nWe define request as data request credits and this is not always equal to the number of API calls executed against the API. A request is deemed to be a single one if the limit query parameter on the endpoint isn’t available, isn’t used or it's stated otherwise in the API documentation. Otherwise — if the limit query parameter is available and is used — then each of the 100 data points returned in the response is counted as one request.\n\nFor example at the 2019-08-22 13:00 UTC value of the requests remaining (X-RateLimit-Remaining) will be equal to the allocated quota (X-RateLimit-Limit) decreased by the sum of the request costs (SUM(X-RateLimit-Request-Cost)) executed in the period 2019-08-21 13:00 UTC - 2019-08-22 13:00 UTC (last 24 hours).\n\n\nHTTP Header | Type | Description\n---------- | ------- | ---\nX-RateLimit-Used | int | Provides information about the request limit that has been used within the last 24-hour period. This header indicates the amount of request capacity consumed based on the usage history. It is important to note that the header is not always appended to every request to optimize the operation of the API.\nX-RateLimit-Limit | int | Is an optional feature that can be enabled via the customer portal to impose a limit on the capabilities of a specific API key. It allows you to define a threshold for the number of requests that can be made using a single API key within a 24-hour time frame.\nX-RateLimit-Remaining | int | Provides information about the number of requests that can still be made within the last 24-hour period based on the usage history. This header serves as a helpful indicator of the remaining request capacity, allowing API consumers to manage their usage effectively. It is important to note that the header is not always appended to every request to optimize the operation of the API.\nX-RateLimit-Request-Cost | int | The number of requests used to generate current HTTP response.\nX-RateLimit-Reset | timestring | The time when all provisioned requests are available to execute again if no more requests will be executed.\nX-RateLimit-Quota-Overage | string | Provides information about whether a given API key may exceed the plan quota within a 24-hour time frame, which could result in additional charges. This header is fully defined and configured in the customer portal.\nX-RateLimit-Quota-Allocated | string | Total number of requests that can be made within a specific subscription during a 24-hour time frame. This quota allocation is determined based on the user's subscription purchase.\nX-RateLimit-Quota-Remaining | string | Provides valuable information about the remaining quota within the subscription for making requests within a 24-hour time frame. This header indicates the number of requests that can still be made within the allocated quota for the current 24-hour period.\n\n```json\nGET v1/exchanges/ECB/apiKey-ED802AF4-E855-YOUR-API-KEY\nHost: coinapi.io\nX-RateLimit-Used: 1000\nX-RateLimit-Limit: 5000\nX-RateLimit-Remaining: 4000\nX-RateLimit-Request-Cost: 1\nX-RateLimit-Reset: 2023-05-05T12:00:00.0000001Z\nX-RateLimit-Quota-Overage: ENABLED\nX-RateLimit-Quota-Allocated: 10000\nX-RateLimit-Quota-Remaining: 5000\n```\n\nExplanation:\n\n- X-RateLimit-Used: 1000 (requests used in the last 24 hours)\n- X-RateLimit-Limit: 5000 (total request limit within a 24-hour time frame)\n- X-RateLimit-Remaining: 4000 (requests remaining within the last 24 hours)\n- X-RateLimit-Request-Cost: 1 (cost or \"weight\" of each individual request)\n- X-RateLimit-Reset: 2023-05-05T12:00:00.0000001Z (when the rate limit will reset within a 24-hour period)\n- X-RateLimit-Overage: ENABLED (API key may exceed the plan quota within a 24-hour time frame)\n- X-RateLimit-Quota-Allocated: 10000 (total number of requests allowed for all API keys within the subscription within a 24-hour time frame)\n- X-RateLimit-Quota-Remaining: 5000 (requests remaining within the subscription's allocated quota within the last 24 hours)\n\n#### Concurrency limit / APIKey\n\n```html\nX-ConcurrencyLimit-Limit: 10\nX-ConcurrencyLimit-Remaining: 5\n```\n\nThe concurrency limit defines the number of maximum concurrent API calls/requests that the API could process for your subscription at the current moment. Every API call/request increases the Concurrency limit against quota, and when it finishes, decreases it.\n\nHTTP Header | Type | Description\n---------- | ------- | ---\nX-ConcurrencyLimit-Limit | int | Concurrency limit allocated for your API key.\nX-ConcurrencyLimit-Remaining | int | The number of concurrent API calls/requests available to be executed in this moment for your API key.\n\n### Output data format\n\nBy default we are using JSON output data format for all of our endpoints, you can control format of data by using `output_format` variable in query string parameters.\n\n#### URL Parameters\n\nParameter | Type | Description\n---------- | ------- | -------\noutput_format | string | Output data format *(optional, default value is `json`, possible values are `json`, `xml` or `csv`)*\ncsv_include_header | bool | Ignore header line in CSV output? *(optional, default value is `true`, `true` to include CSV header line, `false` otherwise)*\ncsv_include_quotes | bool | Encapsulate strings with quotes in CSV output? *(optional, default value is `false`, `true` to encapsulate all strings with `\"`, `false` to leave them unquoted)*\ncsv_exclude_col | string | Comma delimited list of column names to ignore in CSV output *(optional, by default all columns are included)*\ncsv_set_delimiter | string | Character that will be used as column delimiter in CSV output *(optional, default value is `;`)*\ncsv_set_dec_mark | string | Character that will be used as decimal separator in CSV output *(optional, default value is `.`)*\ncsv_set_timeformat | string | Format for datetime type in CSV output or `unix` for unix timestamp *(optional, default value is `yyyy-MM-ddTHH:mm:ss.fffffffZ`)*\ncsv_set_newline | string | New line type *(optional, default value is `unix`, possible values `win`, `mac`, `unix`)*\n\n### Excel / G-Sheets\n\nThere are several ways to use data from our REST API inside the Excel, Google Sheets, or similar calculation sheet application. This section will do as best as possible to keep all information up to date on how you could load the data into these applications. Feel free to contact support if we are missing an option.\n\n#### CSV download, import:\n\n 1. Open the data in the CSV format from the browser eg. ```https://rest.coinapi.io/v1/exchangerate/USD?apikey=YOUR_API_KEY&invert=true&output_format=csv```\n 2. Save the data to the file with the .csv extension.\n 3. Use the file saved and import it into the software.\n 4. When configuring import, refer to the parameters like delimiter from the [Output data format](#output-data-format)\n\nThe platform-independent way described above is based on CSV but could also be used in other formats like JSON and XML as long as the software support it, but the import procedure needs to be adjusted accordingly.\n\n#### Microsoft Excel\n\n * Use [PowerQuery](https://docs.microsoft.com/en-us/power-query/power-query-what-is-power-query) to load the URL directly into the CSV import without saving the file locally. \n * Use the [=WEBSERVICE](https://support.office.com/en-us/article/webservice-function-0546a35a-ecc6-4739-aed7-c0b7ce1562c4) function to load the API response directly into the sheet, but this will not parse the data; additional processing is required.\n\n#### Google Sheets\n\n * Use [=IMPORT](https://support.google.com/docs/answer/3093335?hl=en) function to load the REST API endpoint and automatically parse the CSV format data into the cells. eg. ```=IMPORTDATA(\"https://rest.coinapi.io/v1/exchangerate/USD?apikey=YOUR_API_KEY&invert=true&output_format=csv```\n\n#### OpenOffice Calc\n\n * Select the menu Insert -> Sheet From File, 2. In the Insert dialog, put the URL eg. ```https://rest.coinapi.io/v1/exchangerate/USD?apikey=YOUR_API_KEY&invert=true&output_format=csv``` in the File Name box at the bottom. Set the drop-down list next to that to Web Page Query and click Open. The Text Import dialog opens where you can change the defaults if needed.\n " contact: name: COINAPI LTD url: https://www.coinapi.io @@ -10,16 +10,19 @@ info: name: MIT License url: https://github.com/coinapi/coinapi-sdk/blob/master/LICENSE version: v1 +servers: + - url: https://rest.coinapi.io paths: /v1/assets: get: tags: - - Assets - summary: Retrieves all assets. + - Metadata + summary: List all assets + description: "Retrieves all assets.\r\n \r\n:::info\r\nOur asset identifiers are aligned with the ISO 4217 currency codes standard only for fiat money (government or law regulated currency).\r\n:::\r\n \r\n:::info\r\nProperties of the output are providing aggregated information from across all symbols related to the specific asset. If you need to calculate your aggregation (e.g., limiting only the particular type of symbols), you should use /v1/symbols endpoint as a data source.\r\n:::" parameters: - name: filter_asset_id in: query - description: The asset ID filter. + description: 'Comma or semicolon delimited asset identifiers used to filter response. (optional, eg. `BTC;ETH`).' schema: type: string - name: include_supply @@ -55,8 +58,8 @@ paths: '/v1/assets/{asset_id}': get: tags: - - Assets - summary: Retrieves asset information for a specific asset ID. + - Metadata + summary: List all assets by asset ID parameters: - name: asset_id in: path @@ -91,8 +94,9 @@ paths: '/v1/assets/icons/{size}': get: tags: - - Assets - summary: Retrieves icons for all assets. + - Metadata + summary: List all asset icons + description: Gets the list of icons (of the given size) for all the assets. parameters: - name: size in: path @@ -125,155 +129,29 @@ paths: type: array items: $ref: '#/components/schemas/v1.Icon' - /v1/delay: - get: - tags: - - Delay - summary: Delays the response for the specified amount of time. - parameters: - - name: ms - in: query - description: The delay time in milliseconds. - schema: - type: integer - format: int32 - default: 1000 - responses: - '200': - description: successful operation - content: - text/plain: - schema: - type: string - application/json: - schema: - type: string - text/json: - schema: - type: string - application/x-msgpack: - schema: - type: string - '/rc/exchangerate/{asset_id_base}/{asset_id_quote}': - get: - tags: - - ExchangeRate - summary: Retrieves the exchange rate for a specific base and quote asset at a given time or the current rate. - parameters: - - name: asset_id_base - in: path - description: Base asset identifier - required: true - schema: - type: string - - name: asset_id_quote - in: path - description: Quote asset identifier - required: true - schema: - type: string - - name: time - in: query - description: Time for historical rate (optional) - schema: - type: string - responses: - '200': - description: successful operation - content: - text/plain: - schema: - type: array - items: - $ref: '#/components/schemas/v1.ExchangeRate' - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/v1.ExchangeRate' - text/json: - schema: - type: array - items: - $ref: '#/components/schemas/v1.ExchangeRate' - application/x-msgpack: - schema: - type: array - items: - $ref: '#/components/schemas/v1.ExchangeRate' '/v1/exchangerate/{asset_id_base}/{asset_id_quote}': get: tags: - - ExchangeRate - summary: Retrieves the exchange rate for a specific base and quote asset at a given time or the current rate. + - Exchange Rates + summary: '[exchange rates] Get specific rate' + description: "Retrieves the exchange rate for a specific base and quote asset at a given time or the current rate.\r\n \r\n:::info\r\nIf you are using an exchange rate for mission-critical operations, then for best reliability, you should measure the difference between current time and the time returned from the response to ensure that value of the difference between those meets your internal requirements.\r\n:::" + operationId: Get specific rate parameters: - name: asset_id_base in: path - description: Base asset identifier + description: Requested exchange rate base asset identifier required: true schema: type: string - name: asset_id_quote in: path - description: Quote asset identifier - required: true - schema: - type: string - - name: time - in: query - description: Time for historical rate (optional) - schema: - type: string - responses: - '200': - description: successful operation - content: - text/plain: - schema: - type: array - items: - $ref: '#/components/schemas/v1.ExchangeRate' - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/v1.ExchangeRate' - text/json: - schema: - type: array - items: - $ref: '#/components/schemas/v1.ExchangeRate' - application/x-msgpack: - schema: - type: array - items: - $ref: '#/components/schemas/v1.ExchangeRate' - '/rc/exchangerate/{asset_id_base}': - get: - tags: - - ExchangeRate - summary: 'Retrieves all exchange rates for a specific base asset, optionally filtered by quote assets and time.' - parameters: - - name: asset_id_base - in: path - description: Base asset identifier + description: Requested exchange rate quote asset identifier required: true schema: type: string - - name: filter_asset_id - in: query - description: Filter for quote assets (optional) - schema: - type: string - - name: invert - in: query - description: Flag to invert rates (optional) - schema: - type: boolean - default: false - name: time in: query - description: Time for historical rates (optional) + description: 'Time at which exchange rate is calculated (optional, if not supplied then current rate is returned)' schema: type: string responses: @@ -282,44 +160,97 @@ paths: content: text/plain: schema: - type: array - items: - $ref: '#/components/schemas/v1.ExchangeRatesRate' + $ref: '#/components/schemas/v1.ExchangeRate' + examples: + Current rate: + value: { + "time": "2024-02-01T12:07:40.8741043Z", + "asset_id_base": "BTC", + "asset_id_quote": "USD", + "rate": 10000.0 +} + Historical rate: + value: { + "time": "2024-01-31T12:07:40.8743058Z", + "asset_id_base": "BTC", + "asset_id_quote": "USD", + "rate": 10000.0 +} application/json: schema: - type: array - items: - $ref: '#/components/schemas/v1.ExchangeRatesRate' + $ref: '#/components/schemas/v1.ExchangeRate' + examples: + Current rate: + value: { + "time": "2024-02-01T12:07:40.8741043Z", + "asset_id_base": "BTC", + "asset_id_quote": "USD", + "rate": 10000.0 +} + Historical rate: + value: { + "time": "2024-01-31T12:07:40.8743058Z", + "asset_id_base": "BTC", + "asset_id_quote": "USD", + "rate": 10000.0 +} text/json: schema: - type: array - items: - $ref: '#/components/schemas/v1.ExchangeRatesRate' + $ref: '#/components/schemas/v1.ExchangeRate' + examples: + Current rate: + value: { + "time": "2024-02-01T12:07:40.8741043Z", + "asset_id_base": "BTC", + "asset_id_quote": "USD", + "rate": 10000.0 +} + Historical rate: + value: { + "time": "2024-01-31T12:07:40.8743058Z", + "asset_id_base": "BTC", + "asset_id_quote": "USD", + "rate": 10000.0 +} application/x-msgpack: schema: - type: array - items: - $ref: '#/components/schemas/v1.ExchangeRatesRate' + $ref: '#/components/schemas/v1.ExchangeRate' + examples: + Current rate: + value: { + "time": "2024-02-01T12:07:40.8741043Z", + "asset_id_base": "BTC", + "asset_id_quote": "USD", + "rate": 10000.0 +} + Historical rate: + value: { + "time": "2024-01-31T12:07:40.8743058Z", + "asset_id_base": "BTC", + "asset_id_quote": "USD", + "rate": 10000.0 +} '/v1/exchangerate/{asset_id_base}': get: tags: - - ExchangeRate - summary: 'Retrieves all exchange rates for a specific base asset, optionally filtered by quote assets and time.' + - Exchange Rates + summary: '[exchange rates] Get all current rates' + description: "Get the current exchange rate between requested asset and all other assets.\r\n \r\n:::info\r\nIf you are using an exchange rate for mission-critical operations, then for best reliability, you should measure the difference between current time and the time returned from the response to ensure that value of the difference between those meets your internal requirements.\r\n:::\r\n \r\n:::info\r\nYou can invert the rates by using Y = 1 / X equation, for example BTC/USD = 1 / (USD/BTC);\r\n:::" parameters: - name: asset_id_base in: path - description: Base asset identifier + description: Requested exchange rates base asset identifier required: true schema: type: string - name: filter_asset_id in: query - description: Filter for quote assets (optional) + description: Comma or semicolon delimited asset identifiers used to filter response (optional) schema: type: string - name: invert in: query - description: Flag to invert rates (optional) + description: 'True will invert all the rates (optional, if true then rates will be calculated as `rate = 1 / actual_rate` eg. `USD/BTC` as `BTC/USD`)' schema: type: boolean default: false @@ -352,40 +283,12 @@ paths: type: array items: $ref: '#/components/schemas/v1.ExchangeRatesRate' - /rc/exchangerate/history/periods: - get: - tags: - - ExchangeRate - summary: Retrieves all supported time periods for requesting exchange rate historical timeseries data. - responses: - '200': - description: successful operation - content: - text/plain: - schema: - type: array - items: - $ref: '#/components/schemas/v1.TimeseriesPeriod' - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/v1.TimeseriesPeriod' - text/json: - schema: - type: array - items: - $ref: '#/components/schemas/v1.TimeseriesPeriod' - application/x-msgpack: - schema: - type: array - items: - $ref: '#/components/schemas/v1.TimeseriesPeriod' /v1/exchangerate/history/periods: get: tags: - - ExchangeRate - summary: Retrieves all supported time periods for requesting exchange rate historical timeseries data. + - Exchange Rates + summary: '[exchange rates] Timeseries periods' + description: "You can also obtain historical exchange rates of any asset pair, grouped into time periods.\r\nGet full list of supported time periods available for requesting exchange rates historical timeseries data.\r\n \r\n## Timeseries periods\r\nTime unit |\tPeriod identifiers\r\n--- | ---\r\nSecond | 1SEC, 2SEC, 3SEC, 4SEC, 5SEC, 6SEC, 10SEC, 15SEC, 20SEC, 30SEC\r\nMinute | 1MIN, 2MIN, 3MIN, 4MIN, 5MIN, 6MIN, 10MIN, 15MIN, 20MIN, 30MIN\r\nHour | 1HRS, 2HRS, 3HRS, 4HRS, 6HRS, 8HRS, 12HRS\r\nDay | 1DAY, 2DAY, 3DAY, 5DAY, 7DAY, 10DAY" responses: '200': description: successful operation @@ -410,106 +313,43 @@ paths: type: array items: $ref: '#/components/schemas/v1.TimeseriesPeriod' - '/rc/exchangerate/{assetBase}/{assetQuote}/history': - get: - tags: - - ExchangeRate - summary: Retrieves the historical exchange rates between two assets in the form of a timeseries. - parameters: - - name: assetBase - in: path - description: Base asset identifier - required: true - schema: - type: string - - name: assetQuote - in: path - description: Quote asset identifier - required: true - schema: - type: string - - name: period_id - in: query - description: Identifier of the requested timeseries period - schema: - type: string - - name: time_start - in: query - description: Timeseries starting time - schema: - type: string - - name: time_end - in: query - description: Timeseries ending time - schema: - type: string - - name: limit - in: query - description: Amount of items to return (optional) - schema: - type: integer - format: int32 - default: 100 - responses: - '200': - description: successful operation - content: - text/plain: - schema: - type: array - items: - $ref: '#/components/schemas/v1.ExchangeRatesTimeseriesItem' - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/v1.ExchangeRatesTimeseriesItem' - text/json: - schema: - type: array - items: - $ref: '#/components/schemas/v1.ExchangeRatesTimeseriesItem' - application/x-msgpack: - schema: - type: array - items: - $ref: '#/components/schemas/v1.ExchangeRatesTimeseriesItem' '/v1/exchangerate/{assetBase}/{assetQuote}/history': get: tags: - - ExchangeRate - summary: Retrieves the historical exchange rates between two assets in the form of a timeseries. + - Exchange Rates + summary: '[exchange rates] Timeseries data' + description: Get the historical exchange rates between two assets in the form of the timeseries. parameters: - name: assetBase in: path - description: Base asset identifier + description: Requested exchange rates base asset identifier required: true schema: type: string - name: assetQuote in: path - description: Quote asset identifier + description: Requested exchange rates base asset identifier required: true schema: type: string - name: period_id in: query - description: Identifier of the requested timeseries period + description: 'Identifier of requested timeseries period (required, e.g. `5SEC` or `1HRS`)' schema: type: string - name: time_start in: query - description: Timeseries starting time + description: Timeseries starting time in ISO 8601 (required) schema: type: string - name: time_end in: query - description: Timeseries ending time + description: Timeseries ending time in ISO 8601 (required) schema: type: string - name: limit in: query - description: Amount of items to return (optional) + description: 'Amount of items to return (optional, mininum is 1, maximum is 100000, default value is 100, if the parameter is used then every 100 output items are counted as one request)' schema: type: integer format: int32 @@ -541,12 +381,13 @@ paths: /v1/exchanges: get: tags: - - Exchanges - summary: Retrieves all exchanges with optional filtering. + - Metadata + summary: List all exchanges + description: "Get a detailed list of exchanges provided by the system.\r\n \r\n:::info\r\nProperties of the output are providing aggregated information from across all symbols related to the specific exchange. If you need to calculate your aggregation (e.g., limiting only the particular type of symbols), you should use /v1/symbols endpoint as a data source.\r\n:::" parameters: - name: filter_exchange_id in: query - description: The filter for exchange ID. + description: 'Comma or semicolon delimited exchange identifiers used to filter response. (optional, eg. `BITSTAMP;GEMINI`)' schema: type: string responses: @@ -576,8 +417,8 @@ paths: '/v1/exchanges/{exchange_id}': get: tags: - - Exchanges - summary: Retrieves symbols for a specific exchange. + - Metadata + summary: List all exchanges by exchange_id parameters: - name: exchange_id in: path @@ -612,8 +453,8 @@ paths: '/v1/exchanges/icons/{size}': get: tags: - - Exchanges - summary: Retrieves icons for all exchanges with the specified size. + - Metadata + summary: List of icons for the exchanges parameters: - name: size in: path @@ -646,33 +487,11 @@ paths: type: array items: $ref: '#/components/schemas/v1.Icon' - /v1/exchanges/test: + /v1/indexes: get: tags: - - Exchanges - summary: Test endpoint for the exchanges controller. - responses: - '200': - description: Success - /v1/throw: - get: - tags: - - Http500 - responses: - '200': - description: Success - /: - get: - tags: - - Index - responses: - '200': - description: Success - /v1/metrics/listing: - get: - tags: - - Metrics - summary: Get all data metrics. + - Indexes + summary: List of available indexes responses: '200': description: successful operation @@ -681,66 +500,64 @@ paths: schema: type: array items: - $ref: '#/components/schemas/v1.Metric' + $ref: '#/components/schemas/v1.Index' application/json: schema: type: array items: - $ref: '#/components/schemas/v1.Metric' + $ref: '#/components/schemas/v1.Index' text/json: schema: type: array items: - $ref: '#/components/schemas/v1.Metric' + $ref: '#/components/schemas/v1.Index' application/x-msgpack: schema: type: array items: - $ref: '#/components/schemas/v1.Metric' - '/v1/metrics/by-exchange/{exchange_id}': - get: + $ref: '#/components/schemas/v1.Index' + post: tags: - - Metrics - summary: Get all data metrics. - parameters: - - name: exchange_id - in: path - required: true - schema: - type: string + - Indexes + summary: Create index + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/v1.IndexData' + text/json: + schema: + $ref: '#/components/schemas/v1.IndexData' + application/*+json: + schema: + $ref: '#/components/schemas/v1.IndexData' + application/x-msgpack: + schema: + $ref: '#/components/schemas/v1.IndexData' responses: - '200': + '201': description: successful operation content: text/plain: schema: - type: array - items: - $ref: '#/components/schemas/v1.Metric' + $ref: '#/components/schemas/v1.IndexDataResponse' application/json: schema: - type: array - items: - $ref: '#/components/schemas/v1.Metric' + $ref: '#/components/schemas/v1.IndexDataResponse' text/json: schema: - type: array - items: - $ref: '#/components/schemas/v1.Metric' + $ref: '#/components/schemas/v1.IndexDataResponse' application/x-msgpack: schema: - type: array - items: - $ref: '#/components/schemas/v1.Metric' - '/v1/metrics/exchange/{exchange_id}/current': + $ref: '#/components/schemas/v1.IndexDataResponse' + '/v1/indexes/{index_id}': get: tags: - - Metrics - summary: Get current exchange. + - Indexes + summary: Get index data parameters: - - name: exchange_id + - name: index_id in: path - description: The exchange id. required: true schema: type: string @@ -750,72 +567,83 @@ paths: content: text/plain: schema: - type: array - items: - $ref: '#/components/schemas/v1.GeneralData' + $ref: '#/components/schemas/v1.IndexData' application/json: schema: - type: array - items: - $ref: '#/components/schemas/v1.GeneralData' + $ref: '#/components/schemas/v1.IndexData' text/json: schema: - type: array - items: - $ref: '#/components/schemas/v1.GeneralData' + $ref: '#/components/schemas/v1.IndexData' application/x-msgpack: schema: - type: array - items: - $ref: '#/components/schemas/v1.GeneralData' - '/v1/metrics/asset/{asset_id}/current': - get: + $ref: '#/components/schemas/v1.IndexData' + put: tags: - - Metrics - summary: Get current asset. + - Indexes + summary: Update index parameters: - - name: asset_id + - name: index_id in: path - description: The asset id. required: true schema: type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/v1.IndexData' + text/json: + schema: + $ref: '#/components/schemas/v1.IndexData' + application/*+json: + schema: + $ref: '#/components/schemas/v1.IndexData' + application/x-msgpack: + schema: + $ref: '#/components/schemas/v1.IndexData' responses: '200': description: successful operation content: text/plain: schema: - type: array - items: - $ref: '#/components/schemas/v1.GeneralData' + $ref: '#/components/schemas/v1.IndexDataResponse' application/json: schema: - type: array - items: - $ref: '#/components/schemas/v1.GeneralData' + $ref: '#/components/schemas/v1.IndexDataResponse' text/json: schema: - type: array - items: - $ref: '#/components/schemas/v1.GeneralData' + $ref: '#/components/schemas/v1.IndexDataResponse' application/x-msgpack: schema: - type: array - items: - $ref: '#/components/schemas/v1.GeneralData' - '/v1/metrics/symbol/{symbol_id}/current': + $ref: '#/components/schemas/v1.IndexDataResponse' + '/v1/indexes/{index_id}/history': get: tags: - - Metrics - summary: Get current symbol. + - Indexes + summary: Retrieve Historical Index Value and Composition parameters: - - name: symbol_id + - name: index_id in: path - description: The symbol id. required: true schema: type: string + - name: time_start + in: query + schema: + type: string + format: date-time + - name: time_end + in: query + schema: + type: string + format: date-time + - name: limit + in: query + schema: + type: integer + format: int32 + default: 100 responses: '200': description: successful operation @@ -824,73 +652,104 @@ paths: schema: type: array items: - $ref: '#/components/schemas/v1.GeneralData' + $ref: '#/components/schemas/v1.IndexValue' application/json: schema: type: array items: - $ref: '#/components/schemas/v1.GeneralData' + $ref: '#/components/schemas/v1.IndexValue' text/json: schema: type: array items: - $ref: '#/components/schemas/v1.GeneralData' + $ref: '#/components/schemas/v1.IndexValue' application/x-msgpack: schema: type: array items: - $ref: '#/components/schemas/v1.GeneralData' - /v1/metrics/history: + $ref: '#/components/schemas/v1.IndexValue' + '/v1/indexes/{index_id}/timeseries': get: tags: - - Metrics - summary: Get history. + - Indexes + summary: Retrieve Historical Index Value Timeseries parameters: - - name: metric_id - in: query - description: The metric id. + - name: index_id + in: path + required: true schema: type: string - - name: symbol_id + - name: time_start in: query - description: The symbol id. schema: type: string - - name: asset_id + format: date-time + - name: time_end in: query - description: The asset id. schema: type: string - - name: exchange_id + format: date-time + - name: limit in: query - description: The exchange id. + schema: + type: integer + format: int32 + default: 100 + responses: + '200': + description: successful operation + content: + text/plain: + schema: + type: array + items: + $ref: '#/components/schemas/v1.IndexTimeseriesItem' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/v1.IndexTimeseriesItem' + text/json: + schema: + type: array + items: + $ref: '#/components/schemas/v1.IndexTimeseriesItem' + application/x-msgpack: + schema: + type: array + items: + $ref: '#/components/schemas/v1.IndexTimeseriesItem' + '/v1/indexes/{index_id}/timeseries/TO_BE_ANNOUNCED': + get: + tags: + - Indexes + summary: "Retrieve Historical Composition Value Timeseries\r\nRetrieves historical timeseries for the specific composition value for an index" + parameters: + - name: index_id + in: path + required: true schema: type: string - - name: time_start + - name: source_id in: query - description: The start time. schema: type: string - format: date-time - - name: time_end + - name: source_type in: query - description: The end time. schema: type: string - format: date-time - - name: time_format + - name: time_start in: query - description: The time format. schema: type: string - - name: period_id + format: date-time + - name: time_end in: query - description: Time period schema: type: string + format: date-time - name: limit in: query - description: The limit of returned data. schema: type: integer format: int32 @@ -903,78 +762,187 @@ paths: schema: type: array items: - $ref: '#/components/schemas/v1.MetricData' + $ref: '#/components/schemas/v1.IndexTimeseriesItem' application/json: schema: type: array items: - $ref: '#/components/schemas/v1.MetricData' + $ref: '#/components/schemas/v1.IndexTimeseriesItem' text/json: schema: type: array items: - $ref: '#/components/schemas/v1.MetricData' + $ref: '#/components/schemas/v1.IndexTimeseriesItem' application/x-msgpack: schema: type: array items: - $ref: '#/components/schemas/v1.MetricData' - /v1/metrics/group: + $ref: '#/components/schemas/v1.IndexTimeseriesItem' + /v1/metadata: + get: + tags: + - Metadata + responses: + '200': + description: Success + /v1/metrics/listing: get: tags: - Metrics - summary: Get grouped data. + summary: Listing of all supported metrics by CoinAPI + description: Get all data metrics. + responses: + '200': + description: successful operation + content: + text/plain: + schema: + type: array + items: + $ref: '#/components/schemas/v1.Metric' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/v1.Metric' + text/json: + schema: + type: array + items: + $ref: '#/components/schemas/v1.Metric' + application/x-msgpack: + schema: + type: array + items: + $ref: '#/components/schemas/v1.Metric' + /v1/metrics/exchange/listing: + get: + tags: + - Metrics + summary: Listing of all supported exchange metrics + description: Get data metrics for exchange. parameters: - name: metric_id in: query - description: The metric id. + description: The metric identifier schema: type: string - name: exchange_id in: query - description: The exchange id. + description: The exchange identifier + required: true schema: type: string - - name: symbol_id + responses: + '200': + description: successful operation + content: + text/plain: + schema: + type: array + items: + $ref: '#/components/schemas/v1.ListingItem' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/v1.ListingItem' + text/json: + schema: + type: array + items: + $ref: '#/components/schemas/v1.ListingItem' + application/x-msgpack: + schema: + type: array + items: + $ref: '#/components/schemas/v1.ListingItem' + /v1/metrics/exchange/current: + get: + tags: + - Metrics + summary: Current metrics for given exchange + description: Get current exchange metrics values. + parameters: + - name: metric_id in: query - description: The symbol id. + description: The metric identifier schema: type: string - - name: asset_id + - name: exchange_id in: query - description: The asset id. + description: The exchange identifier + required: true schema: type: string - - name: groupby + responses: + '200': + description: successful operation + content: + text/plain: + schema: + type: array + items: + $ref: '#/components/schemas/v1.GeneralData' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/v1.GeneralData' + text/json: + schema: + type: array + items: + $ref: '#/components/schemas/v1.GeneralData' + application/x-msgpack: + schema: + type: array + items: + $ref: '#/components/schemas/v1.GeneralData' + /v1/metrics/exchange/history: + get: + tags: + - Metrics + summary: Historical metrics for the exchange + description: Get exchange metrics history. + parameters: + - name: metric_id in: query - description: The groupby parameter. + description: Metric identifier + required: true + schema: + type: string + - name: exchange_id + in: query + description: Exchange identifier + required: true schema: type: string - name: time_start in: query - description: The start time. + description: Starting time in ISO 8601 schema: type: string format: date-time - name: time_end in: query - description: The end time. + description: Ending time in ISO 8601 schema: type: string format: date-time - name: time_format in: query - description: The time format. + description: 'If set, returned values will be in unix timestamp format (valid values: unix_sec, unix_millisec, unix_microsec, unix_nanosec)' schema: type: string - name: period_id in: query - description: Time period + description: 'Identifier of requested timeseries period (e.g. `5SEC` or `2MTH`), default value is `1SEC`' schema: type: string - name: limit in: query - description: The limit of returned data. + description: 'Amount of items to return (optional, mininum is 1, maximum is 100000, default value is 100, if the parameter is used then every 100 output items are counted as one request)' schema: type: integer format: int32 @@ -985,85 +953,225 @@ paths: content: text/plain: schema: - $ref: '#/components/schemas/v1.MetricGroupData' + type: array + items: + $ref: '#/components/schemas/v1.MetricData' application/json: schema: - $ref: '#/components/schemas/v1.MetricGroupData' + type: array + items: + $ref: '#/components/schemas/v1.MetricData' text/json: schema: - $ref: '#/components/schemas/v1.MetricGroupData' + type: array + items: + $ref: '#/components/schemas/v1.MetricData' application/x-msgpack: schema: - $ref: '#/components/schemas/v1.MetricGroupData' - '/v1/orderbooks/{symbol_id}/depth/current': + type: array + items: + $ref: '#/components/schemas/v1.MetricData' + /v1/metrics/symbol/listing: get: tags: - - OrderBooks - summary: Retrieves the current depth of the order book for the specified symbol. + - Metrics + summary: Listing of all supported metrics for symbol + description: Get data metrics for symbol. parameters: + - name: metric_id + in: query + description: Metric identifier + schema: + type: string + - name: exchange_id + in: query + description: Exchange identifier + schema: + type: string - name: symbol_id - in: path - description: The symbol ID. - required: true + in: query + description: Symbol identifier schema: type: string - - name: limit_levels + responses: + '200': + description: successful operation + content: + text/plain: + schema: + type: array + items: + $ref: '#/components/schemas/v1.ListingItem' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/v1.ListingItem' + text/json: + schema: + type: array + items: + $ref: '#/components/schemas/v1.ListingItem' + application/x-msgpack: + schema: + type: array + items: + $ref: '#/components/schemas/v1.ListingItem' + /v1/metrics/symbol/current: + get: + tags: + - Metrics + summary: Current metrics for given symbol + description: Get current symbol metrics. + parameters: + - name: metric_id in: query - description: The maximum number of levels to include in the response. + description: Metric identifier schema: - type: integer - format: int32 + type: string + - name: symbol_id + in: query + description: Symbol identifier + schema: + type: string + - name: exchange_id + in: query + description: Exchange id. + schema: + type: string responses: '200': description: successful operation content: text/plain: schema: - $ref: '#/components/schemas/v1.OrderBookDepth' + type: array + items: + $ref: '#/components/schemas/v1.GeneralData' application/json: schema: - $ref: '#/components/schemas/v1.OrderBookDepth' + type: array + items: + $ref: '#/components/schemas/v1.GeneralData' text/json: schema: - $ref: '#/components/schemas/v1.OrderBookDepth' + type: array + items: + $ref: '#/components/schemas/v1.GeneralData' application/x-msgpack: schema: - $ref: '#/components/schemas/v1.OrderBookDepth' - '/v1/orderbooks/{symbol_id}/history': + type: array + items: + $ref: '#/components/schemas/v1.GeneralData' + /v1/metrics/symbol/history: get: tags: - - OrderBooks - summary: Retrieves the historical order book data for the specified symbol within the given time range. + - Metrics + summary: Historical metrics for symbol + description: Get symbol metrics history. parameters: + - name: metric_id + in: query + description: Metric identifier + required: true + schema: + type: string - name: symbol_id - in: path - description: The symbol ID. + in: query + description: Symbol identifier required: true schema: type: string - name: time_start in: query - description: The starting time of the historical data. + description: Starting time in ISO 8601 schema: type: string + format: date-time - name: time_end in: query - description: The ending time of the historical data. + description: Ending time in ISO 8601 + schema: + type: string + format: date-time + - name: time_format + in: query + description: 'If set, returned values will be in unix timestamp format (valid values: unix_sec, unix_millisec, unix_microsec, unix_nanosec)' + schema: + type: string + - name: period_id + in: query + description: 'Identifier of requested timeseries period (e.g. `5SEC` or `2MTH`), default value is `1SEC`' schema: type: string - name: limit in: query - description: The maximum number of items to return. + description: 'Amount of items to return (optional, mininum is 1, maximum is 100000, default value is 100, if the parameter is used then every 100 output items are counted as one request)' schema: type: integer format: int32 default: 100 - - name: limit_levels + responses: + '200': + description: successful operation + content: + text/plain: + schema: + type: array + items: + $ref: '#/components/schemas/v1.MetricData' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/v1.MetricData' + text/json: + schema: + type: array + items: + $ref: '#/components/schemas/v1.MetricData' + application/x-msgpack: + schema: + type: array + items: + $ref: '#/components/schemas/v1.MetricData' + /v1/metrics/asset/listing: + get: + tags: + - Metrics + summary: Listing of all supported metrics for asset + description: Get data metrics for asset. + parameters: + - name: metric_id in: query - description: The maximum number of levels to include in the response. + description: Metric identifier schema: - type: integer - format: int32 + type: string + - name: exchange_id + in: query + description: Exchange identifier + schema: + type: string + - name: chain_id + in: query + description: Chain identifier + schema: + type: string + - name: network_id + in: query + description: Network identifier + schema: + type: string + - name: asset_id + in: query + description: Asset identifier + schema: + type: string + - name: asset_id_external + in: query + description: The asset external identifier + schema: + type: string responses: '200': description: successful operation @@ -1072,47 +1180,49 @@ paths: schema: type: array items: - $ref: '#/components/schemas/v1.OrderBook' + $ref: '#/components/schemas/v1.ListingItem' application/json: schema: type: array items: - $ref: '#/components/schemas/v1.OrderBook' + $ref: '#/components/schemas/v1.ListingItem' text/json: schema: type: array items: - $ref: '#/components/schemas/v1.OrderBook' + $ref: '#/components/schemas/v1.ListingItem' application/x-msgpack: schema: type: array items: - $ref: '#/components/schemas/v1.OrderBook' - '/v1/orderbooks/{symbol_id}/latest': + $ref: '#/components/schemas/v1.ListingItem' + /v1/metrics/asset/current: get: tags: - - OrderBooks - summary: Retrieves the latest order book snapshots for the specified symbol. + - Metrics + summary: Current metrics for given asset + description: Get current asset metrics. parameters: - - name: symbol_id - in: path - description: The symbol ID. - required: true + - name: metric_id + in: query + description: Metric identifier schema: type: string - - name: limit + - name: asset_id in: query - description: The maximum number of items to return. + description: Asset identifier schema: - type: integer - format: int32 - default: 100 - - name: limit_levels + type: string + - name: asset_id_external in: query - description: The maximum number of levels to include in the response. + description: Exchange asset identifier schema: - type: integer - format: int32 + type: string + - name: exchange_id + in: query + description: Exchange identifier + schema: + type: string responses: '200': description: successful operation @@ -1121,39 +1231,80 @@ paths: schema: type: array items: - $ref: '#/components/schemas/v1.OrderBook' + $ref: '#/components/schemas/v1.GeneralData' application/json: schema: type: array items: - $ref: '#/components/schemas/v1.OrderBook' + $ref: '#/components/schemas/v1.GeneralData' text/json: schema: type: array items: - $ref: '#/components/schemas/v1.OrderBook' + $ref: '#/components/schemas/v1.GeneralData' application/x-msgpack: schema: type: array items: - $ref: '#/components/schemas/v1.OrderBook' - /v1/orderbooks/current: + $ref: '#/components/schemas/v1.GeneralData' + /v1/metrics/asset/history: get: tags: - - OrderBooks - summary: Retrieves the current order books for all or a specific symbol. + - Metrics + summary: Historical metrics for asset + description: Get asset metrics history. parameters: - - name: filter_symbol_id + - name: metric_id in: query - description: Comma or semicolon delimited parts of symbol identifier used to filter the response. + description: Metric identifier + required: true schema: type: string - - name: limit_levels + - name: asset_id in: query - description: The maximum number of levels to include in the response. + description: Asset identifier + schema: + type: string + - name: asset_id_external + in: query + description: Exchange asset identifier + schema: + type: string + - name: exchange_id + in: query + description: Exchange identifier + required: true + schema: + type: string + - name: time_start + in: query + description: Starting time in ISO 8601 + schema: + type: string + format: date-time + - name: time_end + in: query + description: Ending time in ISO 8601 + schema: + type: string + format: date-time + - name: time_format + in: query + description: 'If set, returned values will be in unix timestamp format (valid values: unix_sec, unix_millisec, unix_microsec, unix_nanosec)' + schema: + type: string + - name: period_id + in: query + description: 'Identifier of requested timeseries period (e.g. `5SEC` or `2MTH`), default value is `1SEC`' + schema: + type: string + - name: limit + in: query + description: 'Amount of items to return (optional, mininum is 1, maximum is 100000, default value is 100, if the parameter is used then every 100 output items are counted as one request)' schema: type: integer format: int32 + default: 100 responses: '200': description: successful operation @@ -1162,27 +1313,28 @@ paths: schema: type: array items: - $ref: '#/components/schemas/v1.OrderBookBase' + $ref: '#/components/schemas/v1.MetricData' application/json: schema: type: array items: - $ref: '#/components/schemas/v1.OrderBookBase' + $ref: '#/components/schemas/v1.MetricData' text/json: schema: type: array items: - $ref: '#/components/schemas/v1.OrderBookBase' + $ref: '#/components/schemas/v1.MetricData' application/x-msgpack: schema: type: array items: - $ref: '#/components/schemas/v1.OrderBookBase' - '/v1/orderbooks/{symbol_id}/current': + $ref: '#/components/schemas/v1.MetricData' + '/v1/orderbooks/{symbol_id}/depth/current': get: tags: - - OrderBooks - summary: Retrieves the current order book for the specified symbol. + - Order Book + summary: '[order book] Current depth of the order book' + description: Retrieves the current depth of the order book for the specified symbol. parameters: - name: symbol_id in: path @@ -1202,30 +1354,49 @@ paths: content: text/plain: schema: - $ref: '#/components/schemas/v1.OrderBookBase' + $ref: '#/components/schemas/v1.OrderBookDepth' application/json: schema: - $ref: '#/components/schemas/v1.OrderBookBase' + $ref: '#/components/schemas/v1.OrderBookDepth' text/json: schema: - $ref: '#/components/schemas/v1.OrderBookBase' + $ref: '#/components/schemas/v1.OrderBookDepth' application/x-msgpack: schema: - $ref: '#/components/schemas/v1.OrderBookBase' - /v1/orderbooks3/current: + $ref: '#/components/schemas/v1.OrderBookDepth' + '/v1/orderbooks/{symbol_id}/history': get: tags: - - OrderBooks3 - summary: Retrieves the current order books for all or a specific symbol. + - Order Book + summary: '[order book] Historical data' + description: "Get historical order book snapshots for a specific symbol within time range, returned in time ascending order.\r\n \r\n:::info\r\nThe historical order book data via the REST API is currently limited by a number of updates and to the maximum number of 20 levels.\r\n:::" parameters: - - name: filter_symbol_id + - name: symbol_id + in: path + description: Symbol identifier for requested timeseries + required: true + schema: + type: string + - name: time_start in: query - description: Comma or semicolon delimited parts of symbol identifier used to filter the response. + description: Starting time in ISO 8601 (required) schema: type: string + - name: time_end + in: query + description: 'Timeseries ending time in ISO 8601 (optional, if not supplied then the data is returned to the end or when result elements count reaches the limit)' + schema: + type: string + - name: limit + in: query + description: 'Amount of items to return (optional, mininum is 1, maximum is 100000, default value is 100, if the parameter is used then every 100 output items are counted as one request)' + schema: + type: integer + format: int32 + default: 100 - name: limit_levels in: query - description: The maximum number of levels to include in the response. + description: Maximum amount of levels from each side of the book to include in response (optional) schema: type: integer format: int32 @@ -1237,37 +1408,80 @@ paths: schema: type: array items: - $ref: '#/components/schemas/v1.OrderBookBase' + $ref: '#/components/schemas/v1.OrderBook' application/json: schema: type: array items: - $ref: '#/components/schemas/v1.OrderBookBase' + $ref: '#/components/schemas/v1.OrderBook' text/json: schema: type: array items: - $ref: '#/components/schemas/v1.OrderBookBase' + $ref: '#/components/schemas/v1.OrderBook' + application/x-msgpack: + schema: + type: array + items: + $ref: '#/components/schemas/v1.OrderBook' + '/v1/orderbooks/{symbol_id}/current': + get: + tags: + - Order Book + summary: Get current order book + description: Retrieves the current order book for the specified symbol. + parameters: + - name: symbol_id + in: path + description: The symbol ID. + required: true + schema: + type: string + - name: limit_levels + in: query + description: The maximum number of levels to include in the response. + schema: + type: integer + format: int32 + responses: + '200': + description: successful operation + content: + text/plain: + schema: + $ref: '#/components/schemas/v1.OrderBookBase' + application/json: + schema: + $ref: '#/components/schemas/v1.OrderBookBase' + text/json: + schema: + $ref: '#/components/schemas/v1.OrderBookBase' application/x-msgpack: schema: - type: array - items: - $ref: '#/components/schemas/v1.OrderBookBase' - '/v1/orderbooks3/{symbol_id}/current': + $ref: '#/components/schemas/v1.OrderBookBase' + '/v1/orderbooks/{symbol_id}/latest': get: tags: - - OrderBooks3 - summary: Retrieves the current order book for the specified symbol. + - Order Book + summary: '[order book] Latest data' + description: "Get latest order book snapshots for a specific symbol, returned in time descending order.\r\n \r\n:::info\r\nThe historical order book data via the REST API is currently limited by a number of updates and to the maximum number of 20 levels.\r\n:::" parameters: - name: symbol_id in: path - description: The symbol ID. + description: Symbol identifier of requested timeseries required: true schema: type: string + - name: limit + in: query + description: 'Amount of items to return (optional, mininum is 1, maximum is 100000, default value is 100, if the parameter is used then every 100 output items are counted as one request)' + schema: + type: integer + format: int32 + default: 100 - name: limit_levels in: query - description: The maximum number of levels to include in the response. + description: Maximum amount of levels from each side of the book to include in response (optional) schema: type: integer format: int32 @@ -1277,21 +1491,29 @@ paths: content: text/plain: schema: - $ref: '#/components/schemas/v1.OrderBookBase' + type: array + items: + $ref: '#/components/schemas/v1.OrderBook' application/json: schema: - $ref: '#/components/schemas/v1.OrderBookBase' + type: array + items: + $ref: '#/components/schemas/v1.OrderBook' text/json: schema: - $ref: '#/components/schemas/v1.OrderBookBase' + type: array + items: + $ref: '#/components/schemas/v1.OrderBook' application/x-msgpack: schema: - $ref: '#/components/schemas/v1.OrderBookBase' - /current: + type: array + items: + $ref: '#/components/schemas/v1.OrderBook' + /v1/orderbooks3/current: get: tags: - - OrderBooksBase - summary: Retrieves the current order books for all or a specific symbol. + - Order Book L3 + summary: '[order book l3] Current order books' parameters: - name: filter_symbol_id in: query @@ -1328,11 +1550,12 @@ paths: type: array items: $ref: '#/components/schemas/v1.OrderBookBase' - '/{symbol_id}/current': + '/v1/orderbooks3/{symbol_id}/current': get: tags: - - OrderBooksBase - summary: Retrieves the current order book for the specified symbol. + - Order Book L3 + summary: '[order book l3] Current order book by symbol_id' + description: Retrieves the current order book for the specified symbol. parameters: - name: symbol_id in: path @@ -1366,27 +1589,28 @@ paths: get: tags: - Quotes - summary: Retrieve historical quote updates within a requested time range. + summary: '[quotes] Historical data' + description: 'Get historical quote updates within requested time range, returned in time ascending order.' parameters: - name: symbol_id in: path - description: The symbol identifier. + description: Symbol identifier for requested timeseries required: true schema: type: string - name: time_start in: query - description: The start time for the historical data. + description: Starting time in ISO 8601 (required) schema: type: string - name: time_end in: query - description: The end time for the historical data. + description: 'Timeseries ending time in ISO 8601 (optional, if not supplied then the data is returned to the end or when result elements count reaches the limit)' schema: type: string - name: limit in: query - description: The maximum number of items to return. + description: 'Amount of items to return (optional, minimum is 1, maximum is 100000, default value is 100, if the parameter is used then every 100 output items are counted as one request)' schema: type: integer format: int32 @@ -1419,11 +1643,12 @@ paths: get: tags: - Quotes - summary: Retrieve current quotes for all symbols or for a specific symbol. + summary: '[quotes] Current data' + description: "Get current quotes for all symbols or for a specific symbol.\r\n \r\n:::info\r\nWhen requesting current data for a specific symbol, output is not encapsulated into JSON array as only one item is returned.\r\n:::" parameters: - name: filter_symbol_id in: query - description: The symbol identifier filter. + description: Comma or semicolon delimited parts of symbol identifier used to filter response. (optional) schema: type: string responses: @@ -1454,7 +1679,7 @@ paths: get: tags: - Quotes - summary: Retrieve current quotes for a specific symbol. + summary: '[quotes] Current quotes for a specific symbol' parameters: - name: symbol_id in: path @@ -1482,16 +1707,17 @@ paths: get: tags: - Quotes - summary: Retrieve the latest quote updates. + summary: '[quotes] Latest data' + description: Get latest updates of the quotes up to 1 minute ago. Latest data is always returned in time descending order. parameters: - name: filter_symbol_id in: query - description: The symbol identifier filter. + description: Comma or semicolon delimited parts of symbol identifier used to filter response. (optional) schema: type: string - name: limit in: query - description: The maximum number of items to return. + description: 'Amount of items to return (optional, mininum is 1, maximum is 100000, default value is 100, if the parameter is used then every 100 output items are counted as one request)' schema: type: integer format: int32 @@ -1524,17 +1750,17 @@ paths: get: tags: - Quotes - summary: Retrieve the latest quote updates for a specific symbol. + summary: '[quotes] Latest quote updates for a specific symbol' parameters: - name: symbol_id in: path - description: The symbol identifier. + description: Symbol identifier of requested timeseries required: true schema: type: string - name: limit in: query - description: The maximum number of items to return. + description: 'Amount of items to return (optional, mininum is 1, maximum is 100000, default value is 100, if the parameter is used then every 100 output items are counted as one request)' schema: type: integer format: int32 @@ -1563,94 +1789,16 @@ paths: type: array items: $ref: '#/components/schemas/v1.Quote' - /v1/status/ip: - get: - tags: - - Status - summary: Retrieves the IP information of the client and server. - responses: - '200': - description: Success - /v1/status/delay: - get: - tags: - - Status - summary: Delays the response by a specified number of milliseconds. - parameters: - - name: ms - in: query - description: The delay time in milliseconds. - schema: - type: integer - format: int32 - default: 1000 - responses: - '200': - description: successful operation - content: - text/plain: - schema: - type: string - application/json: - schema: - type: string - text/json: - schema: - type: string - application/x-msgpack: - schema: - type: string - /v1/status/exchanges: - get: - tags: - - Status - summary: Retrieves the status of exchanges based on the data received. - parameters: - - name: diff_recv_exch_min - in: query - description: The minimum difference between receive time and entry time for an exchange to be considered on time. - schema: - type: integer - format: int32 - default: 60 - - name: diff_now_recv_min - in: query - description: The minimum difference between the current time and receive time for an exchange to be considered on time. - schema: - type: integer - format: int32 - default: 60 - - name: debug - in: query - description: Specifies whether to include detailed data for debugging. - schema: - type: boolean - default: false - responses: - '200': - description: successful operation - content: - text/plain: - schema: - $ref: '#/components/schemas/Mvc.JsonResult' - application/json: - schema: - $ref: '#/components/schemas/Mvc.JsonResult' - text/json: - schema: - $ref: '#/components/schemas/Mvc.JsonResult' - application/x-msgpack: - schema: - $ref: '#/components/schemas/Mvc.JsonResult' /v1/symbols: get: tags: - - Symbols - summary: Retrieves all symbols with optional filtering. + - Metadata + summary: List all symbols + description: "Retrieves all symbols with optional filtering.\r\n \r\n:::info\r\n\"price_precision\" and \"size_precision\" are data precisions and are not always the same precisions used for trading eg. for the \"BINANCE\" exchanges.\r\n:::\r\n \r\n:::info\r\nYou should not assume that the market data will be always within the resolution provided by the \"price_precision\" and \"size_precision\". The fact that the precision values can be derived from a posterior implies the fact that this data could be delayed, also it can be changed by the data source without notice and we will immediately deliver data with the new precision while could not update the precision values in this endpoint immediately.\r\n:::\r\n \r\n### Symbol identifier\r\n \r\nOur symbol identifier is created using a pattern that depends on symbol type.\r\n \r\nType | `symbol_id` pattern\r\n--------- | ---------\r\nSPOT | `{exchange_id}_SPOT_{asset_id_base}_{asset_id_quote}`\r\nFUTURES | `{exchange_id}_FTS_{asset_id_base}_{asset_id_quote}_{YYMMDD of future_delivery_time}`\r\nOPTION | `{exchange_id}_OPT_{asset_id_base}_{asset_id_quote}_{YYMMDD of option_expiration_time}_{option_strike_price}_{option_type_is_call as C/P}`\r\nPERPETUAL | `{exchange_id}_PERP_{asset_id_base}_{asset_id_quote}`\r\nINDEX | `{exchange_id}_IDX_{index_id}`\r\nCREDIT | `{exchange_id}_CRE_{asset_id_base}`\r\nCONTACT | `{exchange_id}_COT_{contract_id}`\r\n \r\n:::info\r\nIn the unlikely event when the \"symbol_id\" for more than one market is the same. We will append the additional term (prefixed with the \"_\") at the end of the duplicated identifiers to differentiate them.\r\n:::info\r\n \r\n### Symbol types list (enumeration of `symbol_type` output variable)\r\n \r\nType | Name | Description\r\n-------- | - | -----------\r\nSPOT | FX Spot | Agreement to exchange one asset for another one *(e.g. Buy BTC for USD)*\r\nFUTURES | Futures contract | FX Spot derivative contract where traders agree to trade fx spot at predetermined future time\r\nOPTION | Option contract | FX Spot derivative contract where traders agree to trade right to require buy or sell of fx spot at agreed price on exercise date\r\nPERPETUAL | Perpetual contract | FX Spot derivative contract where traders agree to trade fx spot continously without predetermined future delivery time\r\nINDEX | Index | Statistical composite that measures changes in the economy or markets.\r\nCREDIT | Credit/Funding | Margin funding contract. Order book displays lending offers and borrow bids. Price represents the daily rate.\r\nCONTRACT | Contract | Represents other types of financial instruments *(e.g. spreads, interest rate swap)*\r\n \r\n### Additional output variables for `symbol_type = INDEX`\r\n \r\nVariable | Description\r\n--------- | -----------\r\nindex_id | Index identifier\r\nindex_display_name | Human readable name of the index *(optional)*\r\nindex_display_description | Description of the index *(optional)*\r\n \r\n### Additional output variables for `symbol_type = FUTURES`\r\n \r\nVariable | Description\r\n--------- | -----------\r\nfuture_delivery_time | Predetermined time of futures contract delivery date in ISO 8601\r\nfuture_contract_unit | Contact size *(eg. 10 BTC if `future_contract_unit` = `10` and `future_contract_unit_asset` = `BTC`)*\r\nfuture_contract_unit_asset | Identifier of the asset used to denominate the contract unit\r\n \r\n### Additional output variables for `symbol_type = PERPETUAL`\r\n \r\nVariable | Description\r\n--------- | -----------\r\nfuture_contract_unit | Contact size *(eg. 10 BTC if `future_contract_unit` = `10` and `future_contract_unit_asset` = `BTC`)*\r\nfuture_contract_unit_asset | Identifier of the asset used to denominate the contract unit\r\n \r\n### Additional output variables for `symbol_type = OPTION`\r\n \r\nVariable | Description\r\n--------- | -----------\r\noption_type_is_call | Boolean value representing option type. `true` for Call options, `false` for Put options\r\noption_strike_price | Price at which option contract can be exercised\r\noption_contract_unit | Base asset amount of underlying spot which single option represents\r\noption_exercise_style | Option exercise style. Can be `EUROPEAN` or `AMERICAN`\r\noption_expiration_time | Option contract expiration time in ISO 8601\r\n \r\n### Additional output variables for `symbol_type = CONTRACT`\r\n \r\nVariable | Description\r\n--------- | -----------\r\ncontract_delivery_time | Predetermined time of contract delivery date in ISO 8601\r\ncontract_unit | Contact size *(eg. 10 BTC if `contract_unit` = `10` and `contract_unit_asset` = `BTC`)*\r\ncontract_unit_asset | Identifier of the asset used to denominate the contract unit\r\ncontract_id | Identifier of contract by the exchange" parameters: - name: filter_symbol_id in: query - description: The filter for symbol ID. + description: 'Comma or semicolon delimited parts of symbol identifier used to filter response. (optional, eg. `BITSTAMP`_ or `BINANCE_SPOT_`)' schema: type: string - name: filter_exchange_id @@ -1690,8 +1838,8 @@ paths: '/v1/symbols/map/{exchange_id}': get: tags: - - Symbols - summary: Retrieves symbol mapping for a specific exchange. + - Metadata + summary: List symbol mapping for the exchange parameters: - name: exchange_id in: path @@ -1726,8 +1874,8 @@ paths: '/v1/symbols/{exchange_id}': get: tags: - - Symbols - summary: Retrieves symbols for a specific exchange with optional filtering. + - Metadata + summary: List of symbols for the exchange parameters: - name: exchange_id in: path @@ -1772,8 +1920,9 @@ paths: /v1/ohlcv/periods: get: tags: - - TimeSeries - summary: Retrieves the full list of supported time periods for requesting OHLCV timeseries data. + - Ohlcv + summary: '[ohlcv] List all periods' + description: "Get full list of supported time periods available for requesting OHLCV timeseries data.\r\n \r\n### Available periods\r\n \r\nTime unit | Period identifiers\r\n--------- | -----------\r\nSecond | 1SEC, 2SEC, 3SEC, 4SEC, 5SEC, 6SEC, 10SEC, 15SEC, 20SEC, 30SEC\r\nMinute | 1MIN, 2MIN, 3MIN, 4MIN, 5MIN, 6MIN, 10MIN, 15MIN, 20MIN, 30MIN\r\nHour | 1HRS, 2HRS, 3HRS, 4HRS, 6HRS, 8HRS, 12HRS\r\nDay | 1DAY, 2DAY, 3DAY, 5DAY, 7DAY, 10DAY\r\nMonth | 1MTH, 2MTH, 3MTH, 4MTH, 6MTH\r\nYear | 1YRS, 2YRS, 3YRS, 4YRS, 5YRS\r\n \r\n:::tip\r\nYou can assume that we will not remove any periods from this response, however, we may add new ones.\r\n:::" responses: '200': description: successful operation @@ -1801,40 +1950,41 @@ paths: '/v1/ohlcv/{symbol_id}/history': get: tags: - - TimeSeries - summary: Retrieves the OHLCV timeseries data for a specified symbol within a time range and period. + - Ohlcv + summary: '[ohlcv] Historical data' + description: "Get OHLCV timeseries data returned in time ascending order. Data can be requested by the period and for the specific symbol eg `BITSTAMP_SPOT_BTC_USD`, if you need to query timeseries by asset pairs eg. `BTC/USD`, then please reffer to the Exchange Rates Timeseries data\r\n \r\n:::info\r\nThe OHLCV Historical endpoint data can be delayed a few seconds. Use OHLCV Latest endpoint to get real-time data without delay.\r\n:::" parameters: - name: symbol_id in: path - description: The symbol identifier. + description: Symbol identifier of requested timeseries required: true schema: type: string - name: period_id in: query - description: The period identifier. + description: 'Identifier of requested timeseries period (required, e.g. `5SEC` or `2MTH`)' schema: type: string - name: time_start in: query - description: The starting time of the timeseries data. + description: Timeseries starting time in ISO 8601 (required) schema: type: string - name: time_end in: query - description: The ending time of the timeseries data. + description: 'Timeseries ending time in ISO 8601 (optional, if not supplied then the data is returned to the end or when count of result elements reaches the limit)' schema: type: string - name: limit in: query - description: The maximum number of items to return. + description: 'Amount of items to return (optional, mininum is 1, maximum is 100000, default value is 100, if the parameter is used then every 100 output items are counted as one request)' schema: type: integer format: int32 default: 100 - name: include_empty_items in: query - description: Specifies whether to include items with no activity. + description: 'Include items with no activity? (optional, default value is `false`, possible values are `true` or `false`)' schema: type: boolean default: false @@ -1865,30 +2015,31 @@ paths: '/v1/ohlcv/{symbol_id}/latest': get: tags: - - TimeSeries - summary: Retrieves the latest OHLCV timeseries data for a specified symbol and period. + - Ohlcv + summary: '[ohlcv] Latest data' + description: "Get OHLCV latest timeseries data returned in time descending order. Data can be requested by the period and for the specific symbol eg `BITSTAMP_SPOT_BTC_USD`, if you need to query timeseries by asset pairs eg. `BTC/USD`, then please reffer to the Exchange Rates Timeseries data\r\n \r\n:::info\r\nOHLCV Latest endpoint is providing real-time data without delay. The OHLCV Historical endpoint data can be delayed a few seconds.\r\n:::" parameters: - name: symbol_id in: path - description: The symbol identifier. + description: Symbol identifier of requested timeseries required: true schema: type: string - name: period_id in: query - description: The period identifier. + description: 'Identifier of requested timeseries period (required, e.g. `5SEC` or `2MTH`)' schema: type: string - name: limit in: query - description: The maximum number of items to return. + description: 'Amount of items to return (optional, mininum is 1, maximum is 100000, default value is 100, if the parameter is used then every 100 output items are counted as one request)' schema: type: integer format: int32 default: 100 - name: include_empty_items in: query - description: Specifies whether to include items with no activity. + description: 'Include items with no activity? (optional, default value is `false`, possible values are `true` or `false`)' schema: type: boolean default: false @@ -1920,34 +2071,35 @@ paths: get: tags: - Trades - summary: Gets the historical trades for a specific symbol within the specified time range. + summary: '[trades] Historical data' + description: 'Get history transactions from specific symbol, returned in time ascending order.' parameters: - name: symbol_id in: path - description: The symbol identifier. + description: Symbol identifier for requested timeseries required: true schema: type: string - name: time_start in: query - description: The starting time in ISO 8601 format. + description: Starting time in ISO 8601 (required) schema: type: string - name: time_end in: query - description: The ending time in ISO 8601 format (optional). + description: 'Timeseries ending time in ISO 8601 (optional, if not supplied then the data is returned to the end or when result elements count reaches the limit)' schema: type: string - name: limit in: query - description: 'The amount of items to return (optional, default is 100).' + description: 'Amount of items to return (optional, mininum is 1, maximum is 100000, default value is 100, if the parameter is used then every 100 output items are counted as one request)' schema: type: integer format: int32 default: 100 - name: include_id in: query - description: Specifies whether to include additional exchange trade identifier in the response. + description: Information that additional exchange trade identifier should be included in the `id_trade` parameter of the trade if exchange providing identifiers. schema: type: boolean default: false @@ -1979,24 +2131,25 @@ paths: get: tags: - Trades - summary: Gets the latest trades for a specific symbol. + summary: '[trades] Latest data by symbol_id' + description: Get latest trades executed up to 1 minute ago. Latest data is always returned in time descending order. parameters: - name: symbol_id in: path - description: The symbol identifier. + description: Symbol identifier for requested timeseries required: true schema: type: string - name: limit in: query - description: 'The amount of items to return (optional, default is 100).' + description: 'Amount of items to return (optional, mininum is 1, maximum is 100000, default value is 100, if the parameter is used then every 100 output items are counted as one request)' schema: type: integer format: int32 default: 100 - name: include_id in: query - description: Specifies whether to include additional exchange trade identifier in the response. + description: Information that additional exchange trade identifier should be included in the `id_trade` parameter of the trade if exchange providing identifiers. schema: type: boolean default: false @@ -2028,22 +2181,23 @@ paths: get: tags: - Trades - summary: Gets the latest trades for all symbols. + summary: '[trades] Latest data' + description: Get latest trades executed up to 1 minute ago. Latest data is always returned in time descending order. parameters: - name: filter_symbol_id in: query - description: The symbol identifiers used to filter the response (optional). + description: Comma or semicolon delimited parts of symbol identifier used to filter response. (optional) schema: type: string - name: include_id in: query - description: Specifies whether to include additional exchange trade identifier in the response. + description: Information that additional exchange trade identifier should be included in the `id_trade` parameter of the trade if exchange providing identifiers. schema: type: boolean default: false - name: limit in: query - description: 'The amount of items to return (optional, default is 100).' + description: 'Amount of items to return (optional, mininum is 1, maximum is 100000, default value is 100, if the parameter is used then every 100 output items are counted as one request)' schema: type: integer format: int32 @@ -2072,20 +2226,6 @@ paths: type: array items: $ref: '#/components/schemas/v1.Trade' - /www/apitest: - get: - tags: - - Wwws - parameters: - - name: timeoutms - in: query - schema: - type: integer - format: int32 - default: 5000 - responses: - '200': - description: Success components: schemas: Model.VWAP24RefRate: @@ -2104,21 +2244,6 @@ components: type: number format: double additionalProperties: false - Mvc.JsonResult: - type: object - properties: - content_type: - type: string - nullable: true - serializer_settings: - nullable: true - status_code: - type: integer - format: int32 - nullable: true - value: - nullable: true - additionalProperties: false v1.Asset: type: object properties: @@ -2465,6 +2590,165 @@ components: nullable: true additionalProperties: false description: Represents an icon. + v1.Index: + type: object + properties: + index_id: + type: string + description: Gets or sets the index ID associated with the index. + nullable: true + name: + type: string + description: Gets or sets the name associated with the index. + nullable: true + description: + type: string + description: Gets or sets the descripion of the index. + nullable: true + additionalProperties: false + description: Represents an index. + v1.IndexData: + type: object + properties: + index_id: + type: string + description: Gets or sets the index ID associated with the index. + nullable: true + name: + type: string + description: Gets or sets the name associated with the index. + nullable: true + description: + type: string + description: Gets or sets the descripion of the index. + nullable: true + index_method: + type: string + description: Gets or sets the index method. + nullable: true + index_method_parameters: + type: object + additionalProperties: + type: string + description: Gets or sets the parameters of the index method. + nullable: true + period_recalculation: + type: string + description: Gets or sets the period recalculation of the index. + nullable: true + visibility_public: + type: boolean + description: Gets or sets the visibility public of the index. + nullable: true + notify_emails: + type: string + description: Gets or sets the notify emails of the index. + nullable: true + components: + type: array + items: + $ref: '#/components/schemas/v1.IndexDataComponent' + description: Gets or sets the components of the index. + nullable: true + additionalProperties: false + description: Represents a data model for index data. + v1.IndexDataComponent: + type: object + properties: + component_id: + type: string + nullable: true + evaluation_method: + type: string + nullable: true + evaluation_method_parameters: + type: object + additionalProperties: + type: string + nullable: true + additionalProperties: false + v1.IndexDataResponse: + type: object + properties: + index_id: + type: string + nullable: true + status: + type: string + nullable: true + additionalProperties: false + v1.IndexTimeseriesItem: + type: object + properties: + time_period_start: + type: string + description: The start time of the time period. + format: date-time + time_period_end: + type: string + description: The end time of the time period. + format: date-time + time_open: + type: string + description: The time when the value opened. + format: date-time + nullable: true + time_close: + type: string + description: The time when the value closed. + format: date-time + nullable: true + value_open: + type: number + description: The opening value. + format: double + nullable: true + value_high: + type: number + description: The highest value during the time period. + format: double + nullable: true + value_low: + type: number + description: The lowest value during the time period. + format: double + nullable: true + value_close: + type: number + description: The closing value. + format: double + nullable: true + value_count: + type: integer + description: The number of values during the time period. + format: int64 + additionalProperties: false + description: Represents a timeseries item with value information. + v1.IndexValue: + type: object + properties: + timestamp: + type: string + format: date-time + value: + type: number + format: double + composition: + type: array + items: + $ref: '#/components/schemas/v1.IndexValueComponent' + nullable: true + additionalProperties: false + v1.IndexValueComponent: + type: object + properties: + component_id: + type: string + nullable: true + component_value: + type: number + format: double + additionalProperties: false v1.LastTrade: type: object properties: @@ -2494,6 +2778,43 @@ components: nullable: true additionalProperties: false description: Represents the last executed transaction. + v1.ListingItem: + type: object + properties: + metric_id: + type: string + description: Gets or sets the metric ID. + nullable: true + symbol_id: + type: string + description: Gets or sets the symbol ID. + nullable: true + symbol_id_external: + type: string + description: Gets or sets the symbol ID from the exchange. + nullable: true + exchange_id: + type: string + description: Gets or sets the exchange ID. + nullable: true + asset_id: + type: string + description: Gets or sets the asset ID. + nullable: true + asset_id_external: + type: string + description: Gets or sets the asset ID from the exchange. + nullable: true + chain_id: + type: string + description: Gets or sets the chain id. + nullable: true + network_id: + type: string + description: Gets or sets the network id. + nullable: true + additionalProperties: false + description: Represents a listing item. v1.Metric: type: object properties: @@ -2524,24 +2845,6 @@ components: format: double additionalProperties: false description: Represents a data model for metric data. - v1.MetricGroupData: - type: object - properties: - series_label: - type: array - items: - type: string - description: Gets or sets the labels for the series in the group. This property can be null if the metric group data does not have any series labels. - nullable: true - rows: - type: array - items: - type: array - items: { } - description: Gets or sets the rows of data in the group. Each object array in the list represents a row of data in the group. - nullable: true - additionalProperties: false - description: Represents a group of metric data in the system. v1.OrderBook: type: object properties: @@ -3074,4 +3377,33 @@ components: name: X-CoinAPI-Key in: header security: - - ApiKey: [ ] \ No newline at end of file + - ApiKey: [ ] +tags: + - name: Exchange Rates + description: "\r\n\r\nExchange rate is defined as (VWAP-24H) last 24 hour (rolling window over time) Volume Weighted Average Price across multiple data sources listed on our platform. We are selecting and managing the data sources that are used in the calculation based on multiple factors to provide data of highest quality. \r\n\r\nAlgorithm is described below:\r\n\r\n 1. Exchange rates are produced from quotes, trades, and metadata datasets.\r\n 1. Symbols that are not data_type = \"SPOT\" are excluded from the calculation.\r\n 1. Symbols from the data sources that were marked by us as not legitimate are excluded from the calculation.\r\n 1. Quotes data where the spread is outside the range of ```<0$; 67%>``` are discarded. `spreadPrc = (ask - bid) / ((ask + bid) / 2)`\r\n 1. The midpoint from the quote data is used as a pricing reference and it's weighted by the passive cumulative volume resting on the best prices.\r\n 1. Volume from the trades is used to weight the midpoint prices in the VWAP24 algorithm.\r\n 1. Midpoint data that has not been updated in the last 5 minutes and 1 second is discarded.\r\n 1. The last 24-hour volume for each symbol is updated every 4 hours when approximately 20% of the data in the sliding window changes (also, the list of eligible markets is updated at the same time).\r\n 1. Everywhere in the algorithm below, we are using asset pairs only from exchanges that have the highest legitimacy rank, and the rest of the exchanges are discarded. As we establish the highest-ranking exchanges that have this data for each asset pair, we ensure that the highest quality data is used for each of them. The rank used for asset pairing is carried over to the following steps.\r\n 1. Every 1 second, we update VWAP24 data for every asset pair across all data sources.\r\n 1. For each asset pair, we also discard data that is outside the 3 sigma range if there are at least 3 exchanges for this asset pair.\r\n 1. From the VWAP24 data, we are creating a tree structure where node/vertex = asset and edge = rate.\r\n 1. By traversing the tree structure using the BFS algorithm and our secret sauce, we are able to establish the final exchange rates.\r\n " + - name: Metadata + description: + - name: Order Book L3 + description: "\n\nThis section describes calls related to order book data, also known as books or passive level 3 data." + - name: Order Book + description: "\n\nThis section describes calls related to order book data, also known as books or passive level 2 data.\n\n:::info\nWhen requesting current data for a specific symbol, output is not encapsulated into JSON array as only one item is returned.\n:::\n\n:::info\nGET `/v1/orderbooks/current` endpoint is charged one request per 100 data points returned after applying a filter defined by filter_symbol_id parameter. If filter symbols target more than one exchange, error is returned.\n:::\n\n:::info\nWhen requesting current order book data limited to a single level, then quotes are actually used. This information is important from the perspective that quotes data could be faster than order book data (behavior is dependent solely one the data source) and they can have the size equal to 0 when the size is unknown. Some data sources publish order books and separately quote data (without the sizes) at a higher frequency. In that case, we will merge the order book feed with quotes feed to make sure that our updates are as fast as possible. The quotes will have the size equal to 0 as the value is unknown and the customer can decide if these higher frequency updates without the sizes are valuable or if not then can discard them or ask for at least 2 order book levels (in case of a REST API call). For the data sources that publish order books only or order books and quotes with the sizes then this will not happen.\n:::" + - name: Ohlcv + description: "\n\n\nAPI calls described in this section are related to downloading OHLCV *(Open, High, Low, Close, Volume)* timeseries data.\nEach data point of this timeseries represents several indicators calculated from transactions activity inside a time range (period).\n\n:::info\nOHLCV data primary purpose is to present an overview of the market in human readable form. \nIt's often used to visualize market data on charts, websites, and various kinds of reports.\n:::\n\n:::tip\nCoinAPI expanded the standard OHLCV timeseries by including time of first and last trade and amount of trades executed inside period.\n:::\n " + - name: Assets + description: Controller for accessing asset information. + - name: Indexes + description: Controller for accessing indexes + - name: Metrics + description: "\r\nMetrics are quantitative measurements used to evaluate the performance and activity of cryptocurrency exchanges. These metrics include:\r\n\r\n1. Trading Volume: The total amount of cryptocurrency traded on an exchange within a specific time period, indicating liquidity and activity.\r\n1. Market Depth: The level of buy and sell orders at different price levels, providing insights into liquidity and potential price impact.\r\n1. Order Book: A record of outstanding buy and sell orders for a cryptocurrency, reflecting supply and demand dynamics.\r\n1. Spread: The difference between the highest bid and lowest ask prices, indicating liquidity and trading costs.\r\n1. Price Charts: Visual representations of cryptocurrency price movements over time, helping identify trends and inform trading decisions.\r\n1. Market Cap: The total value of a cryptocurrency calculated by its price multiplied by circulating supply, reflecting relative size and value.\r\n1. Trading Pairs: Combinations of cryptocurrencies available for trading, including volume, price, and spread for each pair.\r\n1. User Metrics: Data on active users, new registrations, user retention, and engagement, indicating platform popularity and growth.\r\n1. Trading Fees: Fees charged for executing trades, including fee structure, discounts, and revenue generated by the exchange.\r\n1. Security Metrics: Measures assessing the security of an exchange, such as past incidents, user fund protection, and security audits.\r\n\r\nThese metrics assist traders and investors in evaluating market activity, liquidity, and the reliability of crypto exchanges for informed decision-making." + - name: OrderBooks3 + description: Controller for managing order book L3 data. + - name: OrderBooks + description: Controller for managing order book data. + - name: Quotes + description: 'Controller for retrieving quotes data, also known as quotes or passive level 1 data.' + - name: Symbols + description: Controller for retrieving symbol information. + - name: TimeSeries + description: 'Controller for retrieving OHLCV (Open, High, Low, Close, Volume) timeseries data.' + - name: Trades + description: Controller for retrieving trade data related to executed transactions. \ No newline at end of file