Count
Count: Area breakdown
GET
/v1/count/areasCounts of the child areas of a country (Admin1, or H3 R8 cells) or of one Admin1 (Admin2).
- Authentication
- Workspace API key:
Authorization: Bearer YOUR_API_KEY - Price
- 1,000 credits ($0.001 per request)1,000 credits per successful request; every page is a request.
Try in PlaygroundOpens the request in the Playground. Nothing runs until you choose Run.
Parameters
| Parameter | Type and limits | Description |
|---|---|---|
countryrequired | string | ISO 3166-1 alpha-2 country code. |
modeoptional | stringOne of admin, h3default admin | admin: Admin1 children (Admin2 with state); h3: every H3 R8 cell of the country. |
stateoptional | string | Admin1 parent for Admin2 children; not with mode=h3. |
category_idoptional | string | One category ID (Any membership); unset counts all places. |
poi_validityoptional | stringOne of all, valid, uncertain, invalid, unknowndefault all | Validity bucket. |
limitoptional | integer1–1000, default 100 | Rows per page, 1–1000. |
cursoroptional | string | Opaque next_cursor from the previous page, with the same other parameters. Every page is a separate request, billed on its own. |
Response
JSON. The example on the right shows the shape with illustrative values.
X-Request-Id: Server-generated ID of this request; quote it to support.X-Credits-Charged: Credits actually debited for this request (0when nothing was charged).Retry-After: 429 only: seconds until the rate window ends.
Errors
| Status | Meaning |
|---|---|
401 | Missing, invalid or revoked API key (WWW-Authenticate: Bearer). Not charged. |
402 | Insufficient credits: the wallet cannot cover the operation's base price before the call, or the actual price of the result at debit time (for example a large page). Nothing is charged; top up and retry. |
404 | Country dataset or place not found. Not charged. |
422 | Invalid parameter or combination, or an invalid cursor. Not charged. |
429 | Workspace rate limit exceeded; retry after Retry-After seconds. Not charged. |
502 | Upstream error or unexpected response. Not charged. |
504 | Upstream timeout. Not charged. |
Errors are JSON, {"detail": "..."}. See Errors and rate limits.