Recetas de datos

Sacar videos, perfiles y comentarios de TikTok

Tiktok Scraper (Pay Per Result) · apidojo/tiktok-scraper

Redes socialesGeneración de leadsVideos👤 14,980 usuarios★ 4.4 (30)

Extrae perfiles, videos, hashtags y comentarios de TikTok, con filtros para buscar justo lo que necesitas. Exporta en JSON o CSV.

Para qué te sirve

  • Encontrar influencers para campañas
  • Investigar qué contenido funciona en tu mercado
  • Seguir la conversación sobre tu marca

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 "apidojo/tiktok-scraper" (sacar videos, perfiles y comentarios de tiktok).

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:
   - Encontrar influencers para campañas
   - Investigar qué contenido funciona en tu mercado
   - Seguir la conversación sobre tu marca
   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 videos, perfiles y comentarios de TikTok",
  "nodes": [
    {
      "parameters": {},
      "name": "Inicio",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        0,
        0
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.apify.com/v2/acts/apidojo~tiktok-scraper/run-sync-get-dataset-items",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer TU_TOKEN_DE_APIFY"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "{\n  \"hashtags\": [\n    \"duet\"\n  ],\n  \"resultsPerPage\": 100,\n  \"profiles\": [\n    \"gordonramsayofficial\"\n  ],\n  \"profileSorting\": \"latest\",\n  \"excludePinnedPosts\": false,\n  \"leastDiggs\": 0,\n  \"mostDiggs\": 1000000000,\n  \"keywords\": [\n    \"Artificial Intelligence\",\n    \"podcast\"\n  ],\n  \"sortType\": \"RELEVANCE\",\n  \"dateRange\": \"DEFAULT\",\n  \"startUrls\": [\n    \"https://www.tiktok.com/@billieeilish/video/7050551461734042926\",\n    \"https://www.tiktok.com/@rabbitbrandmy/photo/7553874290735729940\",\n    \"https://www.tiktok.com/@gordonramsayofficial\",\n    \"https://www.tiktok.com/search?q=Recipes\",\n    \"https://www.tiktok.com/tag/duet\",\n    \"https://www.tiktok.com/music/original-sound-Newcastle-United-7297730198175402784\",\n    \"https://www.tiktok.com/place/New-York-22535796481546927\"\n  ],\n  \"postURLs\": [\n    \"https://www.tiktok.com/@billieeilish/video/7050551461734042926\"\n  ],\n  \"location\": \"US\",\n  \"maxItems\": 1000,\n  \"includeSearchKeywords\": false,\n  \"customMapFunction\": \"(object) => { return {...object} }\"\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/apidojo~tiktok-scraper/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 = {
  "hashtags": [
    "duet"
  ],
  "resultsPerPage": 100,
  "profiles": [
    "gordonramsayofficial"
  ],
  "profileSorting": "latest",
  "excludePinnedPosts": false,
  "leastDiggs": 0,
  "mostDiggs": 1000000000,
  "keywords": [
    "Artificial Intelligence",
    "podcast"
  ],
  "sortType": "RELEVANCE",
  "dateRange": "DEFAULT",
  "startUrls": [
    "https://www.tiktok.com/@billieeilish/video/7050551461734042926",
    "https://www.tiktok.com/@rabbitbrandmy/photo/7553874290735729940",
    "https://www.tiktok.com/@gordonramsayofficial",
    "https://www.tiktok.com/search?q=Recipes",
    "https://www.tiktok.com/tag/duet",
    "https://www.tiktok.com/music/original-sound-Newcastle-United-7297730198175402784",
    "https://www.tiktok.com/place/New-York-22535796481546927"
  ],
  "postURLs": [
    "https://www.tiktok.com/@billieeilish/video/7050551461734042926"
  ],
  "location": "US",
  "maxItems": 1000,
  "includeSearchKeywords": false,
  "customMapFunction": "(object) => { return {...object} }"
};

const run = await client.actor('apidojo/tiktok-scraper').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 = {
  "hashtags": [
    "duet"
  ],
  "resultsPerPage": 100,
  "profiles": [
    "gordonramsayofficial"
  ],
  "profileSorting": "latest",
  "excludePinnedPosts": false,
  "leastDiggs": 0,
  "mostDiggs": 1000000000,
  "keywords": [
    "Artificial Intelligence",
    "podcast"
  ],
  "sortType": "RELEVANCE",
  "dateRange": "DEFAULT",
  "startUrls": [
    "https://www.tiktok.com/@billieeilish/video/7050551461734042926",
    "https://www.tiktok.com/@rabbitbrandmy/photo/7553874290735729940",
    "https://www.tiktok.com/@gordonramsayofficial",
    "https://www.tiktok.com/search?q=Recipes",
    "https://www.tiktok.com/tag/duet",
    "https://www.tiktok.com/music/original-sound-Newcastle-United-7297730198175402784",
    "https://www.tiktok.com/place/New-York-22535796481546927"
  ],
  "postURLs": [
    "https://www.tiktok.com/@billieeilish/video/7050551461734042926"
  ],
  "location": "US",
  "maxItems": 1000,
  "includeSearchKeywords": false,
  "customMapFunction": "(object) => { return {...object} }"
}

run = client.actor("apidojo/tiktok-scraper").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/apidojo~tiktok-scraper/run-sync-get-dataset-items" \
  -H "Authorization: Bearer TU_TOKEN_DE_APIFY" \
  -H "Content-Type: application/json" \
  -d '{"hashtags":["duet"],"resultsPerPage":100,"profiles":["gordonramsayofficial"],"profileSorting":"latest","excludePinnedPosts":false,"leastDiggs":0,"mostDiggs":1000000000,"keywords":["Artificial Intelligence","podcast"],"sortType":"RELEVANCE","dateRange":"DEFAULT","startUrls":["https://www.tiktok.com/@billieeilish/video/7050551461734042926","https://www.tiktok.com/@rabbitbrandmy/photo/7553874290735729940","https://www.tiktok.com/@gordonramsayofficial","https://www.tiktok.com/search?q=Recipes","https://www.tiktok.com/tag/duet","https://www.tiktok.com/music/original-sound-Newcastle-United-7297730198175402784","https://www.tiktok.com/place/New-York-22535796481546927"],"postURLs":["https://www.tiktok.com/@billieeilish/video/7050551461734042926"],"location":"US","maxItems":1000,"includeSearchKeywords":false,"customMapFunction":"(object) => { return {...object} }"}'

Parecidos en Redes sociales