Skip to content

Latest commit

 

History

History
136 lines (103 loc) · 9.25 KB

QuoteApi.md

File metadata and controls

136 lines (103 loc) · 9.25 KB

swagger_client.QuoteApi

All URIs are relative to https://www.bitmex.com/api/v1

Method HTTP request Description
quote_get GET /quote Get Quotes.
quote_get_bucketed GET /quote/bucketed Get previous quotes in time buckets.

quote_get

list[Quote] quote_get(symbol=symbol, filter=filter, columns=columns, count=count, start=start, reverse=reverse, start_time=start_time, end_time=end_time)

Get Quotes.

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.QuoteApi()
symbol = 'symbol_example' # str | Instrument symbol. Send a bare series (e.g. XBT) to get data for the nearest expiring contract in that series.  You can also send a timeframe, e.g. `XBT:quarterly`. Timeframes are `nearest`, `daily`, `weekly`, `monthly`, `quarterly`, `biquarterly`, and `perpetual`.  Symbols are case-insensitive. (optional)
filter = 'filter_example' # str | Generic table filter. Send JSON key/value pairs, such as `{\"key\": \"value\"}`. You can key on individual fields, and do more advanced querying on timestamps. See the [Timestamp Docs](https://www.bitmex.com/app/restAPI#Timestamp-Filters) for more details. (optional)
columns = 'columns_example' # str | Array of column names to fetch. If omitted, will return all columns.  Note that this method will always return item keys, even when not specified, so you may receive more columns that you expect. (optional)
count = 100 # int | Number of results to fetch. Must be a positive integer. (optional) (default to 100)
start = 0 # int | Starting point for results. (optional) (default to 0)
reverse = false # bool | If true, will sort results newest first. (optional) (default to false)
start_time = '2013-10-20T19:20:30+01:00' # datetime | Starting date filter for results. (optional)
end_time = '2013-10-20T19:20:30+01:00' # datetime | Ending date filter for results. (optional)

try:
    # Get Quotes.
    api_response = api_instance.quote_get(symbol=symbol, filter=filter, columns=columns, count=count, start=start, reverse=reverse, start_time=start_time, end_time=end_time)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling QuoteApi->quote_get: %s\n" % e)

Parameters

Name Type Description Notes
symbol str Instrument symbol. Send a bare series (e.g. XBT) to get data for the nearest expiring contract in that series. You can also send a timeframe, e.g. `XBT:quarterly`. Timeframes are `nearest`, `daily`, `weekly`, `monthly`, `quarterly`, `biquarterly`, and `perpetual`. Symbols are case-insensitive. [optional]
filter str Generic table filter. Send JSON key/value pairs, such as `{"key": "value"}`. You can key on individual fields, and do more advanced querying on timestamps. See the Timestamp Docs for more details. [optional]
columns str Array of column names to fetch. If omitted, will return all columns. Note that this method will always return item keys, even when not specified, so you may receive more columns that you expect. [optional]
count int Number of results to fetch. Must be a positive integer. [optional] [default to 100]
start int Starting point for results. [optional] [default to 0]
reverse bool If true, will sort results newest first. [optional] [default to false]
start_time datetime Starting date filter for results. [optional]
end_time datetime Ending date filter for results. [optional]

Return type

list[Quote]

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json, application/xml, text/xml, application/javascript, text/javascript

[Back to top] [Back to API list] [Back to Model list] [Back to README]

quote_get_bucketed

list[Quote] quote_get_bucketed(bin_size=bin_size, partial=partial, symbol=symbol, filter=filter, columns=columns, count=count, start=start, reverse=reverse, start_time=start_time, end_time=end_time)

Get previous quotes in time buckets.

Timestamps returned by our bucketed endpoints are the end of the period, indicating when the bucket was written to disk. Some other common systems use the timestamp as the beginning of the period. Please be aware of this when using this endpoint.

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.QuoteApi()
bin_size = '1m' # str | Time interval to bucket by. Available options: [1m,5m,1h,1d]. (optional) (default to 1m)
partial = false # bool | If true, will send in-progress (incomplete) bins for the current time period. (optional) (default to false)
symbol = 'symbol_example' # str | Instrument symbol. Send a bare series (e.g. XBT) to get data for the nearest expiring contract in that series.  You can also send a timeframe, e.g. `XBT:quarterly`. Timeframes are `nearest`, `daily`, `weekly`, `monthly`, `quarterly`, `biquarterly`, and `perpetual`.  Symbols are case-insensitive. (optional)
filter = 'filter_example' # str | Generic table filter. Send JSON key/value pairs, such as `{\"key\": \"value\"}`. You can key on individual fields, and do more advanced querying on timestamps. See the [Timestamp Docs](https://www.bitmex.com/app/restAPI#Timestamp-Filters) for more details. (optional)
columns = 'columns_example' # str | Array of column names to fetch. If omitted, will return all columns.  Note that this method will always return item keys, even when not specified, so you may receive more columns that you expect. (optional)
count = 100 # int | Number of results to fetch. Must be a positive integer. (optional) (default to 100)
start = 0 # int | Starting point for results. (optional) (default to 0)
reverse = false # bool | If true, will sort results newest first. (optional) (default to false)
start_time = '2013-10-20T19:20:30+01:00' # datetime | Starting date filter for results. (optional)
end_time = '2013-10-20T19:20:30+01:00' # datetime | Ending date filter for results. (optional)

try:
    # Get previous quotes in time buckets.
    api_response = api_instance.quote_get_bucketed(bin_size=bin_size, partial=partial, symbol=symbol, filter=filter, columns=columns, count=count, start=start, reverse=reverse, start_time=start_time, end_time=end_time)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling QuoteApi->quote_get_bucketed: %s\n" % e)

Parameters

Name Type Description Notes
bin_size str Time interval to bucket by. Available options: [1m,5m,1h,1d]. [optional] [default to 1m]
partial bool If true, will send in-progress (incomplete) bins for the current time period. [optional] [default to false]
symbol str Instrument symbol. Send a bare series (e.g. XBT) to get data for the nearest expiring contract in that series. You can also send a timeframe, e.g. `XBT:quarterly`. Timeframes are `nearest`, `daily`, `weekly`, `monthly`, `quarterly`, `biquarterly`, and `perpetual`. Symbols are case-insensitive. [optional]
filter str Generic table filter. Send JSON key/value pairs, such as `{"key": "value"}`. You can key on individual fields, and do more advanced querying on timestamps. See the Timestamp Docs for more details. [optional]
columns str Array of column names to fetch. If omitted, will return all columns. Note that this method will always return item keys, even when not specified, so you may receive more columns that you expect. [optional]
count int Number of results to fetch. Must be a positive integer. [optional] [default to 100]
start int Starting point for results. [optional] [default to 0]
reverse bool If true, will sort results newest first. [optional] [default to false]
start_time datetime Starting date filter for results. [optional]
end_time datetime Ending date filter for results. [optional]

Return type

list[Quote]

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json, application/xml, text/xml, application/javascript, text/javascript

[Back to top] [Back to API list] [Back to Model list] [Back to README]