## <center>[Download from here](https://github.com/mondeja/pymarketcap)</center> https://s29.postimg.org/qo08bvkjb/coinmarketcap_markets.jpg <center>[PyPi Version](https://pypi.python.org/pypi/pymarketcap/)</center> **Pymarketcap** is an APACHE licensed library for retrieve information from [coinmarketcap](http://coinmarketcap.com/) API and web. Consist of a parser built on BeautifulSoup and a API wrapper. It works for Python 2 and 3. If you only want the API wrapper, go to [here](https://github.com/mondeja/coinmarketcap-api). ## Installation: You need to install BeautifulSoup before: $ pip install bs4 From source use: $ python setup.py install or install from PyPi $ pip install pymarketcap ## Documentation: ### API methods - **`GET /v1/ticker/`** - **`GET /v1/ticker/currency`** ```python >>> from pymarketcap import * # Only contains the class Pymarketcap >>> coinmarketcap = Pymarketcap() >>> coinmarketcap.ticker(<currency>) # <currency> can be passed through 'ethereum' or 'ETH' and returns in json >>> coinmarketcap.ticker('ETH') >>> coinmarketcap.ticker('ethereum') # Add VERBOSE=True or V=True for a string response, like this: >>> coinmarketcap.ticker('STEEM', V=True) # This is for receive all the currencies in a string >>> coinmarketcap.ticker(VERBOSE=True) [ { id: "bitcoin", name: "Bitcoin", symbol: "BTC", rank: 1, price_usd: 448.66, 24h_volume_usd: 84396000, market_cap_usd: 6946212888, available_supply: 15482200, total_supply: 15482200, percent_change_1h: 0.47, percent_change_24h: -1.61, percent_change_7d: 1.25 }, { id: "ethereum", name: "Ethereum", symbol: "ETH", rank: 2, price_usd: 7.28, 24h_volume_usd: 13419600, market_cap_usd: 578917949, available_supply: 79512085, total_supply: 79512085, percent_change_1h: 0.21, percent_change_24h: -6.51, percent_change_7d: -14.64 }, ... ] ``` <center></center> - **`GET /v1/global/`** ```python >>> coinmarketcap.stats(VERBOSE=True) { total_market_cap_usd: 8280726727, total_24h_volume_usd: 108644044, bitcoin_percentage_of_market_cap: 81.77, active_currencies: 690, active_assets: 57, active_markets: 1902 } ``` ### Web Parser methods #### [Currency markets](http://coinmarketcap.com/currencies/<currency>/#markets) - **`GET http://coinmarketcap.com/currencies/<currency>/#markets`** ```python >>> coinmarketcap.markets('ETH', V=True) [ { "pair": "ETH/BTC", "source": "Poloniex", "percent_volume": 29.72, "price_usd": 49.07, "24h_volume_usd": 35779900 }, { "pair": "ETH/USD", "source": "GDAX", "percent_volume": 8.22, "price_usd": 49.99, "24h_volume_usd": 9897980 }, { "pair": "ETH/USD", "source": "Bitfinex", "percent_volume": 7.98, "price_usd": 49.45, "24h_volume_usd": 9606490 }, ... ] ``` #### [Global ranks](http://www.coinmarketcap.com/gainers-losers/) - **`GET http://www.coinmarketcap.com/gainers-losers/`** ```python >>> coinmarketcap.ranks(V=True) { "losers": { "1h": [ { "24h_volume_usd": 15219, "symbol": "XEN", "price_usd": 0.327427, "percent_change": -24.28, "name": "Xenixcoin" }, { "24h_volume_usd": 818024, "symbol": "PINK", "price_usd": 0.002168, "percent_change": -18.3, "name": "PinkCoin" }, ... # You can pass '7d', '24h', '1h', 'gainers' and 'losers' for filter responses: coinmarketcap.ranks('gainers', '1h', V=True) { "1h": [ { "24h_volume_usd": 62719, "symbol": "NOBL", "price_usd": 0.00024, "percent_change": 18.99, "name": "NobleCoin" }, { "24h_volume_usd": 22355, "symbol": "RDD", "price_usd": 5.5e-05, "percent_change": 17.72, "name": "ReddCoin" }, { "24h_volume_usd": 12723, "symbol": "BOLI", "price_usd": 0.003156, "percent_change": 15.83, "name": "Bolivarcoin" }, ... ```
author | mondeja |
---|---|
permlink | pymarketcap-coinmarketcap-python-api-and-web-parser |
category | cryptocurrency |
json_metadata | {"tags":["cryptocurrency","programming","howto","coinmarketcap","api"],"links":["https://github.com/mondeja/pymarketcap","https://pypi.python.org/pypi/pymarketcap/","http://coinmarketcap.com/","https://github.com/mondeja/coinmarketcap-api","http://coinmarketcap.com/currencies/<currency>/#markets","http://www.coinmarketcap.com/gainers-losers/"],"app":"steemit/0.1","format":"markdown","image":["https://s29.postimg.org/qo08bvkjb/coinmarketcap_markets.jpg"]} |
created | 2017-04-01 12:07:00 |
last_update | 2017-04-01 13:28:45 |
depth | 0 |
children | 3 |
last_payout | 2017-04-08 12:07:00 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.030 HBD |
curator_payout_value | 0.005 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 4,096 |
author_reputation | 9,894,814,339,118 |
root_title | "Pymarketcap - Coinmarketcap Python API and web parser" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 2,915,775 |
net_rshares | 996,958,273,550 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
berniesanders | 0 | 916,376,007,144 | 5% | ||
fyrstikken | 0 | 53,078,596,035 | 1% | ||
seb | 0 | 527,103,467 | 100% | ||
mondeja | 0 | 6,155,959,171 | 100% | ||
sergey44 | 0 | 444,836,177 | 100% | ||
bigrigbutters | 0 | 0 | 100% | ||
deaddy | 0 | 0 | 100% | ||
nelyp | 0 | 14,765,384,285 | 100% | ||
sqube | 0 | 2,985,898,781 | 1% | ||
cathynsons | 0 | 309,825,450 | 1% | ||
sellergenius | 0 | 2,109,362,191 | 100% | ||
resnullius | 0 | 150,132,044 | 100% | ||
bedroomshaman | 0 | 55,168,805 | 100% | ||
selfmadeinvestor | 0 | 0 | 100% | ||
qommander | 0 | 0 | 100% | ||
rapuncoco | 0 | 0 | 100% | ||
vmbsaturno | 0 | 0 | 100% |
pip install bs4 Worked fine. pip install pymarketcap Error = " Could not find a version that satisfies the requirement pymarketcap (from versions: ) No matching distribution found for pymarketcap". I use Python 3.5.2
author | aguazul |
---|---|
permlink | re-mondeja-pymarketcap-coinmarketcap-python-api-and-web-parser-20170611t042335429z |
category | cryptocurrency |
json_metadata | {"tags":["cryptocurrency"],"app":"steemit/0.1"} |
created | 2017-06-11 04:23:33 |
last_update | 2017-06-11 04:23:33 |
depth | 1 |
children | 1 |
last_payout | 2017-06-18 04:23:33 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 219 |
author_reputation | 44,356,920,781 |
root_title | "Pymarketcap - Coinmarketcap Python API and web parser" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 4,571,591 |
net_rshares | 0 |
If you use Linux: git clone https://github.com/mondeja/pymarketcap.git cd pymarketcap python3 setup.py install In windows, you can download it in [github](https://github.com/mondeja/pymarketcap) and instal from source.
author | mondeja |
---|---|
permlink | re-aguazul-re-mondeja-pymarketcap-coinmarketcap-python-api-and-web-parser-20170612t141926340z |
category | cryptocurrency |
json_metadata | {"tags":["cryptocurrency"],"links":["https://github.com/mondeja/pymarketcap.git","https://github.com/mondeja/pymarketcap"],"app":"steemit/0.1"} |
created | 2017-06-12 14:19:36 |
last_update | 2017-06-12 14:20:48 |
depth | 2 |
children | 0 |
last_payout | 2017-06-19 14:19:36 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 219 |
author_reputation | 9,894,814,339,118 |
root_title | "Pymarketcap - Coinmarketcap Python API and web parser" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 4,660,175 |
net_rshares | 155,335,000 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
aguazul | 0 | 155,335,000 | 100% |
great project! that's exactly the thing i'm working on, but i wanted to write the infos gathered from the api to a csv or excel file sorted by columns (fields = id, name ect...) with the data under, do you know how to do so?
author | selfmadeinvestor |
---|---|
permlink | re-mondeja-pymarketcap-coinmarketcap-python-api-and-web-parser-20180315t152119817z |
category | cryptocurrency |
json_metadata | {"tags":["cryptocurrency"],"app":"steemit/0.1"} |
created | 2018-03-15 15:21:48 |
last_update | 2018-03-15 15:21:48 |
depth | 1 |
children | 0 |
last_payout | 2018-03-22 15:21:48 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 224 |
author_reputation | 9,540,267,776 |
root_title | "Pymarketcap - Coinmarketcap Python API and web parser" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 44,615,284 |
net_rshares | 0 |