generic_countries_list
const url = 'https://example.com/api/generic/countries/';const options = {method: 'GET', headers: {Authorization: '<Authorization>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://example.com/api/generic/countries/ \ --header 'Authorization: <Authorization>'List countries with optional filtering.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Filter by alpha-2 code (exact match)
Filter by alpha-3 code (exact match)
Filter by country name (contains, case-insensitive)
Which field to use when ordering the results.
A page number within the paginated result set.
Filter by region (contains)
A search term.
Responses
Section titled “Responses”object
Serializer for representing country information according to ISO 3166 standards.
Fields: name (CharField): The name of the country. alpha_2 (CharField): The ISO 3166-1 alpha-2 code for the country. alpha_3 (CharField): The ISO 3166-1 alpha-3 code for the country. country_code (CharField): The ISO 3166-1 numeric country code. iso_3166_2 (CharField): The ISO 3166-2 code for the country. region (CharField): The region in which the country is located. sub_region (CharField): The sub-region in which the country is located. intermediate_region (CharField): The intermediate region, if applicable. May be blank. region_code (CharField): The code for the region. sub_region_code (CharField): The code for the sub-region. intermediate_region_code (CharField): The code for the intermediate region, if applicable. May be blank.
object
Example
{ "count": 123, "next": "http://api.example.org/accounts/?page=4", "previous": "http://api.example.org/accounts/?page=2"}
