API client for Quantextive AEX Data Platform
Switch branches/tags
Nothing to show
Clone or download
Babajide Ogunjobi Babajide Ogunjobi
Babajide Ogunjobi and Babajide Ogunjobi added examples directory
Latest commit 8021a36 Jul 18, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dist updated tag version Jun 20, 2017
examples added examples directory Jul 18, 2017
qtx reorganizing package Jun 20, 2017
LICENSE.txt added license file and updated setup.py Jun 20, 2017
MANIFEST added additional files Jun 20, 2017
README.txt correction to readme.txt Jul 13, 2017
__init__.py added additional files Jun 20, 2017
readme.md correction to markdown file Jul 13, 2017
setup.cfg initial commit Jun 20, 2017
setup.py updated tag version Jun 20, 2017

readme.md

Quantextive AEX API Client

Dependencies

How to make an API request?

class ApiClient in qtx.py is provisioned to make API requests. In the constructor of the ApiClient class, a dictionary of default headers for all requests can be supplied so that headers need not be supplied with each request.

default_headers = { 'x-api-key' : '<token>' }
client = ApiClient(default_headers)

To make a GET request, ApiClient.get() method is used with following params

  • api_key: API key required for authenticating the requests
  • name: string api name which will be appended to base_url
  • params: dict of url params

EXAMPLE

from qtx import qtx

api = "market-data-eod"
params = { 
    'securityId': 'NSE:NNFM',
    'startDate': '2017-02-08',
    'endDate': '2017-02-10'
}
api_key = '<api_token>'

client = qtx.ApiClient()
print client.get(api_key, api, params).data_frame()

The get() method returns a Response object from which below methods can be used to get response data as json or Pandas DataFrame.

  • client.get(api_key, name, queryparams).json() will return response data as json, and
  • client.get(api_key, name, queryparams).data_frame() will return response data as pandas DataFrame
Running the test script
python tests/test.py