Pages: [1] :: one page |
|
Author |
Thread Statistics | Show CCP posts - 0 post(s) |
Ideki
E.A.D Alliance
240
|
Posted - 2017.05.19 14:49:45 -
[1] - Quote
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.
Creator of The EVE Planetary Planner
|
Blacksmoke16
Resilience.
64
|
Posted - 2017.05.19 22:54:24 -
[2] - Quote
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
E.A.D Alliance
240
|
Posted - 2017.05.20 00:50:16 -
[3] - Quote
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.
Creator of The EVE Planetary Planner
|
Blacksmoke16
Resilience.
64
|
Posted - 2017.05.20 02:21:44 -
[4] - Quote
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
E.A.D Alliance
240
|
Posted - 2017.05.20 03:32:44 -
[5] - Quote
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
Creator of The EVE Planetary Planner
|
|
|
|
Pages: [1] :: one page |
First page | Previous page | Next page | Last page |