Your KBBI API is now live at: https://kbbi-api.baguskto.workers.dev
curl https://kbbi-api.baguskto.workers.dev/api/lookup/rumah
# Response: {"exists":true,"word":"rumah"}curl https://kbbi-api.baguskto.workers.dev/api/word/rumah
# Returns full KBBI entry with meanings, etymology, related words, etc.curl 'https://kbbi-api.baguskto.workers.dev/api/search?q=rum&limit=5'
# Response: {"query":"rum","count":5,"results":["rum","rum gula","ruma","rumah","rumah (ber)loteng"]}curl https://kbbi-api.baguskto.workers.dev/api/similar/rumh
# Response: {"word":"rumh","suggestions":[{"word":"ruah","distance":1},{"word":"rumah","distance":1},...]}curl https://kbbi-api.baguskto.workers.dev/api/check/rumah
# Response: {"is_standard":true,"word":"rumah","non_standard_forms":[]}curl https://kbbi-api.baguskto.workers.dev/api/stats
# Response: {"total_words":112645,"api_version":"1.0.0","endpoints":[...]}const KBBI_API_URL = 'https://kbbi-api.baguskto.workers.dev';
// Check if word exists
async function checkWord(word) {
const response = await fetch(`${KBBI_API_URL}/api/lookup/${encodeURIComponent(word)}`);
const data = await response.json();
return data.exists;
}
// Get word details
async function getWordDetails(word) {
const response = await fetch(`${KBBI_API_URL}/api/word/${encodeURIComponent(word)}`);
return response.json();
}
// Get typo suggestions
async function getSuggestions(word, limit = 5) {
const response = await fetch(
`${KBBI_API_URL}/api/similar/${encodeURIComponent(word)}?limit=${limit}`
);
return response.json();
}
// Search words
async function searchWords(query, limit = 10) {
const response = await fetch(
`${KBBI_API_URL}/api/search?q=${encodeURIComponent(query)}&limit=${limit}`
);
return response.json();
}
// Check if word is standard form
async function checkStandardForm(word) {
const response = await fetch(`${KBBI_API_URL}/api/check/${encodeURIComponent(word)}`);
return response.json();
}import React, { useState } from 'react';
import { View, TextInput, Text, FlatList } from 'react-native';
const KBBI_API_URL = 'https://kbbi-api.baguskto.workers.dev';
export default function SpellChecker() {
const [text, setText] = useState('');
const [suggestions, setSuggestions] = useState([]);
const checkWord = async (word) => {
if (!word) return;
// Check if word exists
const lookupRes = await fetch(`${KBBI_API_URL}/api/lookup/${encodeURIComponent(word)}`);
const lookupData = await lookupRes.json();
if (!lookupData.exists) {
// Get suggestions for misspelled word
const suggestRes = await fetch(`${KBBI_API_URL}/api/similar/${encodeURIComponent(word)}`);
const suggestData = await suggestRes.json();
setSuggestions(suggestData.suggestions);
} else {
setSuggestions([]);
}
};
return (
<View>
<TextInput
value={text}
onChangeText={(value) => {
setText(value);
const words = value.split(' ');
const lastWord = words[words.length - 1];
checkWord(lastWord);
}}
placeholder="Type in Indonesian..."
/>
{suggestions.length > 0 && (
<FlatList
data={suggestions}
renderItem={({ item }) => (
<Text onPress={() => {
const words = text.split(' ');
words[words.length - 1] = item.word;
setText(words.join(' '));
setSuggestions([]);
}}>
{item.word}
</Text>
)}
keyExtractor={(item) => item.word}
/>
)}
</View>
);
}| Endpoint | Method | Description |
|---|---|---|
/ |
GET | API information |
/api/stats |
GET | API statistics (total words, version, endpoints) |
/api/lookup/:word |
GET | Check if word exists in KBBI |
/api/word/:word |
GET | Get complete word details |
/api/check/:word |
GET | Check if word is standard form |
/api/similar/:word?limit=N |
GET | Get typo suggestions using Levenshtein distance |
/api/search?q=query&limit=N |
GET | Search words by prefix or substring |
- Global CDN: Deployed on Cloudflare's edge network (270+ locations worldwide)
- Low Latency: KV storage with millisecond lookups
- High Availability: 99.99% uptime SLA
- Auto-scaling: Handles any traffic volume
- Free Tier: 100,000 requests/day included
CORS is enabled for all origins (*), so you can use this API from:
- React Native apps
- Web browsers
- Mobile apps
- Any HTTP client
- Text Editor Screen: Use
/api/lookupto check words as user types - Spell Checking: Use
/api/similarfor typo suggestions - Word Details: Use
/api/wordto show definitions, examples, etymology - Autocomplete: Use
/api/searchfor word suggestions - Formality Checker: Use
/api/checkto detect non-standard forms
# View real-time logs
npx wrangler tail
# Check KV storage
npx wrangler kv:key list --namespace-id=2649f25bbb964775bc357e0700eeec29
# Update a word
npx wrangler kv:key put "rumah" --path=word.json --namespace-id=2649f25bbb964775bc357e0700eeec29
# Deploy updates
npm run deploy- Total Words: 112,645
- Non-standard Forms Indexed: 3,619
- KV Storage Used: ~128 MB
- Average Lookup Time: < 50ms globally
Enjoy building your KBBI Assistant app! 🚀