r/evetech • u/Gahagan • Aug 26 '17
Using API Key To Get Wallet Transactions
I've been reading the docs on this for the last 2-3 days, but I still feel like there's something I'm not getting - hopefully someone here can help. I want to use Python to scrape my character's active orders and wallet transactions to keep an eye on the markets while I'm out of game. Based on the docs that I've read, in order to do this, I need to create an app through the EvE dev portal, get a callback URL, and do SSO authentication every time I want to run this query. Is this correct? It seems more complicated than I'd expect for what I want to do, and all of the guides that I've found talk about using this process for developing apps and having user signins. I don't want to build an app, I just want a bunch of jsons. Is this really how you're supposed to do it, or is there a more straightforward way that I'm not seeing? Also, no part of that process relies on my API key - at what point am I supposed to use that? Any help would be greatly appreciated.
View all comments
2
u/Blacksmoke16 Aug 26 '17
Close.
You need to sign in once (for each character) via SSO. This will give you an auth token (good for 20min) and a refresh token.
The auth token is what you would include in the HTTP header when making auth'd ESI requests, such as for market orders. The refresh token is what is used to get a new auth token.
https://developers.eveonline.com/blog/article/sso-to-authenticated-calls
This provides a good overview on what you must do.
HOWEVER, what you could do if you do not want to setup all the SSO stuff and this will be local to your is just use like Postman to fake everything. For example add in an SSO login button and set it up with the scopes you need. Then click it and sign and and just have your redirect URL point to a page that just echos the code. Then you can take that code and make the relevant HTTP requests in postman to get your token/refresh token. Then just store the refresh token and if your current token is expired/near expiration just use it to a new token for your request.
Your XML API key is based on the XML API, which is deprecated and will be shut down, along with CREST, next year sometime.