# FACTRAIL — Evidence infrastructure for AI agents (`spherical_distinction/factrail-evidence`) Actor

Verify supported real-world facts and perform evidence-backed assessments with provenance, freshness, conflict handling, and reusable receipts.

- **URL**: https://apify.com/spherical\_distinction/factrail-evidence.md
- **Developed by:** [Baron Sigma](https://apify.com/spherical_distinction) (community)
- **Categories:** AI, Developer tools, MCP servers
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.005 / factrail verification

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

## FACTRAIL — Evidence infrastructure for AI agents

> Structured, source-backed real-world evidence with provenance, freshness, conflicts, coverage, and reusable receipts.

This Actor is a thin distribution and billing client for the canonical FACTRAIL MCP at **https://mcp.factrail.online/mcp**. It does not implement the evidence resolvers. The source repository and Evidence Core remain at https://github.com/baronsigma/factrail; the direct MCP endpoint remains available.

FACTRAIL is in public beta. Agents should begin with `factrail_capabilities` on the canonical MCP service to discover current support, source state, and limitations; the Apify wrapper does not expose a capability-discovery action. The Actor exposes actions for `factrail_verify`, `factrail_assess`, and `factrail_get_receipt`.

### Current capabilities

- **French company verification (`company_fr`):** supported facts for companies and establishments by SIREN/SIRET, using INSEE / Sirene and BODACC. Field availability depends on records; current registry evidence takes precedence for current status and legal name, while lower-priority evidence remains visible. Supports supplier, vendor, procurement, CRM, marketplace, and KYB-support workflows; FACTRAIL alone is not legally sufficient KYC/KYB.
- **Trade/import assessment (`import`, Beta):** structured import assessment that distinguishes caller input, source evidence, classification candidates, and derived calculations. Results can be partial or provisional.
- **Receipts:** retrieve a previously generated EvidenceEnvelope by receipt ID. Receipt content is content-addressed and integrity-checked; this does not attest universal truth.

No genuine European Commission TARIC snapshot is currently installed. Official TARIC snapshot ingestion infrastructure exists for validated Commission files supplied by an operator. Access2Markets is secondary evidence, and curated tariff and VAT references are provisional. Authoritative EU VAT integration and a complete authoritative landed-cost chain are not available.

### Example actions

#### Verify a French company

```json
{
  "action": "verify",
  "input": {
    "subject_type": "company_fr",
    "identifier": "<9-digit SIREN or 14-digit SIRET>",
    "fields": ["status", "legal_name"]
  }
}
```

#### Assess an import (Beta)

```json
{
  "action": "assess_import",
  "input": {
    "product": "<product description>",
    "origin_country": "CN",
    "destination_country": "FR",
    "quantity": 1,
    "goods_value": 100,
    "currency": "EUR"
  }
}
```

Optional: `"assessment_date": "YYYY-MM-DD"` sets the TARIC effective/simulation date; availability depends on the installed snapshot. The sample values are illustrative caller inputs. Assessment outputs can be partial/provisional and are not binding customs decisions.

#### Retrieve a receipt

```json
{"action":"get_receipt","input":{"receipt_id":"<receipt_id returned by FACTRAIL>"}}
```

The Actor returns `{ "action": "…", "result": <canonical EvidenceEnvelope> }`. Read the receipt ID from a previous FACTRAIL result; no sample result is implied here.

### Pricing

This public Actor uses Pay Per Event. Check the current Apify Pricing tab for live rates and account charges. The Actor should bill only configured qualifying outcomes; partial, unsupported, stale, conflicting, insufficient, and degraded outcomes follow the event rules in the deployed Actor configuration.

### Architecture and privacy

The Actor calls the canonical FACTRAIL MCP service and does not contain source adapters, authority rules, tariff calculations, receipt hashing, or FACTRAIL credentials. It does not intentionally send Apify user IDs, payment IDs, or custom attribution headers to FACTRAIL. Demand telemetry records normalized operation/outcome categories and does not intentionally store raw IP addresses, complete User-Agent strings, full arguments, authorization headers, or entire Evidence envelopes.

### Limits

FACTRAIL does not provide arbitrary natural-language fact checking, general web search, complete global company verification, dedicated sanctions/beneficial ownership/EORI resolution, authoritative installed TARIC data, authoritative EU VAT integration, complete authoritative landed costs, signed receipts, or a blockchain ledger. Use `factrail_capabilities` and the live MCP tool list to confirm deployed support.

# Actor input Schema

## `action` (type: `string`):

Verify a French company, request a Beta import assessment, or retrieve an Evidence receipt.

## `input` (type: `object`):

Use the documented input for the selected action. Extra or incomplete fields are rejected without an event charge.

## Actor input object example

```json
{}
```

# Actor output Schema

## `evidence_results` (type: `string`):

Canonical FACTRAIL EvidenceEnvelopes for successful billable verify and import assessment actions.

## `free_results_and_errors` (type: `string`):

Free receipt retrieval results, partial or insufficient assessments, and structured errors.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("spherical_distinction/factrail-evidence").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("spherical_distinction/factrail-evidence").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 '{}' |
apify call spherical_distinction/factrail-evidence --silent --output-dataset

```

## MCP server setup

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

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/p5ATr0Z8zZuntgx91/builds/Hvl4bGGKPr5amo3bx/openapi.json
