Skip to main content
POST
Tweet Writing Style API for Cached X Profile Samples
Cached response: free · Refresh: 1 credit per tweet returned

Build a Reusable Tweet Writing Profile

Send one X username to cache recent tweet writing samples. Xquik searches posts from that username and stores each returned Tweet ID, text, author, and time. This route manages cache creation and refreshes. It does not generate a tone label, vocabulary summary, sentence score, or engagement analysis. Use the returned samples for your approved writing review. Use Analyze Performance for current likes, replies, reposts, quotes, bookmarks, and views.

Understand Cached and Refreshed Responses

The HTTP status explains the cache action. Always inspect fetchedAt too. A 200 response does not guarantee a recent refresh. Compare fetchedAt with your freshness policy before using the samples. The route has no force parameter. Repeating POST while the profile is fresh returns the same cache without another X request.

Send a Normalized X Username

Send a non-empty X username without @, spaces, or a profile URL. Xquik lowercases the value before lookup and storage.
The request body accepts one field only: Missing, empty, or non-string values return 400 invalid_input. Preserve the returned xUsername value for Get, Compare, Delete, and Performance requests.

Read the Cached Tweet Writing Samples

The profile response contains exact cached examples. It does not contain derived writing conclusions. isOwnAccount compares the username with the saved X identity during a refresh. A cached 200 response does not recompute that flag.

Parse Every Cached Tweet

Each public tweets[] entry contains these fields: Keep Tweet IDs as strings. JavaScript numbers cannot safely represent every X Tweet ID. The public Style Profile contract does not include cached media objects. Use a Tweet or media endpoint when your workflow requires images, videos, or GIFs.

Review Observable Tweet Writing Features

The response provides source text for your analysis. Start with observable features before assigning subjective voice or tone labels. Do not infer future engagement from writing samples. Refresh public metrics through Analyze Performance when outcome comparisons are required.

Build a Safe Twitter Brand Voice Workflow

  1. Set the X identity before refreshing.
  2. Send one public X username to this endpoint.
  3. Branch on HTTP 200 or 201.
  4. Store xUsername, fetchedAt, and tweetCount.
  5. Preserve every Tweet ID and text value.
  6. Review observable patterns with a human editor.
  7. Keep current product claims out of copied historical tweets.
Use cached examples as references. Never copy another person’s distinctive phrasing without authorization.

Analyze Another Public X Account

You can cache recent public tweets from another username. The resulting profile belongs only to the authenticated Xquik account. This route does not expose drafts, private posts, private analytics, followers, following, profile visits, or direct messages.

Budget a Style Refresh

Cached 200 responses are free. A 201 refresh costs 1 credit per Tweet returned and stored. Use tweetCount to reconcile the refresh. The endpoint does not accept a limit parameter, date range, pagination cursor, or requested sample count. When a stale cache exists without enough available credits, Xquik returns that cache with 200. It does not delete the existing writing samples.

Handle Style Cache Errors

The response widget includes every status in the canonical OpenAPI contract.

Headers

Send x-api-key with an Xquik API key. OAuth clients can send a bearer token through the Authorization header instead.
string
required
Your Xquik API key. Generate one from the dashboard.
string
required
Must be application/json.

Body

string
required
Non-empty X username without @. Xquik lowercases the value.

Response

200 OK

Returns a cached profile. It can be fresh or an unfunded stale fallback.

201 Created

Returns a newly fetched and stored profile.
string
Lowercase analyzed X username.
number
Number of cached Tweet samples.
boolean
Stored ownership classification.
string
ISO 8601 cache fetch timestamp.
object[]
Cached tweet writing samples.

400 Invalid Input

Username is missing, empty, or not a string. Send one username string.

401 Unauthenticated

Authentication failed. Replace the missing or invalid credential.

402 No Cached Style

No cache exists and the refresh cannot be funded. Top up through the billing page, or save approved tweet examples with Save Custom Style.

429 Rate Limited

Too many requests. Wait for Retry-After, then retry once.

How Do I Analyze a Twitter Writing Style?

Cache one public username, then review the returned tweet text. This endpoint supplies writing samples. Your application performs any voice or tone analysis.

Does Analyze Style Return Tone or Vocabulary Scores?

No. It returns Tweet IDs, text, authors, timestamps, and cache metadata. It does not return generated style labels or scores.

Why Did Analyze Style Return 200 Instead of 201?

The route reused an existing cache. Check fetchedAt. A 200 can also be a stale fallback when refresh funding is unavailable.

Can I Force a Twitter Style Refresh?

No force parameter exists. Fresh profiles return from cache. Delete and recreate a profile only when that destructive workflow is appropriate.

Can I Analyze Another Twitter Account?

Yes, for recent public tweets. The cached profile remains isolated to your authenticated Xquik account.
Next: Get Style reads samples without a refresh. Compare Styles retrieves 2 profiles.