Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.5.0"
".": "0.5.1"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 122
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/xquik/x-twitter-scraper-a89d9fe0de8895b2daf847c8f3ff8bc93f43039c040d0bf093ec6dc1e734f57b.yml
openapi_spec_hash: c6365ebfe4f85183f384f27865cf66ce
config_hash: 9a418581d96f0820ef923bfe5ffa2541
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/xquik/x-twitter-scraper-26de9a1d18b92c9472fcc289877ba281ae305db846b7b14065142e26c7637d72.yml
openapi_spec_hash: f90f7016413291fdcbedb986385dc3ae
config_hash: 17c84052d27489691ee6dd861cc56e24
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 0.5.1 (2026-07-22)

Full Changelog: [v0.5.0...v0.5.1](https://github.com/Xquik-dev/x-twitter-scraper-typescript/compare/v0.5.0...v0.5.1)

### Chores

* sync generated SDK contracts ([ff8612e](https://github.com/Xquik-dev/x-twitter-scraper-typescript/commit/ff8612e3b474a71aabae2f709ae93a487d5ad69d))
* verify final public contract ([bcd7c6a](https://github.com/Xquik-dev/x-twitter-scraper-typescript/commit/bcd7c6adecf0e4f1dd42025a3c9615c3abcd4223))

## 0.5.0 (2026-07-22)

Full Changelog: [v0.4.1...v0.5.0](https://github.com/Xquik-dev/x-twitter-scraper-typescript/compare/v0.4.1...v0.5.0)
Expand Down
1 change: 0 additions & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,3 @@ For answers to common questions about this code of conduct, see the FAQ at [http
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "x-twitter-scraper",
"version": "0.5.0",
"version": "0.5.1",
"description": "TypeScript SDK for Xquik API workflows. Xquik is an independent third-party service. Not affiliated with X Corp. \"Twitter\" and \"X\" are trademarks of X Corp.",
"author": "Xquik <support@xquik.com>",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,7 @@ export class XTwitterScraper {
*/
radar: API.Radar = new API.Radar(this);
/**
* Real-time X account monitoring
* X account monitoring with 1-second checks
*/
monitors: API.Monitors = new API.Monitors(this);
/**
Expand Down
4 changes: 2 additions & 2 deletions src/resources/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ export namespace AccountRetrieveResponse {
activeHourlyBurn: string;

/**
* Estimated daily usage for 1 active instant monitor.
* Rounded daily estimate for 1 active monitor.
*/
creditsPerActiveMonitorDay: string;

/**
* Hourly usage charged for 1 active instant monitor.
* Hourly credits charged for 1 active monitor.
*/
creditsPerActiveMonitorHour: string;

Expand Down
297 changes: 232 additions & 65 deletions src/resources/compose.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,17 @@ import { RequestOptions } from '../internal/request-options';
*/
export class Compose extends APIResource {
/**
* Compose, refine, or score a tweet
* Run one step of Xquik's three-step writing workflow. Compose returns questions
* and editorial rules. Refine returns goal-specific guidance. Score applies
* deterministic text checks. It does not predict reach or expose X ranking
* weights.
*
* @example
* ```ts
* const compose = await client.compose.create({
* step: 'compose',
* topic: 'PostgreSQL query planning',
* goal: 'engagement',
* topic: 'AI trends in 2025',
* });
* ```
*/
Expand All @@ -25,85 +28,249 @@ export class Compose extends APIResource {
}
}

export interface ComposeCreateResponse {
/**
* AI feedback on the draft
*/
feedback?: string;
export type ComposeCreateResponse =
| ComposeCreateResponse.ComposePrepareResult
| ComposeCreateResponse.ComposeRefineResult
| ComposeCreateResponse.ComposeScoreResult;

/**
* Engagement score (0-100)
*/
score?: number;
export namespace ComposeCreateResponse {
export interface ComposePrepareResult {
/**
* Xquik editorial heuristics, ordered for the goal.
*/
contentRules: Array<ComposePrepareResult.ContentRule>;

/**
* Improvement suggestions
*/
suggestions?: Array<string>;
/**
* Published engagement signal names. Production multipliers are not published.
*/
engagementMultipliers: Array<ComposePrepareResult.EngagementMultiplier>;

/**
* Generated or refined tweet text
*/
text?: string;
/**
* Publication limit for timing and decay claims.
*/
engagementVelocity: string;

followUpQuestions: Array<string>;

/**
* X post intent seeded with the topic.
*/
intentUrl: string;

nextStep: string;

/**
* Published signal names with unpublished weights as null.
*/
scorerWeights: Array<ComposePrepareResult.ScorerWeight>;

/**
* Signal source and evidence limits.
*/
source: string;

/**
* Negative engagement predictions in the public model.
*/
topPenalties: Array<string>;

/**
* Style analyses saved to the account.
*/
savedStyles?: Array<ComposePrepareResult.SavedStyle>;

/**
* Next action when no cached style is available.
*/
styleNote?: string;

/**
* Cached examples for the requested style username.
*/
styleTweets?: Array<string>;
}

export namespace ComposePrepareResult {
export interface ContentRule {
rule: string;
}

export interface EngagementMultiplier {
/**
* Human-readable published signal name.
*/
action: string;

multiplier: 'Production weight not published by X';
}

export interface ScorerWeight {
/**
* Signal direction and publication limit.
*/
context: string;

/**
* Signal name from X's public ranking repository.
*/
signal: string;

/**
* X does not publish the production weight.
*/
weight: null;
}

export interface SavedStyle {
tweetCount: number;

username: string;
}
}

export interface ComposeRefineResult {
/**
* Goal, tone, media, and editorial guidance.
*/
compositionGuidance: Array<string>;

examplePatterns: Array<ComposeRefineResult.ExamplePattern>;

/**
* X post intent seeded with the topic.
*/
intentUrl: string;

nextStep: string;
}

export namespace ComposeRefineResult {
export interface ExamplePattern {
description: string;

pattern: string;
}
}

export interface ComposeScoreResult {
/**
* Deterministic editorial checks. Not a reach prediction.
*/
checklist: Array<ComposeScoreResult.Checklist>;

nextStep: string;

passed: boolean;

passedCount: number;

topSuggestion: string;

[k: string]: unknown;
totalChecks: 9;

/**
* Present only when every check passes.
*/
intentUrl?: string;
}

export namespace ComposeScoreResult {
export interface Checklist {
factor: string;

passed: boolean;

/**
* Present only when the check fails.
*/
suggestion?: string;
}
}
}

export interface ComposeCreateParams {
/**
* Workflow step
*/
step: 'compose' | 'refine' | 'score';
export type ComposeCreateParams =
| ComposeCreateParams.ComposePrepareRequest
| ComposeCreateParams.ComposeRefineRequest
| ComposeCreateParams.ComposeScoreRequest;

/**
* Extra context or URLs (refine)
*/
additionalContext?: string;
export declare namespace ComposeCreateParams {
export interface ComposePrepareRequest {
step: 'compose';

/**
* Desired call to action (refine)
*/
callToAction?: string;
/**
* Subject for the post.
*/
topic: string;

/**
* Tweet draft text to evaluate (score)
*/
draft?: string;
/**
* Editorial goal used to order the rules and questions.
*/
goal?: 'engagement' | 'followers' | 'authority' | 'conversation';

/**
* Optimization goal
*/
goal?: 'engagement' | 'followers' | 'authority' | 'conversation';
/**
* Username from a style analysis saved to this account.
*/
styleUsername?: string;

/**
* Whether a link is attached (score)
*/
hasLink?: boolean;
[k: string]: unknown;
}

/**
* Whether media is attached (score)
*/
hasMedia?: boolean;
export interface ComposeRefineRequest {
/**
* Editorial goal for the guidance.
*/
goal: 'engagement' | 'followers' | 'authority' | 'conversation';

/**
* Media type (refine)
*/
mediaType?: 'photo' | 'video' | 'none';
step: 'refine';

/**
* Cached style username for voice matching (compose)
*/
styleUsername?: string;
/**
* Requested writing tone.
*/
tone: string;

/**
* Desired tone (refine)
*/
tone?: string;
/**
* Subject for the post.
*/
topic: string;

/**
* Tweet topic (compose, refine)
*/
topic?: string;
/**
* Audience, constraints, sources, or other writing context.
*/
additionalContext?: string;

/**
* Specific action the draft should request.
*/
callToAction?: string;

/**
* Planned media type.
*/
mediaType?: 'photo' | 'video' | 'none';

[k: string]: unknown;
}

export interface ComposeScoreRequest {
/**
* Full post text for deterministic editorial checks.
*/
draft: string;

step: 'score';

/**
* True when a separate link card is attached.
*/
hasLink?: boolean;

/**
* @deprecated Ignored. Remove this field. Use hasLink for a separate link card.
*/
hasMedia?: boolean;

[k: string]: unknown;
}
}

export declare namespace Compose {
Expand Down
Loading