Skip to main content

API client for Quantextive AEX Data Platform

Project description

## Quantextive AEX API Client

#### Dependencies

- [**Requests: HTTP for Humans**](
- install it using **pip**

pip install request
- [**Pandas**](
- install it using **pip**

pip install pandas

#### How to make an API request?

class `ApiClient` in [``]( 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


import qtx

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

client = api_client.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/

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for qtx, version 0.2
Filename, size File type Python version Upload date Hashes
Filename, size qtx-0.2.tar.gz (2.6 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page