PoE API information?
" This isn't an issue of the API exposed, but rather how you choose to consume it. You don't need a browser to get a web page in JSON and parse its results. Almost every major language has libraries to do web fetches, and to parse JSON documents. Do some googling for your language of choice and you will no doubt find a wealth of information. For example, in C# or other .NET languages, you can use the WebRequest class. See for example http://stackoverflow.com/a/4510300/1130522 Similarly, for parsing JSON http://stackoverflow.com/questions/6620165/how-to-parse-json-in-c Last edited by saj14saj on Mar 5, 2015, 6:59:28 AM
| |
Thanks Michael and ChuanHsing for the information!
" Yup. my languages equiv to WebRequest is HTTPRequest (WinHttp.WinHttpRequest.5.1), but doing so returned the source of the login page even if I was already logged in. I'm guessing that's because I didn't pass any header info, just the url. Thus my program (different than my browser) wasn't logged in to get that needed JSON stuff (Which I already know how to parse). Will look into it more. rawr. fear me. Last edited by tidbit on Mar 5, 2015, 12:53:55 PM
| |
" two completely unrelated things. god knows I find the trade-centered design of loot annoying, but exposing an API for players to tinker with to get useful information, is a great move by GGG in my opinion. awesome move. definite thumbs up. and this thread, even though it likely sounds like Klingon to the vast majority of forum readers, is a great source of information for PoE tool developers. bookmarked. have fun, tidbit :) Alva: I'm sweating like a hog in heat Shadow: That was fun Last edited by johnKeys on Mar 5, 2015, 1:38:27 PM
| |
As far as I can tell the login URL is https://www.pathofexile.com/login according to the http header. It wants the variables 'login_email' and 'login_password'.
It would be nice with a documented API though. | |
" Yep. I played with header stuff and tried that. tried adding remember_me and login_submit too, still only returned the login page source. Doing some snooping it seems there is also a Hash that is generated. When I tried tossing that in I got something like "This hash was used by another session and expired" (something similar to that). So I think we might need to just wait for the devs to add features that don't require a login, as Michael said they plan on adding (or an API key). Unless someone more knowledgeable can help (and it doesn't upset the developers. What they allow will be up to them) " :D rawr. fear me. Last edited by tidbit on Mar 5, 2015, 3:06:46 PM
| |
" Hey Michael , tell your guys to use Swagger. Depending your REST implementation , you just have to output a swagger specification and host their embeded documentation site. http://swagger.io/ http://petstore.swagger.io/ Should take maximum 1 week man power to do this But as you have already released the game this should have been done long ago :P ^_^ | |
That's the API the character/stash viewer on the website uses. They were most likely discovered by logging the requests the browser makes when you play around with that feature. At least that's how I learned what I know about it.
As for the parameters: the easiest way to go is just mess around with them, check how the response changes, and guess. A better way would be reading the JS source of the website, that makes and parses those requests. "Word of mouth" is for people who never had to debug JS code :) Don't expect to find any unexpectedly useful information in there: it has just enough data to give us that basic display. While it's still useful for some tools, it does not expose anything you couldn't see in-game by hovering the item. Also, you will need a session cookie to access these for your account. The calls you make will be throttled after making a lot of requests (like 50 or 60 API "calls?") Procurement and Acquisition, and I think most other tools , use these APIs, and you could take a peek at their source to learn more about parsing the data returned. ChuanHsing's post has all the parameters I know of. |
|
" Great. It would really help 3rd party tools to make some tasks easier for users. Simple key based authentication would be sufficient. Example: The "Manage account" could have "Change API key" link added, on which page the current API key would be displayed together with "Generate key" button. Each time one presses button, the new key would be generated for an account. The API scripts then could look for URL parameter "apikey" to get hold of API key for a request. And this key based method could co-exist with existing session based method pretty much. | |
For clarity (and lazyness :p) you should take a look at RestSharp which is an stable HTTP library that handle cookies and sessions very easily. Your problem was probably that you weren't saving/keeping the cookies/sessions when you tried to log yourself.
| |
" i have successfully made login using a website using login_name, login_password, and hash. I did not get a go ahead from GGG to use it for security reasons. I agree with their reasons though. GGG already has steam login implemented. If we could somehow use that to login from a different website to PoE, it would help a lot. I need more purple titles
|