# Universal Social Media & Video Insights Harvester (`trusted_tech_spot/universal-social-media-scraper`) Actor

All-in-one harvester for Instagram, TikTok, YouTube, Reddit, and Twitter/X posts. Extracts views, likes, comments, captions, creator handles, and direct media URLs without needing 5 separate scrapers.

- **URL**: https://apify.com/trusted_tech_spot/universal-social-media-scraper.md
- **Developed by:** [David Sandor](https://apify.com/trusted_tech_spot) (community)
- **Categories:** Social media, MCP servers, AI
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.40 / 1,000 harvested social media post records

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Universal Social Media & Video Insights Harvester 🚀

[![Apify Actor](https://img.shields.io/badge/Apify-Actor-orange.svg?style=flat-square)](https://apify.com/trusted_tech_spot/universal-social-media-scraper)
[![Pay Per Event](https://img.shields.io/badge/Pricing-Pay%20Per%20Result-green.svg?style=flat-square)](https://apify.com/trusted_tech_spot/universal-social-media-scraper)
[![Zero Maintenance](https://img.shields.io/badge/Maintenance-Zero%20Maintenance-blue.svg?style=flat-square)](https://apify.com/trusted_tech_spot/universal-social-media-scraper)
[![RAG Ready](https://img.shields.io/badge/AI%20%2F%20RAG-Token%20Chunking%20Included-purple.svg?style=flat-square)](https://apify.com/trusted_tech_spot/universal-social-media-scraper)

All-in-one harvester for Instagram, TikTok, YouTube, Reddit, and Twitter/X posts. Extracts views, likes, comments, captions, creator handles, and direct media URLs without needing 5 separate scrapers.

> ⚡ **Try it in 1-Click**: Click the **Run** or **Try for Free** button on the right to test this Actor immediately with pre-configured parameters. No technical setup, passwords, or API keys required!
> 🎁 **Free Starter Allowance**: Test runs cost less than a fraction of a cent ($0.0001 container fee) so you can run test queries risk-free with your monthly Apify starter credits.

<div align="center">
  <a href="https://apify.com/trusted_tech_spot/universal-social-media-scraper/input-schema">
    <img src="https://img.shields.io/badge/1️⃣_VIEW_INPUT_SCHEMA-CLICK_'INPUT'_TAB_ABOVE-blue?style=for-the-badge&logo=apify&logoColor=white" height="38" alt="View Input Tab" />
  </a>
  &nbsp;&nbsp;
  <a href="https://console.apify.com/actors/trusted_tech_spot/universal-social-media-scraper/input">
    <img src="https://img.shields.io/badge/⚡_RUN_IN_CONSOLE-START_INSTANT_TEST-brightgreen?style=for-the-badge&logo=play&logoColor=white" height="38" alt="Run Actor Free" />
  </a>
  <p><strong>⚡ 1-Click Instant Run • 🎁 Free Starter Tier ($0.0001) • 🚀 Results in &lt; 2s</strong></p>
  <p><strong>🌏 支持出海跨境与全球数据采集 • 免代理 / 免登录 / 免验证码 • 一键导出 Excel / CSV / JSON</strong></p>
  <p><sub>💡 <strong>Tip / 提示</strong>: Click the <strong>"Input"</strong> tab at the top of this page (or <strong>"Try for free"</strong>) to see the pre-filled 1-click form! (点击页面上方的 <strong>Input</strong> 标签页即可查看已填好的默认参数并一键运行)</sub></p>
</div>
<div align="center">
  <img src="https://img.shields.io/badge/Make.com-Ready-orange?style=flat-square&logo=make" alt="Make.com" />
  <img src="https://img.shields.io/badge/Zapier-Automated-orange?style=flat-square&logo=zapier" alt="Zapier" />
  <img src="https://img.shields.io/badge/n8n-Workflow_Ready-red?style=flat-square&logo=n8n" alt="n8n" />
  <img src="https://img.shields.io/badge/LangChain_%26_LlamaIndex-Vector_Ready-blue?style=flat-square" alt="LangChain" />
  <img src="https://img.shields.io/badge/Google_Sheets-1--Click_Sync-green?style=flat-square&logo=googlesheets" alt="Google Sheets" />
</div>

***

#### ⚡ 1-Click API Quick-Start (cURL / Python / Dify / FastGPT / Coze)

Run directly via HTTP API without opening the browser form (支持直接通过 API 调用，无缝接入 Dify、Coze、FastGPT 与自动化脚本):

```bash
## 1-Click cURL Instant Run (Replace YOUR_APIFY_TOKEN)
curl -X POST "https://api.apify.com/v2/acts/trusted_tech_spot~universal-social-media-scraper/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'
```

***

### 🌟 Why Choose This Actor?

> 📊 **No-Code Instant Export**: Download your clean extracted data directly into **Excel (.xlsx)**, **CSV**, **JSON**, or sync directly to **Google Sheets** with 1 click right from the Apify Console dataset tab. No coding required!

- ⚡ **High-Speed & Resilient Extraction**: Engineered with intelligent rate adaptation and defensive fallbacks to eliminate downtime or captchas.
- 💰 **Predictable Pay-Per-Result Pricing**: Only pay for the actual records extracted. Never pay for actor startup overhead, cold starts, or container idle seconds.
- 🧠 **AI & RAG Ready**: Seamlessly feeds vector databases (Pinecone, Qdrant, ChromaDB, Weaviate) and LLM agents with pre-calculated OpenAI token counts and semantic chunking.
- 🎯 **Native Keyword Filtering**: Target exact records automatically with `includeKeywords` and `excludeKeywords` without client-side post-processing.
- 📊 **Instant Multi-Format Export**: One-click download into **JSON**, **CSV**, **Excel**, **XML**, or **HTML Table** directly from Apify Console or API.

***

> 💡 **国内/跨境电商用户快速上手 (Quick Guide for China & Cross-Border Teams)**:
>
> 1. 本工具已内置自动抗封锁与动态解析，**无需配置任何国外代理 (No Proxy Needed)**，亦无需提供个人手机号或 Cookie 凭据。
> 2. 点击右侧或上方 **"Run"** 或 **"Try for free"**，使用系统自带的预设参数即可在 2 秒内完成首批数据提取测试。
> 3. 支持在控制台直接导出 **Excel、CSV、JSON** 等全格式数据，或无缝对接 Python / Node.js API。

***

### 🚀 How to Run in 3 Easy Steps

1. **Open the Actor**: Click the **Run** button on the top right of this page.
2. **Review or Adjust Inputs**: The form is organized into clean visual sections (Primary Settings, Filtering, and AI Vector Options). Run it with default values or customize to your target.
3. **Download Results**: View your extracted dataset in real time and export it to Excel, CSV, or JSON.

***

### 📥 Input Parameters

All parameters come pre-filled with sensible defaults so you can run the Actor right away:

| Parameter | Type | Required | Default / Prefill | Description |
|:---|:---|:---:|:---:|:---|
| **Target URL** (`url`) | `string` | No | `"https://www.youtube.com/watch?v=dQw4w9WgXcQ"` | The public URL from Instagram, TikTok, YouTube, Reddit, or Twitter/X |
| **Include Keywords (Filter)** (`includeKeywords`) | `string` | No | `""` | Filter results to only include items containing these comma-separated keywords |
| **Exclude Keywords (Filter)** (`excludeKeywords`) | `string` | No | `""` | Filter out results containing these comma-separated keywords |
| **Enable AI / RAG Token Chunking** (`enableRagEnrichment`) | `boolean` | No | `true` | Automatically compute OpenAI token counts and generate semantic vector chunks for RAG pipelines |
| **Preferred Output Format** (`outputFormat`) | `string` | No | `"JSON"` | Format results for preferred downstream consumer (e.g. JSON, Markdown, Flat) |

***

### 📤 Sample Output Data

Data is saved directly to the default dataset. Below is a realistic example of the structured fields returned:

```json
{
  "url": "Sample url",
  "platform": "Sample platform",
  "title": "Sample title",
  "author": "Sample author",
  "authorUrl": "Sample authorUrl",
  "viewsCount": 42,
  "likesCount": 42,
  "commentsCount": 42,
  "mediaType": "Sample mediaType",
  "mediaUrls": [
    "Sample Record 1",
    "Sample Record 2"
  ],
  "publishedTime": "Sample publishedTime",
  "_sentimentScore": 0.25,
  "_rag": {
    "estimatedTokens": 380,
    "chunksCount": 1,
    "ingestionReady": true
  }
}
```

***

### 💻 Developer API & AI Framework Integration

#### Node.js (`apify-client`)

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({
    token: 'YOUR_APIFY_TOKEN',
});

// Run actor with pre-configured parameters
const run = await client.actor('trusted_tech_spot/universal-social-media-scraper').call();

// Fetch structured items from the dataset
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(`Extracted ${items.length} records:`, items);
```

#### Python (`apify-client`)

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")

## Run actor with default parameters
run = client.actor("trusted_tech_spot/universal-social-media-scraper").call()

## Fetch dataset items
items = client.dataset(run["defaultDatasetId"]).list_items().items
print(f"Extracted {len(items)} records:", items)
```

#### LangChain Vector Ingestion (AI & RAG)

```python
from apify_client import ApifyClient
from langchain_community.vectorstores import Chroma
from langchain_openai import OpenAIEmbeddings
from langchain_core.documents import Document

## 1. Fetch pre-chunked dataset from Apify
client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("trusted_tech_spot/universal-social-media-scraper").call()
items = client.dataset(run["defaultDatasetId"]).list_items().items

## 2. Extract semantic chunks directly into LangChain documents
docs = []
for item in items:
    chunks = item.get("_rag", {}).get("chunks", [str(item)])
    for chunk in chunks:
        docs.append(Document(page_content=chunk, metadata={"source": "universal-social-media-scraper"}))

## 3. Ingest into ChromaDB / Pinecone vector store
vector_store = Chroma.from_documents(docs, OpenAIEmbeddings())
print(f"Successfully indexed {len(docs)} chunks into Vector DB!")
```

#### LlamaIndex Knowledge Ingestion

```python
from apify_client import ApifyClient
from llama_index.core import VectorStoreIndex, Document

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("trusted_tech_spot/universal-social-media-scraper").call()
items = client.dataset(run["defaultDatasetId"]).list_items().items

## Wrap clean extracted text into LlamaIndex documents
documents = [Document(text=str(item)) for item in items]
index = VectorStoreIndex.from_documents(documents)
query_engine = index.as_query_engine()
response = query_engine.query("Summarize key findings from this extracted data")
print(response)
```

***

### 🔗 Related Automations (Social Media Trends, Creator Analytics & Global Jobs Fleet)

Explore our specialized high-speed micro-scrapers and cross-border intelligence tools from the **trusted_tech_spot** fleet:

- [**Xiaohongshu (REDnote) Posts Scraper 小红书笔记与爆款采集** (`xiaohongshu-rednote-posts-trends-scraper`)](https://apify.com/trusted_tech_spot/xiaohongshu-rednote-posts-trends-scraper) — Extract Xiaohongshu (REDnote) viral notes, KOL engagement metrics, and trending lifestyle tags.
- [**TikTok Trending Hashtags & Viral Sounds Scraper** (`tiktok-trending-hashtags-sounds-scraper`)](https://apify.com/trusted_tech_spot/tiktok-trending-hashtags-sounds-scraper) — Scrape viral TikTok hashtags, trending sounds, creator growth metrics, and video views.
- [**Remote Tech Jobs & Compensation Salary Scraper** (`remote-tech-jobs-salary-scraper`)](https://apify.com/trusted_tech_spot/remote-tech-jobs-salary-scraper) — Extract high-paying remote developer, AI engineer, and DevOps jobs with verified salary bands.
- [**TikTok Video, Audio & Profile Scraper** (`fast-tiktok-video-audio-scraper`)](https://apify.com/trusted_tech_spot/fast-tiktok-video-audio-scraper) — High-speed TikTok video, audio stream, author stats, and engagement extractor.
- [**Indeed Jobs & Salary Scraper (Remote & Contacts)** (`fast-indeed-jobs-scraper`)](https://apify.com/trusted_tech_spot/fast-indeed-jobs-scraper) — Scrape Indeed job postings, company salaries, remote roles, and hiring manager contacts.

***

### 💬 Technical Support & Custom Demands

Need custom extraction fields, high-volume dedicated scraping, enterprise data feeds, or encountered an edge-case?

- 🐛 **Open an Issue**: Open a ticket directly on the [Actor Issues Tab](https://console.apify.com/actors/trusted_tech_spot/universal-social-media-scraper/issues) for 24-hour engineer response.
- ✉️ **Direct Email Support**: Reach out directly to **contact@trustedtechspot.com** for custom scraping jobs, private proxy setups, or SLA contracts.
- 💡 **Feature Requests**: Request new export columns, filtering rules, or platform endpoints anytime.

***

### 🔒 Privacy & Enterprise Compliance

- **No Passwords or Cookies Required**: Safely executes without requesting your credentials, private tokens, or session cookies.
- **Enterprise Grade Sanitization**: Automatically scrubs sensitive headers and tracking parameters before saving data.

# Actor input Schema

## `url` (type: `string`):

The public URL from Instagram, TikTok, YouTube, Reddit, or Twitter/X (输入搜索词或目标网址，或保持默认值直接点击 Start 运行)

## `includeKeywords` (type: `string`):

Filter results to only include items containing these comma-separated keywords

## `excludeKeywords` (type: `string`):

Filter out results containing these comma-separated keywords

## `enableRagEnrichment` (type: `boolean`):

Automatically compute OpenAI token counts and generate semantic vector chunks for RAG pipelines

## `outputFormat` (type: `string`):

Format results for preferred downstream consumer (e.g. JSON, Markdown, Flat)

## Actor input object example

```json
{
  "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "includeKeywords": "",
  "excludeKeywords": "",
  "enableRagEnrichment": true,
  "outputFormat": "JSON"
}
```

# Actor output Schema

## `dataset` (type: `string`):

Structured output and extracted data from Universal Social Media & Video Insights Harvester

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "includeKeywords": "",
    "excludeKeywords": "",
    "enableRagEnrichment": true,
    "outputFormat": "JSON"
};

// Run the Actor and wait for it to finish
const run = await client.actor("trusted_tech_spot/universal-social-media-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "includeKeywords": "",
    "excludeKeywords": "",
    "enableRagEnrichment": True,
    "outputFormat": "JSON",
}

# Run the Actor and wait for it to finish
run = client.actor("trusted_tech_spot/universal-social-media-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "includeKeywords": "",
  "excludeKeywords": "",
  "enableRagEnrichment": true,
  "outputFormat": "JSON"
}' |
apify call trusted_tech_spot/universal-social-media-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,trusted_tech_spot/universal-social-media-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/E1PYlk1pHR3KX2rch/builds/oLqcAQVDPGSyvDjsq/openapi.json
