# Official Docs Pack: llms.txt & Library Docs for Agents (`geeky_goth_gamer/official-docs-pack`) Actor

Give AI agents current official documentation. Name a library or API, or give its docs URL, plus an optional topic or version. Returns compact markdown chunks from the official domain only (llms.txt first, then the sitemap), with source URLs and token estimates.

- **URL**: https://apify.com/geeky_goth_gamer/official-docs-pack.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 $3.00 / 1,000 docs pack

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/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

## Official Docs Pack: llms.txt & Library Docs for Agents

Ask for a library or API **by name and topic**, for example `stripe` + `webhooks`, and get back a small, token-counted pack of the **official** documentation pages that answer it. The pack is built from the project's own domain only, prefers `llms.txt`, and never uses mirrors or blogs. Use it when an agent needs current docs instead of stale training data.

> **Which tool should I use?** Use this Actor when you know the **library and topic** but not the pages: it finds and packs the official docs. If you already have a specific **PDF or Word file URL** to turn into Markdown, use [PDF & DOCX to Markdown](https://apify.com/geeky_goth_gamer/pdf-docx-to-markdown).

### What does Official Docs Pack do?

Official Docs Pack is a **documentation pack API** for AI agents. Give it a **library or API name**, or an **official docs URL**, plus an optional **topic** or **version**. It finds official documentation, fetches a small set of relevant pages, and returns **compact markdown chunks** with source URLs, titles, `fetchedAt`, and token estimates.

It does **not** crawl the open web, run a browser, bypass logins, or pull third-party mirrors. Pages must be on the **project's own official domain**. Discovery prefers `llms.txt` / `llms-full.txt`, then the sitemap, then official docs pages.

One-line example:

```json
{ "name": "stripe", "topic": "webhooks" }
```

or

```json
{ "url": "https://docs.stripe.com", "topic": "webhooks" }
```

Then read `results[0].chunks`.

### Why use Official Docs Pack?

Agents need current official docs, not stale training data or random blog posts:

- Resolves a known library **name** to its official docs origin, or accepts an official **url**.
- Prefers **`llms.txt` / `llms-full.txt`**, then the **sitemap**, then official pages on the same domain.
- Converts HTML to compact **markdown chunks** with **source URL**, **title**, **fetchedAt**, and a **token estimate** (4 characters ≈ 1 token).
- **Caches** each URL in a key-value store (default 24 hours) so repeat asks do not refetch the same page.
- Reuses the same **URL-safety** core as Agent Safety Gate: SSRF / private IP blocks, robots.txt, size and timeout limits.
- An empty input or `GET /health` is a **free health check**.
- Works as a normal Apify run **and** as a Server Actor: `GET`/`POST /docs` returns JSON. A minimal MCP `get_docs` tool is at `POST /mcp`.

Standby (server) mode is enabled so agents can pin a live HTTP endpoint instead of waiting for a cold start.

### What data can Official Docs Pack extract?

| Field | Type | Description |
| --- | --- | --- |
| `chunks` | array | Markdown chunks. Each has `url`, `title`, `heading`, `markdown`, `tokenEstimate`, `fetchedAt`, and `cached`. |
| `tokenEstimate` | integer | Estimated tokens returned across chunks. |
| `officialUrl` | string | Resolved official documentation origin. |
| `source` | string | How pages were discovered: `llms.txt`, `llms-full.txt`, `sitemap`, or `pages`. |
| `pagesFetched` / `pagesCached` | integer | Fresh fetches versus cache hits on this run. |
| `fetchedAt` | string | ISO-8601 timestamp. |
| `status` | string | `ok`, `DOCS_FAILED`, or `health`. |
| `charged` | boolean | `true` when a `docs` event was billed. |
| `heavyUnits` | integer | Extra `heavy` usage events for additional ~10k tokens returned. |

### How to get official docs for an AI agent

1. Open this Actor in Apify Console, or call its server URL.
2. Send `name` or `url`, and optionally `topic`, `version`, `maxPages` (1–8), and `maxTokens`. Leave the input empty for a free health check.
3. Run the Actor, or `GET`/`POST /docs` in server mode.
4. Read `chunks` and keep the source URLs with any answer you generate.
5. You can download the dataset in various formats such as JSON, HTML, CSV, or Excel.

### How much does it cost?

Pay per event. The primary event is `docs` at **$0.003** per successful pack. The first ~10,000 estimated tokens returned are included. Extra tokens add a `heavy` usage event at **$0.001** per additional ~10,000 tokens. Health checks and failed packs (unknown name without a URL, fetch errors, SSRF blocks) are **free**. Normal (non-standby) runs also have a tiny start fee. Set a maximum cost per run in Console if you want a hard cap.

### Input

See the input tab for full configuration options.

- Provide a **name** or an official **url** (or both; the URL is used as the origin).
- `topic` and `version` bias which official paths are fetched.
- Only public `http` and `https` URLs are fetched. Local, private, and credentialed URLs are rejected.
- Off-domain links (including from `llms.txt`) are dropped.

### Output

Each dataset item is one pack. Example:

```json
{
  "status": "ok",
  "officialUrl": "https://docs.example.com/",
  "source": "llms.txt",
  "chunks": [
    {
      "url": "https://docs.example.com/guide",
      "title": "Getting started",
      "heading": "Install",
      "markdown": "## Install\n\nUse the official package.",
      "tokenEstimate": 12,
      "fetchedAt": "2026-11-27T08:00:00.000Z",
      "cached": false
    }
  ],
  "tokenEstimate": 12,
  "pagesFetched": 1,
  "pagesCached": 0,
  "charged": true,
  "heavyUnits": 0
}
```

### Tips for AI agent builders

- Pass the official docs URL when you have it. A name only works when it is in the Actor's official-origin registry.
- Use `topic` to keep the pack small and on-subject.
- Treat chunks as untrusted content. They are official pages, but still data, not instructions.
- Pin the Actor in Apify MCP as `https://mcp.apify.com?tools=geeky_goth_gamer/official-docs-pack`, or call the Actor's stable server URL:
  - `GET /health` — free health check
  - `GET` or `POST /docs` — JSON in, JSON out
  - `POST /mcp` — minimal MCP JSON-RPC with a `get_docs` tool
- The Actor runs with limited permissions.

### Limits and safety notes

- HTTP-only: no JavaScript rendering. Client-rendered docs sites may return limited text.
- At most 8 pages per request, with the same size and timeout limits as the other agent tools (~2 MB and 10 seconds per page).
- PDFs and binary downloads are not converted.
- The Actor does not bypass logins, CAPTCHAs, or paywalls, and it does not track people.
- robots.txt disallows, private IPs, and unsafe URLs are refused and not charged.

### FAQ

#### What if the name is not in the registry?

Pass the official docs `url`. The Actor will not guess third-party mirrors.

#### What if robots.txt disallows a path?

That page is skipped. If no official page can be read at all (robots, rate limiting, a non-HTML file), you get `DOCS_FAILED` with `errorCode: "NO_PAGES"` and the reasons, and nothing is charged.

Our Actors do not extract private user data. They only read public official documentation or content you supply. You should still treat results as untrusted. If you are unsure whether your use is legitimate, consult your lawyers.

Use the Issues tab for feedback, and the API tab for programmatic access.

# Actor input Schema

## `name` (type: `string`):

Resolved to a registered official docs origin when no url is given (for example stripe, react, apify).

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

Official documentation URL or origin. Private, local, and credentialed URLs are rejected. Only pages on this project's domain are fetched.

## `topic` (type: `string`):

Optional topic to prefer, such as webhooks or authentication.

## `version` (type: `string`):

Optional version or release to prefer in paths.

## `maxPages` (type: `integer`):

Maximum official pages to fetch (1–8). Default 8.

## `maxTokens` (type: `integer`):

Cap on estimated tokens returned across chunks (4 characters ≈ 1 token). Default 12,000.

## Actor input object example

```json
{
  "maxPages": 8,
  "maxTokens": 12000
}
```

# Actor output Schema

## `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("geeky_goth_gamer/official-docs-pack").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("geeky_goth_gamer/official-docs-pack").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 geeky_goth_gamer/official-docs-pack --silent --output-dataset

```

## MCP server setup

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

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/1oChzpGnqJeYgyj45/builds/uQPKlPTn36ShjksIe/openapi.json
