# PDF Evidence Graph API (`axetl_industries/my-actor`) Actor

Turn public text-layer PDFs into deterministic, citation-ready JSON for AI agents, RAG pipelines, APIs, and developer workflows. Extract page-level evidence spans, stable citation IDs, document/page hashes, outlines, and internal/outbound link graphs. No OCR, authentication, or private documents.

- **URL**: https://apify.com/axetl\_industries/my-actor.md
- **Developed by:** [Izak Botes](https://apify.com/axetl_industries) (community)
- **Categories:** Developer tools, AI, Integrations
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $80.00 / 1,000 medium pdfs

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?

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

## PDF Evidence Graph API

Turn public, text-layer PDF documents into deterministic, citation-ready JSON for AI agents, retrieval pipelines, audits, and document-processing systems.

This Actor accepts only public HTTPS PDF URLs. It extracts normalized page text, stable evidence spans, native bookmarks, document metadata, and link relationships. Each evidence span has a reproducible citation identifier tied to the exact PDF bytes, page number, span index, and text hash.

### Why use it

- Stable citations that can be stored and checked later.
- Predictable JSON for API, MCP, RAG, and automation consumers.
- Page-level and span-level hashes for provenance checks.
- Native PDF structure only; it does not invent headings.
- Outbound links are reported but never followed.
- One bad document does not discard successful results from the same run.

### Input

```json
{
  "urls": ["https://example.org/public-document.pdf"],
  "include_page_text": true,
  "include_links": true,
  "include_outline": true
}
```

Submit between 1 and 20 unique public HTTPS URLs. The Actor deliberately does not accept authentication material or custom request headers.

### Output

Successfully processed document records are written to the default dataset with exactly one workload-banded value event. Failed document records are stored separately in the `ERRORS` key-value-store record and are never written as billable dataset items. The `OUTPUT` record contains the run summary and delivery count, not a free duplicate of successful value records.

Key fields include:

- `document_id`, `binary_sha256`, and `content_sha256`
- normalized `pages` with page hashes
- deterministic `evidence_spans` with character offsets and citation IDs
- native `outline` entries, where present
- internal and outbound `link_graph` edges
- bounded, customer-safe error codes

Example evidence span:

```json
{
  "citation_id": "pdf:v1:<binary-sha256>:p0001:s0001:<text-hash-prefix>",
  "page_number": 1,
  "span_index": 1,
  "character_start": 0,
  "character_end": 142,
  "text": "Extracted evidence...",
  "text_hash": "<sha256>"
}
```

### Determinism and limitations

The same PDF bytes and product version produce the same document identity, page hashes, citation IDs, spans, native outline, and link graph. Runtime duration and timestamps are operational metadata and are not deterministic.

The MVP supports PDFs with an embedded text layer. OCR, scanned-image interpretation, passwords, signed download links, non-standard ports, private-network targets, and target-site authentication are intentionally unsupported. Some PDFs encode visual reading order ambiguously; extracted order follows the PDF text representation. The Actor does not provide legal verification or claim that document content is true.

### Security and privacy

- HTTPS only, port 443 only.
- DNS resolution and every redirect are checked against non-public network ranges.
- Download count, size, redirect, page, text, link, and runtime bounds are enforced.
- No browser, proxy network, paid API, external AI model, or persistent copy of input files is required.
- PDF actions and embedded JavaScript are not executed.
- Outbound links found in PDFs are never visited.
- Temporary files are removed after processing.
- Full input contents are not written to application logs.

### Pricing

This public Store Actor uses pay per event. The final validated event prices are:

- `document-small`: $0.005, up to 10 pages and 2 MiB.
- `document-medium`: $0.020, up to 100 pages and 10 MiB, excluding small documents.
- `document-large`: $0.050, all other supported documents within the 250-page and 25 MiB hard caps.

Exactly one workload-band value event is associated with each successfully delivered document. Failed documents do not generate a document-processing charge. Platform usage is included in the event price. A small synthetic Actor-start event may appear once per run under Apify's platform accounting; it is not a document-processing event.

### Support

Report reproducible failures using the public source URL, the safe error code, and the Actor version through the Apify Issues workflow. Never send access credentials, private URLs, signed links, or private documents. The public production Actor remains limited to public HTTPS, text-layer PDFs and the documented resource and security limits.
itations that can be stored and checked later.

- Predictable JSON for API, MCP, RAG, and automation consumers.
- Page-level and span-level hashes for provenance checks.
- Native PDF structure only; it does not invent headings.
- Outbound links are reported but never followed.
- One bad document does not discard successful results from the same run.

### Input

```json
{
  "urls": ["https://example.org/public-document.pdf"],
  "include_page_text": true,
  "include_links": true,
  "include_outline": true
}
```

Submit between 1 and 20 unique public HTTPS URLs. The Actor deliberately does not accept authentication material or custom request headers.

### Output

Successfully processed document records are written to the default dataset with exactly one workload-banded value event. Failed document records are stored separately in the `ERRORS` key-value-store record and are never written as billable dataset items. The `OUTPUT` record contains the run summary and delivery count, not a free duplicate of successful value records.

Key fields include:

- `document_id`, `binary_sha256`, and `content_sha256`
- normalized `pages` with page hashes
- deterministic `evidence_spans` with character offsets and citation IDs
- native `outline` entries, where present
- internal and outbound `link_graph` edges
- bounded, customer-safe error codes

Example evidence span:

```json
{
  "citation_id": "pdf:v1:<binary-sha256>:p0001:s0001:<text-hash-prefix>",
  "page_number": 1,
  "span_index": 1,
  "character_start": 0,
  "character_end": 142,
  "text": "Extracted evidence...",
  "text_hash": "<sha256>"
}
```

### Determinism and limitations

The same PDF bytes and product version produce the same document identity, page hashes, citation IDs, spans, native outline, and link graph. Runtime duration and timestamps are operational metadata and are not deterministic.

The MVP supports PDFs with an embedded text layer. OCR, scanned-image interpretation, passwords, signed download links, non-standard ports, private-network targets, and target-site authentication are intentionally unsupported. Some PDFs encode visual reading order ambiguously; extracted order follows the PDF text representation. The Actor does not provide legal verification or claim that document content is true.

### Security and privacy

- HTTPS only, port 443 only.
- DNS resolution and every redirect are checked against non-public network ranges.
- Download count, size, redirect, page, text, link, and runtime bounds are enforced.
- No browser, proxy network, paid API, external AI model, or persistent copy of input files is required.
- PDF actions and embedded JavaScript are not executed.
- Outbound links found in PDFs are never visited.
- Temporary files are removed after processing.
- Full input contents are not written to application logs.

### Pricing intent

The intended Store model is pay-per-event, charged atomically with storage of a successfully parsed document. Workload events are `document-small` (up to 10 pages and 2 MB), `document-medium` (up to 100 pages and 10 MB), and `document-large` (within the 250-page/25 MB hard caps). Failed documents produce no value event. Prices remain a pre-publication hypothesis until a zero-cost owner-approved Apify container benchmark measures actual platform usage.

### Support

Report reproducible failures using the public source URL, the safe error code, and the Actor version. Never send access credentials. This development version is local and unpublished.

# Actor input Schema

## `urls` (type: `array`):

One to twenty public HTTPS PDF URLs. Credential-bearing or signed/authentication URLs are rejected.

## `include_page_text` (type: `boolean`):

Include normalized page text in addition to citation spans.

## `include_links` (type: `boolean`):

Extract internal PDF links and outbound URLs without following them.

## `include_outline` (type: `boolean`):

Extract native PDF bookmarks where present. No hierarchy is hallucinated.

## Actor input object example

```json
{
  "urls": [
    "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
  ],
  "include_page_text": true,
  "include_links": true,
  "include_outline": true
}
```

# Actor output Schema

## `documents` (type: `string`):

Successfully processed, billable document results. Failed documents are never written as billable dataset items.

## `runSummary` (type: `string`):

Run status, counts, delivery count, and bounded-cost indicators; successful value records remain in the dataset.

## `errors` (type: `string`):

Customer-safe per-document failures, stored separately and never billed as successful value.

# 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 = {
    "urls": [
        "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("axetl_industries/my-actor").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 = { "urls": ["https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"] }

# Run the Actor and wait for it to finish
run = client.actor("axetl_industries/my-actor").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 '{
  "urls": [
    "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
  ]
}' |
apify call axetl_industries/my-actor --silent --output-dataset

```

## MCP server setup

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

```

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/ZjAYYCcKuUk41ZRo7/builds/VsK115JqcdP3s5RSe/openapi.json
