Tonik - API
Welcome to the documentation for the Tonik API. This API provides access to time-series stored with the tonik package.
The endpoints available in the API are:
curl -X GET "http://your.host.server:yourport/inventory"To do the same with Python using requests you can use the following code:
import requests url = "http://your.host.server:yourport/inventory" response = requests.get(url) response.json()
curl -X GET "http://your.host.server:yourport/feature?name=rsam&starttime=2019-12-01T00:00:00&endtime=2019-12-31T00:00:00&subdir=Whakaari&subdir=WIZ"To do the same with Python using pandas you can use the following code:
import pandas as pd feature="rsam" starttime="2019-12-01T00:00:00" endtime="2019-12-31T00:00:00" volcano="Whakaari" site="WIZ" url = f"http://your.host.server:yourport/feature?name={feature}&starttime={starttime}&endtime={endtime}&subdir={volcano}&subdir={site}" pd.read_csv(url, parse_dates=True, index_col=0)