worldref

v1.2.1
io.github.arj-89/worldref Checked 6 hours ago Published 21 days ago

Every 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.

ParameterTypeDescription
iso2 *stringISO 3166-1 alpha-2 code, e.g. SA. XK for Kosovo.
langstringLanguage 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.

ParameterTypeDescription
query *string
langstringUI language for ranking. Default: en.
limitinteger

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.

ParameterTypeDescription
country *stringiso2 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.

ParameterTypeDescription
iso2 *string