Skip to main content
List endpoints return paginated results with 25 items per page by default.

Request

Use the page query parameter to navigate through pages:
curl https://app.plugchoice.com/api/v3/chargers?page=2 \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Response format

Paginated responses include data, links, and meta fields:
{
  "data": [
    { "uuid": "abc-123", "identity": "CHARGER-001", ... },
    { "uuid": "def-456", "identity": "CHARGER-002", ... }
  ],
  "links": {
    "first": "https://app.plugchoice.com/api/v3/chargers?page=1",
    "last": null,
    "prev": "https://app.plugchoice.com/api/v3/chargers?page=1",
    "next": "https://app.plugchoice.com/api/v3/chargers?page=3"
  },
  "meta": {
    "current_page": 2,
    "from": 26,
    "path": "https://app.plugchoice.com/api/v3/chargers",
    "per_page": 25,
    "to": 50
  }
}

Fields

FieldDescription
dataArray of resources for the current page
links.firstURL to the first page
links.lastURL to the last page (may be null)
links.prevURL to the previous page, or null if on the first page
links.nextURL to the next page, or null if on the last page
meta.current_pageCurrent page number
meta.fromIndex of the first item on this page
meta.toIndex of the last item on this page
meta.per_pageNumber of items per page

Iterating through pages

To fetch all results, follow the links.next URL until it returns null:
let url = 'https://app.plugchoice.com/api/v3/chargers';
const allChargers = [];

while (url) {
  const response = await fetch(url, {
    headers: { 'Authorization': 'Bearer YOUR_API_TOKEN' }
  });
  const json = await response.json();
  allChargers.push(...json.data);
  url = json.links.next;
}