Challenge: Get data from https://api.cryptonator.com/api/full/dash-btc. Unfortunaletly this API requests more than a simple and pure http-request.
Local stored JSON: https://api.json-content-importer.com/extra/json/api_cryptonator_com_dash-btc.json
Shortcode:
convertjsonnumbers2strings=yes is curial here. With this the Numbers are transformed to strings. Otherwise PHP would round the number due to it’s number formats.
Rounded: 437578.372398
In the JSON: 437578.37239754
[jsoncontentimporterpro nameoftemplate="api.cryptonator.com" convertjsonnumbers2strings=yes]
Create a new JCI-Template:
- Name: api.cryptonator.com
- URL: https://api.json-content-importer.com/extra/json/api_cryptonator_com_dash-btc.json
- twig-template:
volume: {{ticker.volume}}<br> change: {{ticker.change}}<br> price: {{ticker.price}} <ul> {% for m in ticker.markets %} <li> Base: {{m.market}}: price={{m.price}} / volume={{m.volume}} </li> {% endfor %} </ul>
In Action:
curlGET failed, http-code: 301