import requests
import time
# address = '15aayQV7Dx6u22wLnR2fe8DVmuVraUQXQn'
address = 'bc1qa9sw3l5ucl9zse3sjmtmxh5zkzylaw0vp3xtky'
url = f"https://blockchain.info/rawaddr/{address}"
response = requests.get(url)
data = response.json()
# data = response.json()
# 输出地址的基本信息
total_received = data['total_received'] / 1e8 # 转换为 BTC
total_sent = data['total_sent'] / 1e8 # 转换为 BTC
final_balance = data['final_balance'] / 1e8 # 转换为 BTC
print(f"地址: {address}")
print(f"接收到的总金额: {total_received} BTC")
print(f"发送的总金额: {total_sent} BTC")
print(f"当前余额: {final_balance} BTC")
print("-" * 60)
# 输出交易记录
for tx in data['txs']:
# print(tx)
print(f"交易哈希: {tx['hash']}")
output_addr = tx['out']
if output_addr:
output_addr = output_addr[0]['addr']
print(f'转出接受地址:{output_addr}')
date_str = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(tx['time']))
print(f"时间: {date_str}")
print(f"总金额: {tx['result'] / 1e8} BTC")
print("-" * 30)
Speedy emails, satisfied customers
Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)