import requests
import cloudscraper
import json
scraper = cloudscraper.create_scraper()
ApiKey = “ptlc_QyoJTstnR8WC7I0hrou2a3dKCmwcGBhEQ5PD66iMJbh”
try:
response = scraper.get(“https://game.whynodes.space/api/client”, headers={
‘method’: ‘GET’,
‘Accept’: ‘application/json’,
‘content-type’: ‘application/json’,
‘Authorization’: ‘Bearer’ + ApiKey
})
if response.status_code == 200:
try:
api_response = response.json()
object_type = api_response.get("object")
print(object_type)
except json.JSONDecodeError:
print("Ответ сервера не является валидным JSON")
else:
print("Произошла ошибка при выполнении запроса. Код ошибки:", response.status_code)
except Exception as e:
print(“Произошла ошибка:”, e)
Произошла ошибка при выполнении запроса. Код ошибки: 403
MajekPro Master is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.