# Retrieve Page Count from JSON Headr

**URL:** <https://forums.eveonline.com/t/retrieve-page-count-from-json-headr/389222>\
**Category:** Third Party Developers\
**Created:** [December 23, 2022, 5:31am UTC](https://forums.eveonline.com/t/retrieve-page-count-from-json-headr/389222 "2022-12-23T05:31:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tamara\_Yaken](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/tamara_yaken/32/347695_2.png) [@Tamara\_Yaken](https://forums.eveonline.com/u/Tamara_Yaken)\
**Post date:** [December 23, 2022, 5:31am UTC](https://forums.eveonline.com/t/retrieve-page-count-from-json-headr/389222/1 "2022-12-23T05:31:20Z")

</div>

After a ridiculous amount of googling and experimenting I can not figure out how to retrieve X-pages data from the JSON Header using PHP (For /markets/{region\_id}/orders/ ) I can do the rest of what I want, just can not solve this. Any tips, clues, help?

Thank you.

---

<div class="post-metadata">

**Author:** ![Golden\_Gnu](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/golden_gnu/32/459734_2.png) [@Golden\_Gnu](https://forums.eveonline.com/u/Golden_Gnu)\
**Post date:** [December 23, 2022, 11:43am UTC](https://forums.eveonline.com/t/retrieve-page-count-from-json-headr/389222/2 "2022-12-23T11:43:36Z")

</div>

It depends on what method you’re using to download from the endpoints.

---

<div class="post-metadata">

**Author:** ![Tamara\_Yaken](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/tamara_yaken/32/347695_2.png) [@Tamara\_Yaken](https://forums.eveonline.com/u/Tamara_Yaken)\
**Post date:** [December 23, 2022, 1:42pm UTC](https://forums.eveonline.com/t/retrieve-page-count-from-json-headr/389222/3 "2022-12-23T13:42:41Z")

</div>

$json = file\_get\_contents(‘[https://esi.evetech.net/latest/markets/‘.$nextRegion.’/orders/?datasource=tranquility&order\_type=all&page=](https://esi.evetech.net/latest/markets/'.%24nextRegion.'/orders/?datasource=tranquility&order_type=all&page=)’.$varPage);

```
$arrItems = json_decode($json, true);

```

---

<div class="post-metadata">

**Author:** ![Golden\_Gnu](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/golden_gnu/32/459734_2.png) [@Golden\_Gnu](https://forums.eveonline.com/u/Golden_Gnu)\
**Post date:** [December 23, 2022, 2:18pm UTC](https://forums.eveonline.com/t/retrieve-page-count-from-json-headr/389222/4 "2022-12-23T14:18:08Z")

</div>

In that case the header are in the `$http_response_header` variable  
[https://www.php.net/manual/en/reserved.variables.httpresponseheader.php](https://www.php.net/manual/en/reserved.variables.httpresponseheader.php)

Just in case you missed it, there are some really good php libraries, that may make things a fair bit easier.

> **[GitHub - devfleet/awesome-eve: A list of 3rd party Applications and Tools for...](https://github.com/devfleet/awesome-eve#php)**
>
> A list of 3rd party Applications and Tools for the awesome Eve Online MMO. - GitHub - devfleet/awesome-eve: A list of 3rd party Applications and Tools for the awesome Eve Online MMO.

---

<div class="post-metadata">

**Author:** ![Tamara\_Yaken](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/tamara_yaken/32/347695_2.png) [@Tamara\_Yaken](https://forums.eveonline.com/u/Tamara_Yaken)\
**Post date:** [December 23, 2022, 2:18pm UTC](https://forums.eveonline.com/t/retrieve-page-count-from-json-headr/389222/5 "2022-12-23T14:18:54Z")

</div>

Thank you so much.

---

<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:** [March 23, 2023, 2:19pm UTC](https://forums.eveonline.com/t/retrieve-page-count-from-json-headr/389222/6 "2023-03-23T14:19:24Z")

</div>

Closed on March 23, 2023, 2:19pm UTC

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