Paginate through API responses easily
Instead of forcing SDK users to learn the intricacies of your pagination system, Fern SDKs will return an iterator so that user’s can simply loop through all the results.
TypeScript
Python
When pagination for an endpoint is configured, the TypeScript SDK method
will return a Page<T>
where T
is the underlying data type. The Page<T>
will implement the AsyncIterable
interface, allowing you to use it in a
for await
loop.
Below is an example method signature for a list endpoint:
And here is an example of how a user would use the list
method:
Supported Pagination Types
Fern supports the following pagination schemes:
Pagination Scheme | Supported |
---|---|
Offset-based | |
Cursor-based | |
Link-based |