{"id":13700047,"url":"https://github.com/barnumbirr/coinmarketcap","last_synced_at":"2025-05-04T18:34:05.657Z","repository":{"id":18031561,"uuid":"21069841","full_name":"barnumbirr/coinmarketcap","owner":"barnumbirr","description":"A python wrapper around the https://coinmarketcap.com API.","archived":true,"fork":false,"pushed_at":"2023-06-13T17:38:52.000Z","size":97,"stargazers_count":440,"open_issues_count":14,"forks_count":110,"subscribers_count":35,"default_branch":"master","last_synced_at":"2025-04-10T06:41:22.272Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/barnumbirr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null},"funding":{"github":["barnumbirr"]}},"created_at":"2014-06-21T14:04:14.000Z","updated_at":"2025-04-05T18:13:04.000Z","dependencies_parsed_at":"2023-10-20T18:18:00.618Z","dependency_job_id":null,"html_url":"https://github.com/barnumbirr/coinmarketcap","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barnumbirr%2Fcoinmarketcap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barnumbirr%2Fcoinmarketcap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barnumbirr%2Fcoinmarketcap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barnumbirr%2Fcoinmarketcap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/barnumbirr","download_url":"https://codeload.github.com/barnumbirr/coinmarketcap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252382854,"owners_count":21739229,"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":[],"created_at":"2024-08-02T20:00:47.781Z","updated_at":"2025-05-04T18:34:01.679Z","avatar_url":"https://github.com/barnumbirr.png","language":"Python","funding_links":["https://github.com/sponsors/barnumbirr"],"categories":["Python"],"sub_categories":["Data Sources","数据来源"],"readme":"\n# ![icon](https://raw.githubusercontent.com/barnumbirr/coinmarketcap/master/doc/coinmarketcap.png) coinmarketcap\n\n[![PyPi Version](http://img.shields.io/pypi/v/coinmarketcap.svg)](https://pypi.python.org/pypi/coinmarketcap/)\n\n**coinmarketcap** is an APACHE licensed library written in Python providing an easy to use wrapper around the [coinmarketcap.com](http://coinmarketcap.com/) API. This library has been tested with Python 2.7.x and Python 3.6.x and uses.\n\nAs of version 5.0.0 this library uses coinmarketcap's ```Public API Version 2``` as ```Public API Version 1``` will be shutdown on **November 30th, 2018**.\n\n## Installation:\n\nFrom source use\n\n    $ python setup.py install\n\nor install from PyPi\n\n    $ pip install coinmarketcap\n\n## API Documentation:\n\n**Please note that all results are cached for 120 seconds.**\n\nThis API can currently retrieve the following data from [coinmarketcap.com](http://coinmarketcap.com/):\n\n#### **`GET /v2/listings/`**\n- **`Description`** - This endpoint displays all active cryptocurrency listings in one call. Use the ```id``` field on the ```ticker``` endpoint to query more information on a specific cryptocurrency.\n- **`Optional parameters:`**\n    - None\n\n```python\n\u003e\u003e\u003e from coinmarketcap import Market\n\u003e\u003e\u003e coinmarketcap = Market()\n\u003e\u003e\u003e coinmarketcap.listings()\n{\n    \"cached\": false,\n    \"data\": [\n        {\n            \"symbol\": \"BTC\",\n            \"website_slug\": \"bitcoin\",\n            \"id\": 1,\n            \"name\": \"Bitcoin\"\n        },\n        {\n            \"symbol\": \"LTC\",\n            \"website_slug\": \"litecoin\",\n            \"id\": 2,\n            \"name\": \"Litecoin\"\n        },\n        {\n            \"symbol\": \"NMC\",\n            \"website_slug\": \"namecoin\",\n            \"id\": 3,\n            \"name\": \"Namecoin\"\n        },\n        ...\n    ],\n    \"metadata\": {\n        \"timestamp\": 1525776852,\n        \"num_cryptocurrencies\": 1597,\n        \"error\": null\n    }\n}\n```\n\n#### **`GET /v2/ticker/`**\n- **`Description`** - This endpoint displays cryptocurrency ticker data in order of rank. The maximum number of results per call is ```100```. Pagination is possible by using the ```start``` and ```limit``` parameters.\n- **`Optional parameters:`**\n    - **(int) start** - return results from rank [start] and above (default is 1)\n    - **(int) limit** - return a maximum of [limit] results (default is 100; max is 100)\n    - **(string) sort** - return results sorted by [sort]. Possible values are: \"id\", \"rank\", \"volume_24h\", and \"percent_change_24h\" (default is rank)\n      - *Note: It is strongly recommended to use id to sort if paginating through all available results since id is the only sort option guaranteed to return in a consistent order.*\n    - **(string) structure** - specify the structure for the main data field. Possible values are dictionary and array (default is dictionary).\n    - **(string) convert** - return pricing info in terms of another currency.\n    Valid fiat currency values are: \"AUD\", \"BRL\", \"CAD\", \"CHF\", \"CLP\", \"CNY\", \"CZK\", \"DKK\", \"EUR\", \"GBP\", \"HKD\", \"HUF\", \"IDR\", \"ILS\", \"INR\", \"JPY\", \"KRW\", \"MXN\", \"MYR\", \"NOK\", \"NZD\", \"PHP\", \"PKR\", \"PLN\", \"RUB\", \"SEK\", \"SGD\", \"THB\", \"TRY\", \"TWD\", \"ZAR\"\n    Valid cryptocurrency values are: \"BTC\", \"ETH\" \"XRP\", \"LTC\", and \"BCH\"\n\n```python\n\u003e\u003e\u003e from coinmarketcap import Market\n\u003e\u003e\u003e coinmarketcap = Market()\n\u003e\u003e\u003e coinmarketcap.ticker(start=0, limit=3, convert='EUR', sort='rank')\n{\n    \"cached\": false,\n    \"data\": {\n        \"1\": {\n            \"last_updated\": 1525778371,\n            \"name\": \"Bitcoin\",\n            \"symbol\": \"BTC\",\n            \"rank\": 1,\n            \"total_supply\": 17021800.0,\n            \"quotes\": {\n                \"USD\": {\n                    \"market_cap\": 158065966762.0,\n                    \"percent_change_7d\": 3.19,\n                    \"price\": 9286.09,\n                    \"percent_change_24h\": -0.5,\n                    \"volume_24h\": 7003230000.0,\n                    \"percent_change_1h\": -0.48\n                },\n                \"EUR\": {\n                    \"market_cap\": 132684366083.0,\n                    \"percent_change_7d\": 3.19,\n                    \"price\": 7794.96681216,\n                    \"percent_change_24h\": -0.5,\n                    \"volume_24h\": 5878679339.519999,\n                    \"percent_change_1h\": -0.48\n                }\n            },\n            \"max_supply\": 21000000.0,\n            \"circulating_supply\": 17021800.0,\n            \"website_slug\": \"bitcoin\",\n            \"id\": 1\n        },\n        \"1027\": {\n            \"last_updated\": 1525778355,\n            \"name\": \"Ethereum\",\n            \"symbol\": \"ETH\",\n            \"rank\": 2,\n            \"total_supply\": 99305267.0,\n            \"quotes\": {\n                \"USD\": {\n                    \"market_cap\": 73659184992.0,\n                    \"percent_change_7d\": 12.49,\n                    \"price\": 741.745,\n                    \"percent_change_24h\": 2.05,\n                    \"volume_24h\": 3503160000.0,\n                    \"percent_change_1h\": -0.88\n                },\n                \"EUR\": {\n                    \"market_cap\": 61831287703.0,\n                    \"percent_change_7d\": 12.49,\n                    \"price\": 622.63855488,\n                    \"percent_change_24h\": 2.05,\n                    \"volume_24h\": 2940636579.839999,\n                    \"percent_change_1h\": -0.88\n                }\n            },\n            \"max_supply\": null,\n            \"circulating_supply\": 99305267.0,\n            \"website_slug\": \"ethereum\",\n            \"id\": 1027\n        },\n        \"52\": {\n            \"last_updated\": 1525778642,\n            \"name\": \"Ripple\",\n            \"symbol\": \"XRP\",\n            \"rank\": 3,\n            \"total_supply\": 99992263539.0,\n            \"quotes\": {\n                \"USD\": {\n                    \"market_cap\": 31994651347.0,\n                    \"percent_change_7d\": -0.95,\n                    \"price\": 0.816643,\n                    \"percent_change_24h\": -0.98,\n                    \"volume_24h\": 469711000.0,\n                    \"percent_change_1h\": -0.96\n                },\n                \"EUR\": {\n                    \"market_cap\": 26857078212.0,\n                    \"percent_change_7d\": -0.95,\n                    \"price\": 0.6855097336,\n                    \"percent_change_24h\": -0.98,\n                    \"volume_24h\": 394286686.4639999,\n                    \"percent_change_1h\": -0.96\n                }\n            },\n            \"max_supply\": 100000000000.0,\n            \"circulating_supply\": 39178259468.0,\n            \"website_slug\": \"ripple\",\n            \"id\": 52\n        }\n    },\n    \"metadata\": {\n        \"timestamp\": 1525778464,\n        \"num_cryptocurrencies\": 1597,\n        \"error\": null\n    }\n}\n```\n\n#### **`GET /v2/ticker/{id}`**\n- **`Description`** - This endpoint displays ticker data for a specific cryptocurrency. Use the ```id``` field from the ```listings``` endpoint in the URL.\n- **`Optional parameters:`**\n    - **(string) structure**  - specify the structure for the main data field. Possible values are dictionary and array (default is dictionary).\n    - **(string) convert** - return pricing info in terms of another currency.\n    Valid fiat currency values are: “AUD”, “BRL”, “CAD”, “CHF”, “CLP”, “CNY”, “CZK”, “DKK”, “EUR”, “GBP”, “HKD”, “HUF”, “IDR”, “ILS”, “INR”, “JPY”, “KRW”, “MXN”, “MYR”, “NOK”, “NZD”, “PHP”, “PKR”, “PLN”, “RUB”, “SEK”, “SGD”, “THB”, “TRY”, “TWD”, “ZAR”\n    Valid cryptocurrency values are: “BTC”, “ETH” “XRP”, “LTC”, and “BCH”\n\n```python\n\u003e\u003e\u003e coinmarketcap.ticker(1, convert='EUR')\n{\n    \"cached\": false,\n    \"data\": {\n        \"last_updated\": 1525778672,\n        \"name\": \"Bitcoin\",\n        \"symbol\": \"BTC\",\n        \"rank\": 1,\n        \"total_supply\": 17021800.0,\n        \"quotes\": {\n            \"USD\": {\n                \"market_cap\": 157721275312.0,\n                \"percent_change_7d\": 2.96,\n                \"price\": 9265.84,\n                \"percent_change_24h\": -0.74,\n                \"volume_24h\": 6982350000.0,\n                \"percent_change_1h\": -0.73\n            },\n            \"EUR\": {\n                \"market_cap\": 132395023808.0,\n                \"percent_change_7d\": 2.96,\n                \"price\": 7777.96847616,\n                \"percent_change_24h\": -0.74,\n                \"volume_24h\": 5861152166.399999,\n                \"percent_change_1h\": -0.73\n            }\n        },\n        \"max_supply\": 21000000.0,\n        \"circulating_supply\": 17021800.0,\n        \"website_slug\": \"bitcoin\",\n        \"id\": 1\n    },\n    \"metadata\": {\n        \"timestamp\": 1525778504,\n        \"error\": null\n    }\n}\n```\n\n#### **`GET /v2/global/`**\n- **`Description`** - This endpoint displays the global data found at the top of coinmarketcap.com.\n- **`Optional parameters:`**\n    - **(string) convert** - return pricing info in terms of another currency.\n    Valid fiat currency values are: “AUD”, “BRL”, “CAD”, “CHF”, “CLP”, “CNY”, “CZK”, “DKK”, “EUR”, “GBP”, “HKD”, “HUF”, “IDR”, “ILS”, “INR”, “JPY”, “KRW”, “MXN”, “MYR”, “NOK”, “NZD”, “PHP”, “PKR”, “PLN”, “RUB”, “SEK”, “SGD”, “THB”, “TRY”, “TWD”, “ZAR”\n    Valid cryptocurrency values are: “BTC”, “ETH” “XRP”, “LTC”, and “BCH”\n\n```python\n\u003e\u003e\u003e coinmarketcap.stats(convert='EUR')\n{\n    \"status\": {\n        \"timestamp\": 1525778648,\n        \"error\": null\n    },\n    \"cached\": false,\n    \"data\": {\n        \"quotes\": {\n            \"USD\": {\n                \"total_volume_24h\": 23318683476.0,\n                \"total_market_cap\": 435375210543.0\n            },\n            \"EUR\": {\n                \"total_volume_24h\": 19574262558.0,\n                \"total_market_cap\": 365464400735.0\n            }\n        },\n        \"last_updated\": 1525778672,\n        \"bitcoin_percentage_of_market_cap\": 36.23,\n        \"active_cryptocurrencies\": 1597,\n        \"active_markets\": 10649\n    },\n    \"metadata\": {\n        \"timestamp\": 1525778648,\n        \"error\": null\n    }\n}\n```\n\n## License:\n\n```\nCopyright 2014-2018 Martin Simon\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\n```\n\n## Buy me a coffee?\n\nIf you feel like buying me a coffee (or a beer?), donations are welcome:\n\n```\nBTC : 1BNFXHPNRtg7LrLUmQWwPUwzoicUi3uP8Q\nETH : 0xd061B7dD794F6EB357bf132172ce06D1B0E5b97B\nBCH : qpcmv8vstulfhgdf29fd8sf2g769sszscvaktty2rv\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarnumbirr%2Fcoinmarketcap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbarnumbirr%2Fcoinmarketcap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarnumbirr%2Fcoinmarketcap/lists"}