Access LaoCorpus data programmatically through our REST API. Perfect for researchers, developers, and AI practitioners.
1. Request API access through our Access Request Form
2. Receive your API key via email after approval
3. Include your API key in the Authorization header: Authorization: Bearer YOUR_API_KEY
4. Start making requests to our endpoints
{
"file": "multipart/form-data",
"title": "string (required)",
"author": "string (optional)",
"category": "enum (required)",
"year": "integer (optional)"
}{
"success": true,
"documentId": 157,
"title": "ປະຫວັດສາດລາວ",
"tokenCount": 15234,
"message": "Document uploaded successfully"
}id(integer)Document ID (optional){
"documents": [
{
"id": 1,
"title": "ປະຫວັດສາດລາວ",
"author": "ດຣ.ໄພວັນ ມາລາວົງ",
"category": "Education",
"year": 2023,
"tokenCount": 15234,
"source": "National Library"
}
],
"total": 156
}category(string)Filter by category (optional)limit(integer)Max results (default: 100)offset(integer)Skip results (default: 0){
"documents": [
{
"id": 1,
"title": "ປະຫວັດສາດລາວ",
"textContent": "ປະເທດລາວມີປະຫວັດສາດອັນຍາວນານ...",
"tokenCount": 15234,
"metadata": {
"author": "ດຣ.ໄພວັນ ມາລາວົງ",
"year": 2023
}
}
],
"total": 156,
"hasMore": true
}category(string)Filter by category (optional){
"totalTokens": 1234567,
"totalDocuments": 156,
"byCategory": [
{ "category": "Education", "count": 45, "tokens": 456789 },
{ "category": "Literature", "count": 32, "tokens": 345678 }
],
"lastUpdated": "2025-12-07T10:30:00Z"
}# Upload document curl -X POST "https://sambai.ai/api/upload" \ -H "Authorization: Bearer YOUR_API_KEY" \ -F "[email protected]" \ -F "title=ປະຫວັດສາດລາວ" \ -F "category=Education" # Get metadata curl -X GET "https://sambai.ai/api/getMetadata?id=1" \ -H "Authorization: Bearer YOUR_API_KEY" # Get corpus data curl -X GET "https://sambai.ai/api/getCorpus?category=Education&limit=10" \ -H "Authorization: Bearer YOUR_API_KEY" # Get token counts curl -X GET "https://sambai.ai/api/tokenCount" \ -H "Authorization: Bearer YOUR_API_KEY"
Free Tier: 100 requests/day
Academic Tier: 1,000 requests/day
Commercial Tier: 10,000 requests/day
Need higher limits? View our pricing plans