Count

Count: Area breakdown

GET/v1/count/areas

Counts 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

ParameterType and limitsDescription
countryrequiredstringISO 3166-1 alpha-2 country code.
modeoptionalstringOne of admin, h3default adminadmin: Admin1 children (Admin2 with state); h3: every H3 R8 cell of the country.
stateoptionalstringAdmin1 parent for Admin2 children; not with mode=h3.
category_idoptionalstringOne category ID (Any membership); unset counts all places.
poi_validityoptionalstringOne of all, valid, uncertain, invalid, unknowndefault allValidity bucket.
limitoptionalinteger1–1000, default 100Rows per page, 1–1000.
cursoroptionalstringOpaque 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 (0 when nothing was charged).
  • Retry-After: 429 only: seconds until the rate window ends.

Errors

StatusMeaning
401Missing, invalid or revoked API key (WWW-Authenticate: Bearer). Not charged.
402Insufficient 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.
404Country dataset or place not found. Not charged.
422Invalid parameter or combination, or an invalid cursor. Not charged.
429Workspace rate limit exceeded; retry after Retry-After seconds. Not charged.
502Upstream error or unexpected response. Not charged.
504Upstream timeout. Not charged.

Errors are JSON, {"detail": "..."}. See Errors and rate limits.