CPCCambodiaPostalCode Dev
API ReferencePricing
CPCCambodiaPostalCode Dev

REST API for Cambodia address data — provinces, districts, communes, and villages. Free to start, no credit card required.

GitHubTwitter / X
Free API — no credit card required

Docs

  • Introduction
  • Quick Start
  • API Reference
  • Authentication
  • Error Codes
  • Rate Limits

Product

  • Pricing
  • Use Cases
  • Dashboard
  • API Keys
  • Changelog
  • Status

Community

  • GitHub
  • Blog
  • Changelog
  • Discussions
  • Contact

Company

  • About
  • Privacy Policy
  • Terms of Service

© 2026 CambodiaPostalCode Dev. Built for developers.

PrivacyTermsContactChangelogGitHub
CambodiaPostalCode Dev
CambodiaPostalCode Dev
DocsAPI ReferenceHomeIntroduction
API ReferenceGet all provinces GETGet province by ID GETGet districts by province GETGet district by ID GETGet communes by district GETGet commune by ID GETGet villages by commune GETGet village by ID GETSearch administrative units GETLookup postal code GET
Error HandlingRate LimitsSDKs & Libraries
Resources

Error Handling

Understand API error responses and status codes

Error Format

All errors follow a consistent JSON format with a statusCode field, an error object containing a machine-readable code and a human-readable message, and a metadata object with a correlationId for tracing:

{
  "statusCode": 404,
  "error": {
    "code": "NOT_FOUND",
    "message": "Postal code not found",
    "details": {}
  },
  "metadata": {
    "correlationId": "01a0642a-f300-765d-abd3-aac300a772e8"
  }
}

The correlationId in metadata is a UUIDv7 that uniquely identifies the request across all services. Include it when contacting support — it lets us trace the exact request path through logs.

HTTP Status Codes

CodeDescription
200Success
400Bad Request — invalid parameters
401Unauthorized — missing or invalid API key
404Not Found — resource doesn't exist
429Too Many Requests — rate limit exceeded
500Internal Server Error

Common Errors

401 Unauthorized

Your API key is missing, invalid, or revoked. Check the Authorization header.

{
  "statusCode": 401,
  "error": {
    "code": "NO_API_KEY_PROVIDED",
    "message": "No API key provided",
    "details": {}
  },
  "metadata": {
    "correlationId": "01a0642b-17f8-788f-8536-ae8d7d32eef3"
  }
}

400 Bad Request

The request failed validation. The error.models field lists which parameter failed and why:

{
  "statusCode": 400,
  "error": {
    "message": "Validation failed",
    "code": "VALIDATION_FAILED",
    "models": {
      "_": "Invalid input: expected string, received undefined"
    }
  },
  "data": null,
  "metadata": {
    "correlationId": "01a0642a-f300-765d-abd3-aac300a772e8"
  }
}

404 Not Found

The requested resource (province, district, commune, or village) doesn't exist with the given ID or postal code.

429 Too Many Requests

You've exceeded your rate limit. See Rate Limits for details.

Lookup postal code GET

Previous Page

Rate Limits

API rate limiting and quota information