# L'API /directory\_items.json restituisce un link errato per la pagina successiva

**URL:** <https://meta.discourse.org/t/directory-items-json-api-returns-wrong-link-for-next-page/96268>\
**Category:** Product Support\
**Created:** [3 Settembre 2018, 1:03pm UTC](https://meta.discourse.org/t/directory-items-json-api-returns-wrong-link-for-next-page/96268 "2018-09-03T13:03:26Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![cebe](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cebe/32/119560_2.png) [@cebe](https://meta.discourse.org/u/cebe)\
**Post date:** [3 Settembre 2018, 1:03pm UTC](https://meta.discourse.org/t/directory-items-json-api-returns-wrong-link-for-next-page/96268/1 "2018-09-03T13:03:26Z")

</div>

I am trying to get post counts from the discourse API via the [/directory\_items.json](https://docs.discourse.org/#tag/Users%2Fpaths%2F~1directory_items.json%3Fperiod%3D%7Bperiod%7D%26order%3D%7Border%7D%2Fget) endpoint.

The API returns a URL for retrieving the next page of items, however the URL I see is `/directory_items?order=post_count&page=1&period=all` while I expected the URL to include the `.json` extension: `/directory_items.json?order=post_count&page=1&period=all`.

As far as I see this is a bug, the API should return the URL for the next page for the format which I am currently using in the API request (json) and not the URL for the HTML page.

I am currently using discourse v2.1.0.beta5.

---

_[View the full topic](https://meta.discourse.org/t/directory-items-json-api-returns-wrong-link-for-next-page/96268)._
