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='<insert unique id>')
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='<insert unique id>')
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='<insert unique id>')
print(cryptoHistorical2022ByID)

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

## Retrieve Cryptocurrency Derivatives Exchanges by ID
cryptoDerivativesByID = cryptodatapi.get_derivatives(id='<insert unique id>')
print(cryptoDerivativesByID)

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

## Retrieve Cryptocurrency Decentralized Exchanges by ID
cryptoDecentralizedByID = cryptodatapi.get_dex(id='<insert unique id>')
print(cryptoDecentralizedByID)

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

## Retrieve Cryptocurrency Lending Exchanges by ID
cryptoLendingByID = cryptodatapi.get_lending(id='<insert unique id>')
print(cryptoLendingByID)

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

## Retrieve Cryptocurrency Spot Exchanges by ID
cryptoSpotByID = cryptodatapi.get_spot(id='<insert unique id>')
print(cryptoSpotByID)

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

## Retrieve Cryptocurrency News by ID
cryptoNewsByID = cryptodatapi.get_news(id='<insert unique id>')
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.2.tar.gz (6.4 kB view details)

Uploaded Source

Built Distributions

cryptodatapi-1.0.2-py3.8.egg (2.6 kB view details)

Uploaded Egg

cryptodatapi-1.0.2-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cryptodatapi-1.0.2.tar.gz
  • Upload date:
  • Size: 6.4 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.2.tar.gz
Algorithm Hash digest
SHA256 fd5c2ae847b8c90a498623468a8641549103285b0c8a26f8d971004e36c23faa
MD5 2897929c0dbab5952648819cadbdd6cc
BLAKE2b-256 e93702383a56ead8704a637e8b9a1a236cec907abe2ee56b050a68e8f98ecca1

See more details on using hashes here.

File details

Details for the file cryptodatapi-1.0.2-py3.8.egg.

File metadata

  • Download URL: cryptodatapi-1.0.2-py3.8.egg
  • Upload date:
  • Size: 2.6 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.0

File hashes

Hashes for cryptodatapi-1.0.2-py3.8.egg
Algorithm Hash digest
SHA256 0aa2a6e4d5030495280c3ca3bca3d755ca00a9bc3dfbe16bdacf59db59cd8092
MD5 75f19e85659994181d7da0c6273e35f8
BLAKE2b-256 a3275d027e406a141facfbba287637be3c9144e7bcc52e26f3d405e606de722d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cryptodatapi-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 8.1 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 81d064036b157ec817c4aba13ffbdd61782ca8d49d71f7605ff1c08cab67df06
MD5 2b7826f9d46dde8872f5622b44cd3671
BLAKE2b-256 c7ace540407e5d53bf28e2f3b0be8161dc5921d65deb50076b310c10539b2e07

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