Ranked Text Search gives you fuzzy matching over a list of space-separated words. Send a search term in source and the candidate text in target, and it returns ranked matches with their Levenshtein distance from the source.
Use limit to cap how many results come back and offset to skip ranked entries. If you need broader matching, you can also enable accent-insensitive or unicode-normalized handling in the query.
Ranked Text Search is useful when you need to compare a user query against tokenized text, such as searching short labels, finding near-matches in product titles, or normalizing typos in autocomplete and lookup flows. The response is a data array of objects, each with a match string and its numeric distance.
It is a small, focused utility for ordered fuzzy lookup when you want a ranked list rather than a simple yes-or-no match.
Search for the term ing inside a ranked list of words.
curl -X POST "https://api.eu.apyhub.com/apyhub/ranked-text-search" \
-H "apy-token: $APY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"source":"ing","target":"finding things bring sing ring"}'
What you'll get back
Returns a JSON object with a data array. Each item has a match string and a distance integer, where distance is the Levenshtein distance from the source.
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
About this endpoint
What it does
Performs a ranked fuzzy search by comparing a source string against a space-separated target string and returns the best matches. The request controls how many ranked results to return, how many to skip, and whether comparisons should ignore accents or use Unicode normalization.
Query Parameter(s)
Attribute
Type
Description
accent-insensitive
Boolean
Default: false
unicode-normalized
Boolean
Default: false
Request Body
Parameter
Type
Description
limit
Integer
Maximum number of results to return. Minimum: 0. Default: 0, where 0 means all results.
offset
Integer
Number of ranked results to skip. Minimum: 0. Default: 0.
source
String
The search term.
target
String
Space-separated words to search within.
Response
Returns a JSON object with a data array field. Each item in data is an object with a match string field and a distance integer field, where distance is the Levenshtein distance from the source.
Parameter
Type
Description
data
Object Array
Array of ranked matches. Each item contains: match: the matched string. distance: Levenshtein distance from the source.
▣ COMMON ERRORS
Errors any endpoint can return
400bad_request
Required parameter missing or malformed body.
401unauthorized
API key missing, revoked, or not authorized for this service.
429rate_limited
Your plan's per-second rate exceeded. Retry with exponential backoff.
503upstream_busy
Backend temporarily unavailable. Try again in a few seconds.
Similar APIs
Closest matches in the catalog based on this service.