Eveswagger Market Data

I’m trying to build a marketing tool in excel using eveswagger. I have it figured out and functioning; the problem I’m having is that the " /markets/{region_id}/orders is limited to only returning 1000 rows; is there anyway to change this through power query or another tool? Under Code 200 it says: maxItems: 1000

Any ideas?

Thanks.

It’s 1,000 items per page. ESI includes an X-Pages header within the response that you should use to know how many times to iterate to fetch the other pages. I.e. if that header returns "5", you would want to do 4 more additional requests like:

/markets/{region_id}/orders?page=2
/markets/{region_id}/orders?page=3
/markets/{region_id}/orders?page=4
/markets/{region_id}/orders?page=5

Thank’s, but I’m using the query from website; not the response body; how would I do what you suggest?

Not sure I follow. If you’re not using the request body then how you are getting the data into your sheet? This is kinda related to ESI Excel login. However I’m not familiar with Power Query so I don’t have any suggestions on how to access response headers.

I’m pulling data from the “Request URL” and pasting that in the query from web in excel; this will allow a live feed; how would you suggest doing it?

This is what I’m using

Right, which would only get you the first page. You’ll need to iterate n times to get all the pages of data. Either by figuring out a way to access the first response’s headers and use the X-Pages header, or by hard-coding a value, like that other thread suggests.

It seems in order to get the response headers you would have to create a custom data connector? See https://community.powerbi.com/t5/Desktop/Retrieve-API-response-headers/m-p/641107/highlight/true#M307053.

EDIT: If all you really want to do is get price data on a set of items; I would suggest to just use an existing API like https://market.fuzzwork.co.uk/api/.

Thanks for the help; that link is for powerbi, not excel. I’ve used fuzzwork before but it’s hard to create relationships like you can in excel through queries & pivots. The only thing that I can edit in excel is this:

= Table.ExpandRecordColumn(#“Converted to Table”, “Column1”, {“duration”, “is_buy_order”, “issued”, “location_id”, “min_volume”, “order_id”, “price”, “range”, “system_id”, “type_id”, “volume_remain”, “volume_total”}, {“Column1.duration”, “Column1.is_buy_order”, “Column1.issued”, “Column1.location_id”, “Column1.min_volume”, “Column1.order_id”, “Column1.price”, “Column1.range”, “Column1.system_id”, “Column1.type_id”, “Column1.volume_remain”, “Column1.volume_total”})

you can use the evermarketer API.

It allows you to make only one call to get up to 200 item informations.

Of course the data is limited.

Yeah, I started with that but it is severely limited.

depends on what you want. will still work out of the box, while your trying to mix ESI and excel may take some time.

Right, but do they not use the same functions. I.e. it’s also using Web.contents which is what you are using in excel no?

You can loop through pages until no data return

My similar script is down below

let
GetJson = (Url) =>
    let 
        RawData = Web.Contents(Url),
        Json    = Json.Document(RawData)
    in  Json,

region_id= "10000002",
api_url = "https://esi.evetech.net/latest/markets/" & region_id & "/orders/?page=",

Source = List.Generate(()=> [ i = 2, temp = GetJson(api_url & Number.ToText(1))] ,
         each List.Count([temp]) > 0,
         each [i = [i] + 1,
               temp = GetJson(api_url & Number.ToText([i]))] ,
         each [temp]),
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Expanded Column1" = Table.ExpandListColumn(#"Converted to Table", "Column1"),
#"Expanded Column2" = Table.ExpandRecordColumn(#"Expanded Column1", "Column1", {"duration", "is_buy_order", "issued", "location_id", "min_volume", "order_id", "price", "range", "system_id", "type_id", "volume_remain", "volume_total"}, {"duration", "is_buy_order", "issued", "location_id", "min_volume", "order_id", "price", "range", "system_id", "type_id", "volume_remain", "volume_total"})  in  #"Expanded Column2"

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