Recetas de datos

Sacar tweets de X (Twitter) por resultado

Tweet Scraper|$0.18/1K Tweets | Pay-Per Result | No Rate Limits · kaitoeasyapi/twitter-x-data-tweet-scraper-pay-per-result-cheapest

Redes socialesGeneración de leads👤 46,478 usuarios★ 4.2 (86)

Extrae tweets de X (Twitter) pagando solo por los resultados que obtienes.

Para qué te sirve

  • Monitorear menciones de tu marca
  • Seguir conversaciones sobre un tema
  • Reunir tweets para analizarlos

Cómo empezar

  1. Entra a la herramienta con el botón "Probar gratis" y crea tu cuenta de Apify.
  2. Llena el formulario. Empieza con pocos resultados para gastar poco crédito.
  3. Dale "Start" y descarga el resultado en Excel o CSV desde "Storage".

Úsalo donde ya trabajas

Todo usa tu token de Apify. Cámbialo donde dice TU_TOKEN_DE_APIFY y no lo compartas. ¿Primera vez? Ve el curso gratis.

Pégalo en ChatGPT o Claude y llena tu objetivo.

Actúa como mi asistente de datos. Voy a usar el actor de Apify "kaitoeasyapi/twitter-x-data-tweet-scraper-pay-per-result-cheapest" (sacar tweets de x (twitter) por resultado).

Mi objetivo: [DESCRIBE QUÉ QUIERES LOGRAR, PARA QUÉ NEGOCIO Y EN QUÉ CIUDAD O NICHO]

1. Hazme máximo 3 preguntas si te falta algo para configurarlo.
2. Dame el JSON de input para pegar en Apify, empezando con pocos resultados para gastar poco crédito.
3. Dime qué columnas del resultado me van a importar y cuáles puedo ignorar.
4. Cuando te pase el CSV, sácame:
   - Monitorear menciones de tu marca
   - Seguir conversaciones sobre un tema
   - Reunir tweets para analizarlos
   Y entrégame una tabla con los 10 mejores casos y por qué.

No inventes datos: si algo no viene en el CSV, dímelo.

Copia, abre un workflow en n8n y pega con Ctrl+V. Lección de n8n.

{
  "name": "Sacar tweets de X (Twitter) por resultado",
  "nodes": [
    {
      "parameters": {},
      "name": "Inicio",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        0,
        0
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.apify.com/v2/acts/kaitoeasyapi~twitter-x-data-tweet-scraper-pay-per-result-cheapest/run-sync-get-dataset-items",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer TU_TOKEN_DE_APIFY"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "{\n  \"tweetIDs\": [\n    \"1846987139428634858\"\n  ],\n  \"twitterContent\": \"from:elonmusk make -\\\"live laugh love\\\"\",\n  \"searchTerms\": [\n    \"from:elonmusk since:2024-01-01_00:00:00_UTC until:2024-01-02_00:00:00_UTC\",\n    \"from:NASA starsince:2024-01-01_00:00:00_UTC until:2024-01-02_00:00:00_UTC\"\n  ],\n  \"lang\": \"en\",\n  \"from\": \"elonmusk\",\n  \"to\": \"\",\n  \"@\": \"\",\n  \"list\": \"\",\n  \"near\": \"\",\n  \"within\": \"\",\n  \"geocode\": \"\",\n  \"since_time\": \"\",\n  \"until_time\": \"\",\n  \"since_id\": \"\",\n  \"max_id\": \"\",\n  \"conversation_id\": \"\",\n  \"quoted_tweet_id\": \"\",\n  \"quoted_user_id\": \"\",\n  \"card_name\": \"\",\n  \"url\": \"\"\n}",
        "options": {
          "timeout": 300000
        }
      },
      "name": "Apify",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        260,
        0
      ]
    }
  ],
  "connections": {
    "Inicio": {
      "main": [
        [
          {
            "node": "Apify",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
  1. Crea un escenario nuevo y agrega el módulo HTTP → "Make a request".
  2. URL: https://api.apify.com/v2/acts/kaitoeasyapi~twitter-x-data-tweet-scraper-pay-per-result-cheapest/run-sync-get-dataset-items
  3. Method: POST.
  4. Headers: Authorization = Bearer TU_TOKEN_DE_APIFY
  5. Body type: Raw, Content type: JSON (application/json). En Request content pega el input de abajo.
  6. Marca "Parse response" para que cada resultado salga como dato y puedas mandarlo a Google Sheets con un Iterator.

Lección de Make

// npm install apify-client
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });

const input = {
  "tweetIDs": [
    "1846987139428634858"
  ],
  "twitterContent": "from:elonmusk make -\"live laugh love\"",
  "searchTerms": [
    "from:elonmusk since:2024-01-01_00:00:00_UTC until:2024-01-02_00:00:00_UTC",
    "from:NASA starsince:2024-01-01_00:00:00_UTC until:2024-01-02_00:00:00_UTC"
  ],
  "lang": "en",
  "from": "elonmusk",
  "to": "",
  "@": "",
  "list": "",
  "near": "",
  "within": "",
  "geocode": "",
  "since_time": "",
  "until_time": "",
  "since_id": "",
  "max_id": "",
  "conversation_id": "",
  "quoted_tweet_id": "",
  "quoted_user_id": "",
  "card_name": "",
  "url": ""
};

const run = await client.actor('kaitoeasyapi/twitter-x-data-tweet-scraper-pay-per-result-cheapest').call(input);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items.length, 'resultados');
console.log(items[0]);
# pip install apify-client
import os
from apify_client import ApifyClient

client = ApifyClient(os.environ["APIFY_TOKEN"])

run_input = {
  "tweetIDs": [
    "1846987139428634858"
  ],
  "twitterContent": "from:elonmusk make -\"live laugh love\"",
  "searchTerms": [
    "from:elonmusk since:2024-01-01_00:00:00_UTC until:2024-01-02_00:00:00_UTC",
    "from:NASA starsince:2024-01-01_00:00:00_UTC until:2024-01-02_00:00:00_UTC"
  ],
  "lang": "en",
  "from": "elonmusk",
  "to": "",
  "@": "",
  "list": "",
  "near": "",
  "within": "",
  "geocode": "",
  "since_time": "",
  "until_time": "",
  "since_id": "",
  "max_id": "",
  "conversation_id": "",
  "quoted_tweet_id": "",
  "quoted_user_id": "",
  "card_name": "",
  "url": ""
}

run = client.actor("kaitoeasyapi/twitter-x-data-tweet-scraper-pay-per-result-cheapest").call(run_input=run_input)
items = list(client.dataset(run["defaultDatasetId"]).iterate_items())
print(len(items), "resultados")
print(items[0] if items else "sin resultados")
curl -X POST "https://api.apify.com/v2/acts/kaitoeasyapi~twitter-x-data-tweet-scraper-pay-per-result-cheapest/run-sync-get-dataset-items" \
  -H "Authorization: Bearer TU_TOKEN_DE_APIFY" \
  -H "Content-Type: application/json" \
  -d '{"tweetIDs":["1846987139428634858"],"twitterContent":"from:elonmusk make -\"live laugh love\"","searchTerms":["from:elonmusk since:2024-01-01_00:00:00_UTC until:2024-01-02_00:00:00_UTC","from:NASA starsince:2024-01-01_00:00:00_UTC until:2024-01-02_00:00:00_UTC"],"lang":"en","from":"elonmusk","to":"","@":"","list":"","near":"","within":"","geocode":"","since_time":"","until_time":"","since_id":"","max_id":"","conversation_id":"","quoted_tweet_id":"","quoted_user_id":"","card_name":"","url":""}'

Parecidos en Redes sociales