Skip to content
Documentation

Connection

To work with the API, first create a session. A session can be configured using a config file or by providing your client_id and client_secret directly.

We recommend using a config file. Your credentials and authentication settings then live outside your code, so changing them never requires a code change.

Get the required credentials by creating an OAuth client at auth.volueinsight.com (see the documentation for details).

Create a config file (e.g. config.ini). The simplest way is to copy the sample config file and insert your client_id and client_secret:

[common]
urlbase = https://data-forecasts.volue.com
auth_type = OAuth
timeout = 300
[OAuth]
id = client_id
secret = client_secret
auth_urlbase = https://auth.volueinsight.com

Then pass the file path when creating the session:

import volue_insight_timeseries
config_file_path = 'path/to/your/config.ini'
session = volue_insight_timeseries.Session(config_file=config_file_path)

timeout is in seconds and defaults to 300.

You can also pass credentials directly:

import volue_insight_timeseries
session = volue_insight_timeseries.Session(
client_id='client id',
client_secret='client secret',
timeout=300
)

The timeout parameter is optional and defaults to 300 seconds.

Proxy and CA bundle from environment variables

Section titled “Proxy and CA bundle from environment variables”

The library responds to the standard environment variables (HTTPS_PROXY, REQUESTS_CA_BUNDLE, etc.) if they are present.

Pass your own requests.Session when you need a proxy, a CA bundle, a client certificate or a larger connection pool, and cannot set them through environment variables. All requests, authentication included, are sent through it.

import requests
import volue_insight_timeseries
http_session = requests.Session()
http_session.proxies = {'https': 'http://proxy.example.com:8080'}
http_session.verify = '/path/to/ca-bundle.pem'
session = volue_insight_timeseries.Session(
config_file='config.ini',
requests_session=http_session
)

By default, a request that times out, fails to connect, or gets a 408 or 5xx response is retried 4 times, with 0.5 seconds between attempts. Change the number with retries, or pass a urllib3 Retry for other rules, such as backoff:

import volue_insight_timeseries
from urllib3.util import Retry
session = volue_insight_timeseries.Session(config_file='config.ini', retries=2)
session = volue_insight_timeseries.Session(
config_file='config.ini',
retries=Retry(total=5, backoff_factor=1, status_forcelist=[502, 503, 504],
allowed_methods=None, raise_on_status=False)
)

retries=0 turns retries off. Use it when your own requests_session already retries through a urllib3 Retry on its adapters; otherwise requests are retried at both levels.

© 2026 Volue.Version v0.6.38017 November 2026