POST https://xquik.com/api/v1/x/analysis/classify
2 credits per analyzed post · All plans from $0.00012/credit · Supports guest paid reads
POST /api/v1/x/analysis/classify.
Without
analysis.questions, it answers the
sentiment questions.
Write a question
Each question needs anid, a type, a version, and instructions. Write
the instructions as you would brief a careful reader.- A
choiceaddscategories. Each name maps to a short description ornull. Add a category such asotherorunclearfor posts that fit none. - A
scoreaddslevels. List 2 to 10 descriptions, lowest first. The answer is the level’s index, from0. It can have decimals, such as1.4. - A
probabilitycan addcriteria, with what counts asyesand asno.
feature_request. A name with spaces or capitals
returns 400 invalid_input with the name to fix.Classify topics
A topic classifier is 1choice question whose categories are your topics.
Add other for posts outside them. analysisSummary.questions.<id>.shares
holds each topic’s share of posts.Version your questions
version is yours. Change it whenever you change a question’s instructions,
categories, or levels. Each answer carries questionVersion, so stored rows
show which wording produced them.Use a preset
Setanalysis.preset instead of questions for a ready set, at the same
price.Pick the posts to analyze
SendtweetIds, texts, a page, or a search, never more than 1. See pick the posts to analyze for each source.Compare with an earlier answer
Send theresults of an earlier call as baseline to see what changed. The comparison costs nothing extra. See compare with an earlier answer for an example.Budget the analysis
Each analyzed post costs 2 credits. Each text intexts costs the same. Posts in unanalyzed cost nothing. See budget the analysis for each reason.Body
See body parameters for every field. Common ones aretweetIds, texts, query, username, and limit.Headers
Response
200 OK
400 Invalid input
{ "error": "invalid_input", "message": "Rename \"Feature Request\". Write question IDs & category names in lower case without hyphens, such as feature_request." }
The body names no posts or names more than 1 source. A body with an invalid field gets the same error.
The message says what to send instead. The request costs nothing.401 Unauthenticated
Anonymous requests getWWW-Authenticate: Bearer and a guest wallet checkout action. This is not a Payment challenge.
Missing or invalid API key. Check the x-api-key header value.402 Payment required
Full account keys can receiveno_subscription, subscription_inactive, no_credits, or insufficient_credits with account payment options. Guest keys receive only the guest top-up action.
The failed request creates no checkout. Ask the user to confirm before calling any checkout or top-up route.403 Protected account
{ "error": "x_account_protected" }
A search that needs a protected author returns this. Choose a public account.
The request costs nothing.502 X API unavailable
The read service returned an error. Retry after a short delay.503 Service busy
Xquik is busy. Wait for theRetry-After header, then send the request again.
The request costs nothing.429 Rate limit exceeded
You exceeded your tier rate limit. Wait for theRetry-After header before retrying.424 Dependency failed
The normalized v1 response contract can return 424 when the read service is unavailable.Tweet classification API questions
How do I classify tweets by topic?
Send 1choice question whose categories are your topics, with other for the
rest. Each row’s answers holds the topic, and the summary counts posts per
topic.How many questions and categories can I use?
As many questions as fit in 8,000 bytes together. A choice takes 2 to 255 categories, and a score 2 to 10 levels. The price stays 2 credits per post.Can I set my own confidence threshold?
Yes.results[].analysis.answers gives each answer’s confidence and the
probability of every category or level. Keep the rows above your threshold.Can I classify my own texts, such as support tickets?
Yes. Send your texts intexts. Xquik reads nothing from X for them.How much does classification cost?
Each analyzed post costs 2 credits, whatever the number of questions. Posts inunanalyzed and refused requests cost nothing.Does this replace X’s official API?
No. This page documents Xquik, an independent third-party service. It does not document X’s official API.Next steps. Brand mentions answers ready brand questions, or Viral score rates how posts read.
Response examples
- 400
{ "error": "invalid_input", "message": "Invalid input. Check the request body." } - 401
{ "error": "unauthenticated", "message": "Authentication required." } - 402
{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." } - 403
{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." } - 424
{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." } - 429
{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 } - 502
{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." } - 503
{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }