# API question: top 100 pages

**URL:** <https://forum.pirsch.io/t/api-question-top-100-pages/44>\
**Category:** General\
**Created:** [February 7, 2024, 3:00pm UTC](https://forum.pirsch.io/t/api-question-top-100-pages/44 "2024-02-07T15:00:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![KasperKamperman](https://forum.pirsch.io/user_avatar/forum.pirsch.io/kasperkamperman/32/29_2.png) [@KasperKamperman](https://forum.pirsch.io/u/KasperKamperman)\
**Post date:** [February 7, 2024, 3:00pm UTC](https://forum.pirsch.io/t/api-question-top-100-pages/44/1 "2024-02-07T15:00:32Z")

</div>

Hi,  
I was reading the API documentation. However I couldn’t really encounter a way of getting statistics on the most visited pages.

My idea is to get the nth (100, 500 for example) most visited pages the last 7 days.

---

<div class="post-metadata">

**Author:** ![Marvin](https://forum.pirsch.io/user_avatar/forum.pirsch.io/marvin/32/16_2.png) [@Marvin](https://forum.pirsch.io/u/Marvin)\
**Post date:** [February 7, 2024, 3:52pm UTC](https://forum.pirsch.io/t/api-question-top-100-pages/44/2 "2024-02-07T15:52:24Z")

</div>

Hi Kasper,

That’s easy, use the pages endpoint ([API | Pirsch Documentation](https://docs.pirsch.io/api-sdks/api#pages)) and set the filter accordingly ([API | Pirsch Documentation](https://docs.pirsch.io/api-sdks/api#filter)).

I also have an example using curl here: [pirsch-api-statistics-example.md · GitHub](https://gist.github.com/Kugelschieber/43876968d3f029d7d5a31c23a6f27b21) This includes the steps to get a token and the domain ID.

In your case, the URL would look something like this:

```auto
https://api.pirsch.io/api/v1/statistics/page?id=INSERT_DASHBOARD_ID&from=2024-02-01&to=2024-02-07&limit=100

```

The limit is hard coded to 100, so you would need to run multiple queries using the offset field to query more than 100 pages. Also, you can check your browser tab on our dashboard to see the URL. The dashboard also just uses the API.

---

<div class="post-metadata">

**Author:** ![KasperKamperman](https://forum.pirsch.io/user_avatar/forum.pirsch.io/kasperkamperman/32/29_2.png) [@KasperKamperman](https://forum.pirsch.io/u/KasperKamperman)\
**Post date:** [February 8, 2024, 7:56am UTC](https://forum.pirsch.io/t/api-question-top-100-pages/44/3 "2024-02-08T07:56:58Z")

</div>

The limit doesn’t seem hard-coded?  
Thanks for the curl example (pretty easy to translate to PHP curl like this with ChatGPT)

Below gives me 200 results (I don’t mind, but since you said it’s capped to 100).  
`https://api.pirsch.io/api/v1/statistics/page?id={$dashboardId}&from={$sevenDaysAgo}&to={$currentDate}&limit=200`

---

<div class="post-metadata">

**Author:** ![Marvin](https://forum.pirsch.io/user_avatar/forum.pirsch.io/marvin/32/16_2.png) [@Marvin](https://forum.pirsch.io/u/Marvin)\
**Post date:** [February 8, 2024, 9:13am UTC](https://forum.pirsch.io/t/api-question-top-100-pages/44/4 "2024-02-08T09:13:59Z")

</div>

Hmm, maybe the documentation is outdated, or this is a bug. I’ll check.

---

<div class="post-metadata">

**Author:** ![Marvin](https://forum.pirsch.io/user_avatar/forum.pirsch.io/marvin/32/16_2.png) [@Marvin](https://forum.pirsch.io/u/Marvin)\
**Post date:** [February 16, 2024, 12:50pm UTC](https://forum.pirsch.io/t/api-question-top-100-pages/44/5 "2024-02-16T12:50:24Z")

</div>

The limit does indeed not apply. We’ll keep it like that for now.
