# Patent Number → Full-Text Markdown (Claims & Spec) (`ingenious_quip_bxq/patent-to-markdown`) Actor

Publication numbers → full-text Markdown (title, abstract, claims, description) + RAG chunks + CPC/citations. Only robots-allowed patents.google.com /patent/ pages — no search/SERP. 512 MB. Failures free.

- **URL**: https://apify.com/ingenious_quip_bxq/patent-to-markdown.md
- **Developed by:** [新世紀書僮](https://apify.com/ingenious_quip_bxq) (community)
- **Categories:** Developer tools, Automation, AI
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.00 / 1,000 patent markdowns

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

## Patent Number → Full-Text Markdown (Claims & Spec)

Turn patent **publication numbers** (e.g. `US9876543B2`, `EP3411969B1`, `WO2017120318A1`) into clean **full-text Markdown** for RAG and due-diligence pipelines:

- Title, abstract
- **Claims** (itemized)
- **Description / specification** as Markdown
- Paragraph **RAG chunks** (~500–1000 chars with headings)
- Metadata: applicants / assignees, inventors, priority / filing / publication dates, CPC, backward & forward citations, PDF link

### Compliance (robots.txt)

`patents.google.com/robots.txt`:

```
User-agent: *
Disallow: /*
Allow: /patent/
```

This Actor **only** fetches `https://patents.google.com/patent/{NUMBER}/{lang}` pages.\
It does **not** search, does **not** crawl SERPs, and does **not** hit listing/disallowed paths.

No API key, account, or KYC is required.

### Input

| Field | Notes |
|---|---|
| `publicationNumbers` | List of publication numbers (primary) |
| `patentNumbers` | Alias of the above |
| `datasetId` / `keyValueStoreId` | Optional batch sources |
| `includeClaims` / `includeDescription` / `includeRagChunks` | Defaults **true** |
| `maxConcurrency` | Default **2** (keep low) |
| `useApifyProxy` | Default **false** — prefer direct; enable only if you measure sustained 429/blocks |

### Output

- **Dataset**: one row per number (`status=ok|failed`, title, abstract, claims\[], descriptionMarkdown, cpc\[], citations\*, markdown, chunks\[])
- **KV** `REPORT.md` — summary + abstract previews
- **KV** `PATENTS.md` — full Markdown documents
- **KV** `CHUNKS.jsonl` — RAG chunks (optional)
- **KV** `SUMMARY` / `OUTPUT`

Failed / not-found / invalid rows are **not charged**.

### Pricing (pay-per-event)

| Event | Price |
|---|---|
| Actor start | $0.001 |
| `patent-markdown` (primary) | **$0.004** per successful patent |

### vs typical patent scrapers

Most Store Actors focus on **search + citation graphs** and default to **4 GB** browsers. This one is built for **RAG Markdown + chunks**, stays on robots-allowed `/patent/` pages only, and targets **512 MB**.

### Memory & limits

Default **512 MB**, timeout **3600 s**. Concurrency 1–5 (default 2). Retries on 429/5xx/timeouts.

### Example

```json
{
  "publicationNumbers": ["US9876543B2"],
  "includeRagChunks": true,
  "maxConcurrency": 2
}
```

# Changelog

This Actor's version history is a separate document: https://apify.com/ingenious_quip_bxq/patent-to-markdown/changelog.md

# Actor input Schema

## `publicationNumbers` (type: `array`):

One publication number per line (e.g. US9876543B2, EP3411969B1, WO2017120318A1). Spaces, dashes and colons are stripped. Duplicates are dropped. Only /patent/{NUMBER} pages are fetched — this Actor does not search.

## `patentNumbers` (type: `array`):

Optional alias of `publicationNumbers`. Same normalization rules.

## `datasetId` (type: `string`):

Optional. Read publication numbers from another Actor's dataset. Uses 'Number field', else publicationNumber / patentNumber / number / patent / id.

## `keyValueStoreId` (type: `string`):

Optional. Read numbers from a key-value record: JSON array, {"publicationNumbers": \[...]}, or plain text with one number per line.

## `keyValueRecordKey` (type: `string`):

Record key inside the key-value store (default INPUT_PATENTS).

## `numberField` (type: `string`):

Optional. Name of the field holding the publication number in dataset items or JSON objects.

## `language` (type: `string`):

Language path segment for patents.google.com /patent/{NUMBER}/{lang} (default en).

## `includeClaims` (type: `boolean`):

Parse and include itemized claims in Markdown and dataset rows.

## `includeDescription` (type: `boolean`):

Parse and include the full description (specification) as Markdown.

## `includeRagChunks` (type: `boolean`):

Split each patent Markdown into ~500–1000 character chunks with headings. Written to key-value record CHUNKS.jsonl and attached on each ok row as `chunks`.

## `chunkMinChars` (type: `integer`):

Soft minimum size for RAG chunks (default 500).

## `chunkMaxChars` (type: `integer`):

Soft maximum size for RAG chunks (default 1000).

## `maxItems` (type: `integer`):

Cap how many publication numbers to process (default 50).

## `maxConcurrency` (type: `integer`):

Parallel patent page fetches (default 2, max 5). Keep low to respect rate limits.

## `maxRetries` (type: `integer`):

Retries on 429 / 5xx / timeout / transient block (default 3).

## `requestTimeoutSecs` (type: `integer`):

Per-request timeout (default 45).

## `useApifyProxy` (type: `boolean`):

Default false — prefer direct fetches (measured OK from datacenter IPs for /patent/ pages). Enable only if you observe sustained 429/blocks after lowering concurrency.

## Actor input object example

```json
{
  "publicationNumbers": [
    "US9876543B2"
  ],
  "keyValueRecordKey": "INPUT_PATENTS",
  "language": "en",
  "includeClaims": true,
  "includeDescription": true,
  "includeRagChunks": true,
  "chunkMinChars": 500,
  "chunkMaxChars": 1000,
  "maxItems": 50,
  "maxConcurrency": 2,
  "maxRetries": 3,
  "requestTimeoutSecs": 45,
  "useApifyProxy": false
}
```

# Actor output Schema

## `results` (type: `string`):

Dataset rows: publicationNumber, title, abstract, claims, descriptionMarkdown, cpc, citations, markdown, chunks, errorClass.

## `reportMarkdown` (type: `string`):

Summary counts + abstract previews per successful patent.

## `patentsMarkdown` (type: `string`):

Concatenated full patent Markdown documents.

## `chunks` (type: `string`):

Newline-delimited JSON chunks (~500–1000 chars) when includeRagChunks is true.

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

ok, failed, byClass, charged, durationSecs, peakMemoryMb.

# 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 = {
    "publicationNumbers": [
        "US9876543B2"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("ingenious_quip_bxq/patent-to-markdown").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 = { "publicationNumbers": ["US9876543B2"] }

# Run the Actor and wait for it to finish
run = client.actor("ingenious_quip_bxq/patent-to-markdown").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 '{
  "publicationNumbers": [
    "US9876543B2"
  ]
}' |
apify call ingenious_quip_bxq/patent-to-markdown --silent --output-dataset

```

## MCP server setup

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

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/h1lqps7pIEPe1uSoM/builds/naBQ6zj1TZqiUgoxe/openapi.json
