|
@@ -48,7 +48,8 @@ class ContactUs(BaseModel):
|
|
|
|
|
|
@app.get("/showdata/{limit}")
|
|
|
async def showdata(limit):
|
|
|
- url = 'https://api.coinmarketcap.com/data-api/v3/nft/collections?start=0&limit=' + limit
|
|
|
+ # url = 'https://api.coinmarketcap.com/data-api/v3/nft/collections?start=0&limit=' + limit
|
|
|
+ url = 'https://api.coinmarketcap.com/data-api/v3/nft/collections?start=0&limit=' + limit + '&sort=volume&desc=true&period=2'
|
|
|
r = urllib.request.urlopen(url)
|
|
|
collections = json.loads(r.read())['data']['collections']
|
|
|
|
|
@@ -56,9 +57,8 @@ async def showdata(limit):
|
|
|
|
|
|
for req in collections:
|
|
|
logo = 'https://s3.coinmarketcap.com/generated/nft/collections/' + req['slug'] + '.png';
|
|
|
- last_7_days = 'https://s3.coinmarketcap.com/generated/sparklines/nft/collection/web/30d/' + req['slug'] +'.png';
|
|
|
|
|
|
- reqs.append({'rank':req['rank'],'slug':req['slug'],'logo':logo,'website':req['website'],'name':req['name'],'assets':req['assets'],'collection_net_worth':req['netWorth'],'volume_7d':req['volume7d'],'sales_7d':req['sales7d'],'volume_all_time':req['volumeAT'],'sales_all_time':req['salesAT'],'last_7_days':req['sales7d']})
|
|
|
+ reqs.append({'rank':req['rank'],'slug':req['slug'],'logo':logo,'website':req['website'],'name':req['name'],'assets':req['assets'],'collection_net_worth':req['netWorth'],'volume_7d':req['volume7d'],'sales_7d':req['sales7d'],'volume_all_time':req['volumeAT'],'sales_all_time':req['salesAT'],'owners':req['owners']})
|
|
|
return reqs
|
|
|
|
|
|
@app.post("/add_sub")
|