|
|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
- import time
- import requests,json
- def run():
- times = int(time.time()*1000) #时间戳
- instId = str('ETH-USDT') #想查找别的虚拟币只需要把这里改成别的 例如 BTC-USDT
- url = f'https://www.ouyi.art/priapi/v5/market/trades?t={times}&instId={instId}'
- headers = {'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36',
- 'Referer':'https://www.ouyi.art/trade-spot/eth-usdt',
- 'Host':'www.ouyi.art'
- }
- response = requests.get(url=url,headers=headers)
- html = response.text
- for i in json.loads(html)["data"]:
- item = {}
- item['币种'] = i['instId']
- item['数量'] = i['sz']
- item['购买时价格'] = i['px'] + 'usdt'
- item['订单流水号'] = i['tradeId']
- item['购买时间戳'] = i['ts']
- print(item)
- if __name__ == '__main__':
- run()
复制代码 |
|