Filter by property value
Changed onReturns a paginated list of countries whose {property} value equals {value} (case-insensitive, URL-decoded; spaces accept either + or %20). For unique fields like codes.alpha_3 this returns at most one record; for non-unique fields like region this returns every match. An empty result returns an empty objects array, not 404. Supports an optional q to refine within the filtered set.
Request
- Base URLhttps://api.restcountries.com
- Auth
- HTTP bearer
- or API key in query parameter api-key
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Path parameters
Dot-path field name to filter or look up on. See https://restcountries.com/docs#fields for the full set of accepted values.
Exact value to match (case-insensitive, URL-decoded).
Query parameters
Full-text search across every searchable property. Case-insensitive substring match.
Number of records to return. Defaults to 25; accepts an integer from 1 to 100 on the free plan, or up to 500 on paid plans. Non-integer or below-range values return HTTP 400; a value above your plan's ceiling but within the paid maximum (e.g. 200 on a free plan) returns HTTP 403 indicating it is valid only on paid plans. See https://restcountries.com/docs#pagination for details.
Number of records to skip for pagination. Default 0.
Comma-separated dot-path projection. Only the specified fields are returned. Example: names.common,codes.alpha_2,flag.emoji
Comma-separated dot-path blocklist. The specified fields are removed from the response. Useful for trimming heavy branches like names.translations.
Set to true (a bare ?pretty, 1, or true) to pretty-print the JSON response; 0 or false keep it minified. Default is minified.
Response
Paginated list of countries.
Changes
- info
the response property
//became required for the status - info
the response property
//became required for the status - info
the response property
//became required for the status - info
the response property
//became required for the status - info
the response property
//became required for the status - info
the response property
//became required for the status - info
the
//response's property pattern^[a-z_]+\.[a-z0-9_]+$was added for the status - info
the
//response's property pattern^[a-z_]+\.[a-z0-9_]+$was added for the status - info
the
//response's property pattern^[a-z_]+\.[a-z0-9_]+$was added for the status - info
the
//response's property pattern^[a-z_]+\.[a-z0-9_]+$was added for the status - info
the
//response's property pattern^[a-z_]+\.[a-z0-9_]+$was added for the status - info
the
//response's property pattern^[a-z_]+\.[a-z0-9_]+$was added for the status
- info
- breaking
added to the
////response propertyoneOflist for the response status - breaking
the
////response's property type changed fromobjectto no type for status - warning
removed the optional property
/////from the response with the status - warning
removed the optional property
/////from the response with the status - warning
removed the optional property
/////from the response with the status - warning
removed the optional property
/////from the response with the status - warning
removed the optional property
/////from the response with the status
- breaking