# Search API


Use the Search API to execute a search query, retrieve facet values, remove search filters or retrieve a facet query. The Search API applies a [default search configuration](https://doc.sitecore.com/ch/en/developers/cloud-dev/configuration.html) to all searches, using default values and filters. The search endpoint exposes a number of search types, including full-text search and faceted search as well as visual search. It supports various query operators as well as [visual search parameters](https://doc.sitecore.com/ch/en/developers/cloud-dev/supported-visual-search-parameters.html).
## Authentication
To use this API, you need:
- The URL of your Content Hub server. You can get this from your Content Hub
  Administrator. Enter this URL in the <b>{{server}}</b> variable by hovering your mouse 
  over the variable in the <b>Try it</b> pane and then clicking <b>Edit</b>.

- An access token and the client ID. Both are sent with every request. You 
  can create a token through the [Content Hub
  interface](https://doc.sitecore.com/ch/en/users/content-hub/create-an-oauth-client.html) 
  or by [requesting one using the API
  itself](https://doc.sitecore.com/ch/en/developers/cloud-dev/oauth-tokens.html#grant-flows).

{% admonition type="info" name="Note" %}
 The Search API does not use the `Location` header, as there is no support for the creation of a resource.
{% /admonition %}


Version: v1.0
License: closed source
Metadata:
  - product: Content Hub

## Servers

```
https://{server}
```

Variables:
- `server`
Default: "your-server"

## Security

### OAuth2.0

Type: oauth2

## Download OpenAPI description

[Search API](https://api-docs.sitecore.com/_bundle/ch/search-api/index.yaml)

## Search

Use the Search API for full-text searches, faceted searches, and visual searches.

### Execute a complex search query

 - [POST /api/search](https://api-docs.sitecore.com/ch/search-api/search/searchactions.md): Executes a search query and returns the search results. Use POST when the query parameters exceed the URL length limitations. Parameters are passed in a resource instead of URL arguments.

### Execute a simple search query

 - [GET /api/search](https://api-docs.sitecore.com/ch/search-api/search/getsearchactions.md): Executes a search query and returns the search results. Use GET for simple queries that fit within URL length limits, for example, to retrieve the current state of a resource, including its content.

### Retrieve all facet values

 - [POST /api/search/allfacets](https://api-docs.sitecore.com/ch/search-api/search/postallfacets.md): Retrieves all values for a specific facet field, including translations and selection state.

### Remove search filters

 - [POST /api/search/remove](https://api-docs.sitecore.com/ch/search-api/search/searchremovefilters.md): Removes the specified filters from the search query and returns the updated query.

### Retrieve a facet query for an entity

 - [GET /api/search/{id}](https://api-docs.sitecore.com/ch/search-api/search/getfacetquerybyid.md): Retrieves a serialized facet query that can be used to filter search results to items related to a specific entity.

