About this endpoint
What it does
Ranks the provided candidate strings against a source string and returns the matches ordered by closeness. You send the source plus one or more candidates, and the response returns the ranked matches with their distances.
Request Body
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| source | String | Yes | The reference string to match against. |
| candidates | String Array | Yes | Candidate strings to rank. |
| limit | Integer | No | Max results to return. 0 means all. Minimum 0. |
Response
Returns a JSON object with a data array field. Each item in data is an object with a match string and a distance integer, where distance is the Levenshtein distance from the source.
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| data | Object Array | Yes | Ranked match results. Each item contains match and distance. |
| data[].match | String | Yes | The matching candidate string. |
| data[].distance | Integer | Yes | Levenshtein distance from the source. |