# Get statistics areas

Get statistics areas is a read in the HeadHoncho API. Every place the work happened, by postal code and city: jobs, closes, cancels, average ticket and profit, with a point to put on a map.

Page: https://headhoncho.app/docs/api/get_statistics_areas | Part of the HeadHoncho API docs: https://headhoncho.app/docs/api | Machine-readable: https://headhoncho.app/docs/api/openapi.json | Everything in one file: https://headhoncho.app/docs/api/llms-full.txt

## The request

Reference for **Get statistics areas**, HeadHoncho API v1. It is a read, sent to the base address `https://api.headhoncho.app`.

`GET /api/v1/statistics/areas`

The key needs the **Statistics and marketing** area at **read**. An answered call costs 1 credit; a refusal costs nothing. See [credits](https://headhoncho.app/docs/api/errors#credits).

Send your key as `Authorization: Bearer hh_live_...`. See [API keys](https://headhoncho.app/docs/api/keys).

## Parameters

| Name | Kind | Required | Description | Example |
| --- | --- | --- | --- | --- |
| `company_id` | id, in the query | No | One company. Default: every company the credential reaches. | `cmp_14f5` |
| `from` | date, in the query | No | First day. Default: the last 30 days, as the Statistics panel does. | `2026-10-01` |
| `to` | date, in the query | No | Last day, included. Default: today in the company's time zone. | `2026-10-26` |
| `by_date` | text, in the query | No | Which date puts a job in the range: created (default), scheduled or closed. One of `created`, `scheduled`, `closed`. | `created` |

## Try it with your key

Paste your key and change the values. The box builds the call as a cURL line and a fetch line, ready to copy. It never sends anything itself.

Paste your key on the web page and it fills a cURL line and a fetch line with your key and the example values. The page never sends the key anywhere. The same lines with a placeholder key are under Examples below.

## What comes back

from, to, by_date, then areas, one per place: key, label, city, state, postal_code, jobs, closed, canceled, decided, closing_rate (a share from 0 to 1, null with nothing decided), average_ticket, net, net_per_job, lat and lng (the middle of its jobs), pinned and last_job. workspace: net_per_job and closing_rate for the whole range, to compare a place against.

It never changes a record. It only reads the companies the key reaches.

## Every field in the answer

Types are read from the example answer. Money is a plain number in the company's currency. A time carries its offset from UTC (`Z` is UTC). Ids are opaque text. A field with no line of its own here has its name spelled out; the common fields mean the same on every page.

| Field | Type | Meaning |
| --- | --- | --- |
| `from` | date (YYYY-MM-DD) | The first day of the range, inclusive. |
| `to` | date (YYYY-MM-DD) | The last day of the range, inclusive. |
| `by_date` | text | One of `created`, `scheduled`, `closed`. |
| `areas` | list of objects | The areas. |
| `areas[].key` | text | A short code for this item. Match on it in code. |
| `areas[].label` | text | The name the app shows for it. |
| `areas[].city` | text | The city. |
| `areas[].state` | text | The state or region. |
| `areas[].postal_code` | text | The postal code. |
| `areas[].jobs` | whole number | The jobs. |
| `areas[].closed` | whole number | True when the job is closed. |
| `areas[].canceled` | whole number | The canceled. |
| `areas[].decided` | whole number | The decided. |
| `areas[].closing_rate` | number | The closing rate. |
| `areas[].average_ticket` | number | The average ticket. |
| `areas[].net` | money (number) | The net amount, after what is owed either way. In the company's currency. |
| `areas[].net_per_job` | money (number) | The net per job. In the company's currency. |
| `areas[].lat` | number | The lat. |
| `areas[].lng` | number | The lng. |
| `areas[].pinned` | whole number | The pinned. |
| `areas[].last_job` | date (YYYY-MM-DD) | The last job. |
| `workspace` | object | The workspace. |
| `workspace.net_per_job` | money (number) | The net per job. In the company's currency. |
| `workspace.closing_rate` | number | The closing rate. |

## Places, not people

Each row is a postal code and city, never a street. The point is the average of the jobs in it. The app's above and below average labels are not given: read the figures.

## Errors that apply

| Code | Status | What it means |
| --- | --- | --- |
| [`missing_key`](https://headhoncho.app/docs/api/errors#missing_key) | 401 | Send your key as Authorization: Bearer hh_live_... |
| [`unknown_key`](https://headhoncho.app/docs/api/errors#unknown_key) | 401 | That key is not one we issued, or it was revoked. |
| [`no_access`](https://headhoncho.app/docs/api/errors#no_access) | 403 | This credential does not reach that. Ask the person who made it for access. |
| [`not_found`](https://headhoncho.app/docs/api/errors#not_found) | 404 | No such record in the companies this credential reaches. |
| [`out_of_scope`](https://headhoncho.app/docs/api/errors#out_of_scope) | 404 | No such company in the companies this credential reaches. |
| [`invalid`](https://headhoncho.app/docs/api/errors#invalid) | 422 | Some fields were refused. See fields. |
| [`no_credits`](https://headhoncho.app/docs/api/errors#no_credits) | 402 | Out of credits. Top up on Settings › Credits, or turn on auto top-up. |

## Related

- [Get statistics summary](https://headhoncho.app/docs/api/get_statistics_summary): Jobs and leads for a range and the money they left: profit, lead cost, cost per lead, profit after leads, ad spend and profit after advertising.
- [List area jobs](https://headhoncho.app/docs/api/list_area_jobs): The jobs behind one area on the map, newest first, twenty-five a page, with status, price, profit and where they came from.
- [List job pins](https://headhoncho.app/docs/api/list_job_pins): Each job in the range that has a point on the map, newest first, up to 400, with its status, price and profit. Narrow it with a box.
- The same records in the app: [the Statistics panel](https://headhoncho.app/docs/statistics).
- How the API fits together: [the model](https://headhoncho.app/docs/api/model), [API keys](https://headhoncho.app/docs/api/keys), [errors](https://headhoncho.app/docs/api/errors) and [the MCP server](https://headhoncho.app/docs/api/mcp).

## Examples

### Answer

```json
{
  "from": "2026-09-27",
  "to": "2026-10-26",
  "by_date": "created",
  "areas": [
    {
      "key": "61701|Bloomington",
      "label": "61701 · Bloomington",
      "city": "Bloomington",
      "state": "IL",
      "postal_code": "61701",
      "jobs": 21,
      "closed": 14,
      "canceled": 2,
      "decided": 16,
      "closing_rate": 0.875,
      "average_ticket": 1510.0,
      "net": 11840.0,
      "net_per_job": 563.81,
      "lat": 40.4842,
      "lng": -88.9937,
      "pinned": 21,
      "last_job": "2026-10-25"
    },
    {
      "key": "none",
      "label": "No address",
      "city": "",
      "state": "",
      "postal_code": "",
      "jobs": 3,
      "closed": 1,
      "canceled": 0,
      "decided": 1,
      "closing_rate": 1.0,
      "average_ticket": 900.0,
      "net": 410.0,
      "net_per_job": 136.67,
      "lat": null,
      "lng": null,
      "pinned": 0,
      "last_job": "2026-10-19"
    }
  ],
  "workspace": {
    "net_per_job": 530.0,
    "closing_rate": 0.82
  }
}
```

### cURL

```bash
curl "https://api.headhoncho.app/api/v1/statistics/areas?company_id=cmp_14f5&from=2026-10-01" \
  -H "Authorization: Bearer hh_live_..."
```

### Python

```python
import requests

response = requests.get(
    "https://api.headhoncho.app/api/v1/statistics/areas",
    headers={"Authorization": "Bearer hh_live_..."},
    params={
        "company_id": "cmp_14f5",
        "from": "2026-10-01",
    },
)
response.raise_for_status()
print(response.json())
```

### JavaScript

```javascript
const response = await fetch("https://api.headhoncho.app/api/v1/statistics/areas?company_id=cmp_14f5&from=2026-10-01", {
  headers: { Authorization: "Bearer hh_live_..." },
});
const data = await response.json();
console.log(data);
```

### Your AI

```text
Tool: get_statistics_areas
Arguments: company_id (id, optional), from (date, optional), to (date, optional), by_date (text, optional)
Access: read on Statistics and marketing
Hints: readOnly=true, destructive=false, idempotent=true, openWorld=false
Try asking: "Using HeadHoncho, get statistics areas with company_id cmp_14f5."
```
