魔术伊甸园API仅在JSON响应中给出符号吗?
我正在尝试通过Magic Eden API获取NFT系列的地板价格。我正在使用Python请求 -
API的文档提供此示例代码:
import requests
url = "http://api-mainnet.magiceden.dev/v2/collections/DeGods/stats"
payload = {}
headers = {}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
除了URL具有“可符号”,而不是“ DEGOD”。
这些文档在JSON对象中提供了“符号”,“ floorprice”,“ floorprice”,“ floorprice”,“ listedCount”和“ bolumeall”的响应 - 但是,无论我尝试哪种集合,它都只能在响应中给我符号。
没有示例标题或有效载荷。
I'm trying to get floor price of an NFT collection via the Magic Eden API. I'm using python requests -
The docs for the API provide this sample code:
import requests
url = "http://api-mainnet.magiceden.dev/v2/collections/DeGods/stats"
payload = {}
headers = {}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
except the url has "runcible" instead of "DeGods".
The docs give and example response with "symbol", "floorprice", "listedCount" and "volumeAll" in the JSON object - however, no matter what collection I try it only gives me the symbol in the response.
There was no examples headers or payload.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
集合的象征是小写的集合的名称,其空间被下划线取代。尝试
http://api-mainnet.magiceden.dev/v2/collections/degods/stats
,它将起作用。您的代码应该看起来像这样:
使用上述代码,请尝试另一个集合。例如
catalina鲸鱼混合器
。这是简化的,它捕获了大多数收藏。其他人则需要一种更加精确的方法,这些方法太过多样化,我不能在这个答案中介绍。
作为一个提示,可以从收藏页的链接中推导出魔术伊甸园的象征。
例如,
Grim Syndicate
集合的链接是https://magiceden.io/marketplace/grim_syndicate
。链接的最后一段是符号名称。The symbol of a collection is the name of the collection in lowercase, with spaces replaced with an underscore. Try with
http://api-mainnet.magiceden.dev/v2/collections/degods/stats
and it will work.Your code should look like this:
With the above code, try another collection. E.g.
The Catalina Whale Mixer
.That's a simplification, and it captures most of the collections. Others need a more precise approach that are too varied, and I can't go into in this answer.
As a hint, The symbol of a Magic Eden collection can be deduced from the link of the collections page.
For example, the link for the
Grim Syndicate
collection ishttps://magiceden.io/marketplace/grim_syndicate
. The last segment of the link is the symbol name.