# X Research > Busca en X/Twitter opiniones en tiempo real, debates de desarrolladores, feedback de producto, noticias de última hora y opiniones de expertos usando la API v2 de X. Fuente: https://skillsagentes.com/skills/trailofbits/skills-curated/x-research Markdown: https://skillsagentes.com/skills/trailofbits/skills-curated/x-research.md Repositorio: https://github.com/trailofbits/skills-curated Autor: trailofbits Licencia: CC-BY-SA-4.0 Actualizado: hace 9 meses Coste de contexto: 159 tok instalada, 1.9k tok al activarse, 10.6k tok con todos los archivos del bundle Bundle: 9 archivos, 41 KB Permisos que pide: bash, read, grep, glob, write, webfetch ## Instalación Un skill son archivos markdown: los mismos archivos valen para cualquier agente y lo único que cambia es el directorio de destino, es decir la bandera `--agent`. Añade `-g` para instalarlo en todos los proyectos de la máquina. ```bash # Claude Code npx -y skills add trailofbits/skills-curated --skill x-research --agent claude-code # Cursor npx -y skills add trailofbits/skills-curated --skill x-research --agent cursor # Codex npx -y skills add trailofbits/skills-curated --skill x-research --agent codex # Gemini CLI npx -y skills add trailofbits/skills-curated --skill x-research --agent gemini # Windsurf npx -y skills add trailofbits/skills-curated --skill x-research --agent windsurf # Cline npx -y skills add trailofbits/skills-curated --skill x-research --agent cline ``` ## Qué hace - Busca en X/Twitter con la API v2, ordenando por engagement y filtrando por fecha o métricas mínimas - Descompone preguntas de investigación en varias búsquedas y las refina de forma iterativa - Sigue hilos completos a partir del tweet raíz y profundiza en enlaces con WebFetch - Gestiona una watchlist de cuentas y cachea resultados 15 minutos para evitar cargos duplicados - Sintetiza hallazgos por tema con citas, usuarios y recursos enlazados ## Cuándo usarla - El usuario dice cosas como «x research», «search x for», «qué dice la gente sobre», «check x for» - Se necesita el discurso reciente en X sobre un tema (lanzamientos de librerías, cambios de API, eventos del sector) - Se quiere saber qué piensan devs/expertos/comunidad sobre un tema - Monitorización de qué publican cuentas clave o análisis competitivo rápido ## Cuándo no - Publicar tweets, responder o gestionar una cuenta de X (es una herramienta de solo lectura) - Investigación histórica de más de 7 días (solo usa el endpoint de búsqueda reciente) - Buscar en plataformas que no sean X, o tareas donde la búsqueda web dé mejores resultados ## Qué la activa - "Haz x research sobre las reacciones a Claude Code" - "Busca en twitter qué opinan los devs del nuevo lanzamiento de Cursor" - "¿Qué está diciendo X sobre el cambio de API de OpenAI?" - "Comprueba la watchlist de cuentas que sigo en X" - "Sigue el hilo de este tweet y resume las opiniones" ## Antes de instalar - Necesitas un X API Bearer Token (variable de entorno X_BEARER_TOKEN o XAI_API_KEY), Python 3.11+ y uv instalados. - Variables de entorno: XAI_API_KEY, X_BEARER_TOKEN - runs shell commands - writes to your files - makes network requests - needs API credentials ## Archivos - SKILL.md — 7 KB - data/watchlist.example.json — 195 B - references/x-api.md — 4 KB - scripts/pyproject.toml — 240 B - scripts/x_api.py — 7 KB - scripts/x_cache.py — 2 KB - scripts/x_format.py — 4 KB - scripts/x_search.py — 12 KB - scripts/x_xai.py — 4 KB ## SKILL.md Reproducido tal cual desde trailofbits/skills-curated bajo CC-BY-SA-4.0. Esta sección es el documento original y está en inglés. # X Research Agentic research over X/Twitter. Decompose research questions into targeted searches, iteratively refine, follow threads, deep-dive linked content, and synthesize sourced briefings. For X API details (endpoints, operators, response format): read `{baseDir}/skills/x-research/references/x-api.md`. ## Prerequisites - **X API Bearer Token** -- set `X_BEARER_TOKEN` (or `XAI_API_KEY`) env var - **Python 3.11+** and **uv** (`pip install uv` or https://docs.astral.sh/uv/) ## CLI Tool All commands use `uv run` for automatic dependency management: ### Search ```bash uv run {baseDir}/skills/x-research/scripts/x_search.py search "" [options] ``` **Options:** - `--sort likes|impressions|retweets|recent` -- sort order (default: likes) - `--since 1h|3h|12h|1d|7d` -- time filter (default: last 7 days) - `--min-likes N` -- filter by minimum likes - `--min-impressions N` -- filter by minimum impressions - `--pages N` -- pages to fetch, 1-5 (default: 1, 100 tweets/page) - `--limit N` -- max results to display (default: 15) - `--quick` -- quick mode: 1 page, max 10 results, auto noise filter, 1hr cache - `--from-user ` -- shorthand for `from:username` in query - `--quality` -- filter low-engagement tweets (min 10 likes, post-hoc) - `--no-replies` -- exclude replies - `--save` -- save results to `~/x-research-output/` - `--json` -- raw JSON output - `--markdown` -- markdown output for research docs Auto-adds `-is:retweet` unless query already includes it. All searches display estimated API cost. **Examples:** ```bash uv run {baseDir}/skills/x-research/scripts/x_search.py search "claude code" --sort likes --limit 10 uv run {baseDir}/skills/x-research/scripts/x_search.py search "from:anthropic" --sort recent uv run {baseDir}/skills/x-research/scripts/x_search.py search "(cursor OR windsurf) AI editor" --pages 2 --save uv run {baseDir}/skills/x-research/scripts/x_search.py search "AI agents" --quick uv run {baseDir}/skills/x-research/scripts/x_search.py search "AI agents" --quality --quick ``` ### Profile ```bash uv run {baseDir}/skills/x-research/scripts/x_search.py profile [--count N] [--replies] [--json] ``` Fetches recent tweets from a specific user (excludes replies by default). ### Thread ```bash uv run {baseDir}/skills/x-research/scripts/x_search.py thread [--pages N] ``` Fetches full conversation thread by root tweet ID. ### Single Tweet ```bash uv run {baseDir}/skills/x-research/scripts/x_search.py tweet [--json] ``` ### Watchlist ```bash uv run {baseDir}/skills/x-research/scripts/x_search.py watchlist # Show all uv run {baseDir}/skills/x-research/scripts/x_search.py watchlist add [note] # Add account uv run {baseDir}/skills/x-research/scripts/x_search.py watchlist remove # Remove uv run {baseDir}/skills/x-research/scripts/x_search.py watchlist check # Check recent ``` Watchlist stored in `{baseDir}/skills/x-research/data/watchlist.json`. ### Cache ```bash uv run {baseDir}/skills/x-research/scripts/x_search.py cache clear ``` 15-minute TTL. Avoids re-fetching identical queries. ## Research Loop (Agentic) When doing deep research (not just a quick search), follow this loop: ### 1. Decompose the Question into Queries Turn the research question into 3-5 keyword queries using X search operators: - **Core query**: Direct keywords for the topic - **Expert voices**: `from:` specific known experts - **Pain points**: Keywords like `(broken OR bug OR issue OR migration)` - **Positive signal**: Keywords like `(shipped OR love OR fast OR benchmark)` - **Links**: `url:github.com` or `url:` specific domains - **Noise reduction**: `-is:retweet` (auto-added), add `-is:reply` if needed - **Spam filter**: Add `-airdrop -giveaway -whitelist` for crypto-adjacent topics ### 2. Search and Extract Run each query via CLI. After each, assess: - Signal or noise? Adjust operators. - Key voices worth searching `from:` specifically? - Threads worth following via `thread` command? - Linked resources worth deep-diving with `WebFetch`? ### 3. Follow Threads When a tweet has high engagement or is a thread starter: ```bash uv run {baseDir}/skills/x-research/scripts/x_search.py thread ``` ### 4. Deep-Dive Linked Content When tweets link to GitHub repos, blog posts, or docs, fetch with `WebFetch`. Prioritize links that: - Multiple tweets reference - Come from high-engagement tweets - Point to technical resources directly relevant to the question ### 5. Synthesize Group findings by theme, not by query: ``` ### [Theme/Finding Title] [1-2 sentence summary] - @username: "[key quote]" (NL, NI) [Tweet](url) - @username2: "[another perspective]" (NL, NI) [Tweet](url) Resources shared: - [Resource title](url) -- [what it is] ``` ### 6. Save Use `--save` flag or save manually. ## Refinement Heuristics - **Too much noise?** Add `-is:reply`, use `--sort likes`, narrow keywords - **Too few results?** Broaden with `OR`, remove restrictive operators - **Spam flooding results?** Add `-$ -airdrop -giveaway -whitelist` - **Expert takes only?** Use `from:` or `--min-likes 50` - **Substance over hot takes?** Search with `has:links` ## When to Use - Researching what developers/experts/community thinks about a topic - Getting real-time perspectives on breaking news or product launches - Finding technical discussions about libraries, frameworks, or APIs - Monitoring what key accounts are posting about - Gathering sourced evidence for competitive analysis or market research - Quick pulse check on a topic before deeper investigation ## When NOT to Use - Posting tweets, replying, or managing an X account (read-only tool) - Historical research beyond 7 days (uses recent search endpoint only) - Searching non-X platforms (use web search tools instead) - Tasks where web search provides better results (X is best for real-time opinions, discussions, and breaking news -- not reference docs) ## Cost Awareness X API uses pay-per-use pricing ($0.005/post read, $0.01/user lookup). Quick mode keeps costs under ~$0.50/search. Always check the cost display after each search. Cache prevents duplicate charges. See `references/x-api.md` for full pricing. ## File Structure ``` skills/x-research/ SKILL.md (this file) scripts/ x_search.py (CLI entry point, run with uv) x_api.py (X API wrapper) x_cache.py (file-based cache, 15min TTL) x_format.py (terminal + markdown formatters) data/ watchlist.json (accounts to monitor) cache/ (auto-managed) references/ x-api.md (X API endpoint reference) ``` ## Dónde encaja - Categoría: [Investigación](https://skillsagentes.com/categorias/investigacion.md) — Investigación estructurada, búsqueda de fuentes y síntesis. - Creador: [trailofbits](https://skillsagentes.com/creators/trailofbits.md) — 117 skills en el directorio - [Todas las skills](https://skillsagentes.com/skills.md) - [Ranking de instalaciones](https://skillsagentes.com/ranking.md) ## Otras skills del mismo repositorio - [Grilling](https://skillsagentes.com/skills/trailofbits/skills-curated/grilling.md): Interroga al usuario sin descanso sobre un plan, decisión o idea hasta resolver cada rama del árbol de decisión, o cuando dice "grill me on this". - [Handoff](https://skillsagentes.com/skills/trailofbits/skills-curated/handoff.md): Compacta la conversación actual en un documento de traspaso para que un agente nuevo pueda continuar el trabajo en otra sesión. - [Teach](https://skillsagentes.com/skills/trailofbits/skills-curated/teach.md): Enseña al usuario una nueva habilidad o concepto a lo largo de varias sesiones, usando el directorio actual como un espacio de enseñanza con estado, con lecciones, registros de aprendizaje y materiales de referencia. - [Writing Great Skills](https://skillsagentes.com/skills/trailofbits/skills-curated/writing-great-skills.md): Referencia para escribir y editar bien skills de agentes: el vocabulario y los principios que hacen que un skill sea predecible. Consúltalo al redactar, revisar o podar un SKILL.md. - [Ffuf Web Fuzzing](https://skillsagentes.com/skills/trailofbits/skills-curated/ffuf-web-fuzzing.md): Guía experta para el fuzzing web con ffuf en pentesting autorizado: descubrimiento de directorios y subdominios, fuzzing de parámetros, peticiones autenticadas y análisis de resultados. ## Skills relacionadas - [Research](https://skillsagentes.com/skills/mattpocock/skills/research.md): Investiga una pregunta contra fuentes primarias de alta confianza y guarda los hallazgos como un archivo Markdown en el repo. Úsalo para delegar el trabajo de lectura a un agente en segundo plano. - [Agent Reach](https://skillsagentes.com/skills/panniantong/agent-reach/agent-reach.md): Enrutador de acceso a internet para 15 plataformas — 小红书, Twitter, B站, Reddit, LinkedIn, YouTube, GitHub, RSS y más — con varios backends y seis canales sin configuración. - [Academic Paper Review](https://skillsagentes.com/skills/bytedance/deer-flow/academic-paper-review.md): Úsalo cuando el usuario pida revisar, analizar, criticar o resumir papers académicos, artículos de investigación, preprints o publicaciones científicas, con reviews estructuradas al estilo de las mejores conferencias. - [Consulting Analysis](https://skillsagentes.com/skills/bytedance/deer-flow/consulting-analysis.md): Genera informes de investigación de nivel consultoría (mercado, marca, finanzas, industria, due diligence) en dos fases: framework de análisis y luego informe final con narrativas, gráficos e insights estratégicos. - [Deep Research](https://skillsagentes.com/skills/bytedance/deer-flow/deep-research.md): Úsala en vez de WebSearch para cualquier pregunta que requiera investigación web: 'qué es X', 'explica X', 'compara X e Y' o antes de generar contenido. Aplica investigación sistemática multi-ángulo en vez de búsquedas superficiales. --- Skills Agentes · [Índice de páginas en markdown](https://skillsagentes.com/sitemap.md) · [Inicio](https://skillsagentes.com/index.md)