Search, filtering, and pagination
This guide explains how to retrieve and refine data efficiently using AISquare APIs.
These features are essential for building:
- Discovery pages
- Search experiences
- Scalable feeds
Overview
Most AISquare endpoints support:
- Search
- Filtering
- Sorting
- Pagination
These are applied using query parameters.
Search
Search allows you to retrieve content using free text.
Example
What search covers
Search typically works across:
- Titles
- Tags
- Categories
- Focus areas
Best practices
- Keep search queries simple
- Avoid overly long strings
- Combine with filters for better results
Filtering
Filtering allows you to narrow down results based on specific fields.
Common filters
Example
Multiple filters
You can combine filters:
Sorting
Sorting controls the order of results.
Supported options
Example
Ascending vs descending
Use - prefix for descending order:
Pagination
Pagination allows you to retrieve large datasets in smaller chunks.
Parameters
Example
Response structure
How to use pagination
- Use
nextto load more results - Stop when
nextisnull
Combining everything
You can use search, filters, sorting, and pagination together.
Example
Performance best practices
Use pagination always
Avoid fetching large datasets in a single request.
Limit page size
Use reasonable values like:
- 10–20 items per page
Combine filters early
Reduce unnecessary data transfer.
Cache frequent queries
Especially for:
- Trending content
- Popular resources
Common mistakes
Fetching all data at once
Leads to slow performance and large payloads.
Not handling pagination
Missing next leads to incomplete data.
Overusing search
Use filters when possible for better performance.
Example implementation flow
- User searches for “ai”
- Apply filters (
type = AI_EXPERT) - Sort by trending
- Fetch page 1
- Load more using
next
Related pages
- Core Concepts — understand resource types and entities
- AI Studios — the flattened experiences endpoint
- Content modeling guide — structure and display resources
- Community — explore public experiences with filtering
- Quickstart — make your first filtered request
- Errors — handle pagination and query errors

