You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

coindesk

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

coindesk

Bitcoin current and historical price

1.1.0
pipPyPI
Maintainers
1

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!

Keywords

api asynchronous Bitcoin blockchain client Coindesk Python

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.