Skip to main content

Listing and Pagination

Learn how to list prompts in your workspace and paginate through large result sets.

Listing Prompts

Use the list_prompts() method to browse prompts:

Response Format

The list_prompts() method returns a dictionary:

Accessing Results

Pagination

Basic Pagination

Use the cursor parameter to fetch subsequent pages:

Iterating Through All Pages

Pagination with Limit

Control how many results to fetch:

Limit Parameter

Control page size with the limit parameter:
The limit parameter must be between 1 and 100. Default is 20.

Validation

Complete Examples

Example 1: Display All Prompts

Example 2: Search and Filter

Example 3: Export to CSV

Generator Pattern

Use a generator for memory-efficient iteration:

Best Practices

Balance between request count and response time:
Use larger pages for batch processing, smaller pages for interactive displays.
Always check if results are empty:
Show progress when fetching many pages:
Cache results for repeated access:

Error Handling

Handle errors when listing prompts:

Next Steps

Working with Prompts

Learn about prompt content and metadata

Error Handling

Handle errors gracefully

Advanced Features

Performance optimization techniques

API Reference

Complete API documentation