AISquare
Guides

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 retrieves content by free text, typically across titles, tags, categories, and focus areas.

GET /aistudios/experiences/flattened/?search=machine%20learning

Keep queries short, and combine search with filters for sharper results.

Filtering

Filters narrow results by a specific field.

ParameterDescription
typeFilter by resource type
categoryFilter by category ID
category_nameFilter by category name
tagsFilter by tags
publication_urlFilter by a specific studio

Combine filters by adding more parameters:

GET /aistudios/experiences/flattened/?type=AI_EXPERT&category_name=ai

Sorting

Use ordering to control the order of results.

ValueDescription
trendingBased on engagement and recency
newestMost recently created
popularHighest engagement
updatedRecently updated
GET /aistudios/experiences/flattened/?ordering=trending

Prefix the value with - for descending order:

GET /aistudios/experiences/flattened/?ordering=-newest

Pagination

Pagination returns large datasets in smaller pages.

ParameterDescription
pagePage number
page_sizeResults per page
GET /aistudios/experiences/flattened/?page=1&page_size=10

The response wraps the results with paging metadata:

Paged response
{
  "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=10

Performance 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

  1. The user searches for "ai".
  2. Apply a filter, for example type=AI_EXPERT.
  3. Sort by trending.
  4. Fetch page 1.
  5. Load more by following next.

Next steps

On this page