# TrustScanAI (`amusing_lane/trustscanai`) Actor

Claim Verification Agent (Text + Links)

- **URL**: https://apify.com/amusing\_lane/trustscanai.md
- **Developed by:** [Samarth Shendre](https://apify.com/amusing_lane) (community)
- **Categories:** Agents
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

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

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

### 🧠 TruthScan AI — Claim Verification Agent

A powerful AI agent that verifies claims, tweets, news paragraphs, and WhatsApp forwards by fact-checking against trusted sources. Built with [CrewAI](https://www.crewai.com/) and deployed as an [Apify Actor](https://apify.com/actors).

### 💡 What it does

Users can paste:

- A claim or statement
- A tweet or social media post
- A news paragraph
- A WhatsApp forward

👉 **The agent:**

- Breaks the claim into factual sub-claims
- Searches trusted sources (Wikipedia, government sites, news outlets)
- Rates truthfulness with confidence scores
- Explains why content is misleading or true
- Provides evidence and reasoning

### 🔥 Why this matters

- **Extremely relevant**: Misinformation is a critical problem
- **Clear social good**: Helps combat fake news and disinformation
- **No scraping auth hell**: Uses public APIs and search tools
- **Strong AI reasoning demo**: Showcases advanced claim analysis

### How it works

The TruthScan AI agent receives a claim from the user and systematically fact-checks it using multiple verification tools. The agent searches Wikipedia, performs web searches via DuckDuckGo, and analyzes the gathered evidence to provide a comprehensive verdict with confidence scoring and detailed explanations.

### 🧩 Tools Used

- **DuckDuckGo Search**: Web search for current information
- **Wikipedia API**: Access to encyclopedic knowledge
- **Simple HTTP Fetch**: Direct access to trusted sources
- **LLM Reasoning**: Advanced claim analysis and verdict generation

### 🧠 Output Example

**Input:** "Drinking hot water cures COVID-19"

**Output:**

```
Verdict: ❌ False
Confidence: 92%

Evidence:
- WHO states no drink cures COVID-19
- Medical journals confirm no thermal effect on virus
- No peer-reviewed studies support this claim

Reason people believe it:
- Authority bias from social media "experts"  
- Fear-driven misinformation during pandemic
- Confusion between symptom relief and cure
```

### How to use

Simply provide any claim, tweet, or text content in the `claim` input field. The agent will automatically analyze it and provide a detailed verification report.

##### Pay Per Event

This template uses the [Pay Per Event (PPE)](https://docs.apify.com/platform/actors/publishing/monetize#pay-per-event-pricing-model) monetization model, which provides flexible pricing based on defined events.

To charge users, define events in JSON format and save them on the Apify platform. Here is an example schema with the `task-completed` event:

```json
[
    {
        "task-completed": {
            "eventTitle": "Task completed",
            "eventDescription": "Cost per query answered.",
            "eventPriceUsd": 0.1
        }
    }
]
```

In the Actor, trigger the event with:

```python
await Actor.charge(event_name='task-completed')
```

This approach allows you to programmatically charge users directly from your Actor, covering the costs of execution and related services, such as LLM input/output tokens.

To set up the PPE model for this Actor:

- **Configure the OpenAI API key environment variable**: provide your OpenAI API key to the `OPENAI_API_KEY` in the Actor's **Environment variables**.
- **Configure Pay Per Event**: establish the Pay Per Event pricing schema in the Actor's **Monetization settings**. First, set the **Pricing model** to `Pay per event` and add the schema. An example schema can be found in [pay\_per\_event.json](.actor/pay_per_event.json).

### Included features

- **[Apify SDK](https://docs.apify.com/sdk/python/)** for Python - a toolkit for building Apify [Actors](https://apify.com/actors) and scrapers in Python
- **[Input schema](https://docs.apify.com/platform/actors/development/input-schema)** - define and easily validate a schema for your Actor's input
- **[Dataset](https://docs.apify.com/sdk/python/docs/concepts/storages#working-with-datasets)** - store structured data where each object stored has the same attributes
- **[Key-value store](https://docs.apify.com/platform/storage/key-value-store)** - store any kind of data, such as JSON documents, images, or text files

### Resources

- [What are AI agents?](https://blog.apify.com/what-are-ai-agents/)
- [Python tutorials in Academy](https://docs.apify.com/academy/python)
- [Apify Python SDK documentation](https://docs.apify.com/sdk/python/)
- [CrewAI documentation](https://docs.crewai.com/introduction)
- [Integration with Make, GitHub, Zapier, Google Drive, and other apps](https://apify.com/integrations)

### 🚀 Getting Started

1. **Configure OpenAI API Key**: Set your `OPENAI_API_KEY` in the Actor's environment variables
2. **Input a claim**: Paste any claim, tweet, or statement you want to verify
3. **Get results**: Receive a comprehensive fact-check report with evidence and confidence scores

#### Example Verification Process

**Input Claim:** "5G towers cause COVID-19 symptoms"

**TruthScan AI Process:**

1. **Sub-claim extraction**: Breaks down into "5G towers emit harmful radiation" + "Radiation causes COVID-19 symptoms"
2. **Evidence gathering**: Searches WHO, CDC, scientific journals, fact-checkers
3. **Analysis**: Evaluates source credibility and scientific consensus
4. **Verdict generation**: Provides clear assessment with reasoning

**Output:**

```
Verdict: ❌ False
Confidence: 96%

Evidence:
- WHO: No evidence linking 5G to COVID-19
- Multiple peer-reviewed studies show 5G safety
- COVID-19 spreads in areas without 5G coverage
- Virus identified as SARS-CoV-2, not radiation effect

Reasoning: 
COVID-19 is caused by a virus (SARS-CoV-2), not electromagnetic radiation. 
5G operates at frequencies well below harmful ionizing radiation levels.

Why people believe it:
- Correlation fallacy (5G rollout coincided with pandemic)
- Distrust of new technology
- Conspiracy theory amplification on social media
```

### Getting started

For complete information [see this article](https://docs.apify.com/platform/actors/development#build-actor-at-apify-console). In short, you will:

1. Build the Actor
2. Run the Actor with your claim to verify

### Pull the Actor for local development

If you would like to develop locally, you can pull the existing Actor from Apify console using Apify CLI:

1. Install `apify-cli`

   **Using Homebrew**

   ```bash
   brew install apify-cli
   ```

   **Using NPM**

   ```bash
   npm -g install apify-cli
   ```

2. Pull the Actor by its unique `<ActorId>`, which is one of the following:

   - unique name of the Actor to pull (e.g. "apify/hello-world")
   - or ID of the Actor to pull (e.g. "E2jjCZBezvAZnX8Rb")

   You can find both by clicking on the Actor title at the top of the page, which will open a modal containing both Actor unique name and Actor ID.

   This command will copy the Actor into the current directory on your local machine.

   ```bash
   apify pull <ActorId>
   ```

### Documentation reference

To learn more about Apify and Actors, take a look at the following resources:

- [Apify SDK for JavaScript documentation](https://docs.apify.com/sdk/js)
- [Apify SDK for Python documentation](https://docs.apify.com/sdk/python)
- [Apify Platform documentation](https://docs.apify.com/platform)
- [Join our developer community on Discord](https://discord.com/invite/jyEM2PRvMU)

# Actor input Schema

## `claim` (type: `string`):

The claim, tweet, news paragraph, or statement you want to fact-check.

## `modelName` (type: `string`):

The OpenAI model to use. Currently supported models are gpt-4o and gpt-4o-mini

## `debug` (type: `boolean`):

If enabled, the Actor will run in debug mode and produce more output.

## Actor input object example

```json
{
  "claim": "Drinking hot water cures COVID-19",
  "modelName": "gpt-4o-mini",
  "debug": true
}
```

# Actor output Schema

## `verification_reports` (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 = {
    "claim": "Drinking hot water cures COVID-19",
    "modelName": "gpt-4o-mini"
};

// Run the Actor and wait for it to finish
const run = await client.actor("amusing_lane/trustscanai").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 = {
    "claim": "Drinking hot water cures COVID-19",
    "modelName": "gpt-4o-mini",
}

# Run the Actor and wait for it to finish
run = client.actor("amusing_lane/trustscanai").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 '{
  "claim": "Drinking hot water cures COVID-19",
  "modelName": "gpt-4o-mini"
}' |
apify call amusing_lane/trustscanai --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,amusing_lane/trustscanai"
        }
    }
}

```

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/RhcULRmatmb5ZLJ3I/builds/erWnlMdn1WVH8KoFa/openapi.json
