自动请求 core-api.prod.blur.io

问题描述 投票:0回答:0

我正在尝试获取有关 Blur 未发布的 api 的数据https://core-api.prod.blur.io.

如果您在浏览器上访问以下网址https://core-api.prod.blur.io/v1/prices,您应该能够获得成功的响应。

但是,如果您尝试通过非浏览方法发出此请求,则会失败。 这是许多其他尝试中的一个:

import requests

url = "https://core-api.prod.blur.io/v1/prices"
headers = {
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36",
    "Accept-Language": "en-US,en;q=0.5",
    "Accept-Encoding": "gzip, deflate, br",
    "Connection": "keep-alive",
}
print("Status:", response.status_code)
print("Content-type:", response.headers['content-type'])

if response.status_code == 200:
    print("Data:", response.json())
Status: 403
Content-type: text/html; charset=UTF-8

知道如何解决这个问题吗?

(另一篇相关文章:API 调用在 chrome 中工作但不是 postman

python browser python-requests nft
© www.soinside.com 2019 - 2024. All rights reserved.