These forums have been archived and are now read-only.

The new forums are live and can be found at https://forums.eveonline.com/

EVE Technology Lab

 
  • Topic is locked indefinitely.
 

Corp API

Author
Alenn G'kar
Deep Core Mining Inc.
Caldari State
#1 - 2015-01-11 15:57:36 UTC  |  Edited by: Alenn G'kar
Hello I would like to ask how can I pull data from
/corp/WalletJournal.xml.aspx?(key vc char ID)& accountKey=1003 rowCount=2560 RefID=10547310638

I am working in EXCEL because I am an rookie in PHP / Python so I can only work in VBA yet.

Main problem is that It is fetches all data by RefTypeID (or even randomly). I've read some posts here, but it's all in php and I need only
RefTypeID = 37 "Corporation Account Withdrawl" or If it posible, can I filter whole pull by URL anyhow different? Like by NameArg, ect ?

http://prntscr.com/5r6vll

Thank you for any ideas.
qu1ckkkk
The Warp Core Stabilizers
#2 - 2015-01-11 16:04:19 UTC
I dont think the RefID argument you are specifying is even considered from CCP's side. Also don't think there is any type of filtering except for limiting the amount of transactions you get back.

Proud developer of SeAT! A Simple Eve API & Corporation Management Tool.

Project Page: https://github.com/eveseat/seat

Hel O'Ween
Men On A Mission
#3 - 2015-01-11 17:16:42 UTC
qu1ckkkk wrote:
I dont think the RefID argument you are specifying is even considered from CCP's side. Also don't think there is any type of filtering except for limiting the amount of transactions you get back.


Right on both accounts.

Alenn, the way to handle the XML API is to download the whole XML, than filter the data you want/need with an XPath query. For VBA, you wnat to try MSXML. Add a reference to it in your project.

See if this helps as a starting point: https://github.com/HelOWeen/eveExcel

EVEWalletAware - an offline wallet manager.

Dragonaire
Here there be Dragons
#4 - 2015-01-11 17:20:18 UTC
Qu1ckkk is correct there aren't any filters on the XML API you use. You can limit how many rows you get everything else you have to do yourself in the xml yourself.

Finds camping stations from the inside much easier. Designer of Yapeal for the Eve API. Check out the Yapeal PHP API Library thread.

Alenn G'kar
Deep Core Mining Inc.
Caldari State
#5 - 2015-01-11 18:59:02 UTC
Dragonaire wrote:
Qu1ckkk is correct there aren't any filters on the XML API you use. You can limit how many rows you get everything else you have to do yourself in the xml yourself.


Limit is 2560 rows! Result is that needed rows are skipped :(
In wiki dev is some way to "walking behind/from" due to RefID, but RefID seems like random number to me.
Dragonaire
Here there be Dragons
#6 - 2015-01-12 01:42:58 UTC
https://neweden-dev.com/API might be helpful. The result you get back is not sorted so you'll have to do that yourself to find the lowest RefID to use when trying to walk the API back for older rows. Also many people find they can't go back more than about a year on the transaction so keep that in mind as well.

Finds camping stations from the inside much easier. Designer of Yapeal for the Eve API. Check out the Yapeal PHP API Library thread.

Hel O'Ween
Men On A Mission
#7 - 2015-01-12 14:22:22 UTC  |  Edited by: Hel O'Ween
Alenn G'kar wrote:
Dragonaire wrote:
Qu1ckkk is correct there aren't any filters on the XML API you use. You can limit how many rows you get everything else you have to do yourself in the xml yourself.


Limit is 2560 rows! Result is that needed rows are skipped :(
In wiki dev is some way to "walking behind/from" due to RefID, but RefID seems like random number to me.



OK, here's how to do it. I've ripped the parts out of EWA's wallet journal handling. Untested, just to illustrate how to do the "wallet journal walking dance" and keep track of the lowest refID: https://gist.github.com/HelOWeen/22cda2f9d4f6f1b495ec

Remember that it's untested and just to illustrate how to walk.

I've also published EWA's complete source code (see my signature). Albeit the code's pretty old and not up to date, you might still be able to rip needed parts out of it. EWA's written in VB6 = VBA, so that should make it easy for you to use in your Excel sheet.

HTH,
Hel

EVEWalletAware - an offline wallet manager.

insidious Evils
East Khanid Trading
#8 - 2015-01-12 21:01:53 UTC  |  Edited by: insidious Evils
Alenn G'kar wrote:
Dragonaire wrote:
Qu1ckkk is correct there aren't any filters on the XML API you use. You can limit how many rows you get everything else you have to do yourself in the xml yourself.


Limit is 2560 rows! Result is that needed rows are skipped :(
In wiki dev is some way to "walking behind/from" due to RefID, but RefID seems like random number to me.


Its not actually random. However, the order in which the entries are ordered in the xml IS random. What you need to do is sort the refID to get the YOUNGEST ref id. You then pass this using the fromID arg in your next query and it will pull another 2560 rows if there are that many.

There is only 1 months worth of data you can get however. Forward walking the journal is done by omitting the fromID from the request, in which case you get 2560 rows of the LATEST data. Backwards walking is done with the fromID using the youngest refID as mentioned above.
Alenn G'kar
Deep Core Mining Inc.
Caldari State
#9 - 2015-01-12 22:02:31 UTC  |  Edited by: Alenn G'kar
Dragonaire yes I am using that site and limit is one month

insidious Evils so fromRefID is for walking forward and beforeRefID is walking backward? But how do you know what number should you use? It's 7 digits.

Hel O'Ween hmm thank you

I think that CCP should make COPR/ALI UI, roles, divisions maybe API after that whine at forum in next release, so I am not gonna make some big work with it so far.
Hel O'Ween
Men On A Mission
#10 - 2015-01-13 14:52:42 UTC
Alenn G'kar wrote:

insidious Evils so fromRefID is for walking forward and beforeRefID is walking backward? But how do you know what number should you use? It's 7 digits.


Nope.

There's no beforeRefID parameter, only fromRefID. You always walk backwards.

1) Query WalletJournal XML without parameter fromRefID = API provides the newest journal data.
2) Parse that XML, remember the lowest (=oldest) refID
3) Provide the above refID with the parameter fromRefID for the next API query = API gives you 2,560 older items, starting from that refID
4) Repeat steps 2) and 3) until the API returns an error (along the lines of "no more data")

You might fine tune step 3) by comparing your newest refID to the API's oldest refID = you "catched up" on all newer data. I personally download all data the API provides, not stoping at the first hit. And that's how the sample cvode above works. That way, I might spot/add the occacional "didn't import it before for whatever reason" missed journal entry. This might especially necessary whan API bugs are fixed, see the topic on missing corp dividend payments. Once that has been resolved, the API might provide the older journal entries and stopping at the first "hit" might make you miss those.

EVEWalletAware - an offline wallet manager.

Alenn G'kar
Deep Core Mining Inc.
Caldari State
#11 - 2015-01-13 16:09:01 UTC
Hel O'Ween Ahh thx I get it now.