Search and look up words in six Khmer dictionaries from any app, as JSON.
The Dictionary API gives your app the same data as the ToolOrca dictionaries: the Khmer dictionary of Samdech Chuon Nath with Pali, Buddhist and legal lexicons, English–Khmer and Khmer–English with IPA and example sentences, and Korean, Japanese and Chinese dictionaries with Khmer meanings.
Use it to build a dictionary or flashcard app, add a "look up this word" feature to a reader, or test search-as-you-type in Flutter, Android or iOS. Search matches whole words first and then the most common words that start with your text, so it works well for autocomplete.
List the dictionaries with their languages and word counts.
curl 'https://toolorca.com/api/v1/dictionaries'
const res = await fetch('https://toolorca.com/api/v1/dictionaries');
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/dictionaries'),
);
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/dictionaries")
.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/dictionaries")!)
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))
Search a dictionary. Exact matches come first, then the most common words that start with the text.
Up to 100 matches per search, paginated. English search also finds word forms (ran → run, children → child); Korean, Japanese and Chinese search also accept romanization, kana and pinyin.
Parameter
In
Type
Description
dict required
path
string
khmer-khmer, english-khmer, khmer-english, korean-khmer, japanese-khmer or chinese-khmer.
const res = await fetch('https://toolorca.com/api/v1/dictionaries/english-khmer/search?q=hel&limit=3');
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/dictionaries/english-khmer/search?q=hel&limit=3'),
);
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/dictionaries/english-khmer/search?q=hel&limit=3")
.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/dictionaries/english-khmer/search?q=hel&limit=3")!)
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 /dictionaries/english-khmer/search?q=hel&limit=3
Get the full entry for one word: meanings, pronunciation, examples and related words.
The word can be its slug (as returned by search) or any form that search knows. The shape of data depends on the dictionary; see the field notes below.
Parameter
In
Type
Description
dict required
path
string
khmer-khmer, english-khmer, khmer-english, korean-khmer, japanese-khmer or chinese-khmer.
word required
path
string
The word, URL-encoded (e.g. %E1%9E%91%E1%9E%B9%E1%9E%80 for ទឹក).
const res = await fetch('https://toolorca.com/api/v1/dictionaries/english-khmer/words/hello');
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/dictionaries/english-khmer/words/hello'),
);
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/dictionaries/english-khmer/words/hello")
.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/dictionaries/english-khmer/words/hello")!)
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 /dictionaries/english-khmer/words/hello
Example response
{
"dictionary":"english-khmer",
"word":"hello",
"slug":"hello",
"summary":"សួស្តី, ជំរាបសួរ, អាឡូ",
"url":"https://toolorca.com/dictionary/english-khmer/hello/",
"data": {
"w":"hello",
"ipa":"/həˈloʊ/",
"km":"សួស្តី",
"m": [
{
"pos":"exclamation",
"km": [
"សួស្តី",
"ជំរាបសួរ",
"អាឡូ"
],
"en":"used as a greeting or to begin a phone conversation",
"ex": [
{
"en":"Hello, how are you?",
"km":"សួស្តី តើអ្នកសុខសប្បាយទេ?"
}
]
}
]
}
}
const res = await fetch('https://toolorca.com/api/v1/dictionaries/korean-khmer/random');
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/dictionaries/korean-khmer/random'),
);
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/dictionaries/korean-khmer/random")
.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/dictionaries/korean-khmer/random")!)
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 /dictionaries/korean-khmer/random
Example response
{
"dictionary":"korean-khmer",
"word":"나",
"slug":"나",
"summary":"ខ្ញុំ; ឯង (ស្និទ្ធស្នាល)",
"url":"https://toolorca.com/dictionary/korean-khmer/%EB%82%98/",
"data": {
"w":"나",
"roman":"na",
"s": [
{
"pos":"pronoun",
"km":"ខ្ញុំ; ឯង (ស្និទ្ធស្នាល)",
"en":"I; me (informal)",
"ex": {
"ko":"나도 같이 가요.",
"km":"ខ្ញុំក៏ទៅជាមួយដែរ។",
"en":"I am going together too."
}
}
]
}
}
Fields in the word data
khmer-khmer:senses[] with pos (part of speech), def (definition) and src (source lexicon), plus pron.
english-khmer and khmer-english:ipa, km (main meaning) and m[] with pos, km[], en (definition), kmd (Khmer definition) and ex[] examples; some entries add synonyms and antonyms.
korean-khmer and japanese-khmer:roman or kana/romaji, and s[] senses with km, en and an example.
chinese-khmer:py (pinyin), en, km and hsk level.
Fair use
Dictionary endpoints allow 90 requests per minute and 3,000 per day for each IP address. That is plenty for an app used by real people, but the API is not meant for downloading whole dictionaries. Cache results in your app where you can.
Frequently asked questions
Is the Khmer dictionary API free?
Yes. It is free for learning, personal projects and prototypes, with per-IP rate limits. There is no key and no sign-up.
Can I search in Khmer script?
Yes. Send Khmer Unicode in q, URL-encoded. Zero-width spaces are ignored.
How do I show a word page link?
Every result has a url that opens the word on ToolOrca, so users can see the full entry in a browser.
Can I download the whole dictionary?
No. The API is for looking words up; bulk copying is blocked by the daily limit.