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.
 

API question

Author
Katavo Semah
Minds of Murderers
OnlyHoles
#1 - 2013-11-15 20:55:36 UTC
Hello there!

I've been looking into the API a little bit and am wondering if a certain functionality could be establishing:

A corporation wants to see how much has been paid in taxes to them over a certain specific time period, by specific members.

Is it possible to draw this information from the API efficiently without having to manually look through each and every members contributions, etc?

For instance, say the corporation with 10 members wanted to see how much each member has paid to the corporation in taxes in the last month (not beyond the past month, just that month specifically.). Is it possible to get a readout somewhat like (but not exactly of course...)

Member 1 | Time Period | Total Amount Paid
Member 2 | Time Period | Total Amount Paid
Member 3 | Time Period | Total Amount Paid
Member 4 | Time Period | Total Amount Paid
Member 5 | Time Period | Total Amount Paid
Member 6 | Time Period | Total Amount Paid
Member 7 | Time Period | Total Amount Paid
Member 8 | Time Period | Total Amount Paid
Member 9 | Time Period | Total Amount Paid
Member 10 | Time Period | Total Amount Paid
Elmore Jones
New Eden Mining Organisation
The Craftsmen
#2 - 2013-11-15 23:31:46 UTC
API : Corp Wallet Journal would be a good place to start.

+++ Reality Error 404 - Reboot Cosmos +++

Abdiel Kavash
Deep Core Mining Inc.
Caldari State
#3 - 2013-11-16 13:38:51 UTC  |  Edited by: Abdiel Kavash
It's very unlikely you can get something like this to work with just a simple spreadsheet. The reason is that the wallet API only returns one month's worth of data. This means that if you call it today, you will only get entries from 10/16 onwards. You'd only be able to get a full month's report if you called it exactly at the end of the month. (And even then I have a feeling that CCP defines "a month" as 30 days, so sometimes you wouldn't get data from the 1st.)

The second roadblock you will hit is that the API will only return up to 2650 entries at once. If you have more than that (and if you are moderately active in PvE you will have more than that in a month), you will need to use journal walking to get older entries, which is quite difficult to set up correctly in a spreadsheet.


To do what you want requires periodically checking the data every once in a while and writing them into a database. Then you can run (relatively simple) queries on that database to get what you want. Or you could use some wallet monitoring software, some of them come with this utility. Unfortunately I don't use something like this, so I can't recommend any.

Alternatively, if you are okay with only data from the last week, it's not that hard to get it in GDocs. (Well, you'd need to learn to use GDocs queries which are the worst documented thing in the entire universe, but I could help you with that.)
Triage Trogdor
Doomheim
#4 - 2013-11-16 18:40:24 UTC
You can indeed do this very easily, this post actually got me into looking into it and I learned all about the Pivot Table in Excel, and its so nice :D

The issue here like people said is its not easy to do this simply because of the fact that you have to do journal walking for large amounts of journal transactions. Once you learn how to do journal walking if needed (google it) you're ready to start.

Taxes all end up in the master wallet, so its the only one you need to look at. Using CSV format for the wallet entries by typing .CSV in the API url instead of .XML will give you the correct row/column setup right from the start for all of your information.

You then put this information into an Excel sheet. This is where work is needed if you have alot of journal entries and have to use the journal walking. There may be an easier/automated way to do this, but I've yet to see any effective ones, so I paste all of the information from the API pull into a sheet and make it a table. I then do the journal walk, take that information and add it to the end of the table, and keep going as needed. Just remember you only have one months worth of data, so maybe keep up with it every 2 weeks or whatever you like, so that you dont miss any entries.

The cleanest way to do this is probably have two Excel sheets for each month, one with all the raw data, and one with a PIvot Table. If you select all of the raw data, and go to the top and select "Insert" and then "Pivot Table" it creates a table that you can very easily organize for any information you are looking for.

For taxes specifically you would select "refType" "ownerName2" "amount" for your fields. You can then drag the fields to different parts areas of the table such as: Filters, Columns, Rows, and Values. If you drag "Sum of Amounts" to "Values", "ownerName2" to "Rows", and "refType" to "Filters", you'll get exactly what you want.

At the top of your chart you'll have a dropdown box for filters. Since you set the "refType" as a filter, you'll be able to select only the ones you want to look at. Which would be "Bounty Prizes", "Agent Mission Reward", "Agent Mission Time Bonus Reward". You'll then have a table that shows how much each person has paid in taxes. :D

This is using Excel 2010, but im sure it works in 07 as well. Long explanation, but I hope it made sense!