Home > Helparticles > API: api.coinpaprika.com with free and PRO JCI-Plugin

API: api.coinpaprika.com with free and PRO JCI-Plugin

Challenge:
Show data from https://api.coinpaprika.com/v1/exchanges/paribu?quotes=TRY
Solution with the free JCI-Plugin:
[jsoncontentimporter url=https://api.coinpaprika.com/v1/exchanges/paribu?quotes=TRY]
{subloop:quotes:-1}
{subloop:quotes.TRY:-1}
reported_volume_24h = {quotes.TRY.reported_volume_24h}
{/subloop:quotes.TRY}
{/subloop:quotes}
[/jsoncontentimporter]

In Action:
reported_volume_24h = 68503846.3082
Solution with the PRO JCI-Plugin:
Create a template with URL https://api.coinpaprika.com/v1/exchanges/paribu?quotes=TRY and this twig-code:
{% set lire = quotes.TRY.reported_volume_24h|split('.') %}
reported_volume_24h = {{lire.0 | formatnumber(0, '', ',') }}.{{lire.1}}

Store this JCI-Template and use it in a shortcode in this way:
[jsoncontentimporterpro id=_NO_OF_TEMPLATE convertjsonnumbers2strings=yes]

In Action:
reported_volume_24h = 68,503,846.30823986