Discussion: New methods - Economic history Staff Topic

I've just added two new methods to the API:
* http://developer.glitch.com/api/explore/#!economy.recentSDBs
* http://developer.glitch.com/api/explore/#!economy.recentSales

economy.recentSDBs returns the latest status of all SDBs selling things in-game. It returns up to 24 hours of (paged) data. You can use the since argument to periodically poll and read changes. A quantity & price of zero indicates that the SDB is no longer selling items.

economy.recentSales returns the latest in-game sales from auctions and SDBs. It is paged and limited in the same way. By reading the stream, you can track which items are being sold at which prices.

After you've tracked this data for a few days you can build some good visualizations from it. Here's a very simple one: http://i.imgur.com/iPGsV.png
WOW!.... Thanks!!
location_type=interior... means "inside the house"?

recentSales()... includes auctions!!! Thanks!!
in recentSDBs()... we have the sdb_tsid twice... and we don't know in which streetId is placed that sdb. please tell me this is not by design...
another question, in auctions methods, the "id" was the "PlayerId-Number"... here recentSales() has only the "Number". is that number "unique"? I though that the auction id had the PlayerId too, because it wasn't unique.

TIA
"location_type=interior" - yes, inside a house. types are "interior, exterior, tower", although exterior wont show up here.

"in recentSDBs()... we have the sdb_tsid twice" - once as the key and once in the object. yeah. it'll always be equal

"we don't know in which streetId is placed that sdb" - i've added that now (along with the owner TSID)

"is that number "unique"?" this is a different ID, unrelated to the auction ID. it is unique within that API method.
Thanks!
in economySales()... can we have at least the "date_sold" datetime for auctions so we can calculate how long the item was in the AH? ..... please? :)

note: I assume this is not possible in SDBs... or it is?

TIA
BTW... the "since" parameter makes the whole difference... now everything is fast!!
and... sorry... but one more thing, what about adding the ownerTsid of the auction and sdb sale on each economySales() item?

Thanks :)
Not planning to add that information (buyer or seller TSID) just yet - keeping the full sales information semi-anonymized
I've renamed `date_create` to `date_sold` since that's what it actually is. I've also changed the type on the date, quantity and cost fields to numbers, since it was dumb that they weren't.
Ok. if the field is really date_sold... it is ok that we use param "since" to filter for that field? it is "since" param, comparing to field date_sold too?

note: if we could have date_created too... that would be really good :)

again... thanks!
Yes, `since` is comparing against the same field as `date_sold`.

We're not tracking the date the item was put on sale, since it rarely makes sense for SDBs. If an SDB had 100 stock, then had 50 purchased, then was restocked to 80, then had 70 purchased, what was the start time of each purchase?
sorry... I mean only on Auctions... I would like to start using only the new api, and stop (in steps) to use the old one (for auctions).
+1 Most definitely Thank you! I am going to give my try at a Web app.
It seems like there are a few bugs. One thing that I have found is that if you remove all items from an SDB that has a price set, the API doesn't tell us about it. Here are the steps to recreate this problem:

1. Shove some items into an SDB
2. Set the price for the item
3. ....wait a minute or two for an update.....
4. Remove all items from the SDB
5. ....wait a minute or two for an update.....
6. No update that the items were removed: item is still on my app with full quantity and price
yes, I saw the same problem:

Test Cases:
* "stop selling" button: reported OK
* "stop selling" button, then remove everything from SDB, let the SDB on the wall: reported OK
* remove everything from SDB (the owner), and let the SDB on the wall: NOT reported on the API!
* remove everything from SDB (other player, not the owner), and let the SDB on the wall: reported OK
* remove everything from SDB, remove the SDB from the wall and put it again on the wall: NOT reported
* the price is $999777, I then set a new price "0" cero... reports ok. it reports that the new price is 0, with qty=0.

the SDB I used is sdbTsid: BHV2208095V27BA

so, yes, the problem is when the "owner" removes everything and it has a price.
Thanks for the report - I'll get that fixed.
How about getting some item_defs like in auctions.list?
@scragz +1

That would be nice. I've come access a few items that I don't have in my database.

Thank you for providing the Glitch API for us developers to use! I have been having a lot of fun with it. =)
After a few tests this morning, I have found that the bug that UXRoot and I submitted has not been fixed. Can we get an update on the status of this bug, please?
so... the bug is fixed! (just checked all cases)
The economy methods can now optionally return item defs