Country pickers, phone code lists and a Cambodia province dropdown, ready as JSON.
Nearly every sign-up form needs a country picker with flags and phone codes, and Cambodian apps need a province list. This API gives you 198 countries and territories with ISO codes, capital, region, currency, calling code, main languages and a flag emoji, plus the 25 provinces of Cambodia with Khmer names, ISO 3166-2 codes, provincial capitals and coordinates.
The facts are stable, but they are provided for learning and prototypes: check an official source before relying on them.
const res = await fetch('https://toolorca.com/api/v1/countries?subregion=South-Eastern%20Asia&select=name,capital,currency,callingCode,flag');
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const data = await res.json();
console.log(data);
import 'dart:convert';
import 'package:http/http.dart' as http;
Future<void> main() async {
final res = await http.get(
Uri.parse('https://toolorca.com/api/v1/countries?subregion=South-Eastern%20Asia&select=name,capital,currency,callingCode,flag'),
);
if (res.statusCode >= 400) throw Exception('HTTP ${res.statusCode}');
final data = jsonDecode(utf8.decode(res.bodyBytes));
print(data);
}
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.RequestBody.Companion.toRequestBody
// Call from a background thread or coroutine (Dispatchers.IO), never the main thread.
val client = OkHttpClient()
val request = Request.Builder()
.url("https://toolorca.com/api/v1/countries?subregion=South-Eastern%20Asia&select=name,capital,currency,callingCode,flag")
.build()
client.newCall(request).execute().use { res ->
if (!res.isSuccessful) error("HTTP ${res.code}")
println(res.body?.string())
}
import Foundation
var request = URLRequest(url: URL(string: "https://toolorca.com/api/v1/countries?subregion=South-Eastern%20Asia&select=name,capital,currency,callingCode,flag")!)
let (data, response) = try await URLSession.shared.data(for: request)
guard let http = response as? HTTPURLResponse, http.statusCode < 400 else {
throw URLError(.badServerResponse)
}
print(String(decoding: data, as: UTF8.self))
GET /countries?subregion=South-Eastern%20Asia&select=name,cap…
const res = await fetch('https://toolorca.com/api/v1/countries/KH');
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const data = await res.json();
console.log(data);
import 'dart:convert';
import 'package:http/http.dart' as http;
Future<void> main() async {
final res = await http.get(
Uri.parse('https://toolorca.com/api/v1/countries/KH'),
);
if (res.statusCode >= 400) throw Exception('HTTP ${res.statusCode}');
final data = jsonDecode(utf8.decode(res.bodyBytes));
print(data);
}
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.RequestBody.Companion.toRequestBody
// Call from a background thread or coroutine (Dispatchers.IO), never the main thread.
val client = OkHttpClient()
val request = Request.Builder()
.url("https://toolorca.com/api/v1/countries/KH")
.build()
client.newCall(request).execute().use { res ->
if (!res.isSuccessful) error("HTTP ${res.code}")
println(res.body?.string())
}
import Foundation
var request = URLRequest(url: URL(string: "https://toolorca.com/api/v1/countries/KH")!)
let (data, response) = try await URLSession.shared.data(for: request)
guard let http = response as? HTTPURLResponse, http.statusCode < 400 else {
throw URLError(.badServerResponse)
}
print(String(decoding: data, as: UTF8.self))
const res = await fetch('https://toolorca.com/api/v1/cambodia/provinces?select=name,nameKm,code,capital&limit=5');
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const data = await res.json();
console.log(data);
import 'dart:convert';
import 'package:http/http.dart' as http;
Future<void> main() async {
final res = await http.get(
Uri.parse('https://toolorca.com/api/v1/cambodia/provinces?select=name,nameKm,code,capital&limit=5'),
);
if (res.statusCode >= 400) throw Exception('HTTP ${res.statusCode}');
final data = jsonDecode(utf8.decode(res.bodyBytes));
print(data);
}
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.RequestBody.Companion.toRequestBody
// Call from a background thread or coroutine (Dispatchers.IO), never the main thread.
val client = OkHttpClient()
val request = Request.Builder()
.url("https://toolorca.com/api/v1/cambodia/provinces?select=name,nameKm,code,capital&limit=5")
.build()
client.newCall(request).execute().use { res ->
if (!res.isSuccessful) error("HTTP ${res.code}")
println(res.body?.string())
}
import Foundation
var request = URLRequest(url: URL(string: "https://toolorca.com/api/v1/cambodia/provinces?select=name,nameKm,code,capital&limit=5")!)
let (data, response) = try await URLSession.shared.data(for: request)
guard let http = response as? HTTPURLResponse, http.statusCode < 400 else {
throw URLError(.badServerResponse)
}
print(String(decoding: data, as: UTF8.self))
GET /cambodia/provinces?select=name,nameKm,code,capital&limit=5
const res = await fetch('https://toolorca.com/api/v1/cambodia/provinces/siem-reap');
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const data = await res.json();
console.log(data);
import 'dart:convert';
import 'package:http/http.dart' as http;
Future<void> main() async {
final res = await http.get(
Uri.parse('https://toolorca.com/api/v1/cambodia/provinces/siem-reap'),
);
if (res.statusCode >= 400) throw Exception('HTTP ${res.statusCode}');
final data = jsonDecode(utf8.decode(res.bodyBytes));
print(data);
}
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.RequestBody.Companion.toRequestBody
// Call from a background thread or coroutine (Dispatchers.IO), never the main thread.
val client = OkHttpClient()
val request = Request.Builder()
.url("https://toolorca.com/api/v1/cambodia/provinces/siem-reap")
.build()
client.newCall(request).execute().use { res ->
if (!res.isSuccessful) error("HTTP ${res.code}")
println(res.body?.string())
}
import Foundation
var request = URLRequest(url: URL(string: "https://toolorca.com/api/v1/cambodia/provinces/siem-reap")!)
let (data, response) = try await URLSession.shared.data(for: request)
guard let http = response as? HTTPURLResponse, http.statusCode < 400 else {
throw URLError(.badServerResponse)
}
print(String(decoding: data, as: UTF8.self))
Load /countries?select=name,callingCode,flag&limit=0 once, keep it in the app and show flag with callingCode in the picker. Put Cambodia first for Cambodian users with /countries/KH. The response is cacheable for a day.
Free daily limit
Shared with the other mock services: 50 requests per day and 10 per minute per IP address. Country and province data almost never changes, so download it once and bundle it.
Frequently asked questions
Does it include Cambodian districts and communes?
Not yet: only the 25 provinces. They include Khmer names, ISO 3166-2 codes (KH-1 to KH-25), provincial capitals, geographic zones and coordinates.
Where do the flag images come from?
The API returns a flag emoji and a lower-case flagCode that matches open-source flag sets such as flag-icons.
Are Khmer country names included?
For Cambodia, its neighbours and the countries Cambodian users look up most, in nameKm; other countries return null.
Can I use it offline?
Yes. The lists are small: fetch them once and store them in your app.