RKX API Studio Docs
RKX API Studio Docs

Filtering & Pagination

Free Features · RKX API Studio 1.0.0

Choose a parameter mode

In Custom mode the saved per-page, offset, order, orderby and taxonomy settings control the response. URL overrides for those settings are ignored; page still selects a page. Enable Use WordPress Default Parameters to allow supported request parameters to override stored defaults.

  1. Open Query Parameters below Endpoint Settings.
  2. Leave Use WordPress Default Parameters off to use saved query values.
  3. Set Per Page, Offset, Order and Order By for the selected source.
  4. Select taxonomy term IDs when filtering a post source.
  5. Enable WordPress Default Parameters only if clients should supply supported URL overrides.
  6. Save and compare page=1 with page=2 on the actual route.
Actual Query Parameters panel, captured with Pro active. These controls are shared with Free. WordPress Default Parameters is off and no taxonomy terms are selected in this example.

Screenshot detail

Query Parameters in Custom mode with 10 items per page, zero offset, descending date order and empty category and tag filters

Actual Query Parameters panel, captured with Pro active. These controls are shared with Free. WordPress Default Parameters is off and no taxonomy terms are selected in this example.

Sort and filter

Choose ascending or descending order and a sorting field supported by the source. Post sorting includes date, title, modified, ID, author and slug; taxonomy sorting includes name, slug, count, ID and description. Select taxonomy term IDs to narrow post results. Default parameter mode accepts the supported native parameters for each source, not arbitrary SQL or a custom query language.

Read all pages

Responses contain at most 100 items per page. Read X-WP-TotalPages and request page=2, page=3 and so on. An empty array can mean there is no content on that page. Offset skips items before paging and can make an apparently valid page empty.

Bash
curl -i 'https://example.com/wp-json/rkx-api-studio/v1/articles?page=2&per_page=20&order=ASC&orderby=title'

Example prerequisites

The example above assumes the articles endpoint exists and WordPress Default Parameters is enabled. In Custom mode change the saved query settings instead. Confirm filters on published content before enabling caching.

Posts, pages, custom types and taxonomies

REST and configuration reference

Caching, invalidation and performance