Lumirank API docs

Pagination

How to get a long list or report page by page, with limit and offset.

Lists and reports can hold more rows than 1 response returns. You get them page by page. limit sets how many rows a page holds, and offset sets how many rows to skip:

GET /v1/answers?limit=50&offset=100

The response has the rows in data. meta tells you where this page is in the whole list:

{
  "data": [],
  "meta": { "total": 1240, "limit": 50, "offset": 100, "has_more": true }
}

total is the number of matching rows on all pages together. has_more is true when more rows come after this page. To get the next page, set offset to offset + limit.

Endpointlimit defaultlimit max
/v1/prompts, /v1/competitors50200
/v1/answers, /v1/mentions, /v1/citations50100
/v1/reports/*100010000

offset starts at 0. For reports, offset can be at most 100000.

Row order

Every list and report returns its rows in a fixed order. When 2 rows have the same value, their ids decide the order. So no row appears on 2 pages, and no row is skipped. Answers, mentions, and citations come oldest first. A new answer that arrives while you read the pages goes after the last page, so the pages you already read do not change.

Read every page

This Python function requests page after page until has_more is false:

import os

import requests

API = "https://api.lumirank.ai/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['LUMIRANK_API_KEY']}"}


def walk(path, params):
    offset = 0
    while True:
        page = requests.get(f"{API}{path}", headers=HEADERS, params={**params, "limit": 100, "offset": offset},
                            timeout=60)
        page.raise_for_status()
        body = page.json()
        yield from body["data"]
        if not body["meta"]["has_more"]:
            return
        offset += body["meta"]["limit"]


answers = list(walk("/answers", {"start_date": "2026-09-01", "end_date": "2026-09-07"}))
print(len(answers), "answers")

For a large export, read 1 date range at a time, for example 1 week at a time. A date range can be at most 90 days.

On this page