Skip to main content

CoinDesk API client

Powered by CoinDesk

Client written in Python3 for CoinDesk API service.

Features

  • Get Bitcoin current price
  • Get Bitcoin historical price

Getting Started

These instructions will get you a copy of the project on your local system.

Dependencies

CoinDesk API client uses a number of open source projects to work properly:

  • aiohttp - Asynchronous HTTP client/server for asyncio and Python
  • furl - URL parsing and manipulation made easy
  • jsonschema - An implementation of JSON Schema validation for Python
  • [requests] - Python HTTP for Humans

And of course CoinDesk API client itself is open source with a public repository on GitHub.

Installation

Intall the package from Pypi using the command:

pip install -U coindesk

Quick Start

A series of simple examples:

Get currentprice price for Bitcoin in json format

from coindesk.client import CoindeskAPIClient
api_client = CoindeskAPIClient.start('currentprice')
response = api_client.get()

Get currentprice price for Bitcoin in other currency than USD

from coindesk.client import CoindeskAPIClient
api_client = CoindeskAPIClient.start('currentprice', {'currency': 'EUR'})
response = api_client.get()

Get historical price for Bitcoin in json format

from coindesk.client import CoindeskAPIClient
api_client = CoindeskAPIClient.start('historical')
response = api_client.get()

Get historical price for Bitcoin providing optional parameters

from coindesk.client import CoinDeskAPIClient
api_client = CoindeskAPIClient.start('historical', {'currency': 'EUR', 'for': 'yesterday'})
response = api_client.get()

Make a request with custom parameters either for currentprice or historical

from coindesk.client import CoinDeskAPIClient
api_client = CoindeskAPIClient.start('currentprice', retries=5, redirects=False, timeout=10)
response = api_client.get()

Get raw http response either for currentprice or historical

from coindesk.client import CoinDeskAPIClient
api_client = CoindeskAPIClient.start('currentprice')
response = api_client.get(raw=True)

Get supported currencies to fetch Bitcoin price in

from coindesk.client import CoindeskAPIClient
api_client = CoindeskAPIClient()
supported_currencies = api_client.get_supported_currencies()

Full documentation for CoinDesk API is available at https://www.coindesk.com/api/.

License

MIT

Free Software. Hell Yeah!

[requests]: https://github.com/requests/requests

Metadata

Release files for coindesk 1.1.0

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

Source distribution (sdist)

Source distribution for coindesk 1.1.0
File Size Uploaded Provenance Actions
coindesk-1.1.0.tar.gz 11.5 kB Without provenance Details for coindesk-1.1.0.tar.gz

Release files / coindesk-1.1.0.tar.gz

Download URL coindesk-1.1.0.tar.gz
Size 11.5 kB
Tags Source
SHA-256 checksum
How to use checksums
1a67b83791f0d2091779708f29bf0beec238605019f8fe572fcae1df51bc03b1
BLAKE2b-256 checksum
How to use checksums
be58827cb3f44a95c9b03f856ba5ffc627a2acee121aadd25e8a4d36d7c67fe9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.3

Security for coindesk 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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