Pagination
The Pimlico platform API supports certain “list” API methods. For example, you can list sponsorship policies. These list API methods share a common structure and accept, at a minimum, the following three parameters: limit
, starting_after
, and ending_before
.
Pimlico's list API methods use cursor-based pagination through the starting_after
and ending_before
parameters. Both parameters accept an existing object ID value (see below) and return objects in reverse chronological order. The ending_before
parameter returns objects listed before the named object. The starting_after
parameter returns objects listed after the named object. These parameters are mutually exclusive. You can use either the starting_after or ending_before parameter, but not both simultaneously.
Query Parameters
limit
- optional, default is 100
This specifies a limit on the number of objects to return, ranging between 1 and 100.
starting_after
- optional object ID
A cursor to use in pagination. starting_after
is an object ID that defines your place in the list. For example, if you make a list request and receive 100 objects, ending with obj_foo
, your subsequent call can include starting_after=obj_foo to fetch the next page of the list.
ending_before
- optional object ID
A cursor to use in pagination. ending_before
is an object ID that defines your place in the list. For example, if you make a list request and receive 100 objects, starting with obj_bar
, your subsequent call can include ending_before=obj_bar to fetch the previous page of the list.
Example Paginated Response
{
"has_more": true,
"data": [
{
"id": "sp_tangible_knight",
"policy_name": "Pimlico Example Gas Fund",
"policy_status": "active",
"created_at": "2024-05-23T15:23:38",
"start_time": null,
"end_time": null,
"whitelisted_chain_ids": [
10,
8453,
34443,
690,
7777777
],
"global_limits": {
"maximum_usd": 10000000
}
},
{...},
{...},
{...},
{...}
]
}