# Live Link & Citation Verifier for AI Agents (`geeky_goth_gamer/live-link-citation-verifier`) Actor

Check whether URLs are live, redirected, broken or blocked, verify that quoted lines actually appear on the page, and confirm PyPI/npm packages exist. Stops agents acting on hallucinated links, citations or libraries. $0.0015 per URL, $0.003 per citation, $0.0005 per package.

- **URL**: https://apify.com/geeky_goth_gamer/live-link-citation-verifier.md
- **Developed by:** [Chris Day](https://apify.com/geeky_goth_gamer) (community)
- **Categories:** AI, Developer tools, Automation
- **Features:** Limited permissions, Single-tenant, Server interface
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 1,000 verify urls

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## Live Link & Citation Verifier for AI Agents

Give this Actor a list of **URLs**, a **Markdown draft**, a set of **{url, quote} citations**, and/or **PyPI/npm package names**. It returns a structured report that tells you whether each link is actually live, whether a quoted line really appears on the cited page, and whether a library exists on the public registry — before a language model acts on a hallucinated source.

It does **not** search the web and it does **not** call a language model. Checks are deterministic HTTP lookups with SSRF protections.

### When an AI agent should use this

Use `geeky_goth_gamer/live-link-citation-verifier` when:

- You are about to cite or hand a user a URL and need to know if it is live, redirected, gone, or just blocking bots.
- You have a drafted paragraph with links and want every URL checked in one call.
- You must verify that a quoted sentence actually appears on the live page (and get the page's real excerpt if the quote is slightly wrong).
- You are about to install or import a package and need to know it exists on PyPI or npm (including a specific version).

Don't use it for:

- Finding sources: it does not search; pass the URLs or package names you already have.
- Rendering JavaScript-only pages or taking screenshots.
- Paraphrase or factual QA beyond “is this exact/near quote on this page?”.

**Example input:**

```json
{
  "urls": ["https://example.com/"],
  "citations": [
    {
      "url": "https://example.com/",
      "quote": "This domain is for use in documentation examples without needing permission."
    }
  ],
  "packages": [
    {"ecosystem": "pypi", "name": "requests"}
  ]
}
```

**Output:** A summary plus per-item rows: each URL has `status` (`live`, `redirected`, `broken`, `blocked_or_paywalled`, `timeout`, `ssrf_blocked`, `invalid_url`), `httpStatus`, `finalUrl`, `redirectChain`, `pageTitle`, `metaDescription`, `canonicalUrl`, dates and `latencyMs`. Each citation has `matchType` (`exact`, `fuzzy`, `not_found`), `similarity`, `matchedExcerpt` and `contextSnippet`. Each package has `exists`, `latestVersion`, `requestedVersionExists`, `deprecated` and `registryUrl`.

**Cost:** $0.0015 per URL checked, $0.003 per quote verified, $0.0005 per package lookup. Invalid input is not billed. Apify also charges the standard $0.00005 Actor-start fee on ordinary runs.

**Call it from an agent:**

- Apify MCP server: add `https://mcp.apify.com/?tools=geeky_goth_gamer/live-link-citation-verifier` to your MCP client; the tool is `geeky_goth_gamer--live-link-citation-verifier`. Or use `call-actor` with `"actor": "geeky_goth_gamer/live-link-citation-verifier"`.
- Standby HTTP: `POST https://geeky-goth-gamer--live-link-citation-verifier.apify.actor/verify` with `Authorization: Bearer YOUR_TOKEN` and the input JSON. Use `POST /verify-draft` with `{ "text": "..." }` to extract and check every link in a draft. `GET /health` is a liveness check.
- Python: `ApifyClient(token).actor("geeky_goth_gamer/live-link-citation-verifier").call(run_input=...)`, then read `client.dataset(run["defaultDatasetId"]).list_items().items`.
- HTTP run: `POST https://api.apify.com/v2/acts/geeky_goth_gamer~live-link-citation-verifier/run-sync-get-dataset-items?token=YOUR_TOKEN` with the input JSON as the body.

### Why this exists

Agents invent URLs, slightly misquote sources, and sometimes recommend software packages that were never published. A 404 and a Cloudflare challenge look the same if you only treat “not 200” as dead, so this Actor **distinguishes** real dead pages (`404`/`410`/DNS failure → `broken`) from bot-blocks, rate limits and paywalls (`403`/`429`/challenge pages → `blocked_or_paywalled`). For citations it normalises curly/straight quotes and dashes, then returns either an exact match or a fuzzy `matchedExcerpt` so the agent can fix the wording instead of dropping a good source.

### Input

Pass any combination of the following.

| Field | Default | Notes |
|---|---|---|
| `urls` | (empty) | Up to 50 public `http(s)` URLs. Duplicates removed. |
| `text` | (empty) | A draft; http(s) URLs (including Markdown links) are extracted, trailing punctuation stripped, then checked. |
| `citations` | (empty) | `{url, quote}` or `{url, quotes: [...]}`. Up to 40 quotes. |
| `packages` | (empty) | `{ecosystem: "pypi"\|"npm", name, version?}`. Up to 40. Names are strictly validated. |
| `timeoutSeconds` | 15 | Per URL / registry lookup. |
| `maxFileSizeMb` | 2 | Responses are truncated after this size. |
| `fuzzyThreshold` | 0.75 | Minimum similarity for a `fuzzy` quote match. |
| `concurrency` | 8 | Parallel fetches (max 16). |

### Output

The default dataset starts with one envelope (`status`, `summary`, `urls`, `citations`, `packages`) and then one row per check (`kind`: `url`, `citation` or `package`).

URL `status` values:

- `live` — the URL returned a success status with no redirect
- `redirected` — success after following redirects (`finalUrl` and `redirectChain` are set)
- `broken` — `404`, `410`, DNS or network failure, or another unsuccessful response that is not a bot-block
- `blocked_or_paywalled` — `401`/`402`/`403`/`429`, or a Cloudflare-style challenge page
- `timeout` — the download exceeded `timeoutSeconds`
- `ssrf_blocked` — private, loopback, link-local, metadata or otherwise disallowed target
- `invalid_url` — not a usable `http(s)` URL

Citation `matchType`: `exact` (normalised substring), `fuzzy` (high overlap, with `matchedExcerpt` and `contextSnippet` from the live page), or `not_found`.

### Standby / Server mode

When started through Apify's server interface (`APIFY_META_ORIGIN=STANDBY`), the Actor listens on `ACTOR_WEB_SERVER_PORT` and handles:

- `GET /health` — liveness
- `POST /verify` — same input as a normal run, JSON response
- `POST /verify-draft` — requires `text`; extracts and checks links (optional `citations` / `packages` also accepted)
- Any request carrying the `x-apify-container-server-readiness-probe` header is answered immediately with HTTP 200 and body `ok`

### Pricing

| Event | Price | When it is charged |
|---|---|---|
| `verify-url` (primary) | **US$0.0015** | One URL liveness/metadata check (from `urls` or extracted from `text`). |
| `verify-citation` | **US$0.003** | One quote checked against a live page. |
| `verify-package` | **US$0.0005** | One PyPI or npm registry lookup. |
| `apify-actor-start` | US$0.00005 (Apify default) | Once when a standard run starts. |

Failed input (the Actor refused the request) is not billed. Your maximum cost per run is respected.

### Safety

URL fetches are SSRF-safe: only `http`/`https` on standard ports, every redirect hop is re-validated, and private, loopback, link-local, CGNAT and cloud-metadata addresses are blocked. Downloads are size- and time-capped. Package names are validated so they cannot be used for path injection against the registry URLs. The helper connects to already-checked IPs, IPv4 first (Apify containers often have no IPv6 route).

### Limitations

- JavaScript-rendered or bot-walled pages may look empty or `blocked_or_paywalled` even when a browser can open them.
- A soft (HTTP 200) paywall without clear challenge signals may still be reported as `live`.
- Fuzzy matches are deterministic lexical overlap, not a language-model paraphrase check.
- Registry checks hit PyPI and npm only, not other ecosystems.

# Actor input Schema

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

Optional. Public http(s) URLs to check for liveness, redirects, blocks/paywalls and page metadata (title, description, canonical, dates). Max 50. Duplicates are removed. Private, loopback and metadata addresses are rejected as ssrf_blocked.

## `text` (type: `string`):

Optional. A Markdown or plain-text draft. All http(s) URLs are extracted (including Markdown links), trailing punctuation is stripped, and each unique URL is checked like an entry in urls. Max 200,000 characters.

## `citations` (type: `array`):

Optional. Objects with "url" and either "quote" (one string) or "quotes" (a list). Each quote is checked against the live page: exact (normalized substring, including curly/straight quotes), fuzzy (high overlap, with the actual matched excerpt), or not_found. Max 40 quotes per run.

## `packages` (type: `array`):

Optional. Objects {"ecosystem": "pypi" or "npm", "name": "...", "version": "optional"}. Looks up the public registry JSON (not a web search). Names are strictly validated to block path injection. Returns exists, latestVersion, requestedVersionExists and deprecated. Max 40.

## `timeoutSeconds` (type: `integer`):

Download time limit for each URL or registry lookup.

## `maxFileSizeMb` (type: `integer`):

Larger responses are truncated after this many megabytes. Metadata is still returned from the bytes that were read.

## `fuzzyThreshold` (type: `number`):

Minimum token/sequence similarity (0.5–0.99) to report a citation as a fuzzy match with the page's actual excerpt. Exact normalized matches are always reported as exact. Default 0.75. Short 1–2 word quotes need a higher score (0.92).

## `concurrency` (type: `integer`):

How many URLs or registry lookups to fetch at once. Keep modest to stay polite.

## Actor input object example

```json
{
  "urls": [
    "https://example.com/"
  ],
  "packages": [
    {
      "ecosystem": "pypi",
      "name": "requests"
    }
  ],
  "timeoutSeconds": 15,
  "maxFileSizeMb": 2,
  "fuzzyThreshold": 0.75,
  "concurrency": 8
}
```

# Actor output Schema

## `results` (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 = {
    "urls": [
        "https://example.com/"
    ],
    "packages": [
        {
            "ecosystem": "pypi",
            "name": "requests"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("geeky_goth_gamer/live-link-citation-verifier").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://example.com/"],
    "packages": [{
            "ecosystem": "pypi",
            "name": "requests",
        }],
}

# Run the Actor and wait for it to finish
run = client.actor("geeky_goth_gamer/live-link-citation-verifier").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://example.com/"
  ],
  "packages": [
    {
      "ecosystem": "pypi",
      "name": "requests"
    }
  ]
}' |
apify call geeky_goth_gamer/live-link-citation-verifier --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,geeky_goth_gamer/live-link-citation-verifier"
        }
    }
}
```

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/IbegjzcgLpByv29ca/builds/NIOFWms5fu0H2UxZk/openapi.json
