Skip to content

Pagination

All list endpoints return paginated results with page and limit parameters.

Parameters

ParameterDefaultMinMax
page111000
limit251100

Response metadata

Every list response includes a meta object:

json
{
  "meta": {
    "total": 1234,
    "page": 1,
    "limit": 25
  }
}
  • total — Total matching results (before pagination)
  • page — Current page number
  • limit — Results per page

Example: paginate through all results

bash
# Page 1 (first 50 results)
curl "https://fhir-api.luxera.io/api/v1/endpoints?limit=50&page=1"

# Page 2
curl "https://fhir-api.luxera.io/api/v1/endpoints?limit=50&page=2"

# Page 3
curl "https://fhir-api.luxera.io/api/v1/endpoints?limit=50&page=3"
python
import requests

# Page 1 (first 50 results)
page1 = requests.get(
    "https://fhir-api.luxera.io/api/v1/endpoints",
    params={"limit": 50, "page": 1}
).json()

# Page 2
page2 = requests.get(
    "https://fhir-api.luxera.io/api/v1/endpoints",
    params={"limit": 50, "page": 2}
).json()

# Page 3
page3 = requests.get(
    "https://fhir-api.luxera.io/api/v1/endpoints",
    params={"limit": 50, "page": 3}
).json()
typescript
// Page 1 (first 50 results)
const page1 = await fetch(
  "https://fhir-api.luxera.io/api/v1/endpoints?limit=50&page=1"
).then(r => r.json());

// Page 2
const page2 = await fetch(
  "https://fhir-api.luxera.io/api/v1/endpoints?limit=50&page=2"
).then(r => r.json());

// Page 3
const page3 = await fetch(
  "https://fhir-api.luxera.io/api/v1/endpoints?limit=50&page=3"
).then(r => r.json());
csharp
using var client = new HttpClient();

// Page 1 (first 50 results)
var page1 = await client.GetStringAsync(
    "https://fhir-api.luxera.io/api/v1/endpoints?limit=50&page=1"
);

// Page 2
var page2 = await client.GetStringAsync(
    "https://fhir-api.luxera.io/api/v1/endpoints?limit=50&page=2"
);

// Page 3
var page3 = await client.GetStringAsync(
    "https://fhir-api.luxera.io/api/v1/endpoints?limit=50&page=3"
);

Calculating total pages

totalPages = Math.ceil(meta.total / meta.limit)

Example: iterate all Epic endpoints

bash
#!/bin/bash
PAGE=1
TOTAL=1

while [ $PAGE -le $TOTAL ]; do
  RESPONSE=$(curl -s "https://fhir-api.luxera.io/api/v1/endpoints?vendor=epic&limit=100&page=$PAGE")
  TOTAL=$(echo $RESPONSE | jq '.meta.total / .meta.limit | ceil')
  echo $RESPONSE | jq '.data[].url'
  PAGE=$((PAGE + 1))
done
python
import math
import requests

page = 1
total_pages = 1

while page <= total_pages:
    response = requests.get(
        "https://fhir-api.luxera.io/api/v1/endpoints",
        params={"vendor": "epic", "limit": 100, "page": page}
    ).json()

    total_pages = math.ceil(response["meta"]["total"] / response["meta"]["limit"])

    for endpoint in response["data"]:
        print(endpoint["url"])

    page += 1
typescript
let page = 1;
let totalPages = 1;

while (page <= totalPages) {
  const response = await fetch(
    `https://fhir-api.luxera.io/api/v1/endpoints?vendor=epic&limit=100&page=${page}`
  );
  const body = await response.json();

  totalPages = Math.ceil(body.meta.total / body.meta.limit);

  for (const endpoint of body.data) {
    console.log(endpoint.url);
  }

  page++;
}
csharp
using System.Text.Json;

using var client = new HttpClient();
var page = 1;
var totalPages = 1;

while (page <= totalPages)
{
    var json = await client.GetStringAsync(
        $"https://fhir-api.luxera.io/api/v1/endpoints?vendor=epic&limit=100&page={page}"
    );
    var doc = JsonDocument.Parse(json);
    var meta = doc.RootElement.GetProperty("meta");
    var total = meta.GetProperty("total").GetInt32();
    var limit = meta.GetProperty("limit").GetInt32();
    totalPages = (int)Math.Ceiling((double)total / limit);

    foreach (var endpoint in doc.RootElement.GetProperty("data").EnumerateArray())
    {
        Console.WriteLine(endpoint.GetProperty("url").GetString());
    }

    page++;
}

Built by Luxera Software