# Website Document Inventory & PDF Finder (`winning_moonstone/website-document-inventory-pdf-finder`) Actor

Crawl public websites for PDF, Word, Excel, CSV, PowerPoint, RTF, and OpenDocument links with source context and deterministic document categories.

- **URL**: https://apify.com/winning_moonstone/website-document-inventory-pdf-finder.md
- **Developed by:** [月 明](https://apify.com/winning_moonstone) (community)
- **Categories:** Developer tools, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$3.00 / 1,000 unique document link discovereds

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

## Website Document Inventory & PDF Finder

Build a clean inventory of public document links published by websites. The Actor crawls a bounded set of same-site HTML pages and returns one source-attributed record for every unique document it finds.

### Why use it

Document links are often scattered across investor-relations pages, resource centers, support sections, public meeting pages, policy pages, and download libraries. This Actor turns those links into structured rows without downloading document contents.

Useful for investor-relations/public-report inventories, product manuals and datasheets, public forms and policies, RFP/tender discovery, research pipelines, and migration checks.

### Supported document types

PDF, DOC/DOCX, XLS/XLSX, CSV, PPT/PPTX, RTF, ODT, ODS, and ODP.

Links can be recognized from the URL extension, the anchor's download filename, or a declared document MIME type.

### Output

One dataset row is saved per unique document with:

- site
- documentUrl
- extension
- fileName
- anchorText
- category
- sourcePage
- sourceContext
- sameSite
- discoveryDepth

Category labels are deterministic keyword hints, using URL, anchor text, and nearby text. Categories include financial reports, manuals/datasheets, policy/legal files, RFP/tender files, agendas/minutes, forms/applications, brochures/catalogs, menus/price lists, sustainability/ESG documents, research/whitepapers, or other.

The default key-value store contains OUTPUT, a run summary with pages scanned/failed, documents found/saved, per-site errors, and stop reasons.

### Example input

```json
{
  "startUrls": [{"url": "https://www.w3.org/WAI/WCAG21/Techniques/pdf/PDF3"}],
  "maxPagesPerSite": 5,
  "maxDepth": 1,
  "maxDocumentsPerSite": 100,
  "extensions": ["pdf", "doc", "docx", "xls", "xlsx", "csv", "ppt", "pptx"],
  "respectRobotsTxt": true
}
```

### Bounded and safe by default

- Public HTTP(S) URLs and standard ports only.
- Credentials in URLs are rejected.
- DNS/IP checks reject non-public targets before requests and redirects.
- Redirects are capped and every destination is revalidated.
- robots.txt is respected by default.
- Same-site crawling only; linked documents are not fetched.
- Maximum 20 input sites, 50 HTML page attempts per site, crawl depth 2, and 1,000 unique documents per site.
- HTML response bodies are capped at 2 MB.
- No login, form submission, CAPTCHA bypass, document download, OCR, or private-network access.

### Pricing

**$0.003 per unique document saved across the entire run ($3 per 1,000 documents)**. Pages with no matching document do not create a paid dataset record, and failed page requests are not charged as document results.

Always check the live Pricing tab because Store pricing can change.

### Limitations

The Actor reads server-rendered HTML only. It finds links rather than document contents, so JavaScript-only links, OCR, content validation, and authenticated/private documents are outside scope. Category labels are convenience filters, not legal or accounting conclusions.

Only process public websites you are permitted to access and follow applicable site terms, copyright, privacy, and data-use rules.

Start with HTML pages containing document links. Direct file URLs are rejected so supplied filenames are never counted as newly discovered results. Duplicate document URLs across input sites are saved and charged once per run. An all-page-failure run fails explicitly after saving its diagnostics.

# Actor input Schema

## `url` (type: `string`):

A public HTML page containing document links. Used when Batch website URLs is empty.

## `startUrls` (type: `array`):

Up to 20 public websites. Each site is crawled independently within the page/depth limits.

## `maxSites` (type: `integer`):

Maximum number of supplied sites to process (1 to 20).

## `maxPagesPerSite` (type: `integer`):

Hard cap on successful and failed page attempts for each supplied site.

## `maxDepth` (type: `integer`):

0 checks only the supplied page, 1 follows priority internal links, 2 is the maximum.

## `maxDocumentsPerSite` (type: `integer`):

Maximum unique discovered document links per site (1 to 1000).

## `extensions` (type: `array`):

Only links whose URL, download filename, or declared MIME type matches one of these extensions are returned.

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

Maximum wait per public page request, in seconds (5 to 60).

## `respectRobotsTxt` (type: `boolean`):

Recommended for recurring third-party website audits.

## Actor input object example

```json
{
  "url": "https://www.w3.org/WAI/WCAG21/Techniques/pdf/PDF3",
  "startUrls": [],
  "maxSites": 10,
  "maxPagesPerSite": 10,
  "maxDepth": 1,
  "maxDocumentsPerSite": 200,
  "extensions": [
    "pdf",
    "doc",
    "docx",
    "xls",
    "xlsx",
    "csv",
    "ppt",
    "pptx",
    "rtf",
    "odt",
    "ods",
    "odp"
  ],
  "timeoutSeconds": 20,
  "respectRobotsTxt": true
}
```

# Actor output Schema

## `summary` (type: `string`):

No description

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

// Run the Actor and wait for it to finish
const run = await client.actor("winning_moonstone/website-document-inventory-pdf-finder").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("winning_moonstone/website-document-inventory-pdf-finder").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 winning_moonstone/website-document-inventory-pdf-finder --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,winning_moonstone/website-document-inventory-pdf-finder"
        }
    }
}
```

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/fW3lanCeSWhiFt6He/builds/acLng9kgc1mD3RRfg/openapi.json
