# Truth Social Scraper (`louisdeconinck/truth-social-scraper`) Actor

The Truth Social Scraper is your go-to tool for extracting data from Truth Social profiles. Ideal for monitoring updates, conducting sentiment analysis, and gathering research data, it tracks engagement metrics like followers and statuses. Easy setup, run, and download in formats like JSON or CSV.

- **URL**: https://apify.com/louisdeconinck/truth-social-scraper.md
- **Developed by:** [Louis Deconinck](https://apify.com/louisdeconinck) (community)
- **Categories:** Social media, Developer tools, Automation
- **Stats:** 233 total users, 5 monthly users, 100.0% runs succeeded, 3 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## 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

## Instant Donald Trump Webhook Notifications

**If you're looking to get instant webhook notifications whenever Donald Trump makes a post on Truth Social then head over to [ProfileTracer.com](https://www.profiletracer.com/).**

### What does Truth Social Scraper do?

The Truth Social Scraper extracts data from Truth Social profiles. It can fetch profile details, posts, and other relevant information. This tool is ideal for gathering data for analysis, research, or monitoring purposes.

### Why use Truth Social Scraper?

Using the Truth Social Scraper can help you:

- Monitor public profiles for updates.
- Collect data for sentiment analysis.
- Gather information for research purposes.
- Track engagement metrics such as followers count, statuses count, and more.

### How to scrape Truth Social

1. **Set up the scraper**: Provide the list of profile URLs or usernames you want to scrape.
2. **Run the scraper**: Execute the scraper to start collecting data.
3. **Download the data**: Once the scraping is complete, download the data in your preferred format (JSON, CSV, etc.).

### Input

The scraper accepts the following input options:

- **Identifiers**: List of URLs, usernames, or tags to fetch data from Truth Social.

Example input:

```json
{
    "identifiers": [
        {"identifier": "https://truthsocial.com/@realDonaldTrump"},
        {"identifier": "@realDonaldTrump"},
        {"identifier": "realDonaldTrump"}
    ],
    "fetchPosts": true
}
```

### Output

The scraper provides the following data points:

- Profile details (username, display name, followers count, etc.)
- Posts (content, replies count, reblogs count, etc.)

Example output:

```json
{
	"id": "107780257626128497",
	"username": "realDonaldTrump",
	"acct": "realDonaldTrump",
	"display_name": "Donald J. Trump",
	"locked": false,
	"bot": false,
	"discoverable": null,
	"group": false,
	"created_at": "2022-02-11T16:16:57.705Z",
	"note": "<p></p>",
	"url": "https://truthsocial.com/@realDonaldTrump",
	"avatar": "https://static-assets-1.truthsocial.com/tmtg:prime-ts-assets/accounts/avatars/107/780/257/626/128/497/original/454286ac07a6f6e6.jpeg",
	"avatar_static": "https://static-assets-1.truthsocial.com/tmtg:prime-ts-assets/accounts/avatars/107/780/257/626/128/497/original/454286ac07a6f6e6.jpeg",
	"header": "https://static-assets-1.truthsocial.com/tmtg:prime-ts-assets/accounts/headers/107/780/257/626/128/497/original/ba3b910ba387bf4e.jpeg",
	"header_static": "https://static-assets-1.truthsocial.com/tmtg:prime-ts-assets/accounts/headers/107/780/257/626/128/497/original/ba3b910ba387bf4e.jpeg",
	"followers_count": 8333700,
	"following_count": 71,
	"statuses_count": 24235,
	"last_status_at": "2024-12-10",
	"verified": true,
	"location": "",
	"website": "www.DonaldJTrump.com",
	"accepting_messages": false,
	"chats_onboarded": true,
	"feeds_onboarded": true,
	"tv_onboarded": false,
	"bookmarks_onboarded": false,
	"show_nonmember_group_statuses": false,
	"pleroma": {
		"accepts_chat_messages": false
	},
	"tv_account": false,
	"receive_only_follow_mentions": false,
	"emojis": [],
	"fields": [],
	"posts": [
		{
			"id": "113630398498616296",
			"created_at": "2024-12-10T20:24:41.778Z",
			"in_reply_to_id": null,
			"quote_id": null,
			"in_reply_to_account_id": null,
			"sensitive": false,
			"spoiler_text": "",
			"visibility": "public",
			"language": null,
			"uri": "https://truthsocial.com/@realDonaldTrump/113630398498616296",
			"url": "https://truthsocial.com/@realDonaldTrump/113630398498616296",
			"content": "<p></p>",
			"account": {
				"id": "107780257626128497",
				"username": "realDonaldTrump",
				"acct": "realDonaldTrump",
				"display_name": "Donald J. Trump",
				"locked": false,
				"bot": false,
				"discoverable": false,
				"group": false,
				"created_at": "2022-02-11T16:16:57.705Z",
				"note": "<p></p>",
				"url": "https://truthsocial.com/@realDonaldTrump",
				"avatar": "https://static-assets-1.truthsocial.com/tmtg:prime-ts-assets/accounts/avatars/107/780/257/626/128/497/original/454286ac07a6f6e6.jpeg",
				"avatar_static": "https://static-assets-1.truthsocial.com/tmtg:prime-ts-assets/accounts/avatars/107/780/257/626/128/497/original/454286ac07a6f6e6.jpeg",
				"header": "https://static-assets-1.truthsocial.com/tmtg:prime-ts-assets/accounts/headers/107/780/257/626/128/497/original/ba3b910ba387bf4e.jpeg",
				"header_static": "https://static-assets-1.truthsocial.com/tmtg:prime-ts-assets/accounts/headers/107/780/257/626/128/497/original/ba3b910ba387bf4e.jpeg",
				"followers_count": 8333672,
				"following_count": 71,
				"statuses_count": 24235,
				"last_status_at": "2024-12-10",
				"verified": true,
				"location": "",
				"website": "www.DonaldJTrump.com",
				"unauth_visibility": true,
				"chats_onboarded": true,
				"feeds_onboarded": true,
				"accepting_messages": false,
				"show_nonmember_group_statuses": null,
				"emojis": [],
				"fields": [],
				"tv_onboarded": false,
				"tv_account": false
			},
			"media_attachments": [
				{
					"id": "113630398455177561",
					"type": "image",
					"url": "https://static-assets-1.truthsocial.com/tmtg:prime-ts-assets/media_attachments/files/113/630/398/455/177/561/original/f9807ef7bcf8dd10.jpg",
					"preview_url": "https://static-assets-1.truthsocial.com/tmtg:prime-ts-assets/media_attachments/files/113/630/398/455/177/561/small/f9807ef7bcf8dd10.jpg",
					"external_video_id": null,
					"remote_url": null,
					"preview_remote_url": null,
					"text_url": null,
					"meta": {
						"original": {
							"width": 822,
							"height": 1248,
							"size": "822x1248",
							"aspect": 0.6586538461538461
						},
						"small": {
							"width": 649,
							"height": 985,
							"size": "649x985",
							"aspect": 0.6588832487309645
						}
					},
					"description": null,
					"blurhash": "UfMHACoM%Nof-:afWBay~qWBRjayxaWVaxay",
					"processing": "complete"
				}
			],
			"mentions": [],
			"tags": [],
			"card": null,
			"group": null,
			"quote": null,
			"in_reply_to": null,
			"reblog": null,
			"sponsored": false,
			"replies_count": 621,
			"reblogs_count": 2058,
			"favourites_count": 6870,
			"favourited": false,
			"reblogged": false,
			"muted": false,
			"pinned": false,
			"bookmarked": false,
			"poll": null,
			"emojis": []
		},
		{
			"id": "113630397591868546",
			"created_at": "2024-12-10T20:24:27.943Z",
			"in_reply_to_id": null,
			"quote_id": null,
			"in_reply_to_account_id": null,
			"sensitive": false,
			"spoiler_text": "",
			"visibility": "public",
			"language": null,
			"uri": "https://truthsocial.com/@realDonaldTrump/113630397591868546",
			"url": "https://truthsocial.com/@realDonaldTrump/113630397591868546",
			"content": "<p></p>",
			"account": {
				"id": "107780257626128497",
				"username": "realDonaldTrump",
				"acct": "realDonaldTrump",
				"display_name": "Donald J. Trump",
				"locked": false,
				"bot": false,
				"discoverable": false,
				"group": false,
				"created_at": "2022-02-11T16:16:57.705Z",
				"note": "<p></p>",
				"url": "https://truthsocial.com/@realDonaldTrump",
				"avatar": "https://static-assets-1.truthsocial.com/tmtg:prime-ts-assets/accounts/avatars/107/780/257/626/128/497/original/454286ac07a6f6e6.jpeg",
				"avatar_static": "https://static-assets-1.truthsocial.com/tmtg:prime-ts-assets/accounts/avatars/107/780/257/626/128/497/original/454286ac07a6f6e6.jpeg",
				"header": "https://static-assets-1.truthsocial.com/tmtg:prime-ts-assets/accounts/headers/107/780/257/626/128/497/original/ba3b910ba387bf4e.jpeg",
				"header_static": "https://static-assets-1.truthsocial.com/tmtg:prime-ts-assets/accounts/headers/107/780/257/626/128/497/original/ba3b910ba387bf4e.jpeg",
				"followers_count": 8333672,
				"following_count": 71,
				"statuses_count": 24235,
				"last_status_at": "2024-12-10",
				"verified": true,
				"location": "",
				"website": "www.DonaldJTrump.com",
				"unauth_visibility": true,
				"chats_onboarded": true,
				"feeds_onboarded": true,
				"accepting_messages": false,
				"show_nonmember_group_statuses": null,
				"emojis": [],
				"fields": [],
				"tv_onboarded": false,
				"tv_account": false
			},
			"media_attachments": [
				{
					"id": "113630397540483463",
					"type": "image",
					"url": "https://static-assets-1.truthsocial.com/tmtg:prime-ts-assets/media_attachments/files/113/630/397/540/483/463/original/3ca07fbb39320b33.jpg",
					"preview_url": "https://static-assets-1.truthsocial.com/tmtg:prime-ts-assets/media_attachments/files/113/630/397/540/483/463/small/3ca07fbb39320b33.jpg",
					"external_video_id": null,
					"remote_url": null,
					"preview_remote_url": null,
					"text_url": null,
					"meta": {
						"original": {
							"width": 971,
							"height": 984,
							"size": "971x984",
							"aspect": 0.9867886178861789
						},
						"small": {
							"width": 794,
							"height": 805,
							"size": "794x805",
							"aspect": 0.986335403726708
						}
					},
					"description": null,
					"blurhash": "UYKnVj009FjY%MWCfRV@4n?vxuRjD%t7ofof",
					"processing": "complete"
				}
			],
			"mentions": [],
			"tags": [],
			"card": null,
			"group": null,
			"quote": null,
			"in_reply_to": null,
			"reblog": null,
			"sponsored": false,
			"replies_count": 434,
			"reblogs_count": 2331,
			"favourites_count": 6513,
			"favourited": false,
			"reblogged": false,
			"muted": false,
			"pinned": false,
			"bookmarked": false,
			"poll": null,
			"emojis": []
		}
    ]
}
```

### Instant Donald Trump Webhook Notifications

**If you're looking to get instant webhook notifications whenever Donald Trump makes a post on Truth Social then head over to [ProfileTracer.com](https://www.profiletracer.com/).**

### FAQ

#### Is it legal to scrape Truth Social?

Our scrapers are ethical and do not extract any private user data. They only extract what the user has chosen to share publicly.

#### How do I get started?

To get started, simply create an account on Apify, set up the Truth Social Scraper with your desired input, and run the scraper to collect data.

#### Can I customize the scraper?

Yes, you can customize the scraper to fit your specific needs. If you require additional features or modifications, please contact us for a custom solution.

# Actor input Schema

## `identifiers` (type: `array`):

List of objects containing URLs, names, or account tags to fetch data from Truth Social.

## `fetchPosts` (type: `boolean`):

Fetch posts for the profiles.

## Actor input object example

```json
{
  "identifiers": [
    "https://truthsocial.com/@realDonaldTrump",
    "@realDonaldTrump",
    "realDonaldTrump"
  ],
  "fetchPosts": true
}
```

# 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 = {
    "identifiers": [
        "https://truthsocial.com/@realDonaldTrump",
        "@realDonaldTrump",
        "realDonaldTrump"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("louisdeconinck/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 = { "identifiers": [
        "https://truthsocial.com/@realDonaldTrump",
        "@realDonaldTrump",
        "realDonaldTrump",
    ] }

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,louisdeconinck/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/GsRHwiTFlQB8bh2yf/builds/X9nO5IPe2fxGDugaT/openapi.json
