Search and filtering
Retrieve and refine data efficiently with search, filters, sorting, and pagination.
Most AISquare list endpoints accept the same query parameters for search, filtering, sorting, and pagination. Learn them once and they apply across the API. These features are what make discovery pages, search experiences, and scalable feeds possible.
The examples below use the flattened experiences endpoint, but the parameters work the same way on other list endpoints.
Search
Search retrieves content by free text, typically across titles, tags, categories, and focus areas.
GET /aistudios/experiences/flattened/?search=machine%20learningKeep queries short, and combine search with filters for sharper results.
Filtering
Filters narrow results by a specific field.
| Parameter | Description |
|---|---|
type | Filter by resource type |
category | Filter by category ID |
category_name | Filter by category name |
tags | Filter by tags |
publication_url | Filter by a specific studio |
Combine filters by adding more parameters:
GET /aistudios/experiences/flattened/?type=AI_EXPERT&category_name=aiSorting
Use ordering to control the order of results.
| Value | Description |
|---|---|
trending | Based on engagement and recency |
newest | Most recently created |
popular | Highest engagement |
updated | Recently updated |
GET /aistudios/experiences/flattened/?ordering=trendingPrefix the value with - for descending order:
GET /aistudios/experiences/flattened/?ordering=-newestPagination
Pagination returns large datasets in smaller pages.
| Parameter | Description |
|---|---|
page | Page number |
page_size | Results per page |
GET /aistudios/experiences/flattened/?page=1&page_size=10The response wraps the results with paging metadata:
{
"count": 100,
"next": "url_to_next_page",
"previous": null,
"results": []
}Follow next to load more, and stop when it is null.
Combining everything
Search, filters, sorting, and pagination compose into one request.
GET /aistudios/experiences/flattened/?search=ai&type=AI_EXPERT&ordering=trending&page=1&page_size=10Performance best practices
- Always paginate. Never fetch a full dataset in one request.
- Keep pages small. Ten to twenty items per page is a reasonable default.
- Filter early. Narrow on the server to cut payload size.
- Cache hot queries. Trending and popular results are good candidates.
Common mistakes
- Fetching everything at once. Slow responses and large payloads.
- Ignoring
next. Skipping pagination leaves data behind. - Overusing search. Prefer filters where a field match will do.
Example flow
- The user searches for "ai".
- Apply a filter, for example
type=AI_EXPERT. - Sort by
trending. - Fetch page 1.
- Load more by following
next.