feat: add X/Twitter social media search via Xquik#161
Open
kriptoburak wants to merge 1 commit intodzhng:mainfrom
Open
feat: add X/Twitter social media search via Xquik#161kriptoburak wants to merge 1 commit intodzhng:mainfrom
kriptoburak wants to merge 1 commit intodzhng:mainfrom
Conversation
When XQUIK_API_KEY is set, the research loop also searches X/Twitter for each query, adding real-time perspectives and community sentiment alongside Firecrawl web results. Runs in parallel — no extra latency. Opt-in: set XQUIK_API_KEY in .env. Without it, behavior is unchanged. Zero new dependencies (uses native fetch). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds X/Twitter search as a supplementary research source. When
XQUIK_API_KEYis set, the research loop searches X/Twitter for each query in parallel with Firecrawl, adding real-time social media perspectives alongside web results.This is the first social media source for deep-research. Currently, all research comes from web search + scraping — meaning the researcher misses the real-time discourse, expert opinions, and community sentiment that lives on X/Twitter.
What it adds
Research questions like "What do developers think about X?" or "What's the community reaction to Y?" now get signal from actual social media posts, not just blog articles written days later.
Each tweet is converted to a markdown document with:
How it works
Promise.all)SearchResponsedata arrayprocessSerpResult()processes all content the same way — no special handling neededXQUIK_API_KEY, behavior is 100% unchangedChanges
src/xquik.tssrc/deep-research.ts.env.exampleXQUIK_API_KEYoptionWhat's NOT changed
processSerpResult()— unchanged, processes merged results naturallywriteFinalReport()/writeFinalAnswer()— unchangedfetch)Cost
$0.00015 per tweet read via Xquik. A typical research session with 5 queries × 5 tweets = 25 reads = $0.00375 for the social media dimension.
SDK:
@xquik/tweetclawTest plan
npx tsc --noEmit— zero type errorsnpx prettier --check src/— formattedXQUIK_API_KEY— behavior identical to before (xquikEnabled = false, Promise.resolve([]))XQUIK_API_KEY— Xquik search runs in parallel, results merge into SearchResponseBuilt with Claude Code