BeMyPlan API

Pagination

Cursor and page modes for every list.

Every list takes limit (default 50, maximum 200; countries allow up to 300) and at most one of:

  • after or before: cursor mode, the default.
  • page: page mode, 1-based, from 1 to 10000.

Query parameters are camelCase. The response meta always carries limit, after and before. In page mode it also carries page and totalCount.

Cursor mode

curl "https://api.sandbox.bemyplan.com/data/v1/airports?limit=2" \
  -H "Authorization: Bearer bmp_test_…"
{
  "data": [ { "id": "arp_…", "name": "…" }, { "id": "arp_…", "name": "…" } ],
  "meta": { "requestId": "…", "limit": 2, "after": "…", "before": null }
}
  • Pass meta.after back as after to get the next page. On the last page meta.after is null.
  • meta.before goes back the same way. When you walk backwards with before, meta.after is always set and meta.before is null once you reach the start of the list.
  • Cursors are opaque: send them unchanged and never construct or edit one. A malformed cursor answers 400 invalid_cursor. Use a cursor only with the list and the filters that produced it: a cursor is not tied to one list, so a cursor from another list is not recognised as foreign and returns a page keyed on a meaningless position.
  • The order is stable, by name and then by id, and identical in every environment.

Page mode

curl "https://api.sandbox.bemyplan.com/data/v1/airports?page=2&limit=50" \
  -H "Authorization: Bearer bmp_test_…"
{
  "data": [ { "id": "arp_…", "name": "…" } ],
  "meta": { "requestId": "…", "limit": 50, "after": null, "before": null, "page": 2, "totalCount": 1234 }
}

Page mode costs one extra count per request. To walk a whole list, prefer cursors.

Rules

  • Sending more than one of after, before and page answers 400 invalid_request, with each of them you sent in fields. A cursor that this list did not issue answers 400 invalid_cursor, keyed by after or before.
  • Each list request is one request for rate limits and for pricing, whatever its limit.
  • Place suggestions are not paginated: they take a limit of up to 50 (20 when omitted), echoed in meta.limit.

On this page