> ## Documentation Index
> Fetch the complete documentation index at: https://docs.letsfind.work/llms.txt
> Use this file to discover all available pages before exploring further.

# Facets

> Count open jobs per filter value, to build filter menus or size a plan.

`GET /v1/facets` takes the same filters as `GET /v1/jobs`. For each filter marked "Facet" in [the filter table](https://docs.letsfind.work/search.md#all-filters), it returns the most common values among the matching open jobs, with a count.

```bash theme={null}
curl "$BASE_URL/v1/facets?q=teacher&country=US" -H "Authorization: Bearer $API_KEY"
```

```json theme={null}
{
  "facets": {
    "workplaceType": [
      { "value": "onsite", "count": 912 },
      { "value": "hybrid", "count": 85 },
      { "value": "remote", "count": 41 }
    ],
    "region": [
      { "value": "California", "count": 140 },
      { "value": "Texas", "count": 97 }
    ]
  }
}
```

The example is shortened; a real answer has every facet.

## How counts work

* Each facet lists up to 50 values, most jobs first.
* A facet ignores its own filter and applies all the others. With `country=US`, the `country` facet still lists other countries, so you can show "what if" counts in a filter menu.
* A job in several places counts under each of its countries, regions and cities. So a facet's counts can add up to more than the number of jobs.
* Jobs with no value for a facet (no pay, unknown city) are not counted in it.
* Values come from the jobs. A new value appears as soon as a job has it.

## Uses

* Fill filter menus with the values that have jobs.
* See how many jobs a search would return before you page through it.
* Find the exact `region` and `city` names to filter on.

## Count

`GET /v1/count` takes the same filters and returns how many open jobs match, for free. Use it to size a plan before you pull jobs.

```bash theme={null}
curl "$BASE_URL/v1/count?occupation=2512&country=DE" -H "Authorization: Bearer $API_KEY"
```

```json theme={null}
{ "count": 1234 }
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.