All Projects → lagerfeuer → cryptocompare

lagerfeuer / cryptocompare

Licence: MIT License
Python3 Wrapper for the CryptoCompare API

Programming Languages

python
139335 projects - #7 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to cryptocompare

crypto-news
Crypto News allows you to convert cryptocurrencies, view latest news and exchange rates for each ICO – all the data from the world of cryptocurrencies in one place.
Stars: ✭ 26 (-82.31%)
Mutual labels:  crypto, cryptocompare
Coingecko Api
A Node.js wrapper for the CoinGecko API with no dependencies.
Stars: ✭ 159 (+8.16%)
Mutual labels:  crypto, api-wrapper
Pycoingecko
Python wrapper for the CoinGecko API
Stars: ✭ 270 (+83.67%)
Mutual labels:  crypto, api-wrapper
crypto compare
CryptoCompare.com API client for Python
Stars: ✭ 28 (-80.95%)
Mutual labels:  crypto, cryptocompare
blscrapeR
A tool to gather, analyze and visualize data from the Bureau of Labor Statistics (BLS) API. Functions include segmentation, geographic analysis and visualization.
Stars: ✭ 89 (-39.46%)
Mutual labels:  api-wrapper
vickitrix
Trigger crypto trades on GDAX with the Twitter stream
Stars: ✭ 30 (-79.59%)
Mutual labels:  crypto
ramapi
Python implementation for the Rick and Morty API
Stars: ✭ 17 (-88.44%)
Mutual labels:  api-wrapper
sundly
💛 Encrypted & decentralized personal health records. Built on Blockstack and powered by Blockchain.
Stars: ✭ 24 (-83.67%)
Mutual labels:  crypto
WikidataQueryServiceR
An R package for the Wikidata Query Service API
Stars: ✭ 23 (-84.35%)
Mutual labels:  api-wrapper
ro.py
ro.py is a modern, asynchronous Python 3 wrapper for the Roblox API.
Stars: ✭ 65 (-55.78%)
Mutual labels:  api-wrapper
substrate-tcr
A Parity Substrate runtime implementation of a simple Token Curated Registry (TCR)
Stars: ✭ 45 (-69.39%)
Mutual labels:  crypto
cardano-py
Python3 lib and cli for operating a Cardano Passive Node and using the API's. (PRE-ALPHA)
Stars: ✭ 17 (-88.44%)
Mutual labels:  crypto
uniswap-python
🦄 The unofficial Python client for the Uniswap exchange.
Stars: ✭ 533 (+262.59%)
Mutual labels:  crypto
nextcloud
Nextcloud OCS and WebDAV API wrapper for Ruby.
Stars: ✭ 16 (-89.12%)
Mutual labels:  api-wrapper
crypto-database
Database for crypto data, supporting several exchanges. Can be used for TA, bots, backtest, realtime trading, etc.
Stars: ✭ 72 (-51.02%)
Mutual labels:  crypto
secondhand-deal
A campus secondhand trading system based on the vue.js + stylus + koa2 + sequelize ORM + mysql, and typescript is still learning to migrate.🍌
Stars: ✭ 21 (-85.71%)
Mutual labels:  crypto
algobot
Cryptocurrency trading bot with a graphical user interface with support for simulations, backtests, optimizations, and running live bots.
Stars: ✭ 776 (+427.89%)
Mutual labels:  crypto
radiobrowser4j
RadioBrowser Java API library
Stars: ✭ 30 (-79.59%)
Mutual labels:  api-wrapper
ReplAPI.it-NodeJS
[DEPRECIATED] 𝙀𝙫𝙚𝙧𝙮𝙩𝙝𝙞𝙣𝙜 𝙍𝙚𝙥𝙡𝙞𝙩, 𝙖𝙡𝙡 𝙖𝙩 𝙮𝙤𝙪𝙧 𝙙𝙞𝙨𝙥𝙤𝙨𝙖𝙡. This is the single most extensive Replit package, allowing you to access various parts of the site with just a few classes and methods. Maintained by @RayhanADev.
Stars: ✭ 32 (-78.23%)
Mutual labels:  api-wrapper
srtdroid
Secure Reliable Transport (SRT) Protocol for Android
Stars: ✭ 35 (-76.19%)
Mutual labels:  crypto

cryptocompare GitHub Workflow Status (branch) Coverage Status PyPI - Python Version PyPI version

Python3 wrapper to query cryptocurrency prices (and more) using the CryptoCompare API.

Install

pip3 install cryptocompare

Usage

import cryptocompare

API Key

If you have an API key, you can either set it as environment variable CRYPTOCOMPARE_API_KEY or set it manually with:

cryptocompare.cryptocompare._set_api_key_parameter(KEY_HERE)

Coin List

cryptocompare.get_coin_list(format=False)
# ...
# },
# 'BTC': {
#  'Id': '1182'
#  'Url': '/coins/btc/overview'
#  'ImageUrl': '/media/19633/btc.png'
#  'Name': 'BTC'
#  'CoinName': 'Bitcoin'
#  'FullName': 'Bitcoin (BTC)'
#  'Algorithm': 'SHA256'
#  'ProofType': 'PoW'
#  'FullyPremined': '0'
#  'TotalCoinSupply': '21000000'
#  'PreMinedValue': 'N/A'
#  'TotalCoinsFreeFloat': 'N/A'
#  'SortOrder': '1'
# },
# ...

If format is True, the coin list is returned as Python list, containing only the abbreviations (like BTC).

Price

cryptocompare.get_price('BTC')
# or
cryptocompare.get_price('BTC', currency='USD', full=True)
# or
cryptocompare.get_price(['BTC', 'ETH'], ['EUR', 'GBP'])

# {'BTC': {'EUR': 3709.04, 'GBP': 3354.78},
#  'ETH': {'EUR': 258.1, 'GBP': 241.25}}

Historical Prices

# pass either datetime or time instance
cryptocompare.get_historical_price('XMR', timestamp=datetime.datetime(2017,6,6), exchange='CCCAGG')
# or
cryptocompare.get_historical_price('XMR', 'EUR', datetime.datetime(2017,6,6))

# {'XMR': {'EUR': 43.05}}

Day

cryptocompare.get_historical_price_day('BTC', currency='EUR')
cryptocompare.get_historical_price_day('BTC', currency='EUR', limit=30)
cryptocompare.get_historical_price_day('BTC', 'EUR', limit=24, exchange='CCCAGG', toTs=datetime.datetime(2019,6,6))
# or
cryptocompare.get_historical_price_day('BTC', 'EUR', limit=24, exchange='CCCAGG', toTs=datetime.datetime(1559815200))

Hour

cryptocompare.get_historical_price_hour('BTC', currency='EUR')
cryptocompare.get_historical_price_hour('BTC', currency='EUR', limit=24)
cryptocompare.get_historical_price_hour('BTC', 'EUR', limit=24, exchange='CCCAGG')
cryptocompare.get_historical_price_hour('BTC', 'EUR', limit=24, exchange='CCCAGG', toTs=datetime.datetime(2019,6,6,12))
# or
cryptocompare.get_historical_price_hour('BTC', 'EUR', limit=24, exchange='CCCAGG', toTs=datetime.datetime(1559815200))

Minute

cryptocompare.get_historical_price_minute('BTC', currency='EUR')
cryptocompare.get_historical_price_minute('BTC', currency='EUR', limit=1440)
cryptocompare.get_historical_price_minute('BTC', 'EUR', limit=24, exchange='CCCAGG', toTs=datetime.datetime.now())

Average

cryptocompare.get_avg('BTC', currency='EUR', exchange='Kraken')
# {
# 'MARKET': 'CUSTOMAGG',
# 'FROMSYMBOL': 'BTC',
# 'TOSYMBOL': 'EUR',
# 'FLAGS': 0,
# 'PRICE': 3610,
# 'LASTUPDATE': 1503066719,
# 'LASTVOLUME': 0.5,
# 'LASTVOLUMETO': 1805,
# 'LASTTRADEID': 1503066719.7584,
# 'VOLUME24HOUR': 12614.509997469995,
# 'VOLUME24HOURTO': 46397723.00499387,
# 'OPEN24HOUR': 3847.9,
# 'HIGH24HOUR': 3848.96,
# 'LOW24HOUR': 3555,
# 'LASTMARKET': 'Kraken',
# 'CHANGE24HOUR': -237.9000000000001,
# 'CHANGEPCT24HOUR': -6.182593102731363
# }

Exchanges

cryptocompare.get_exchanges()

Pairs

cryptocompare.get_pairs()
pairs = cryptocompare.get_pairs(exchange='Kraken')

Developing

Tests run assuming you have an API key, otherwise they will error due to rate limiting. Install the dev dependencies and run the tests:

pip3 install -r requirements.txt
python3 -m pytest

Credit

Disclaimer

This is a hobby project, no guarantees. If you find bugs or want additional features, open an issue and/or create a pull request.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].