Coinmarketcap Python API Update- Now returns in JSON and you can pass symbols!

in #cryptocurrency7 years ago (edited)

I've updated the Python Coinmarketcap API (https://github.com/mrsmn/coinmarketcap-api).

It works in Python 2 and 3. Until the owner accepts the pull request you can download and install it from my forked repo:

Download from here

API Documentation

Now we can request coinmarketcap.ticker('ETH') and through the old way coinmarketcap.ticker('ethereum') also. The default return is in json. If the request is coinmarketcap.ticker()returns information of all currencies.

The first return after instalation using symbols download all of them and takes a little more, but since then not, so don't worry.

If you want a more readable reponse in a string, request coinmarketcap.ticker('STEEM', VERBOSE=True), coinmarketcap.ticker('steem', VERBOSE=True) or coinmarketcap.stats(VERBOSE=True).

A greeting and happy coding!

Spanish version

He actualizado la API Python de Coinmarketcap (https://github.com/mrsmn/coinmarketcap-api).

Funciona en Python 2 y 3. Hasta que los dueños la acepten puedes descargarla e instalarla desde mi repositorio:

Descarga desde aquí

Documentación de la API

Ahora podemos hacer peticiones de este tipo: coinmarketcap.ticker('ETH') y también a la antigua manera coinmarketcap.ticker('ethereum'). La respuesta por defecto viene en formato json (como lista o diccionario). La petición coinmarketcap.ticker() retorna información de todas las monedas.

La primera respuesta después de la instalación usando símbolos tardará un poquito más porque descarga todos los símbolos de las monedas disponibles, pero desde entonces irá rápido así que no te preocupes.

Si deseas una respuesta más legible, en una cadena teclea, por ejemplo: coinmarketcap.ticker('STEEM', VERBOSE=True), coinmarketcap.ticker('steem', VERBOSE=True) o coinmarketcap.stats(VERBOSE=True).

Un saludo y pásalo bien escribiendo código!

Coin Marketplace

STEEM 0.17
TRX 0.13
JST 0.030
BTC 56400.87
ETH 2980.27
USDT 1.00
SBD 2.19