worldref
v1.2.1Every country in Arabic and English: names, nationalities, dial codes, phone validation.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
get_country
Everything worldref knows about one country or territory: names, official names, nationality, dial codes and phone rules, currencies, capital, population, time zones, languages, week and calendar, address format, emergency numbers, plugs, sports codes. Missing values are null: report them as unknown, never guess.
| Parameter | Type | Description |
|---|---|---|
iso2 * | string | ISO 3166-1 alpha-2 code, e.g. SA. XK for Kosovo. |
lang | string | Language of the returned fields. Default: both. |
search_countries
Find countries by name or alias in Arabic or English (ignores «ال», tashkeel and hamza forms), by ISO code, or by dial code (+966, 00966, 966). Forgives small typos when nothing matches exactly. Returns iso2, names and flag, best match first.
| Parameter | Type | Description |
|---|---|---|
query * | string | |
lang | string | UI language for ranking. Default: en. |
limit | integer |
validate_phone
Parse a phone number as a user typed it (Arabic or Western digits, local or international form). Returns the international (E.164) form, the country it belongs to, and whether it is a valid number and a mobile number.
| Parameter | Type | Description |
|---|---|---|
country * | string | iso2 of the country picked in the phone field; used for local numbers. |
number * | string |
list_subdivisions
ISO 3166-2 subdivisions (regions, provinces, states, emirates) of a country, with Arabic and English names.
| Parameter | Type | Description |
|---|---|---|
iso2 * | string |