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
-
{base_url}/liberator/query— The query endpoint. Use the base URL from your Liberator Profile page download. -
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.

