Get User Locale
Endpoint
gethttps://<REGION>.cloud.appwrite.io/v1/locale
Description
Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.
Required scopes
Authentication
setProject() and a server API key (setKey()), or authenticate as a signed-in user (setSession() or setJWT()). For direct REST calls, send X-Appwrite-Project with either X-Appwrite-Key or session/JWT headers.Locale
User IP address.
Country code in ISO 3166-1 two-character format
Country name. This field support localization.
Continent code. A two character continent code "AF" for Africa, "AN" for Antarctica, "AS" for Asia, "EU" for Europe, "NA" for North America, "OC" for Oceania, and "SA" for South America.
Continent name. This field support localization.
True if country is part of the Europian Union.
Currency code in ISO 4217-1 three-character format
from appwrite.client import Clientfrom appwrite.services.locale import Locale
client = Client()
(client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key)
locale = Locale(client)
result = locale.get()Localization
Get User Locale
Endpoint
gethttps://<REGION>.cloud.appwrite.io/v1/locale
Description
Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.
Required scopes
Authentication
setProject() and a server API key (setKey()), or authenticate as a signed-in user (setSession() or setJWT()). For direct REST calls, send X-Appwrite-Project with either X-Appwrite-Key or session/JWT headers.Locale
User IP address.
Country code in ISO 3166-1 two-character format
Country name. This field support localization.
Continent code. A two character continent code "AF" for Africa, "AN" for Antarctica, "AS" for Asia, "EU" for Europe, "NA" for North America, "OC" for Oceania, and "SA" for South America.
Continent name. This field support localization.
True if country is part of the Europian Union.
Currency code in ISO 4217-1 three-character format
from appwrite.client import Clientfrom appwrite.services.locale import Locale
client = Client()
(client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key)
locale = Locale(client)
result = locale.get()