Skip to main content

Field Values

List the distinct values of an extracted field across documents with GET /v1/search/field-values: per-value counts sorted by frequency for faceted search UIs.

The field values endpoint returns the distinct values of a specific extracted field across all documents in your workspace, with a count of how many documents carry each value. Results are sorted by count descending, so the most common values appear first. Use it to populate filter dropdowns, build faceted search interfaces, or analyze value distributions for data quality.

Values are read from the materialized value store — the same store POST /v1/documents/filter executes against — so every value returned here, passed as an eq condition to the filter, matches exactly count documents. That closed loop is what makes the endpoint safe for facet UIs: a facet chip can display its count up front and the click can never come back empty. Counts respect Sources-IAM visibility, evaluated as the API key's minting user.

The optional q parameter narrows values by case-insensitive substring match, which turns the endpoint into a value-level autocomplete: as a user types into a filter input, fetch matching values with their counts and offer them as suggestions. Combine with source_id to scope the distribution to one ingestion stream — useful when the same field (say currency) has different distributions per source.

The field parameter must be a field registry UUID, not a field name. Resolve names to UUIDs with the field autocomplete endpoint or GET /v1/fields; a non-UUID value returns a 400 error naming the fix.
GET/v1/search/field-values

Query parameters

field*stringThe field registry UUID to read values for (resolve it via field autocomplete).
source_idstringScope to a specific source connection.
qstringFilter values by substring match (case-insensitive).
limitintegerMaximum number of values to return (up to 500). Default: 50

Request

curl "https://api.talonic.com/v1/search/field-values?field=6f1e9a2b-4c3d-4e5f-8a7b-9c0d1e2f3a4b" \
  -H "Authorization: Bearer $TALONIC_API_KEY"

Response

Response fields

valuesarrayArray of distinct value objects sorted by count descending.
values[].valuestringThe distinct field value.
values[].countintegerNumber of documents containing this value.
totalDistinctintegerTotal number of distinct values for this field (before limit is applied).

Response

{
  "values": [
    { "value": "Acme Corp", "count": 47 },
    { "value": "Globex Inc", "count": 23 }
  ],
  "totalDistinct": 156
}

Errors

Error responses

400validation_errorThe `field` parameter is missing or is not a field registry UUID.
401unauthorizedMissing or invalid API key.
429rate_limitedToo many requests. Retry after the period indicated in the Retry-After header.

Pair this endpoint with the field autocomplete endpoint to build a two-step filter UI: first let the user select a field via GET /v1/search/autocomplete, then populate a dropdown with that field's distinct values from this endpoint. The totalDistinct count is useful for showing "N of M values" pagination hints, and for spotting data-quality issues — a field like currency reporting 40 distinct values usually means unnormalized variants worth a resolution policy.

Frequently asked questions

Are values case-sensitive?+
Values are returned as extracted. The `q` substring filter is case-insensitive, so searching for "acme" will match "Acme Corp".
What does totalDistinct represent when a limit is applied?+
It shows the total number of unique values for this field across all documents, regardless of the `limit` parameter. Use it to indicate "showing 50 of 156 values" in your UI.
How do I find the UUID for a field?+
Call `GET /v1/search/autocomplete` with the field name and read `fieldId` from the match, or list the full registry with `GET /v1/fields`. Passing a field name instead of a UUID returns a 400 error.
Will a value from this endpoint always match documents in the filter?+
Yes. Values and counts are read from the same materialized store the document filter queries, so passing a returned value as an eq condition matches exactly count documents (subject to the same IAM visibility).
Can I combine q and source_id?+
Yes. q narrows which distinct values are returned (case-insensitive substring), and source_id narrows which documents are counted — together they answer "which values of this field, matching this text, exist in this ingestion stream, and how often".