# Limiting returned results

**URL:** <https://opendataforum.transport.nsw.gov.au/t/limiting-returned-results/2116>\
**Category:** App development\
**Created:** [September 9, 2020, 8:30am UTC](https://opendataforum.transport.nsw.gov.au/t/limiting-returned-results/2116 "2020-09-09T08:30:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arkhon](https://avatars.discourse-cdn.com/v4/letter/a/91b2a8/32.png) [@Arkhon](https://opendataforum.transport.nsw.gov.au/u/Arkhon)\
**Post date:** [September 9, 2020, 8:30am UTC](https://opendataforum.transport.nsw.gov.au/t/limiting-returned-results/2116/1 "2020-09-09T08:30:08Z")

</div>

Heya,

Is there a way to limit the amount of data returned? Say…the next 5 departures, or the next 2 hours or even just a mode that’s _only_ arrival/departure time data.

I’m trying to use the Trip Planner API to build a mini departure board screen, except I’m hitting an issue with the size of the JSON its returning. I’m using a tiny ESP32 development board which has pretty limited memory and the JSON just straight up won’t fit into memory in its current form.

I’ve filtered down to a specific platform and filtered out everything I don’t want with exclMOT, but as it still returns a full 24 hours of trips, upcoming trackwork information in HTML and accessibility info for each station, I don’t think I’m ever gonna get it to fit.

---

<div class="post-metadata">

**Author:** ![jxeeno](https://sea1.discourse-cdn.com/flex019/user_avatar/opendataforum.transport.nsw.gov.au/jxeeno/32/210_2.png) [@jxeeno](https://opendataforum.transport.nsw.gov.au/u/jxeeno)\
**Post date:** [September 9, 2020, 9:01am UTC](https://opendataforum.transport.nsw.gov.au/t/limiting-returned-results/2116/2 "2020-09-09T09:01:32Z")

</div>

I’m assuming you’re referring to the Trip Planner Departure Monitor `https://api.transport.nsw.gov.au/v1/tp/departure_mon` API?

If you exclude the `departureMonitorMacro=true` attribute, you can specify a limit using `limit=5` instead.

`departureMonitorMacro=true` sets a bunch of defaults which override any parameters you try to give it 🙂

---

<div class="post-metadata">

**Author:** ![Arkhon](https://avatars.discourse-cdn.com/v4/letter/a/91b2a8/32.png) [@Arkhon](https://opendataforum.transport.nsw.gov.au/u/Arkhon)\
**Post date:** [September 9, 2020, 11:05am UTC](https://opendataforum.transport.nsw.gov.au/t/limiting-returned-results/2116/3 "2020-09-09T11:05:39Z")

</div>

Ahah, that’s it, perfect. Thanks!
