Locale API
The Locale service allows you to customize your app based on your users' location. Using this service, you can get your users' location, IP address, list of countries and continents names, phone codes, currencies, and more. Country codes returned follow the ISO 3166-1 standard.
The user service supports multiple locales. This feature allows you to fetch countries and continents information in your app language. To switch locales, all you need to do is pass the 'X-Appwrite-Locale' header or set the 'setLocale' method using any of our available SDKs. View here the list of available locales.
Get User Locale
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.
Authentication
To access this route, init your SDK with your project unique ID and an API Key. Make sure your API Key is created with the "locale.read" scope. You can also authenticate using a valid JWT and perform actions on behalf of your user.
HTTP Response
Status Code | Content Type | Payload |
200 OK | application/json | Locale Object |
-
const sdk = require('node-appwrite'); // Init SDK const client = new sdk.Client(); const locale = new sdk.Locale(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; const promise = locale.get(); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
import * as sdk from "https://deno.land/x/appwrite/mod.ts"; // Init SDK let client = new sdk.Client(); let locale = new sdk.Locale(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; let promise = locale.get(); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
<?php use Appwrite\Client; use Appwrite\Services\Locale; $client = new Client(); $client ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; $locale = new Locale($client); $result = $locale->get();
-
from appwrite.client import Client from 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()
-
require 'Appwrite' include Appwrite client = Client.new .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.new(client) response = locale.get() puts response.inspect
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Locale locale = Locale(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; Future result = locale.get(); result .then((response) { print(response); }).catchError((error) { print(error.response); }); }
-
import io.appwrite.Client import io.appwrite.services.Locale val client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key val locale = Locale(client) val response = locale.get()
-
import io.appwrite.Client; import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Locale; Client client = new Client() .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key Locale locale = new Locale(client); locale.get(new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); return; } System.out.println(result); }));
-
import Appwrite let client = Client() .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key let locale = Locale(client) let locale = try await locale.get()
-
query { localeGet { ip countryCode country continentCode continent eu currency } }
-
GET /v1/locale HTTP/1.1 Host: HOSTNAME Content-Type: application/json X-Appwrite-Response-Format: 1.0.0 X-Appwrite-Project: 5df5acd0d48c2 X-Appwrite-Key: 919c2d18fb5d4...a2ae413da83346ad2 X-Appwrite-JWT: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...
List Countries
List of all countries. You can use the locale header to get the data in a supported language.
Authentication
To access this route, init your SDK with your project unique ID and an API Key. Make sure your API Key is created with the "locale.read" scope. You can also authenticate using a valid JWT and perform actions on behalf of your user.
HTTP Response
Status Code | Content Type | Payload |
200 OK | application/json | Countries List Object |
-
const sdk = require('node-appwrite'); // Init SDK const client = new sdk.Client(); const locale = new sdk.Locale(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; const promise = locale.listCountries(); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
import * as sdk from "https://deno.land/x/appwrite/mod.ts"; // Init SDK let client = new sdk.Client(); let locale = new sdk.Locale(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; let promise = locale.listCountries(); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
<?php use Appwrite\Client; use Appwrite\Services\Locale; $client = new Client(); $client ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; $locale = new Locale($client); $result = $locale->listCountries();
-
from appwrite.client import Client from 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.list_countries()
-
require 'Appwrite' include Appwrite client = Client.new .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.new(client) response = locale.list_countries() puts response.inspect
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Locale locale = Locale(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; Future result = locale.listCountries(); result .then((response) { print(response); }).catchError((error) { print(error.response); }); }
-
import io.appwrite.Client import io.appwrite.services.Locale val client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key val locale = Locale(client) val response = locale.listCountries()
-
import io.appwrite.Client; import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Locale; Client client = new Client() .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key Locale locale = new Locale(client); locale.listCountries(new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); return; } System.out.println(result); }));
-
import Appwrite let client = Client() .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key let locale = Locale(client) let countryList = try await locale.listCountries()
-
query { localeListCountries { total countries { name code } } }
-
GET /v1/locale/countries HTTP/1.1 Host: HOSTNAME Content-Type: application/json X-Appwrite-Response-Format: 1.0.0 X-Appwrite-Project: 5df5acd0d48c2 X-Appwrite-Key: 919c2d18fb5d4...a2ae413da83346ad2 X-Appwrite-JWT: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...
List EU Countries
List of all countries that are currently members of the EU. You can use the locale header to get the data in a supported language.
Authentication
To access this route, init your SDK with your project unique ID and an API Key. Make sure your API Key is created with the "locale.read" scope. You can also authenticate using a valid JWT and perform actions on behalf of your user.
HTTP Response
Status Code | Content Type | Payload |
200 OK | application/json | Countries List Object |
-
const sdk = require('node-appwrite'); // Init SDK const client = new sdk.Client(); const locale = new sdk.Locale(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; const promise = locale.listCountriesEU(); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
import * as sdk from "https://deno.land/x/appwrite/mod.ts"; // Init SDK let client = new sdk.Client(); let locale = new sdk.Locale(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; let promise = locale.listCountriesEU(); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
<?php use Appwrite\Client; use Appwrite\Services\Locale; $client = new Client(); $client ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; $locale = new Locale($client); $result = $locale->listCountriesEU();
-
from appwrite.client import Client from 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.list_countries_eu()
-
require 'Appwrite' include Appwrite client = Client.new .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.new(client) response = locale.list_countries_eu() puts response.inspect
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Locale locale = Locale(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; Future result = locale.listCountriesEU(); result .then((response) { print(response); }).catchError((error) { print(error.response); }); }
-
import io.appwrite.Client import io.appwrite.services.Locale val client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key val locale = Locale(client) val response = locale.listCountriesEU()
-
import io.appwrite.Client; import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Locale; Client client = new Client() .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key Locale locale = new Locale(client); locale.listCountriesEU(new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); return; } System.out.println(result); }));
-
import Appwrite let client = Client() .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key let locale = Locale(client) let countryList = try await locale.listCountriesEU()
-
query { localeListCountriesEU { total countries { name code } } }
-
GET /v1/locale/countries/eu HTTP/1.1 Host: HOSTNAME Content-Type: application/json X-Appwrite-Response-Format: 1.0.0 X-Appwrite-Project: 5df5acd0d48c2 X-Appwrite-Key: 919c2d18fb5d4...a2ae413da83346ad2 X-Appwrite-JWT: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...
List Countries Phone Codes
List of all countries phone codes. You can use the locale header to get the data in a supported language.
Authentication
To access this route, init your SDK with your project unique ID and an API Key. Make sure your API Key is created with the "locale.read" scope. You can also authenticate using a valid JWT and perform actions on behalf of your user.
HTTP Response
Status Code | Content Type | Payload |
200 OK | application/json | Phones List Object |
-
const sdk = require('node-appwrite'); // Init SDK const client = new sdk.Client(); const locale = new sdk.Locale(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; const promise = locale.listCountriesPhones(); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
import * as sdk from "https://deno.land/x/appwrite/mod.ts"; // Init SDK let client = new sdk.Client(); let locale = new sdk.Locale(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; let promise = locale.listCountriesPhones(); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
<?php use Appwrite\Client; use Appwrite\Services\Locale; $client = new Client(); $client ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; $locale = new Locale($client); $result = $locale->listCountriesPhones();
-
from appwrite.client import Client from 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.list_countries_phones()
-
require 'Appwrite' include Appwrite client = Client.new .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.new(client) response = locale.list_countries_phones() puts response.inspect
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Locale locale = Locale(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; Future result = locale.listCountriesPhones(); result .then((response) { print(response); }).catchError((error) { print(error.response); }); }
-
import io.appwrite.Client import io.appwrite.services.Locale val client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key val locale = Locale(client) val response = locale.listCountriesPhones()
-
import io.appwrite.Client; import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Locale; Client client = new Client() .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key Locale locale = new Locale(client); locale.listCountriesPhones(new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); return; } System.out.println(result); }));
-
import Appwrite let client = Client() .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key let locale = Locale(client) let phoneList = try await locale.listCountriesPhones()
-
query { localeListCountriesPhones { total phones { code countryCode countryName } } }
-
GET /v1/locale/countries/phones HTTP/1.1 Host: HOSTNAME Content-Type: application/json X-Appwrite-Response-Format: 1.0.0 X-Appwrite-Project: 5df5acd0d48c2 X-Appwrite-Key: 919c2d18fb5d4...a2ae413da83346ad2 X-Appwrite-JWT: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...
List Continents
List of all continents. You can use the locale header to get the data in a supported language.
Authentication
To access this route, init your SDK with your project unique ID and an API Key. Make sure your API Key is created with the "locale.read" scope. You can also authenticate using a valid JWT and perform actions on behalf of your user.
HTTP Response
Status Code | Content Type | Payload |
200 OK | application/json | Continents List Object |
-
const sdk = require('node-appwrite'); // Init SDK const client = new sdk.Client(); const locale = new sdk.Locale(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; const promise = locale.listContinents(); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
import * as sdk from "https://deno.land/x/appwrite/mod.ts"; // Init SDK let client = new sdk.Client(); let locale = new sdk.Locale(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; let promise = locale.listContinents(); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
<?php use Appwrite\Client; use Appwrite\Services\Locale; $client = new Client(); $client ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; $locale = new Locale($client); $result = $locale->listContinents();
-
from appwrite.client import Client from 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.list_continents()
-
require 'Appwrite' include Appwrite client = Client.new .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.new(client) response = locale.list_continents() puts response.inspect
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Locale locale = Locale(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; Future result = locale.listContinents(); result .then((response) { print(response); }).catchError((error) { print(error.response); }); }
-
import io.appwrite.Client import io.appwrite.services.Locale val client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key val locale = Locale(client) val response = locale.listContinents()
-
import io.appwrite.Client; import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Locale; Client client = new Client() .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key Locale locale = new Locale(client); locale.listContinents(new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); return; } System.out.println(result); }));
-
import Appwrite let client = Client() .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key let locale = Locale(client) let continentList = try await locale.listContinents()
-
query { localeListContinents { total continents { name code } } }
-
GET /v1/locale/continents HTTP/1.1 Host: HOSTNAME Content-Type: application/json X-Appwrite-Response-Format: 1.0.0 X-Appwrite-Project: 5df5acd0d48c2 X-Appwrite-Key: 919c2d18fb5d4...a2ae413da83346ad2 X-Appwrite-JWT: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...
List Currencies
List of all currencies, including currency symbol, name, plural, and decimal digits for all major and minor currencies. You can use the locale header to get the data in a supported language.
Authentication
To access this route, init your SDK with your project unique ID and an API Key. Make sure your API Key is created with the "locale.read" scope. You can also authenticate using a valid JWT and perform actions on behalf of your user.
HTTP Response
Status Code | Content Type | Payload |
200 OK | application/json | Currencies List Object |
-
const sdk = require('node-appwrite'); // Init SDK const client = new sdk.Client(); const locale = new sdk.Locale(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; const promise = locale.listCurrencies(); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
import * as sdk from "https://deno.land/x/appwrite/mod.ts"; // Init SDK let client = new sdk.Client(); let locale = new sdk.Locale(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; let promise = locale.listCurrencies(); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
<?php use Appwrite\Client; use Appwrite\Services\Locale; $client = new Client(); $client ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; $locale = new Locale($client); $result = $locale->listCurrencies();
-
from appwrite.client import Client from 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.list_currencies()
-
require 'Appwrite' include Appwrite client = Client.new .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.new(client) response = locale.list_currencies() puts response.inspect
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Locale locale = Locale(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; Future result = locale.listCurrencies(); result .then((response) { print(response); }).catchError((error) { print(error.response); }); }
-
import io.appwrite.Client import io.appwrite.services.Locale val client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key val locale = Locale(client) val response = locale.listCurrencies()
-
import io.appwrite.Client; import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Locale; Client client = new Client() .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key Locale locale = new Locale(client); locale.listCurrencies(new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); return; } System.out.println(result); }));
-
import Appwrite let client = Client() .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key let locale = Locale(client) let currencyList = try await locale.listCurrencies()
-
query { localeListCurrencies { total currencies { symbol name symbolNative decimalDigits rounding code namePlural } } }
-
GET /v1/locale/currencies HTTP/1.1 Host: HOSTNAME Content-Type: application/json X-Appwrite-Response-Format: 1.0.0 X-Appwrite-Project: 5df5acd0d48c2 X-Appwrite-Key: 919c2d18fb5d4...a2ae413da83346ad2 X-Appwrite-JWT: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...
List Languages
List of all languages classified by ISO 639-1 including 2-letter code, name in English, and name in the respective language.
Authentication
To access this route, init your SDK with your project unique ID and an API Key. Make sure your API Key is created with the "locale.read" scope. You can also authenticate using a valid JWT and perform actions on behalf of your user.
HTTP Response
Status Code | Content Type | Payload |
200 OK | application/json | Languages List Object |
-
const sdk = require('node-appwrite'); // Init SDK const client = new sdk.Client(); const locale = new sdk.Locale(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; const promise = locale.listLanguages(); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
import * as sdk from "https://deno.land/x/appwrite/mod.ts"; // Init SDK let client = new sdk.Client(); let locale = new sdk.Locale(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; let promise = locale.listLanguages(); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
<?php use Appwrite\Client; use Appwrite\Services\Locale; $client = new Client(); $client ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; $locale = new Locale($client); $result = $locale->listLanguages();
-
from appwrite.client import Client from 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.list_languages()
-
require 'Appwrite' include Appwrite client = Client.new .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.new(client) response = locale.list_languages() puts response.inspect
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Locale locale = Locale(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; Future result = locale.listLanguages(); result .then((response) { print(response); }).catchError((error) { print(error.response); }); }
-
import io.appwrite.Client import io.appwrite.services.Locale val client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key val locale = Locale(client) val response = locale.listLanguages()
-
import io.appwrite.Client; import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Locale; Client client = new Client() .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key Locale locale = new Locale(client); locale.listLanguages(new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); return; } System.out.println(result); }));
-
import Appwrite let client = Client() .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key let locale = Locale(client) let languageList = try await locale.listLanguages()
-
query { localeListLanguages { total languages { name code nativeName } } }
-
GET /v1/locale/languages HTTP/1.1 Host: HOSTNAME Content-Type: application/json X-Appwrite-Response-Format: 1.0.0 X-Appwrite-Project: 5df5acd0d48c2 X-Appwrite-Key: 919c2d18fb5d4...a2ae413da83346ad2 X-Appwrite-JWT: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...