根据coinmarket的币种和排名获取价格小于0.00001USD且24小时成交价值大于10000USD的交易品种 具体Python代码如下:
import requests
import json
url = 'https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest'
proxies = {
"http":"http://127.0.0.1:33210",
"https":"http://127.0.0.1:33210"
}
headers = {
'Accepts': 'application/json',
'X-CMC_PRO_API_KEY': '704576b8-8e1e-4ccb-9aa6-51990dab9fdb',
}
params = {
'start':'1',
'limit':'5000',
'convert':'USD'
}
try:
response = requests.get(url, params=params, headers=headers, proxies=proxies)
data = json.loads(response.text)
# df = pd.DataFrame(data['data'])
data = data['data']
for d in data:
if d['quote']['USD']['price'] < 0.00001 and d['quote']['USD']['volume_24h'] > 10000:
print(d['cmc_rank'], d['symbol'], "%.15f"%d['quote']['USD']['price'], d['quote']['USD']['volume_24h'], d['quote']['USD']['market_cap'])
except Exception as e:
print(e)
以上,无需配置代理的可以删除proxies代码
谢谢。
阿宝 思路不错啊
dianwan99 只查24小时,感觉应该已经结束了。
发明者量化-小小梦 感谢分享。
小七 谢谢啊。
小七 这个接口好像只有24小时volume,别的接口没研究,可以改改玩