API connection with python
Hello,
Not sure where to post this. I am learning some API access with Python and thought it would be fun to get my character data. I did a simple request: req = request.get('http//www.pathofexile.com/character-window/get-characters?accountName='+MyAccountName) I am getting an access denied error. Not sure if there is certain params/header I need to pass into it? if I print this link out in the terminal it does take me right to the JSON file on the web browser. Last bumped on Jan 21, 2021, 5:01:35 PM
| |
Also I have done it this way and still comes back with access denied error:
params = {'accountName': 'Kiznilian'} requestURL = self.settings['characterURL'] #this the url https://api.pathofexile.com/character-window/get-characters req = requests.get(requestURL, params=params) Response back is : Forbidden, access denied. | |
Means your id expired, you need to be logged in to get to some routes
|
|
In case you haven't seen this thread, it contains useful information.
https://www.pathofexile.com/forum/view-thread/1212138/page/4 You might also want to inspect the code of Procurement and Acquisition in order to get some ideas. Bird lover of Wraeclast
Las estrellas te iluminan - Hoy te sirven de guía Te sientes tan fuerte que piensas - que nadie te puede tocar |
|
Thanks, figured it out.
You said you need to login and I was wondering how does it know which browser's cookies to use. just put the heads in the request of the browser you are logged into. headers = {'user-agent': 'Mozilla/5.0'} | |
Please set a User-Agent header with your tool / contact information so that we can reach out if there are any problems.
✮
Web Developer ✮ View our Developer Docs ✮ |