ESI Pages

(Minerva Arbosa) #1

How does one figure out from the ESI calls how many pages to ask for in end points such as /markets/{region_id}/types or other ESI calls which you have to declare what page you are seeking? Any one able to point me in the right direction or let me know it would be appreciated.

(CCP Zoetrope) #2

We actually published a blog about this recently!

(Golden Gnu) #3

Note that the wallet endpoints, also, does not have x-pages (they use fromID).
You need to continue until you get an empty result. Due to a bug ( you also have the check that the current page does not match the last or you may end up with a never-ending-loop.

(Minerva Arbosa) #4

CCP Zoetrope, thank you for the help.

Reading the blog makes more sense now for writing the code to access those end points with pagination.

Just for reference, which might also help other developers in the future, the Try It Out! feature on does not actually display the header X-Pages even though it displays much of the other header information.

(CCP Zoetrope) #5

@Minerva_Arbosa I’m not sure what you mean about the Try it Out! feature not displaying the header X-Pages. It is displayed both in the documentation and when you click “Try It Out!”:

But if you do find a case where there’s an endpoint that has X-Pages but it is not displayed in the documentation please let us know here :).

(Minerva Arbosa) #6

CCP Zoetrope, I was talking about on the page where you linked your picture from. There is a button at the bottom of each end point where you can try the end point out in your browser which displays all of the header information you should see and the data for the parameters which were put in. It’s really helpful when coding new features into libraries and such.

(Blacksmoke16) #7

He is probably using an endpoint that doesn’t that header yet. I.e. one of these:!/Contacts/get_characters_character_id_contacts!/Corporation/get_corporations_corporation_id_structures!/Market/get_markets_structures_structure_id!/Universe/get_universe_groups!/Universe/get_universe_types!/Wars/get_wars_war_id_killmails

(Minerva Arbosa) #8

I was using the markets/{region_id}/orders end point. Which is supposed to have the X-Pages header, but when getting the header information from X-Pages doesn’t show up. I have already submitted an issue on github about it. It’s not the only header having an issue when you look at the issues section.

(Blacksmoke16) #9

Strange, because if i use that in chrome or postman i can see the headers, but in Curl it isn’t there. Have to see what the devs can figure out.

(Zeke Darkweaver) #10

It appears that X-Pages is not included if the result set is < 10k (i.e a single page).

If you do all market orders for say Jita 4-4 with no type ID (i.e every order for every typeID) for sells. The X-Pages header shows.

If you look for a specific type ID for sells for example, there is no header, I suspect due to it being a single page.

The way around this would probably be to check the header is set, and if so, continue pagination, if not just ignore pagination code.

(system) #11

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