{"id":13829113,"url":"https://github.com/lagerfeuer/cryptocompare","last_synced_at":"2025-04-04T10:09:42.555Z","repository":{"id":23734820,"uuid":"100631679","full_name":"lagerfeuer/cryptocompare","owner":"lagerfeuer","description":"Python3 Wrapper for the CryptoCompare API","archived":false,"fork":false,"pushed_at":"2024-05-21T06:03:36.000Z","size":79,"stargazers_count":181,"open_issues_count":10,"forks_count":72,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-28T09:08:25.671Z","etag":null,"topics":["api-wrapper","crypto","cryptocompare","cryptocurrency","python3"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lagerfeuer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-08-17T18:06:33.000Z","updated_at":"2025-02-28T08:03:29.000Z","dependencies_parsed_at":"2024-01-15T17:38:50.784Z","dependency_job_id":"dca68def-5531-41f9-bd16-e3da5c6858a2","html_url":"https://github.com/lagerfeuer/cryptocompare","commit_stats":{"total_commits":92,"total_committers":15,"mean_commits":6.133333333333334,"dds":"0.32608695652173914","last_synced_commit":"75f6a5b039f6ff540690efcf26462ffa5cd467db"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lagerfeuer%2Fcryptocompare","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lagerfeuer%2Fcryptocompare/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lagerfeuer%2Fcryptocompare/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lagerfeuer%2Fcryptocompare/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lagerfeuer","download_url":"https://codeload.github.com/lagerfeuer/cryptocompare/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247157283,"owners_count":20893220,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-wrapper","crypto","cryptocompare","cryptocurrency","python3"],"created_at":"2024-08-04T10:00:19.811Z","updated_at":"2025-04-04T10:09:42.537Z","avatar_url":"https://github.com/lagerfeuer.png","language":"Python","readme":"# cryptocompare [![Test](https://github.com/lagerfeuer/cryptocompare/actions/workflows/test.yml/badge.svg)](https://github.com/lagerfeuer/cryptocompare/actions/workflows/test.yml) [![Coverage Status](https://coveralls.io/repos/github/lagerfeuer/cryptocompare/badge.svg?branch=master)](https://coveralls.io/github/lagerfeuer/cryptocompare?branch=master) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/cryptocompare) [![PyPI version](https://badge.fury.io/py/cryptocompare.svg)](https://badge.fury.io/py/cryptocompare)\n\n\nPython3 wrapper to query cryptocurrency prices (and more) using the [CryptoCompare](https://min-api.cryptocompare.com/) API.\n\n\n## Install\n```sh\npip3 install cryptocompare\n```\n\n## Usage\n\n```python\nimport cryptocompare\n```\n\n## API Key\n\nIf you have an API key, you can either set it as environment variable `CRYPTOCOMPARE_API_KEY` or set it manually with: \n\n```\ncryptocompare.cryptocompare._set_api_key_parameter(KEY_HERE)\n```\n\n### Coin List\n\n```python\ncryptocompare.get_coin_list(format=False)\n# ...\n# },\n# 'BTC': {\n#  'Id': '1182'\n#  'Url': '/coins/btc/overview'\n#  'ImageUrl': '/media/19633/btc.png'\n#  'Name': 'BTC'\n#  'CoinName': 'Bitcoin'\n#  'FullName': 'Bitcoin (BTC)'\n#  'Algorithm': 'SHA256'\n#  'ProofType': 'PoW'\n#  'FullyPremined': '0'\n#  'TotalCoinSupply': '21000000'\n#  'PreMinedValue': 'N/A'\n#  'TotalCoinsFreeFloat': 'N/A'\n#  'SortOrder': '1'\n# },\n# ...\n```\n\nIf `format` is `True`, the coin list is returned as Python list,\ncontaining only the abbreviations (like `BTC`).\n\n### Price\n\n```python\ncryptocompare.get_price('BTC')\n# or\ncryptocompare.get_price('BTC', currency='USD', full=True)\n# or\ncryptocompare.get_price(['BTC', 'ETH'], ['EUR', 'GBP'])\n\n# {'BTC': {'EUR': 3709.04, 'GBP': 3354.78},\n#  'ETH': {'EUR': 258.1, 'GBP': 241.25}}\n```\n\n### Historical Prices\n\n```python\n# pass either datetime or time instance\ncryptocompare.get_historical_price('XMR', timestamp=datetime.datetime(2017,6,6), exchange='CCCAGG')\n# or\ncryptocompare.get_historical_price('XMR', 'EUR', datetime.datetime(2017,6,6))\n\n# {'XMR': {'EUR': 43.05}}\n```\n\n#### Day\n\n```python\ncryptocompare.get_historical_price_day('BTC', currency='EUR')\ncryptocompare.get_historical_price_day('BTC', currency='EUR', limit=30)\ncryptocompare.get_historical_price_day('BTC', 'EUR', limit=24, exchange='CCCAGG', toTs=datetime.datetime(2019,6,6))\n# or\ncryptocompare.get_historical_price_day('BTC', 'EUR', limit=24, exchange='CCCAGG', toTs=datetime.datetime(1559815200))\n```\n\n#### Hour\n\n```python\ncryptocompare.get_historical_price_hour('BTC', currency='EUR')\ncryptocompare.get_historical_price_hour('BTC', currency='EUR', limit=24)\ncryptocompare.get_historical_price_hour('BTC', 'EUR', limit=24, exchange='CCCAGG')\ncryptocompare.get_historical_price_hour('BTC', 'EUR', limit=24, exchange='CCCAGG', toTs=datetime.datetime(2019,6,6,12))\n# or\ncryptocompare.get_historical_price_hour('BTC', 'EUR', limit=24, exchange='CCCAGG', toTs=datetime.datetime(1559815200))\n```\n\n#### Minute\n\n```python\ncryptocompare.get_historical_price_minute('BTC', currency='EUR')\ncryptocompare.get_historical_price_minute('BTC', currency='EUR', limit=1440)\ncryptocompare.get_historical_price_minute('BTC', 'EUR', limit=24, exchange='CCCAGG', toTs=datetime.datetime.now())\n```\n\n### Average\n\n```python\ncryptocompare.get_avg('BTC', currency='EUR', exchange='Kraken')\n# {\n# 'MARKET': 'CUSTOMAGG',\n# 'FROMSYMBOL': 'BTC',\n# 'TOSYMBOL': 'EUR',\n# 'FLAGS': 0,\n# 'PRICE': 3610,\n# 'LASTUPDATE': 1503066719,\n# 'LASTVOLUME': 0.5,\n# 'LASTVOLUMETO': 1805,\n# 'LASTTRADEID': 1503066719.7584,\n# 'VOLUME24HOUR': 12614.509997469995,\n# 'VOLUME24HOURTO': 46397723.00499387,\n# 'OPEN24HOUR': 3847.9,\n# 'HIGH24HOUR': 3848.96,\n# 'LOW24HOUR': 3555,\n# 'LASTMARKET': 'Kraken',\n# 'CHANGE24HOUR': -237.9000000000001,\n# 'CHANGEPCT24HOUR': -6.182593102731363\n# }\n```\n\n### Exchanges\n\n```python\ncryptocompare.get_exchanges()\n```\n\n### Pairs\n\n```python\ncryptocompare.get_pairs()\npairs = cryptocompare.get_pairs(exchange='Kraken')\n```\n\n## Developing\n\nTests run assuming you have an API key, otherwise they will error due to rate limiting. Install the dev dependencies and run the tests:\n```sh\npip3 install -r requirements.txt\npython3 -m pytest\n```\n\n## Credit\n\n* The [CryptoCompare API](https://min-api.cryptocompare.com/).\n\n## Disclaimer\n\nThis is a hobby project, no guarantees.\nIf you find bugs or want additional features,\nopen an issue and/or create a pull request.\n","funding_links":[],"categories":["Awesome CryptoCompare [![Awesome](https://github.com/CryptoCompareLTD/awesome-cryptocompare/blob/master/awesomecc.svg)](https://github.com/sindresorhus/awesome)"],"sub_categories":["Python"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flagerfeuer%2Fcryptocompare","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flagerfeuer%2Fcryptocompare","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flagerfeuer%2Fcryptocompare/lists"}