# Truth Social Scraper — Profiles, Posts, Media & Metrics (`foxlabs/truth-social-scraper`) Actor

Extract public Truth Social profiles, Truths, ReTruths, quotes, polls, HD video/image attachments, link cards, hashtags, mentions, and engagement velocity metrics by username, hashtag, or post URL. Standby HTTP and MCP ready.

- **URL**: https://apify.com/foxlabs/truth-social-scraper.md
- **Developed by:** [Berkan Kaplan](https://apify.com/foxlabs) (community)
- **Categories:** Social media, News
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 1,000 truth social post (truth)s

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

![Truth Social Scraper Banner](https://data.foxlabs.com.tr/img/truth-social-scraper-banner.svg)

## Truth Social Scraper — Profiles, Posts, Media & Engagement Metrics 🚀

Extract structured public data from **Truth Social (`truthsocial.com`)** — including **account profiles (`followersCount`, `verified`, `bioText`)**, **full-text Truths, ReTruths & Quoted posts**, **HD video/image `mediaAttachments`**, **link preview cards**, **polls**, **hashtags & mentions**, and **hourly engagement velocity (`likesPerHour`, `retruthsPerHour`)** — with zero login credentials or API keys required.

> **AI Agent & MCP Quick-Start:** Run with `{"usernames":["realDonaldTrump"],"includeProfiles":true,"maxPostsPerSource":20}`. Machine-readable documentation is available at `https://apify.com/foxlabs/truth-social-scraper.md`.

***

### 🔍 1. What Does Truth Social Scraper Do?

**Truth Social** has become a primary breaking-news source for financial markets, political journalism, macroeconomic announcements, and brand monitoring. Standard HTML scrapers fail on Truth Social due to edge protection and return raw HTML tags instead of clean, structured intelligence.

**Truth Social Scraper** extracts clean, analytics-ready JSON across user timelines, hashtag feeds, and individual status URLs:

- **Account Intelligence (`profile`):** Captures `accountId`, `username`, `displayName`, `verified`, `premium`, `followersCount`, `followingCount`, `statusesCount`, `lastStatusAt`, `createdAt`, decoded `bioText`, `websiteUrl`, `avatarUrl`, `headerUrl`, and verified `profileFields[]`.
- **Clean Plain Text + Full Media (`post`):** Converts HTML status bodies into clean paragraph-preserved `text` (removing inline quote boilerplate) alongside `contentHtml`, plus direct MP4/JPEG URLs, dimensions, duration, and bitrate inside `mediaAttachments[]`.
- **Quotes, ReTruths, Link Cards & Polls:** Preserves structured `quotedPost`, `rebloggedPost`, `linkCard` (`url`, `title`, `description`, `providerName`, `image`), `poll` vote tallies, `hashtags[]`, `mentions[]`, and `externalUrls[]`.
- **Incremental Monitoring (`sinceDate`):** Built-in ISO date/timestamp cutoff stops timeline pagination automatically the moment older non-pinned posts are reached — ideal for scheduled 5-minute or hourly market alerts.

***

### 🤖 2. Built for AI Agents, MCP & Automated Workflows

- **MCP & Autonomous Agent Ready:** Plug directly into the Apify MCP Server (`https://mcp.apify.com`), Claude, Gemini, OpenAI, LangChain, n8n, Make, and x402 / Skyfire workflows.
- **Synchronous Standby HTTP Mode:** Query `POST /scrape` for real-time trading, newsroom, or compliance checks without dataset polling.
- **Suggested Agent Prompt:** *"Run `foxlabs/truth-social-scraper` for `usernames: ['realDonaldTrump']` with `sinceDate: '2026-11-20'` and summarize every post mentioning tariffs, energy, semiconductors, or Federal Reserve policy along with its likes and ReTruth velocity."*

***

### 📋 3. Why Choose `foxlabs/truth-social-scraper`?

| Capability | Typical Truth Social Scrapers | `foxlabs/truth-social-scraper` |
| :--- | :--- | :--- |
| **Post Text Cleanliness** | Raw `<p>` / `<span class="quote-inline">` HTML | **Clean plain `text` + preserved `contentHtml` + `externalUrls[]`** |
| **Quotes, ReTruths & Polls** | Flattened or dropped | **Structured `quotedPost`, `rebloggedPost`, `linkCard` & `poll`** |
| **Engagement Velocity** | Raw counts only | **Normalized `hoursSincePost`, `likesPerHour` & `retruthsPerHour`** |
| **Incremental Date Cutoff** | Wastes requests paging old history | **Automatic `sinceDate` early pagination cutoff (skips pinned posts)** |
| **Login / Cookies Required** | Often requires user session tokens | **100% keyless & cookie-free out of the box (`256 MB` RAM)** |

***

### ✨ 4. Key Features

1. **Multi-Source Extraction:** Combine `usernames` (`@handle` or profile URLs), public `hashtags` (`#America`, `Crypto`), and direct `postUrls` in a single run.
2. **HD Video & Image Metadata:** Every attachment includes direct CDN `url`, `previewUrl`, `width`, `height`, `durationSeconds`, `bitrate`, and `altText`.
3. **Pre-Billing Engagement & Media Filters:** Filter by `excludeReplies`, `excludeReTruths`, `onlyMedia`, `sinceDate`, and `minLikes` **before** charging — excluded posts cost `$0.00`.
4. **Idempotent Deduplication:** Keyed by `truth-profile:<accountId>` and `truth-post:<postId>` across overlapping timelines and container restarts.

***

### 📊 5. Transparent Pay-Per-Event Pricing

Billing is enforced strictly via `Actor.getChargingManager()` — **no monthly subscription, no start fee, and `$0.00` charge on filtered-out posts or diagnostic `status` rows**:

| Event Name | Price | Per 1,000 Records | When Charged |
| :--- | :---: | :---: | :--- |
| `profile` | **$0.0030** | **$3.00 / 1K** | Each unique Truth Social account profile emitted (`includeProfiles: true`) |
| `post` | **$0.0015** | **$1.50 / 1K** | Each unique Truth Social post ("Truth") delivered to the dataset |
| `status` | **$0.0000** | **Free** | Diagnostic note emitted only when input is empty or zero records match |

***

### 📥 6. Input Parameters

| Parameter | Type | Default | Description |
| :--- | :---: | :---: | :--- |
| `usernames` | `string[]` | `["realDonaldTrump"]` | Truth Social handles (`realDonaldTrump`, `@realDonaldTrump`) or full profile URLs. |
| `hashtags` | `string[]` | `[]` | Public Truth Social hashtags (`America`, `#MAGA`) to collect from tag timelines. |
| `postUrls` | `string[]` | `[]` | Direct Truth Social post URLs or numeric status IDs. |
| `includeProfiles` | `boolean` | `true` | Emit a structured `profile` record for each account in `usernames`. |
| `excludeReplies` | `boolean` | `true` | Skip comment replies on user timelines so only main posts, quotes, and ReTruths return. |
| `excludeReTruths` | `boolean` | `false` | Skip pure ReTruths (reposts) and keep only original and quoted Truths. |
| `onlyMedia` | `boolean` | `false` | Return only Truths containing image, video, or audio attachments. |
| `sinceDate` | `string` | — | Optional ISO 8601 date/timestamp cutoff (e.g. `"2026-11-20"` or `"2026-11-23T12:00:00Z"`). |
| `minLikes` | `integer` | — | Minimum `likesCount` threshold (filtered-out posts cost `$0`). |
| `maxPostsPerSource` | `integer` | `40` | Maximum posts to collect per username or hashtag (`0–5000`). |
| `maxTotalPosts` | `integer` | `200` | Global cap on billable `post` records across the run (`0–25000`). |
| `proxyConfiguration` | `object` | `{"useApifyProxy":true}` | Proxy configuration (managed automatically out of the box). |

***

### 🎬 7. Quick-Start Input Examples

#### Real-Time Executive & Market Monitoring (`sinceDate` Incremental Run)

```json
{
  "usernames": ["realDonaldTrump", "JDvance"],
  "includeProfiles": true,
  "excludeReplies": true,
  "excludeReTruths": true,
  "sinceDate": "2026-11-20T00:00:00Z",
  "maxPostsPerSource": 40
}
```

#### Viral Media & Hashtag Feed Collection

```json
{
  "hashtags": ["America", "Bitcoin"],
  "onlyMedia": false,
  "minLikes": 50,
  "maxPostsPerSource": 30,
  "maxTotalPosts": 100
}
```

***

### 📤 8. Sample Output Record

```json
{
  "rowType": "post",
  "rowKey": "truth-post:117666141823845971",
  "postId": "117666141823845971",
  "postUrl": "https://truthsocial.com/@realDonaldTrump/117666141823845971",
  "createdAt": "2026-11-23T14:07:17.887Z",
  "editedAt": null,
  "text": "The NVIDIA Board of Directors has made the correct and proper decision to return Jensen Huang to the position of CEO...",
  "language": "en",
  "visibility": "public",
  "isReTruth": false,
  "isReply": false,
  "isQuote": false,
  "isPinned": false,
  "isSponsored": false,
  "likesCount": 25511,
  "retruthsCount": 5751,
  "repliesCount": 1960,
  "upvotesCount": 25511,
  "downvotesCount": 0,
  "hoursSincePost": 11.4,
  "likesPerHour": 2237.81,
  "retruthsPerHour": 504.47,
  "hasMedia": false,
  "mediaCount": 0,
  "mediaTypes": [],
  "mediaAttachments": [],
  "linkCard": null,
  "quotedPost": null,
  "rebloggedPost": null,
  "poll": null,
  "hashtags": [],
  "mentions": [],
  "externalUrls": [],
  "authorId": "107780257626128497",
  "authorUsername": "realDonaldTrump",
  "authorDisplayName": "Donald J. Trump",
  "authorProfileUrl": "https://truthsocial.com/@realDonaldTrump",
  "authorFollowersCount": 13203705,
  "authorVerified": true,
  "authorPremium": true,
  "sourceType": "username",
  "sourceQuery": "realDonaldTrump",
  "scrapedAt": "2026-11-24T01:31:18.000Z"
}
```

***

### 📚 9. Complete Output Schema Reference

#### `post` Record Fields

| Field | Type | Description |
| :--- | :---: | :--- |
| `rowType` / `rowKey` | `string` | `"post"` and unique deduplication key `"truth-post:<postId>"`. |
| `postId` / `postUrl` | `string` | Numeric Truth Social status ID and canonical public URL. |
| `createdAt` / `editedAt` | `string\|null` | ISO 8601 creation and last-edit timestamps. |
| `text` / `contentHtml` | `string\|null` | Clean plain-text Truth body and original HTML markup. |
| `language` / `visibility` | `string\|null` | Detected ISO language code (`"en"`) and visibility (`"public"`). |
| `isReTruth` / `isQuote` / `isReply` | `boolean` | Structural post classification flags (`isPinned` and `isSponsored` included). |
| `likesCount` / `retruthsCount` / `repliesCount` | `integer\|null` | Likes (`favourites_count`), ReTruths (`reblogs_count`), and comment replies. |
| `hoursSincePost` / `likesPerHour` / `retruthsPerHour` | `number\|null` | Age-normalized engagement velocity metrics at extraction time. |
| `hasMedia` / `mediaAttachments` | `boolean / object[]` | Direct CDN video/image URLs, dimensions, duration, bitrate, and alt text. |
| `linkCard` | `object\|null` | External news/article link preview card (`url`, `title`, `description`, `providerName`, `image`). |
| `quotedPost` / `rebloggedPost` | `object\|null` | Embedded summary when quoting or ReTruthing another post. |
| `poll` | `object\|null` | Poll metadata, expiration state, total votes, and option vote counts. |
| `hashtags` / `mentions` / `externalUrls` | `array` | Extracted hashtag strings, `@mention` objects, and external non-Truth URLs. |
| `authorUsername` / `authorFollowersCount` | `string / int` | Author handle, display name, verification badge, and follower count. |

#### `profile` Record Fields

| Field | Type | Description |
| :--- | :---: | :--- |
| `rowType` / `rowKey` | `string` | `"profile"` and `"truth-profile:<accountId>"`. |
| `accountId` / `username` / `displayName` | `string` | Account ID, `@handle`, and public display name. |
| `verified` / `premium` / `isBot` | `boolean\|null` | Red check verification badge, premium status, and automated bot flag. |
| `followersCount` / `followingCount` / `statusesCount` | `integer\|null` | Total followers, following accounts, and lifetime Truth count. |
| `bioText` / `websiteUrl` / `avatarUrl` / `headerUrl` | `string\|null` | Clean biography text, normalized website URL, avatar, and banner image. |

***

### 💻 10. API & SDK Integration Examples

#### cURL

```bash
curl -X POST "https://api.apify.com/v2/acts/foxlabs~truth-social-scraper/runs?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"usernames":["realDonaldTrump"],"includeProfiles":true,"maxPostsPerSource":20}'
```

#### JavaScript (`apify-client`)

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

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('foxlabs/truth-social-scraper').call({
    usernames: ['realDonaldTrump'],
    includeProfiles: true,
    excludeReplies: true,
    maxPostsPerSource: 20,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

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

```python
import os
from apify_client import ApifyClient

client = ApifyClient(os.environ["APIFY_TOKEN"])
run = client.actor("foxlabs/truth-social-scraper").call(run_input={
    "usernames": ["realDonaldTrump"],
    "includeProfiles": True,
    "excludeReplies": True,
    "excludeReTruths": False,
    "maxPostsPerSource": 20,
})
dataset_id = getattr(run, "default_dataset_id", None) or run["defaultDatasetId"]
items = client.dataset(dataset_id).list_items().items
print(f"Fetched {len(items)} Truth Social records")
```

***

### ⚡ 11. Standby HTTP Mode

When running in **Apify Standby**, call `POST /scrape` synchronously:

```bash
curl -X POST "https://foxlabs--truth-social-scraper.apify.actor/scrape?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"usernames":["realDonaldTrump"],"includeProfiles":false,"maxPostsPerSource":5}'
```

***

### 🔗 12. Workflow Automation (n8n, Make, Zapier, Slack & Trading Bots)

- **Scheduled Market & Breaking-News Alerts:** Schedule a run every 5–15 minutes with `sinceDate` set to the start of the day and `maxPostsPerSource: 20`; forward new `postId` items via webhook to Slack, Telegram, Discord, or quantitative NLP pipelines.
- **Profile-Only Follower Tracking:** Set `includeProfiles: true` and `maxPostsPerSource: 0` across dozens of political or media handles to track daily follower and status growth at `$0.003` per account.

***

### 🎯 13. Industry Use Cases

- **Quantitative Finance & Macro Desks:** Monitor tariff, energy, semiconductor, crypto, and regulatory statements in real time with clean plain-text payloads ready for LLM sentiment scoring.
- **Newsrooms & Investigative Journalism:** Archive full-resolution MP4 video clips, quoted posts, external links, and timestamps with immutable `postId` identifiers.
- **Public Affairs & Brand Risk Teams:** Track hashtag narratives (`hashtags`) and engagement velocity (`likesPerHour`, `retruthsPerHour`) to identify fast-moving stories early.

***

### 💡 14. Performance & Cost Optimization Tips

1. **Use `sinceDate` on Recurring Schedules:** Pagination halts automatically as soon as non-pinned posts older than `sinceDate` appear, minimizing runtime and request volume.
2. **Fetch Multiples of `40` Posts:** Truth Social timelines return up to `40` posts per API page, making `maxPostsPerSource: 40` just as fast as `maxPostsPerSource: 5`.
3. **Profile-Only Mode:** Set `maxPostsPerSource: 0` with `includeProfiles: true` when you only need follower counts and profile metadata.

***

### 🛠️ 15. Troubleshooting

- **Zero Posts Returned with `sinceDate`:** Check that `sinceDate` is formatted in ISO 8601 (`"2026-11-23"` or `"2026-11-23T00:00:00Z"`) and that the account has posted after that timestamp.
- **Image/Video-Only Posts Have `text: null`:** On Truth Social, many high-engagement posts consist solely of a video clip or image graphic (`contentHtml: "<p></p>"`). Check `hasMedia: true` and `mediaAttachments[0].url` for the MP4/JPEG asset.
- **Hashtag Returns Zero Items:** Hashtags are case-insensitive (`America` and `#america` match the same feed), but niche tags with no public posts emit a free `status` diagnostic record (`$0.00`).

***

### ❓ 16. Frequently Asked Questions (FAQ)

#### Does Truth Social Scraper require a Truth Social account, API key, or cookies?

No. `foxlabs/truth-social-scraper` extracts public Truth Social profiles, timelines, hashtags, and individual status URLs with zero login credentials, cookies, or third-party API keys.

#### How do I monitor Donald Trump or other public figures for new posts every few minutes?

Pass `usernames: ["realDonaldTrump"]`, set `sinceDate` to your last checkpoint timestamp (ISO 8601), and schedule the actor on Apify Cron or call `POST /scrape` in Standby mode. Pinned posts older than `sinceDate` are safely skipped without prematurely stopping pagination for newer posts underneath.

#### Why is `text` sometimes `null` on a valid Truth Social post?

Truth Social frequently publishes image-only announcements or standalone video statements whose HTML body is `<p></p>`. Rather than fabricating placeholder text, the scraper sets `text: null`, `hasMedia: true`, and populates `mediaAttachments[]` with the direct MP4 or JPEG URL, dimensions, and video duration.

#### How are ReTruths (reposts) and Quoted Truths represented?

Pure reposts set `isReTruth: true` and populate `rebloggedPost` with the original author and content (while also surfacing the text in `text` for convenience). Quoted posts set `isQuote: true`, strip the inline `RT:` link boilerplate from `text`, and include the full quoted post summary inside `quotedPost`.

#### Can I download Truth Social videos and images directly from the output?

Yes. Every item in `mediaAttachments[]` provides the direct CDN `url` (`https://static-assets-1.truthsocial.com/.../original/...mp4` or `.jpg`), `previewUrl`, `width`, `height`, `durationSeconds`, and `bitrate`.

#### Can I scrape Truth Social `/trends` endpoints without logging in?

Public Truth Social account lookups, user timelines, hashtag timelines, and status lookups are accessible without login, whereas `/api/v1/trends/*` requires authenticated user sessions (`401`). Use `usernames`, `hashtags`, and `postUrls` for reliable keyless extraction.

#### Are filtered-out posts (via `sinceDate`, `minLikes`, `excludeReTruths`, or `onlyMedia`) charged?

Never. All filters are evaluated before `Actor.pushData` / `ChargingManager`, so excluded posts and empty-result `status` notes cost `$0.00`.

#### Can I pass full `https://truthsocial.com/@username` URLs instead of bare handles?

Yes. Both `@username` handles and full profile URLs (`https://truthsocial.com/@realDonaldTrump`) are normalized automatically. Likewise, `postUrls` accepts `/posts/<id>`, `/@user/<id>`, `/users/<user>/statuses/<id>`, or bare numeric status IDs.

#### How much memory does Truth Social Scraper need?

Only `256 MB` RAM. Because it communicates directly with Truth Social's JSON endpoints via `undici` without launching a headless browser, runs typically complete in `3–8 seconds`.

***

### ™️ 17. Trademark Notice

**Truth Social** is a trademark of Trump Media & Technology Group Corp. This project is an independent data extraction tool developed by **foXLabs** and is neither affiliated with, endorsed by, nor sponsored by Trump Media & Technology Group Corp.

***

### ⚖️ 18. Legal & Responsible Use

This actor accesses **publicly visible social media posts and profile metadata** only. Users are responsible for complying with applicable data protection laws and platform terms in their jurisdiction.

***

### 🤝 19. Support & Custom Integrations

Questions, custom monitoring feeds, or enterprise volume requests? Open an issue on the Actor's **Issues** tab on Apify Store — we respond promptly.

***

### 📝 20. Changelog

- **v0.1.0 (2026-11-24):** Initial release — public Truth Social `profile` & `post` extraction, clean plain-text conversion, HD video/image `mediaAttachments`, `quotedPost` / `rebloggedPost` / `linkCard` / `poll` objects, hourly engagement velocity, `sinceDate` early cutoff, and Standby HTTP support.

# Changelog

This Actor's version history is a separate document: https://apify.com/foxlabs/truth-social-scraper/changelog.md

# Actor input Schema

## `usernames` (type: `array`):

Truth Social handles (e.g., 'realDonaldTrump', '@realDonaldTrump') or full profile URLs ('https://truthsocial.com/@realDonaldTrump').

## `hashtags` (type: `array`):

Public Truth Social hashtag feeds to extract (e.g., 'America', 'MAGA', 'Crypto' — with or without leading '#').

## `postUrls` (type: `array`):

Direct Truth Social post URLs (e.g., 'https://truthsocial.com/@realDonaldTrump/117667276373895254') or numeric status IDs.

## `includeProfiles` (type: `boolean`):

Emit a dedicated 'profile' record with follower/following/status counts, bio, verification badge, website, avatar, and header for each username in 'usernames'.

## `excludeReplies` (type: `boolean`):

When scraping user timelines, skip comment replies so only main timeline Truths, Quotes, and ReTruths are returned.

## `excludeReTruths` (type: `boolean`):

When true, skip pure ReTruths (reposts of another post) and return only original and quoted Truths.

## `onlyMedia` (type: `boolean`):

Return only Truths containing image, video, or audio attachments.

## `sinceDate` (type: `string`):

Optional ISO date or timestamp cutoff (e.g., '2026-11-01' or '2026-11-23T00:00:00Z'). Pagination stops automatically as soon as older non-pinned posts are reached.

## `minLikes` (type: `integer`):

Optional engagement filter: keep only posts with at least this many likes/favourites (filtered-out posts cost $0).

## `maxPostsPerSource` (type: `integer`):

Maximum Truths to collect for each username or hashtag timeline.

## `maxTotalPosts` (type: `integer`):

Global cap on billable 'post' records across the entire run.

## `proxyConfiguration` (type: `object`):

Proxy settings for Truth Social API requests (managed automatically out of the box).

## Actor input object example

```json
{
  "usernames": [
    "realDonaldTrump"
  ],
  "hashtags": [],
  "postUrls": [],
  "includeProfiles": true,
  "excludeReplies": true,
  "excludeReTruths": false,
  "onlyMedia": false,
  "maxPostsPerSource": 20,
  "maxTotalPosts": 200,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `items` (type: `string`):

No description

## `report` (type: `string`):

No description

# 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 = {
    "usernames": [
        "realDonaldTrump"
    ],
    "maxPostsPerSource": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("foxlabs/truth-social-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 = {
    "usernames": ["realDonaldTrump"],
    "maxPostsPerSource": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("foxlabs/truth-social-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 '{
  "usernames": [
    "realDonaldTrump"
  ],
  "maxPostsPerSource": 20
}' |
apify call foxlabs/truth-social-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,foxlabs/truth-social-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/fCkPiuEHhM4t1JxlF/builds/38VjRcTogMC5K3BeF/openapi.json
