---
title: "Execute search of archives/repositories"
method: GET
path: "/search/v1/archives"
tags: ["SearchForRepositories"]
---

# Execute search of archives/repositories

`GET /search/v1/archives`

## Request

- Base URL: `https://discovery.nationalarchives.gov.uk/API`
- URL: `https://discovery.nationalarchives.gov.uk/API/search/v1/archives`
- Auth: none declared
- TypeScript: <https://skmtc.dev/the-national-archives/apis/discovery/docs/search/v1/archives/get.ts> (a function with typed inputs; its response is checked against the schema)

## Query parameters

- `sps.repositoryCountries` string[]
- `sps.repositoryRegions` string[]
- `sps.repositoryCounties` string[]
- `sps.repositoryTypes` string[]
- `sps.archiveCode` integer
- `sps.titleContains` string
- `sps.searchQuery` string, required
- `sps.returnHighlighted` boolean
- `sps.sortByOption` 'RELEVANCE' | 'REFERENCE_ASCENDING' | 'DATE_ASCENDING' | 'DATE_DESCENDING' | 'TITLE_ASCENDING' | 'TITLE_DESCENDING'
- `sps.page` integer
- `sps.resultsPageSize` integer
- `sps.titleFirstLetter` string
- `sps.batchStartMark` string
- `sps.preferenceQueryStringParameter` string

## Response `200`

OK

- RepositorySearchResultsViewModel: ViewModel representing the search results for repositories, including repository details and related facets.
  - `Repositories` RepositorySearchResultViewModel[]: Gets or sets the list of repository search result view models.
    - `Address` string: Gets or sets the address of the repository.
    - `Id` string: Gets or sets the unique identifier of the asset.
    - `Reference` string: Gets or sets the reference code of the asset.
    - `Score` number, float: Gets or sets the relevance score of the asset.
    - `Source` string: Gets or sets the source of the asset.
    - `Title` string: Gets or sets the title of the asset.
  - `RepositoryTypes` FacetItemViewModel[]: Gets or sets the list of repository type facet items.
    - `Code` string
    - `Count` integer
  - `Countries` FacetItemViewModel[]: Gets or sets the list of country facet items.
    - `Code` string
    - `Count` integer
  - `Regions` FacetItemViewModel[]: Gets or sets the list of region facet items.
    - `Code` string
    - `Count` integer
  - `Counties` FacetItemViewModel[]: Gets or sets the list of county facet items.
    - `Code` string
    - `Count` integer
  - `TitleFirstLetters` FacetItemViewModel[]: Gets or sets the list of title first letter facets.
    - `Code` string
    - `Count` integer
  - `Count` integer: Gets or sets the total count of search results.
  - `NextBatchMark` string: Gets or sets the marker for the next batch of results.

## Other responses

- `400`: Bad request
- `404`: Not found
- `500`: Internal Server Error

---

[API](https://skmtc.dev/the-national-archives/apis/discovery.md) - [All operations](https://skmtc.dev/the-national-archives/apis/discovery/llms.txt) - [OpenAPI document](https://skmtc.dev/the-national-archives/apis/discovery/revisions/1e8c76e26ab1?raw)
