[vc_row][vc_column width=”1/1″][vc_column_text]All data series can be imported directly into Python.

The following example code shows the steps. The code can be downloaded directly as a Jupyter notebook.[/vc_column_text][vc_button border_width=”0″]Download Jupyter Notebook[/vc_button][vc_column_text]

import requests
import pandas as pd
from pandas.io.json import json_normalize

username = 'USER'
password = 'PASSWORD'

url_tokens = 'http://nova-db.com/api/v1/tokens'
url_series = 'http://nova-db.com/api/v1/series/'

r = requests.post(url_tokens, auth=(username, password))
r.status_code # 200 for successful response

response = r.json()

# Series of interest
series = 'population'

# Optional search parameters. Set to "None" to get all.
params = {'region': 'Zuerich', 'year': 2016}

# Prepare token for bearer authentication
token = response['token']
token_bearer = 'Bearer ' + token

headers = {
'Authorization': token_bearer,

s = requests.get(url_series + series, params=params, headers=headers)

s.status_code # 200 for successful response

result = s.json()

#reformat to dataframe 
df = pd.DataFrame.from_dict(json_normalize(result), orient='columns')