Serverless AI Tag Extraction
AI powered tag extraction from text. Extract relevant tags from content automatically or filter from a predefined set of tags. Perfect for content categorization, SEO optimization, and improving search functionality.
Endpoint
Extract relevant tags from text or filter content against predefined tags.
POSThttps://api.xtartapp.com/text/tag-extraction
*Authentication
You must use a Bearer token provided by the dashboard to use for authentication. Add the token to the Authorization header.
Request body
Name | Type | Required | Max | Description |
---|---|---|---|---|
text | string | Yes | 2500 | The text to analyze for tag extraction |
tags | array of strings | No | 10 | Optional array of strings to filter against. If not provided, up to 10 tags will be automatically generated. |
Response
Name | Type | Description |
---|---|---|
data | object | The result of the tag extraction |
data.<tag> | number or null | When tags are provided for filtering: relevance score (0.0 to 1.0) for each tag, or null if not relevant |
data.tags | array | When auto-generating tags: array of extracted tags with relevance scores |
data.tags[].tag | string | The extracted tag text |
data.tags[].relevance | number | Relevance score (0.0 to 1.0) for the tag |
metadata | object | Metadata about the tag extraction process |
metadata.cost | number | The cost of the tag extraction request |
Errors
{
"error": "string",
"code": "string"
}
HTTP Status | Error Code | Message |
---|---|---|
400 | INVALID_PAYLOAD | Occurs when the payload is invalid. |
400 | INVALID_REQUEST | Ex.: The request is invalid. |
400 | TEXT_TAG_EXTRACTION_ERROR | Ex: could not extract tags from the text | parsing error |
400 | HARM_CONTENT | Ex.: The content is harmful and cannot be processed. |
400 | INSUFFICIENT_BALANCE | The user has insufficient balance |
401 | UNAUTHORIZED | Ex.: The token is invalid. |
429 | TOO_MANY_REQUESTS | Ex.: The request limit has been reached. |