# Does datapoint pagination work correctly, is this a bug, or am I doing this wrong?

**URL:** <https://forum.beeminder.com/t/does-datapoint-pagination-work-correctly-is-this-a-bug-or-am-i-doing-this-wrong/6966>\
**Category:** Tech\
**Created:** [July 3, 2020, 1:44pm UTC](https://forum.beeminder.com/t/does-datapoint-pagination-work-correctly-is-this-a-bug-or-am-i-doing-this-wrong/6966 "2020-07-03T13:44:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![aliddell](https://avatars.discourse-cdn.com/v4/letter/a/3bc359/32.png) [@aliddell](https://forum.beeminder.com/u/aliddell)\
**Post date:** [July 3, 2020, 1:44pm UTC](https://forum.beeminder.com/t/does-datapoint-pagination-work-correctly-is-this-a-bug-or-am-i-doing-this-wrong/6966/1 "2020-07-03T13:44:24Z")

</div>

Is the `per` parameter at `/api/v1/users/u/goals/g/datapoints.json`? broken? If I use it in conjunction with `page`, I get a 500!

For example, if I send this GET: `/api/v1/users/aliddell/goals/drop-4-stone/datapoints.json?auth_token=D0th3M0n5t3Rm4sh!&page=2&per=24` I get my 500.

If I omit the `page` parameter: `/api/v1/users/aliddell/goals/drop-4-stone/datapoints.json?auth_token=D0th3M0n5t3Rm4sh!&per=24`, I get all 184 datapoints. This is expected behavior.

But if I keep `page` and just drop `per`, i.e., GET `/api/v1/users/aliddell/goals/drop-4-stone/datapoints.json?auth_token=D0th3M0n5t3Rm4sh!&page=2`, I get 25 datapoints back.

n.b.: unless it’s Halloween, you’re bound to be disappointed if you try to use `D0th3M0n5t3Rm4sh!` for my auth token. :^)

---

<div class="post-metadata">

**Author:** ![adamwolf](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.beeminder.com/adamwolf/32/484_2.png) [@adamwolf](https://forum.beeminder.com/u/adamwolf)\
**Post date:** [July 3, 2020, 5:41pm UTC](https://forum.beeminder.com/t/does-datapoint-pagination-work-correctly-is-this-a-bug-or-am-i-doing-this-wrong/6966/2 "2020-07-03T17:41:28Z")

</div>

The 500 is definitely an error in the API. I’ll file all of this on our bug tracker!

---

<div class="post-metadata">

**Author:** ![bee](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.beeminder.com/bee/32/41_2.png) [@bee](https://forum.beeminder.com/u/bee)\
**Post date:** [May 3, 2021, 6:45pm UTC](https://forum.beeminder.com/t/does-datapoint-pagination-work-correctly-is-this-a-bug-or-am-i-doing-this-wrong/6966/3 "2021-05-03T18:45:06Z")

</div>

This should be fixed now! (actually, as of July 29th 2020, according to git logs :-)).

[https://changelog.beeminder.com/#3488](https://changelog.beeminder.com/#3488)
