Currently BTC 24hr change is -7,17% and ETH 24hr change is -5,64% according to the website https://coinmarketcap.com.
I'm calling the latest listings via curl and this coinmarketcap api command (https://coinmarketcap.com/api/documentation/v1/#operation/getV1CryptocurrencyListingsLatest):
curl -H "X-CMC_PRO_API_KEY: XXX" -H "Accept: application/json" -d "&market_cap_min=100000000000&percent_change_24h_min=0.1" -G https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest | jq -r .
As you can see the marketcap is set to 100000000000 so only BTC and ETH plays a role regarding the results in the curl request. Running the above curl commands print the data for BTC only. Actually it should return an empty set as the 24hr change is far below 0.1%.
To understand what's going on, I was running the command above with "-0.1" as 24hr change:
curl -H "X-CMC_PRO_API_KEY: XXX" -H "Accept: application/json" -d "&market_cap_min=100000000000&percent_change_24h_min=-0.1" -G https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest | jq -r .
Now the result contains BTC and ETH. Actually it should return an empty set.
Can you please help me understand the logic behind this?
The quotes both command return are: For BTC:
"quote": {
"USD": {
"price": 26444.443725284633,
"volume_24h": 34351065145.461086,
"volume_change_24h": 106.779,
"percent_change_1h": 0.00165987,
"percent_change_24h": -7.09120597,
"percent_change_7d": -9.93047998,
"percent_change_30d": -11.83798328,
"percent_change_60d": 0.20502899,
"percent_change_90d": -1.67368081,
"market_cap": 514632331115.6233,
"market_cap_dominance": 48.4523,
"fully_diluted_market_cap": 555333318230.98,
"tvl": null,
"last_updated": "2023-08-18T11:18:00.000Z"
}
}
and for ETH:
"quote": {
"USD": {
"price": 1683.7430006616828,
"volume_24h": 16085210337.999868,
"volume_change_24h": 179.5889,
"percent_change_1h": -0.08490309,
"percent_change_24h": -5.58051305,
"percent_change_7d": -8.81352641,
"percent_change_30d": -11.80180541,
"percent_change_60d": -2.20351582,
"percent_change_90d": -7.1726906,
"market_cap": 202348218149.25436,
"market_cap_dominance": 19.0437,
"fully_diluted_market_cap": 202348218149.25,
"tvl": null,
"last_updated": "2023-08-18T11:18:00.000Z"
}
}
As you can see the field percent_change_24h fits to the website. So coinmarketcap decides to return these coin although the values are ok on API side.
I don't get the logic. Does the minus "-" lead to some trouble? According to API docu values >= -100 are allowed.