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 Top Gainers
cryptoGainers = cryptodatapi.get_gainers()
print(cryptoGainers)

## Retrieve Cryptocurrency Top Gainers by ID
cryptoGainersByID = cryptodatapi.get_gainers(id='<insert unique id>')
print(cryptoGainersByID)

## Retrieve All Cryptocurrency Top Losers
cryptoLosers = cryptodatapi.get_losers()
print(cryptoLosers)

## Retrieve Cryptocurrency Top Losers by ID
cryptoLosersByID = cryptodatapi.get_losers(id='<insert unique id>')
print(cryptoLosersByID)

## 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 2023 Historical Prices
cryptoHistorical2023 = cryptodatapi.get_hist_price_2023()
print(cryptoHistorical2023)

## Retrieve Cryptocurrency 2023 Historical Prices by ID
cryptoHistorical2023ByID = cryptodatapi.get_hist_price_2023(id='<insert unique id>')
print(cryptoHistorical2023ByID)

## 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.5.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

cryptodatapi-1.0.5-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cryptodatapi-1.0.5.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.0

File hashes

Hashes for cryptodatapi-1.0.5.tar.gz
Algorithm Hash digest
SHA256 fe20ef51ac108f8b1074b7f9b94ec4757ad556eb0b67706a0278ec246f6c63e0
MD5 78611ecefaeda1d16fd93265d5d9a886
BLAKE2b-256 d1be96067a79c5e3dd73bc9c5ffca8d27fe59a379320724e41557e03d7f42c36

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cryptodatapi-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.0

File hashes

Hashes for cryptodatapi-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 5c76243f59ec3f867fff5628318ec09fd1d4aa61138558ec228dd8a7c9fdef46
MD5 1d6ef30206019d2b19ded5b5efdc93cf
BLAKE2b-256 252e9bd120b295971afd0ac867e8e9d8ee22c28097fd0b5518f5fb022bb0f25f

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