Skip to main content

Python SDK for integrating with Crypto API.

Project description

Crypto API Python Package Version

Python library for integrating with Crypto API functionality.

Requirements

Python 2.7 and later.

Setup

You can install this package by using the pip tool and installing:

$ pip install cryptodatapi

Or:

$ easy_install cryptodatapi

Usage Example

import cryptodatapi
from dotenv import load_dotenv
import os

## Loads environment variables from .env
load_dotenv('.env')

username = os.getenv('_USERNAME')
password = os.getenv('_PASSWORD')

## Authentication
cryptodatapi.login(username, password)

## Retrieve All Cryptocurrency Prices
cryptoPrices = cryptodatapi.get_crypto_price()
print(cryptoPrices)

## Retrieve Cryptocurrency Price by ID
cryptoPriceByID = cryptodatapi.get_crypto_price(id='3b50f04c-2be5-11ed-b8e8-acde48001122')
print(cryptoPriceByID)

## Retrieve Bitcoin Price
cryptoPrice = cryptodatapi.get_crypto_price(sym='BTC')
print(cryptoPrice)

## Retrieve All Cryptocurrency 2021 Historical Prices
cryptoHistorical2021 = cryptodatapi.get_hist_price_2021()
print(cryptoHistorical2021)

## Retrieve Cryptocurrency 2021 Historical Prices by ID
cryptoHistorical2021ByID = cryptodatapi.get_hist_price_2021(id='4fbec328-2682-11ed-861f-acde48001122')
print(cryptoHistorical2021ByID)

## Retrieve All Cryptocurrency 2022 Historical Prices
cryptoHistorical2022 = cryptodatapi.get_hist_price_2022()
print(cryptoHistorical2022)

## Retrieve Cryptocurrency 2022 Historical Prices by ID
cryptoHistorical2022ByID = cryptodatapi.get_hist_price_2022(id='5069f144-2682-11ed-861f-acde48001122')
print(cryptoHistorical2022ByID)

## Retrieve All Cryptocurrency Derivatives Exchanges
cryptoDerivatives = cryptodatapi.get_derivatives()
print(cryptoDerivatives)

## Retrieve Cryptocurrency Derivatives Exchanges by ID
cryptoDerivativesByID = cryptodatapi.get_derivatives(id='ba1a40ee-2c0e-11ed-81fc-acde48001122')
print(cryptoDerivativesByID)

## Retrieve All Cryptocurrency Decentralized Exchanges
cryptoDecentralized = cryptodatapi.get_dex()
print(cryptoDecentralized)

## Retrieve Cryptocurrency Decentralized Exchanges by ID
cryptoDecentralizedByID = cryptodatapi.get_dex(id='1c57d64a-2c55-11ed-ae83-acde48001122')
print(cryptoDecentralizedByID)

## Retrieve All Cryptocurrency Lending Exchanges
cryptoLending = cryptodatapi.get_lending()
print(cryptoLending)

## Retrieve Cryptocurrency Lending Exchanges by ID
cryptoLendingByID = cryptodatapi.get_lending(id='7aa65740-2c54-11ed-9ad0-acde48001122')
print(cryptoLendingByID)

## Retrieve All Cryptocurrency Spot Exchanges
cryptoSpot = cryptodatapi.get_spot()
print(cryptoSpot)

## Retrieve Cryptocurrency Spot Exchanges by ID
cryptoSpotByID = cryptodatapi.get_spot(id='0350136c-2c67-11ed-a027-acde48001122')
print(cryptoSpotByID)

## Retrieve All Cryptocurrency News
cryptoNews = cryptodatapi.get_news()
print(cryptoNews)

## Retrieve Cryptocurrency News by ID
cryptoNewsByID = cryptodatapi.get_news(id='3946c386-268a-11ed-83b2-acde48001122')
print(cryptoNewsByID)

Setting up an Crypto API Account

Sign up for a self-service user account.

Using the Crypto API

You can read the API documentation to understand what’s possible with the Crypto API. If you need further assistance, don’t hesitate to contact us.

License

This project is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cryptodatapi-1.0.1.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

cryptodatapi-1.0.1-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file cryptodatapi-1.0.1.tar.gz.

File metadata

  • Download URL: cryptodatapi-1.0.1.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.0

File hashes

Hashes for cryptodatapi-1.0.1.tar.gz
Algorithm Hash digest
SHA256 02fedda4f79aeedda58bf6edcefac2b51895889638ffb310cc96b330cf4e5f48
MD5 30f7a69a358419f6fa70e14f101d3738
BLAKE2b-256 3912b1df0dc2bda49987fba55c7159c47af85a51393e21bcb6fcba34a5eab6fe

See more details on using hashes here.

File details

Details for the file cryptodatapi-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: cryptodatapi-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.0

File hashes

Hashes for cryptodatapi-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 75b632951abeed7840db00a41dd34cf0350c46100bd562d2f33a25981ab438c9
MD5 bc205ba3c3c445712f1899e704ca2c4b
BLAKE2b-256 b856e977936a1a7f528b6976d0603cc74e0c36e293be6c86f4d76f14ea3a88c6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page