Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.flashcat.cloud/llms.txt

Use this file to discover all available pages before exploring further.

In general, when we pull or retrieve certain data objects, data is returned in batches based on pagination, rather than returning all data in a single request.

Traditional Pagination


We define pagination technology based on OFFSET and LIMIT queries as traditional pagination. In most Flashduty list query APIs, you can see the following parameter definitions:

Request Parameters

ParameterTypeDescription
pnumberPage number, starting from 1 by default. offset = (p - 1) * limit
limitnumberNumber of items per page, maximum value not exceeding 100, default is 20

Response Parameters

ParameterTypeDescription
totalnumberTotal number of matched entries under current conditions
has_next_pagebooleanWhether there is next page data under current conditions

Example

{
  "p": 1,
  "limit": 20
}

Potential Issues

Although querying based on traditional pagination technology is simple, you may encounter the following issues:
When using OFFSET and LIMIT for paginated queries, the database needs to skip a specified number of rows (OFFSET) and then return a specified number of rows (LIMIT). As the offset increases, query performance may decrease, especially when handling large amounts of data. Each query needs to scan and skip the previous rows, which causes queries to become slower and slower.
When using PAGE and LIMIT for paginated queries, if data is deleted or inserted during the query, results may become unstable. For example, if previous rows are deleted during the query process, subsequent offsets may become invalid, leading to inaccurate or missing results.

Query Limits

To protect the system and ensure stable access for most users, we have imposed the following restrictions on API parameters based on traditional pagination technology:
PAGE × LIMIT must be ≤ 10000. If it exceeds 10000, the system will directly return a 400 error. In this case, please switch to cursor pagination or narrow your query conditions.

Cursor Pagination


We define pagination technology based on SEARCH_AFTER_CTX as cursor pagination. Cursor pagination technology can better handle large datasets and high-performance requirements, providing a more stable and efficient paginated query experience.

Supported APIs

We provide cursor pagination support in the following APIs:

Request Parameters

ParameterTypeDescription
search_after_ctxstringCursor index, starts from the first page when not set
limitnumberNumber of items per page, maximum value not exceeding 100, default is 20

Response Parameters

ParameterTypeDescription
totalnumberTotal number of matched entries under current conditions
has_next_pagebooleanWhether there is next page data under current conditions
search_after_ctxstringNext page cursor address, returned only when next page exists

Example

{
  "search_after_ctx": "658bcbae6ab5a67b3b800230",
  "limit": 20
}

About TOTAL


Regardless of which pagination technology is used, Flashduty will return total and has_next_page parameters. However, please note that the total value is not always accurate. To ensure the system can respond quickly, we have added the following restrictions:
  • When the total matching data is less than 1000, the total value is exact
  • When the total matching data is greater than or equal to 1000, the total value is always 1000, which only indicates that the system matched 1000+ data
Please use has_next_page to determine whether there is next page data, rather than total.