# Using ESI /markets/{region\_id}/history/

**URL:** <https://forums.eveonline.com/t/using-esi-markets-region-id-history/173630>\
**Category:** Third Party Developers\
**Tags:** esi, tool, devblog\
**Created:** [July 9, 2019, 5:44pm UTC](https://forums.eveonline.com/t/using-esi-markets-region-id-history/173630 "2019-07-09T17:44:31Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Churra\_Despotis](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/churra_despotis/32/165781_2.png) [@Churra\_Despotis](https://forums.eveonline.com/u/Churra_Despotis)\
**Post date:** [July 9, 2019, 5:44pm UTC](https://forums.eveonline.com/t/using-esi-markets-region-id-history/173630/1 "2019-07-09T17:44:32Z")

</div>

When using markets/{region\_id}/history/ ESI I’m slightly confused on what the actual key: values are (i’m using python). Is order\_count the total orders sold or just total orders placed AND sold? I’m trying to get a total number of items sold actually and not sure how to do it. I’m pretty sure that ‘volume’ is the total items on the market so I should have that covered. I’m also trying to figure out how to do a 7 day history in python (I’m doing this as a python learning experience) using today -7 days if anyone wants to comment on that.

---

<div class="post-metadata">

**Author:** ![salacious\_necrosis](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/salacious_necrosis/32/136554_2.png) [@salacious\_necrosis](https://forums.eveonline.com/u/salacious_necrosis)\
**Post date:** [July 9, 2019, 10:21pm UTC](https://forums.eveonline.com/t/using-esi-markets-region-id-history/173630/2 "2019-07-09T22:21:32Z")

</div>

If I remember correctly, order\_count is the number of trades for the day (i.e. orders filled) and volume is the number of items which were bought or sold (which seems to be what you’re looking for).

---

<div class="post-metadata">

**Author:** ![Churra\_Despotis](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/churra_despotis/32/165781_2.png) [@Churra\_Despotis](https://forums.eveonline.com/u/Churra_Despotis)\
**Post date:** [July 10, 2019, 3:53pm UTC](https://forums.eveonline.com/t/using-esi-markets-region-id-history/173630/3 "2019-07-10T15:53:32Z")

</div>

@salacious_necrosis Thanks for answering, but isn’t “orders filled” and “bought” and “sold” all the same from the view of a seller?

---

<div class="post-metadata">

**Author:** ![salacious\_necrosis](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/salacious_necrosis/32/136554_2.png) [@salacious\_necrosis](https://forums.eveonline.com/u/salacious_necrosis)\
**Post date:** [July 10, 2019, 4:41pm UTC](https://forums.eveonline.com/t/using-esi-markets-region-id-history/173630/4 "2019-07-10T16:41:53Z")

</div>

Not sure what you mean, but here’s an example of what I mean:

Suppose there is a sell order listed on the market for 1000 Tritanium at 10 ISK.

Suppose a buyer comes along and buys 500 Tritanium by selecting the existing sell order. What actually happens is that EVE creates and posts a buy order for 500 Tritanium at 10 ISK which instantly matches the sell order.

After this transaction:  
order\_count = 1 (the buyer’s order which completed)  
volume = 500

Now another buyer comes along and buys the next 500 Tritanium. Another buy order is posted and fully consumes the seller’s order.

After this transaction:  
order\_count = 2 (possibly 3 since sell order now completely filled, not clear from scant CCP docs)  
volume = 1000

Hope that clears things up.

---

<div class="post-metadata">

**Author:** ![Churra\_Despotis](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/churra_despotis/32/165781_2.png) [@Churra\_Despotis](https://forums.eveonline.com/u/Churra_Despotis)\
**Post date:** [July 10, 2019, 4:44pm UTC](https://forums.eveonline.com/t/using-esi-markets-region-id-history/173630/5 "2019-07-10T16:44:58Z")

</div>

@salacious_necrosis Ah, THANK YOU for clearing that up! I’ve been seeing this all wrong. Well, thats going to change my python coding some. You’re awesome!

So is there a way to get total volume on the market per day?

---

<div class="post-metadata">

**Author:** ![salacious\_necrosis](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/salacious_necrosis/32/136554_2.png) [@salacious\_necrosis](https://forums.eveonline.com/u/salacious_necrosis)\
**Post date:** [July 10, 2019, 8:45pm UTC](https://forums.eveonline.com/t/using-esi-markets-region-id-history/173630/6 "2019-07-10T20:45:25Z")

</div>

For a given market type, the “volume” field of the ESI history result is the total volume for a given day. If you sum that across all market types, you can compute the total volume for all items for a given day.

You may find it useful to compare your computations with the data on [this](https://www.adam4eve.eu/tradeVol_type.php) site. For example, you can compute a 30 day average and see if it agrees with the data published on A4E site. That would give you some validation that you’re on the right track.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/eveonline/original/3X/4/1/41ec4921cbaca7a6f9ea556e7cc20018461eae5e.png) [@system](https://forums.eveonline.com/u/system)\
**Post date:** [October 8, 2019, 8:45pm UTC](https://forums.eveonline.com/t/using-esi-markets-region-id-history/173630/7 "2019-10-08T20:45:26Z")

</div>

Closed on October 8, 2019, 8:45pm UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
