【发布时间】:2022-01-25 14:08:51
【问题描述】:
我正在使用 python 并尝试从 solscan 上的令牌中读取元数据。 我正在从元数据中查找名称、图像等。
我目前使用的 JSON 请求似乎有效(即不会失败),但它只返回我:
{"holder":0}
Process finished with exit code 0
我正在向网站发出其他几个请求,所以我认为我的请求是正确的。 我尝试查看https://public-api.solscan.io/docs 上的文档,我相信我正在请求正确的信息,但我不明白。
这是我当前的代码:
import requests
headers = {
'accept': 'application/jsonParsed',
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36'
}
params = (
('tokenAddress', 'EArf8AxBi44QxFVnSab9gZpXTxVGiAX2YCLokccr1UsW'),
)
response = requests.get('https://public-api.solscan.io/token/meta', headers=headers, params=params)
#response = requests.get('https://arweave.net/viPcoBnO9OjXvnzGMXGvqJ2BEgl25BMtqGaj-I1tkCM', headers=headers)
print(response.content.decode())
任何帮助表示赞赏!
【问题讨论】:
标签: python python-requests solana