Find the most relevant categories from the taxonomy for a given freeform text. Useful for discovering the best category for brand industries, target audiences, etc. Returns ordered matches with confidence scores.
cURL
curl --request POST \ --url https://api.upriver.ai/v1/categories/search \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <api-key>' \ --data @- <<EOF { "text": "telehealth and men's health", "top_k": 5 } EOF
{ "matches": [ { "category_id": "<string>", "display_name": "<string>", "level": 123, "confidence": 0.5, "parent_id": "<string>", "reason": "<string>" } ], "query_text": "<string>" }
Search parameters
Freeform text to match against category taxonomy
"telehealth and men's health"
Number of categories to return, ordered by relevance
1 <= x <= 20
Successful Response
Response from category search endpoint.
Ordered list of matched categories (highest confidence first)
Show child attributes
The input text that was matched