---
type: api
title: Get a synonym set
description: ## Required authorization
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/operation/operation-synonyms-get-synonym
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/operation/operation-synonyms-get-synonym
products:
  - Elasticsearch
---

# Get a synonym set

Availability: 8.10+

## Paths

- `GET` `/_synonyms/{id}`

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

#### Path Parameters

- `id` (string Id)
  The synonyms set identifier to retrieve.

## Description



## Required authorization

* Cluster privileges: `manage_search_synonyms`

## Query String Parameters

- `from` (number · default: 0)
  The starting offset for synonym rules to retrieve.
- `size` (number · default: 10)
  The max number of synonym rules to retrieve.
- `search_after` (string)
  The synonym rule ID to use as a cursor for pagination.
The next page of results will start after this rule ID.
This parameter cannot be used with `from`.

## Response

`application/json`

- `count` (number)
  The total number of synonyms rules that the synonyms set contains.
- `synonyms_set` ([] SynonymRuleRead)
  Synonym rule details.
  - `id` (string Id)
    The identifier for the synonym rule.
If you do not specify a synonym rule ID when you create a rule, an identifier is created automatically by Elasticsearch.
  - `synonyms` (string)
    The synonyms that conform the synonym rule in Solr format.
## Code Examples

#### Console

```console
GET _synonyms/my-synonyms-set
```

#### JavaScript

```javascript
const response = await client.synonyms.getSynonym({
  id: "my-synonyms-set",
});
```

#### Python

```python
resp = client.synonyms.get_synonym(
    id="my-synonyms-set",
)
```

#### curl

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

#### Java

```java
client.synonyms().getSynonym(g -> g
    .id("my-synonyms-set")
);
```

#### C#

```c#
var response = await client.Synonyms.GetSynonymAsync(id: "my-synonyms-set");
```

#### PHP

```php
$resp = $client->synonyms()->getSynonym([
    "id" => "my-synonyms-set",
]);
```

#### Ruby

```ruby
response = client.synonyms.get_synonym(
  id: "my-synonyms-set"
)
```

## Response Examples

#### Synonyms get response example1

A successful response from `GET _synonyms/my-synonyms-set`.

```json
{
  "count": 3,
  "synonyms_set": [
    {
      "id": "test-1",
      "synonyms": "hello, hi"
    },
    {
      "id": "test-2",
      "synonyms": "bye, goodbye"
    },
    {
      "id": "test-3",
      "synonyms": "test => check"
    }
  ]
}
```

