---
type: api
title: Get all synonym sets
description: Get a summary of all defined synonym sets.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-synonyms-get-synonyms-sets
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-synonyms-get-synonyms-sets
products:
  - Elasticsearch
---

# Get all synonym sets

Availability: 8.10+

## Paths

- `GET` `/_synonyms`

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/authentication#apikeyauth)
- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/authentication#basicauth)
- [Bearer auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/authentication#bearerauth)

## Description

Get a summary of all defined synonym sets.

## Required authorization

* Cluster privileges: `manage_search_synonyms`

## Query String Parameters

- `from` (number · default: 0)
  The starting offset for synonyms sets to retrieve.
- `size` (number · default: 10)
  The maximum number of synonyms sets to retrieve.

## Response

`application/json`

- `count` (number)
  The total number of synonyms sets defined.
- `results` ([] SynonymsSetItem)
  The identifier and total number of defined synonym rules for each synonyms set.
  - `synonyms_set` (string Id)
    Synonyms set identifier
  - `count` (number)
    Number of synonym rules that the synonym set contains
## Code Examples

#### Console

```console
GET _synonyms
```

#### JavaScript

```javascript
const response = await client.synonyms.getSynonymsSets();
```

#### Python

```python
resp = client.synonyms.get_synonyms_sets()
```

#### curl

```curl
curl -X GET "$ELASTICSEARCH_URL/_synonyms" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.synonyms().getSynonymsSets(g -> g);
```

#### C#

```c#
var response = await client.Synonyms.GetSynonymsSetsAsync();
```

#### PHP

```php
$resp = $client->synonyms()->getSynonymsSets();
```

#### Ruby

```ruby
response = client.synonyms.get_synonyms_sets
```

## Response Examples

#### Synonyms sets get response example1

A successful response from `GET _synonyms`.

```json
{
  "count": 3,
  "results": [
    {
      "synonyms_set": "ecommerce-synonyms",
      "count": 2
    },
    {
      "synonyms_set": "my-synonyms-set",
      "count": 3
    },
    {
      "synonyms_set": "new-ecommerce-synonyms",
      "count": 1
    }
  ]
}
```

