---
title: "Resource Search Aggregations"
method: GET
path: "/v0.1/discovery/resources/aggregations"
tags: ["discovery"]
---

# Resource Search Aggregations

`GET /v0.1/discovery/resources/aggregations`

## Request

- Base URL: `https://platform.nypl.org/api`
- URL: `https://platform.nypl.org/api/v0.1/discovery/resources/aggregations`
- Auth: none declared
- TypeScript: <https://skmtc.dev/nypl/apis/discovery-api/docs/v0.1/discovery/resources/aggregations/get.ts> (a function with typed inputs; its response is checked against the schema)

Fetch resources search aggregations for a given query. Note that aggregations are not "self-filtered" in order to aid expanding one's filtered search. For example, the subjectLiteral aggregation is built without any subjectLiteral filters.

## Query parameters

- `q` string, required
- `search_scope` 'all' | 'title' | 'journal_title' | 'contributor' | 'subject' | 'series' | 'callnumber'
- `filters[*]` string

## Response `200`

An array of resources search aggregations

- ResourceAggregationsResponse
  - `@context` string, url: URL for JSONLD doc mapping short-hand property names to IRIs
  - `@type` 'itemListElement'
  - `@id` string: ID, e.g. "language"
  - `itemListElement` Aggregation[]
    - `@type` 'nypl:Aggregation'
    - `@id` string: Identifies field being aggregated
    - `field` string: Identifies field being aggregated
    - `values` AggregationValue[]
      - `value` string: term aggregated
      - `count` integer: number of records matching term

## Other responses

- `default`: Unexpected error

---

[API](https://skmtc.dev/nypl/apis/discovery-api.md) - [All operations](https://skmtc.dev/nypl/apis/discovery-api/llms.txt) - [OpenAPI document](https://skmtc.dev/nypl/apis/discovery-api/revisions/fdf39728bf28?raw)
