> ## Documentation Index
> Fetch the complete documentation index at: https://algolia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Export synonyms

> Retrieve an index's complete list of synonyms.

export const Legacy = ({title, href}) => {
  return <Note>

    This page documents an earlier version of the API client.
    For the latest version, see <a href={href}>{title}</a>.

    </Note>;
};

<Legacy title="Browse all synonyms" href="/doc/libraries/sdk/methods/search/browse-synonyms" />

**Required ACL:** `settings`

## Examples

<CodeGroup>
  ```cs C# theme={"system"}
  var synonymsIterator = client.BrowseSynonyms();

  foreach (var synonym in synonymsIterator)
  {
      Console.WriteLine(synonym);
  }
  ```

  ```go Go theme={"system"}
  it, err := index.BrowseSynonyms()
  // error handling

  for {
  	synonym, err := it.Next()
  	if err != nil {
  		if err == io.EOF {
  			// all synonyms have been browsed
  		} else {
  			// error handling
  		}
  		break
  	}
  	fmt.Println(synonym)
  }
  ```

  ```java Java theme={"system"}
  // Only on Sync
  Index<Contact> index = client.initIndex("myIndex", Contact.class);
  List<Synonym> synonyms = new ArrayList<>();

  SynonymsIterable synonymsIterable = index.browseSynonyms();
  synonymsIterable.forEach(synonyms::add);
  ```

  ```js JavaScript theme={"system"}
  index
    .browseSynonyms({
      batch: (batch) => console.log(batch),
    })
    .then(() => {
      // done
    });
  ```

  ```kotlin Kotlin theme={"system"}
  index.browseSynonyms().forEach {
      println(it)
  }
  ```

  ```php PHP theme={"system"}
  $iterator = $index->browseSynonyms();

  foreach ($iterator as $synonym) {
      var_dump($synonym);
  }
  ```

  ```python Python theme={"system"}
  # Print all synonyms in an index.
  for synonym in index.browse_synonyms():
      print(synonym)
  ```

  ```ruby Ruby theme={"system"}
  # Get synonyms by batch
  synonyms = index.browse_synonyms
  # With a block
  index.browse_synonyms { |synonym| puts(synonym) }
  ```

  ```scala Scala theme={"system"}
  val helper = AlgoliaSyncHelper(client)
  helper.exportSynonyms("myIndex").map(println)
  ```

  ```swift Swift theme={"system"}
  index.browseSynonyms { result in
    if case .success(let response) = result {
      print("Response: \(response)")
    }
  }
  ```
</CodeGroup>

## Parameters

<ParamField body="indexName" type="string">
  **Scala only:** index name
</ParamField>

<ParamField body="requestOptions" type="object">
  A mapping of request options to send along with the query.
</ParamField>

## Response

This method returns an iterator.
