JSON API Query Selectors

There are two types of selectors available in most query calls: code and name.

Code selectors

Code selectors define selection criteria for the codes property. The code selector is an array. Each element in the array can have several forms:

// An exact match for a code
"code"

// A range from a start to end (inclusive)
["start code", "end code"]

// A range matching a wildcard (using SQL's 'like' syntax).
["*", "wildcard code"]

// Exclude a rang matching a wildcard
["!*", "wildcard code"]

// Exclude an exact match with a code
["!", "code"]

// Exclude a range
["!", "start code", "end code"]

Open-ended ranges are possible by supplying a blank string for either the start or the end of the range.

Refer to the code select schema for a formal definition.

Examples

Return resources with codes 1 and 3:

["1", "3"]

Return resources with codes in the ranges 10-15 and 23-30:

[["10", "15"], ["23","30"]]

Return resources with codes in the ranges 10-30, excluding 23:

[["10", "30"], ["!", "23"]]

Return resources with codes in the ranges 10-30, excluding 20-23:

[["10", "30"], ["!", "20", "23"]]

Return resources with codes less than or equal to 'BOB':

[["", "BOB"]]

Return resources with codes greater than or equal to 'UKR':

[["UKR", ""]]

Name selectors

Name selectors support wildcards and exclusion operators on both the name and language. The selector is an array. Each element in the array is a name element. The exclude and like properties allow for complex selections:

// Select a specific name (in any language)
{"name": "International"}

// Exclude a specific name
{"name": "International", "exclude": true}

// Select a specific name in English only
{"name": "International", "language": "en"}

// Select all names containing inter
{"name": "%inter%", "like": true}

// Select all names in any national variant of English
{"language": "en%", "like": true}

Refer to the name schema for a formal definition.