Documentation Index
Fetch the complete documentation index at: https://knowledge.cloudquant.com/llms.txt
Use this file to discover all available pages before exploring further.
Advanced - Query Data Using requests.post RESTful API
As of release version 2.0, the P12 client certificate (
liberator.pfx) is no longer required. The cert=cert argument and pfx_to_pem helper shown below are only needed for releases prior to 2.0.requests.post from Python to Access CloudQuant Data Liberator Data
requests.post is an HTTP method you can use to send query arguments to the CloudQuant Data Liberator server for processing.
Post Arguments
-
'https://api.cloudquant.ai/liberator/query'- The URL of the query interface. This must be this exact string to query. -
data=json.dumps(...)- Thisjson.dumpssection provides the body of the query with these parameters:compressjson_xferusertokennameas_ofback_tosymbolssystem
-
headers={'Content-Type':'application/json'} -
cert=cert- cert comes fromwith pfx_to_pem('liberator.pfx','') as cert:
Query the Last Known Value(s)
To get the last known value in any dataset, do not provide theas_of or back_to arguments. This will give you the last known value for the given dataset and symbols.
Query for a Time Series Result
Adding theback_to argument for any query will give you the time series data all the way back to the specified date.
json.dumps Components
| Argument | Description | Type | Example |
|---|---|---|---|
symbols | The security trading symbol(s) you wish to query | String, or List | "symbols":["AAPL","TLT","GOOG"] |
name | The name of the dataset (Required) | String | "name": "daily_bars" |
as_of | This value can be any past date so that you can see the data as it was known on the “as of” date. Defaults to now. | String YYYY-MM-DD HH:MM:SS (HH:MM:SS optional) | "as_of":"2020-11-22 19:51:31" |
back_to | The date where the return dataset should begin. | String YYYY-MM-DD HH:MM:SS (HH:MM:SS optional) | "back_to":"2020-01-01" |
url | Optional. The URL of the CloudQuant Data Liberator server. Defaults to https://api.cloudquant.ai. | String | 'https://api.cloudquant.ai' or 'http://127.0.0.1:47753' |
system | The name of the authorized system from which you are querying. | String | "system":"API" |
compress | The data compression method on the wire. | Boolean | True or False |
json_xfer | JSON transfer. Usually False. | Boolean (Always False) | "json_xfer":False |
user | The user identifier (as assigned by CloudQuant) | String | "user":"myUserID" |
token | The user’s assigned token | String | "token":"mypersonal-private-token" |

