Fuzzy Text Search API

ApyHub
ApyHub
verified icon
25 atoms
Base tier

About

The Fuzzy Text search utility service, allows you to search through a large text data and search for the presence of a specific keywords. The advantage of the fuzzy search is that it searches and matches for words that are mis-spelled (hence the name, fuzzy search) and also can be configured to search for matching terms even if the characters in the text have accents (Diacritics).
Fuzzy Search is a great tool to help you find relevant results even when the search term is mis-spelled. This is greatly helpful when you are getting inputs from a user and searching for that term in the database. In many cases, the search term is mis-spelt by the user. A normal search does not return any result when the search term is mis-spelt. However, Fuzzy Search can return returns when the spelling is wrong.
The Fuzzy Search API lets you search for a term likely to be relevant to a search argument even if that content does not match the search query exactly. Fuzzy search uses a fuzzy matching program, which returns results with likely relevance.

API Playground

API Documentation

fuzzy
POST
https://api.apyhub.com/search/text/fuzzy

Request example

1
curl --location --request POST 'https://api.apyhub.com/search/text/fuzzy' \
2
--header 'Content-Type: application/json' \
3
--header 'apy-token: {{token}}' \
4
--data-raw '{
5
"source":"taching",
6
"target":"teaching is the best qualifying compare another profession"
7
}'
Method: POST
Content Type: application/json
Query Parameter(s)
AttributeData TypeDescription
unicode-normalizedbooleanDefault false. Must be true, in case accents need to be taken into consideration
Request Body
AttributeTypeMandatoryDescription
sourceStringNoThe term that you want to search for.
targetStringNoThe target in which you want to search for the term.
Sample Response
Returns an array of terms that match the source. But if source or target is missing or is null or empty string then this returns an empty array.
1
{
2
"data": [
3
"teaching"
4
]
5
}
Sample with unicode-normalized true
1
curl --location --request POST 'https://api.apyhub.com/search/text/fuzzy?unicode-normalized=true' \
2
--header 'Content-Type: application/json' \
3
--header 'apy-token: {{token}}' \
4
--data-raw '{
5
"source":"ïñg",
6
"target":"teaching is the best qualifying compare another profession"
7
}'
1
{
2
"data": [
3
"teaching",
4
"qualifying"
5
]
6
}

HTTP Response Codes

The method may return one of the following HTTP status codes:
Status CodeDescription
200The request was successful.
400Invalid input or mandatory params are missing.
401Required authentication information is either missing or not valid for the resource.
500Potential error that might occur, if any unexpected error occurs while processing the request.

Authentication

All API requests to ApyHub services need to be authenticated. Currently we support tokens or basic authentication mechanisms. You can generate and view your existing credentials from your workspace settings (on the left side of the navbar) and go to “API Keys".
Points to note:
  • Credential secrets are generated on the fly and are not stored in plain text, so on generating a credential please save the secrets somewhere safe.
  • Use the apy-token as the header parameter to pass the token.
  • Use the Authorization header to send the basic authentication credentials.

Error codes

1
{
2
"error": {
3
"code": 105,
4
"message": "Invalid URL"
5
}
6
}
To search for a specific error code, enter the code in the search box below. Alternatively, you can click on the button to view a complete list of all error codes.
Table of contents
AboutAPI PlaygroundAPI DocumentationAuthenticationError codesRelated Utility APIsRelated Articles