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.
 

Need help with ESI API

Author
Ideki
Wolf Brothers INC
United Neopian Federation
#1 - 2017-05-19 14:49:45 UTC
Hi,

I would need some help from a dev, or someone with heavy knowledge of the ESI api.

I getting the sell/buy order for specific commodities in specific regions
https://esi.tech.ccp.is/latest/markets/10000032/orders/?datasource=tranquility&order_type=all&page=1&type_id=2329


This works fine.

My problems are after that.

First I need the system the order is in.
So I have to do a second call to get the system id of the station
https://esi.tech.ccp.is/latest/universe/stations/60011866/?datasource=tranquility


That's when the first problem arise.
Sometime the location_id blows up the second call because it actually refers to a player structure instead of a NPC station.
And that call only works for NPC stations.
So far I have found no way to distinguish a NPC station from a Player station using only the previous call.
Which mean that I have to do the call no matter what, and when it blows up, then I have to do a third call.
https://esi.tech.ccp.is/latest/universe/structures/1024235980117/?datasource=tranquility


Which then will give me the system ID

Is there a better way to do what I want ? (get orders by system, or at least get the system ID for the order)

NOTE/Suggestion to Devs:
Would be nice to be able to get the system ID directly in the buy order
If not possible, then tell us if the location_id points to a NPC station or a Player station.
Blacksmoke16
Resilience.
#2 - 2017-05-19 22:54:24 UTC
The issue you are running into does not have to do with an NPC versus player station.

The issue is that the endpoint you have is used for the legacy stations while there is another endpoint for the structures. Which you found out.

The size of each ID will tell you what type it is, so you could do something like this:

    if id > 1000000000000
      location = get_structure_data(id)
    else
      location = get_station_data(id)
    end


Ideki
Wolf Brothers INC
United Neopian Federation
#3 - 2017-05-20 00:50:16 UTC
Blacksmoke16 wrote:
The issue you are running into does not have to do with an NPC versus player station.

The issue is that the endpoint you have is used for the legacy stations while there is another endpoint for the structures. Which you found out.

The size of each ID will tell you what type it is, so you could do something like this:

    if id > 1000000000000
      location = get_structure_data(id)
    else
      location = get_station_data(id)
    end




I had guessed that I could use something like this, I just did not know what was the cutting point.
Thanks.

So there is no way to get the systemID directly from the market order?
I really need to do a second call to get the info from the location_id ?
That's a bummer.
Blacksmoke16
Resilience.
#4 - 2017-05-20 02:21:44 UTC
AFAIK yes. You could make an issue about it, but pretty sure they want to keep the data normalized except for really good reasons.
Ideki
Wolf Brothers INC
United Neopian Federation
#5 - 2017-05-20 03:32:44 UTC
Blacksmoke16 wrote:
AFAIK yes. You could make an issue about it, but pretty sure they want to keep the data normalized except for really good reasons.


A good reason?
it would reduce the number of calls, thus alleviate the load on the server Big smile