I’ve created a script in Python using requests module to get the json response from a webpage. I’ve tried to arrange the headers as I see them in dev tools. Fyi, the value of X-Payload
in the headers is subject to change, but I’ve used a hardcoded one instead. I’m unsure if this is the reason the script is unable to fetch the desired response. I intend to get the assets and their respective prices from that landing page.
import requests
import time
unixtime = int(time.time())
start_url = 'https://platform.arkhamintelligence.com/explorer/address/0xBaeD383EDE0e5d9d72430661f3285DAa77E9439F'
link = 'https://api.arkhamintelligence.com/balances/address/0xBaeD383EDE0e5d9d72430661f3285DAa77E9439F'
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36',
'X-Payload': '875fc2337fbb15c87bcd478bcc8e31ba88cb3c8d2cc5d9a618bad22dd0860140',
'X-Timestamp': str(unixtime),
'Accept': 'application/json, text/plain, */*',
'Referer': 'https://platform.arkhamintelligence.com/',
'Accept-Encoding': 'gzip, deflate, br, zstd',
'Accept-Language': 'en-US,en;q=0.9',
'Origin': 'https://platform.arkhamintelligence.com',
}
with requests.Session() as s:
s.headers.update(headers)
r = s.get(start_url)
res = s.get(link,headers=headers)
print(res.json())
EDIT:
When I run the script, I get this response: {'message': 'please sign up for an API key :)'}
whereas I can clearly see the results in the browser as well as dev tools.
Question: How can I get the name of the assets from that webpage?
3