Skip to main content

Python SDK for integrating with Crypto API.

Project description

Crypto API Python Package Version Crypto API Python Build Status

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.0.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

cryptodatapi-1.0.0-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cryptodatapi-1.0.0.tar.gz
  • Upload date:
  • Size: 6.8 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.0.tar.gz
Algorithm Hash digest
SHA256 8fdc157f6509f65ffafe22d833677c33950ec7350c5dffd73180c76b28017dcf
MD5 cd301e2a5b01371fe0665b4f56f91b9e
BLAKE2b-256 bf33094599c00c0f92f40cf1f4ade10b4d6e4abc6cd4395ce041ed309515fcb3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cryptodatapi-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 8.3 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6c8892adbcdeeb539b2787d49e27f35e36a2f31792a4f6b8c3f6bd9c60aefecd
MD5 6fb567a1dc118cf5d41d6a27354522fe
BLAKE2b-256 0dffbb067b4c76455340c81abe3027ce1a11741e3851ae284df18c1cb5b810f0

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