Quickstart
From API key to your first request in four steps.
1. Get an API key
Sign in to the api.co.id Dashboard and copy your API key. Save it here too so Try it on product pages uses it right away.
2. Add the x-api-co-id header
Every request carries the API key in the x-api-co-id header. Keep the key in an environment variable instead of writing it in your code.
export API_CO_ID_KEY="YOUR_API_KEY"3. Send a request
Pick an endpoint from a product page. This example fetches the list of provinces from Indonesia Regional:
GET /regional/indonesia/provinces
curl -X GET "https://use.api.co.id/regional/indonesia/provinces" \ -H "x-api-co-id: $API_CO_ID_KEY"Expected result
Status 200 with is_success: true and the provinces in data.
4. Adjust the payload
File-processing endpoints (OCR, Face Matching, and similar) accept multipart/form-data:
curl -X POST "<endpoint>" \
-H "x-api-co-id: $API_CO_ID_KEY" \
-F "file=@/path/to/image.jpg"
- For JSON endpoints, swap
-Ffor-H "Content-Type: application/json" -d '{...}'. - Check the product page for required fields and size/type limits.
- For best OCR results, use clear, high-resolution images without glare.
Was this page helpful?