Skip to main content
Every geographic endpoint accepts two query parameters that let you shape the response payload without changing the URL:
  • ?fields= — return only the fields you ask for. Trim large list responses down to what your UI actually renders.
  • ?sort= — order list results by one or more fields, ascending or descending.
Availability: Both parameters require the Supporter plan or above. Detail endpoints accept ?fields=; list endpoints accept both ?fields= and ?sort=.
Filtering and sorting are applied server-side after cache, so a typical request still takes under 10 ms even on large responses. The full payload is cached once; each ?fields=/?sort= permutation receives its own ETag.

?fields= — request only the columns you need

Pass a comma-separated list of field names. The response includes only those fields, plus id (always returned so responses are never empty).
200 - Trimmed response

Behaviour rules

Per-entity field lists

The fields available to ?fields= are the same as the columns returned by each endpoint (after tier gating). For the full lists, see the Tier-Based Field Availability table at the bottom of every endpoint page.

?sort= — order list results

Pass a comma-separated list of field or field:asc|desc tokens. Sort is applied to the list after filtering.
200 - Top of response

Multi-field sort

Chain fields with commas — earlier tokens take precedence on ties.

Sortable fields per entity

Only fields with comparable scalar values are sortable. Translation blobs, JSON columns, and similar non-scalar columns are not.

Behaviour rules

Whitespace

Whitespace inside a sort token is tolerated. Both sort=name:desc and sort=name: desc are valid.

Combining ?fields= and ?sort=

You can use both together. Sort is applied first, then fields are trimmed.
You can sort by a field you didn’t include in ?fields= — the sort happens on the full row, then unwanted columns are dropped.

Caching


Error responses

400 - Unknown field in ?fields=
400 - Non-sortable field
400 - Sort field outside tier
400 - Malformed sort token
403 - Feature not on plan

When to use which parameter

Use ?fields= to keep only the columns the UI renders. A country selector usually needs id, name, iso2, emoji — that’s roughly 1 KB per request instead of 50+ KB for the full response.
Use ?sort= to push the work server-side. Sorting 153,765 cities by population in your client is slow and ships a lot of data you’ll discard.
Combine ?fields= and ?sort= to ship exactly the rendered columns in the rendered order. Pair with client-side slicing for pagination.
  • Authentication — how to send X-CSCAPI-KEY
  • Pricing — which plans include filtering and sorting
  • Every endpoint page links back to this guide