Skip to main content
POST
/
1
/
indexes
/
{indexName}
/
synonyms
/
search
curl
curl --request POST \
  --url https://algolia_application_id.algolia.net/1/indexes/ALGOLIA_INDEX_NAME/synonyms/search \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --header 'x-algolia-api-key: ALGOLIA_API_KEY' \
  --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' \
  --data '{"query":"","type":"onewaysynonym","page":0,"hitsPerPage":20}'
{
  "hits": [
    {
      "objectID": "synonymID",
      "type": "onewaysynonym",
      "synonyms": [
        "vehicle",
        "auto"
      ],
      "input": "car",
      "word": "car",
      "corrections": [
        "vehicle",
        "auto"
      ],
      "placeholder": "<Street>",
      "replacements": [
        "street",
        "st"
      ]
    }
  ],
  "nbHits": 20
}
Required ACL: settings

Authorizations

x-algolia-application-id
string
header
required

Your Algolia application ID.

x-algolia-api-key
string
header
required

Your Algolia API key with the necessary permissions to make the request. Permissions are controlled through access control lists (ACL) and access restrictions. The required ACL to make a request is listed in each endpoint's reference.

Path Parameters

indexName
string
required

Name of the index on which to perform the operation.

Example:

"ALGOLIA_INDEX_NAME"

Body

application/json

Body of the searchSynonyms operation.

query
string
default:""

Search query.

type
enum<string>

Synonym type.

Available options:
synonym,
onewaysynonym,
altcorrection1,
altcorrection2,
placeholder,
oneWaySynonym,
altCorrection1,
altCorrection2
Example:

"onewaysynonym"

page
integer
default:0

Page of search results to retrieve.

Required range: x >= 0
hitsPerPage
integer
default:20

Number of hits per page.

Required range: 1 <= x <= 1000

Response

OK

hits
object[]
required

Matching synonyms.

nbHits
integer
required

Number of results (hits).

Example:

20

I