Skip to main content

Python client for Barchart OnDemand

Get access to market data and the OnDemand APIs in just a few lines of code.

Installation

From pypi

pip install ondemand

From Source

python setup.py install

Usage

import ondemand

od = ondemand.OnDemandClient(api_key='CHANGE_ME')

# or if you are using a free sandbox API

od = ondemand.OnDemandClient(api_key='CHANGE_ME', end_point='https://marketdata.websol.barchart.com/')

# if you want data in a format other than json. xml also supported

od = ondemand.OnDemandClient(api_key='CHANGE_ME', format='csv')

# get quote data for Apple and Microsoft
quotes = od.quote('AAPL,MSFT')['results']

for q in quotes:
    print('Symbol: %s, Last Price: %s' % (q['symbol'], q['lastPrice']))

# get 1 minutes bars for Apple
resp = od.history('AAPL', 'minutes', maxRecords=50, interval=1)

# generic request by API name
resp = od.get('getQuote', symbols='AAPL,EXC', fields='bid,ask')

# or, get the crypto
resp = od.crypto('^BTCUSD,^LTCUSD')

Interactive Python Notebook Example

https://colab.research.google.com/drive/1D8389Q8qQzbppqFxwpUOobheZ2jb3Gp4

Version

  • 1.0 - 7/27/2017 -- init

Release files for ondemand 1.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ondemand 1.1.1
File Size Uploaded
ondemand-1.1.1.tar.gz 3.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ondemand 1.1.1
File Interpreter ABI Platform
ondemand-1.1.1-py3-none-any.whl Python 3 none any Details

Total release size:8.6 kB

Release files / ondemand-1.1.1.tar.gz

Download URL ondemand-1.1.1.tar.gz
Size 3.7 kB
Tags Source
SHA-256 checksum
How to use checksums
81711ed63c29e2e556edd4238ab4fa76d3bd29b99b81a82b358d4fc45be74c28
BLAKE2b-256 checksum
How to use checksums
227a9f530f2281fdffd5e70e5f81edda4109f070661bda7f3172931794bc8e81
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0

Release files / ondemand-1.1.1-py3-none-any.whl

Download URL ondemand-1.1.1-py3-none-any.whl
Size 4.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
09de3ab777f96057298e0be06d50627ca8ed0721ceb8a677f6b894054cdc7520
BLAKE2b-256 checksum
How to use checksums
0b39eb825d40a02f45e75703337b0fecb6c7f92f9a13de8713d65897ac890fc5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0

Release history Release notifications | RSS feed

This release

1.1.1 This release

2 release files

1.1.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page