Skip to main content

Quickstart

From API key to your first request in four steps.

  1. Get an API key
  2. Add the header
  3. Send a request
  4. Adjust the payload

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.

Stored only in this browser and used by Try it.

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 -F for -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?