API Reference
The Chavacano API lets you translate English words into Chavacano β the only Spanish-based creole language in Asia, spoken in Ternate, Philippines.
Introduction
All API endpoints are served from
http://localhost:3000
when running locally. Every endpoint except
/api/generate-key
requires authentication.
Authentication
Pass your API key in the
x-api-key
request header on every call.
x-api-key: chav_your_key_here
Rate Limiting
Each API key is limited to 60 requests per minute. If
you exceed this, you'll receive a
429
response with a
retryAfter
field (in seconds).
Endpoints
Translate a Word
| Parameter | Type | Required | Description |
|---|---|---|---|
| word | string | Yes | The English word to translate |
GET /api/translate?word=hello
x-api-key: chav_abc123
{
"english": "hello",
"chavacano": "hola",
"category": "greeting",
"example": "Hola, como ta ustedes?"
}
Search
| Parameter | Type | Required | Description |
|---|---|---|---|
| q | string | Yes | Search query (searches both English and Chavacano) |
GET /api/search?q=amor
Random Word
No parameters required. Returns a random EnglishβChavacano pair.
Browse Dictionary
| Parameter | Type | Required | Description |
|---|---|---|---|
| category | string | No | Filter by category (e.g. greeting, action, people) |
| page | number | No | Page number (default: 1) |
| limit | number | No | Results per page (default: 20) |
Categories
Returns all available categories and how many words are in each.
Usage Stats
Returns request count, rate limit status, and last used timestamp.
Generate Key
No body or authentication required. Returns a new API key.
Error Codes
Code Examples
JavaScript (fetch)
// Translate "love" to Chavacano const response = await fetch('/api/translate?word=love', { headers: { 'x-api-key': 'chav_your_key_here' } }); const data = await response.json(); console.log(data.chavacano); // "amor"
Python
import requests
res = requests.get(
'http://localhost:3000/api/translate',
params={'word': 'water'},
headers={'x-api-key': 'chav_your_key_here'}
)
print(res.json()['chavacano']) # "agua"
curl
curl -H "x-api-key: chav_your_key_here" \ "http://localhost:3000/api/translate?word=friend"