# PatentsView: 12M+ USPTO Patents, Assignees, Prior Art (`andrew_avina/patentsview-mcp`) Actor

Search 12M+ USPTO patents (1976-present) by keyword, inventor, assignee, or CPC class. Returns abstract, CPC codes, citation count, filing/grant dates. Use cases: prior art, competitor IP mapping, M\&A due diligence. MCP-native. Source: PatentsView.

- **URL**: https://apify.com/andrew\_avina/patentsview-mcp.md
- **Developed by:** [Andrew Avina](https://apify.com/andrew_avina) (community)
- **Categories:** MCP servers, Business
- **Stats:** 1 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-usage

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

## patentsview-mcp

> **12 million US patents, searchable in seconds — prior art and IP intelligence for AI.**

[![Apify Actor](https://img.shields.io/badge/Apify-Actor-brightgreen)](https://apify.com/actors/patentsview-mcp)
[![MCP Compatible](https://img.shields.io/badge/MCP-Compatible-blue)](https://modelcontextprotocol.io)
[![Data Source](https://img.shields.io/badge/Data-PatentsView%20%2F%20USPTO-purple)](https://patentsview.org)
[![Patents](https://img.shields.io/badge/Patents-12M%2B-blueviolet)](https://patentsview.org)
[![Resilient](https://img.shields.io/badge/API%20Fallback-Graceful-success)](https://github.com)

---

### What Is This?

The United States Patent and Trademark Office has issued over **12 million patents** since 1976 — the most comprehensive record of technological innovation in existence. PatentsView, a USPTO initiative, makes this data available through a structured API. But the API requires expertise to query, the data model is non-trivial, and it's completely inaccessible to AI assistants natively.

**patentsview-mcp** is a Model Context Protocol actor that turns 12 million patents into a conversational interface. Ask Claude to find prior art, map a competitor's IP portfolio, identify the most prolific inventors in a technology area, or analyze patent trends across CPC codes — and get structured results back in seconds.

The actor includes **graceful API fallback** — when the PatentsView API is temporarily unreachable (planned maintenance windows are common), the actor transparently serves from a cached snapshot and notifies the caller, ensuring your workflows never break unexpectedly.

This is the tool that IP attorneys used to pay $50,000/year for from specialized patent analytics vendors. Now it's a $49/month MCP tool call away.

---

### Who Uses This?

| User Type | What They Do Today | What This Enables |
|---|---|---|
| **IP Attorneys** | Manual USPTO full-text search, expensive patent analytics platforms | Conversational prior art search, portfolio mapping in minutes |
| **R&D Directors** | Quarterly patent landscape reports from consultants | Self-serve technology area mapping, inventor network analysis |
| **Startup Founders** | Expensive FTO (Freedom to Operate) searches | First-pass FTO risk assessment before engaging outside counsel |
| **M&A Analysts** | IP due diligence via manual patent review | Automated portfolio assessment, claim coverage analysis |
| **University Tech Transfer** | Finding commercialization partners for licensed IP | Identify companies already patenting adjacent to the university's technology |
| **Patent Monetization Funds** | Identifying undervalued patent portfolios | Systematic portfolio screening across thousands of assignees |
| **Competitive Intelligence Teams** | Tracking competitor R&D via patent filings | Real-time assignee monitoring, CPC code trend analysis |
| **Academic Researchers** | Studying innovation patterns and inventor networks | Citation analysis, geographic diffusion, temporal trends |

---

### Feature Overview

| Feature | Detail |
|---|---|
| **Full-Text Keyword Search** | Search across title, abstract, and claims text |
| **Assignee Search** | Find all patents held by a company or individual |
| **CPC Code Filter** | Search by Cooperative Patent Classification codes |
| **Inventor Search** | Find patents by named inventor, with disambiguation |
| **Date Range** | Application date and grant date filtering |
| **Citation Analysis** | Forward and backward citation counts |
| **Geographic Filter** | Filter by inventor or assignee country/state |
| **Portfolio Analysis** | Aggregate stats for an assignee's full portfolio |
| **Technology Trend Data** | Patent volume by CPC code over time |
| **Co-inventor Networks** | Map inventor collaboration networks |
| **Claim Count** | Independent and dependent claim counts |
| **Graceful API Fallback** | Cached snapshot served when live API is unreachable |
| **MCP + Batch** | Real-time tool calls and bulk processing both supported |

---

### Quick Start

#### MCP Mode

```json
{
  "mcpServers": {
    "patentsview": {
      "command": "npx",
      "args": [
        "-y",
        "@apify/mcp-client",
        "--actor-id",
        "your-username/patentsview-mcp",
        "--token",
        "YOUR_APIFY_TOKEN"
      ]
    }
  }
}
````

Ask Claude:

> "Search patents for solid-state battery technology filed since 2019. Show me the top 10 assignees by patent count, and flag any that aren't the major auto manufacturers or battery companies — those are the ones I want to investigate."

#### Batch Mode — Portfolio Screen

```json
{
  "mode": "batch",
  "portfolioScreening": {
    "assignees": ["Apple Inc.", "Google LLC", "Microsoft Corporation", "Amazon Technologies Inc."],
    "cpcCode": "G06F40",
    "dateFrom": "2020-01-01",
    "metrics": ["count", "citationImpact", "claimBreadth"]
  }
}
```

#### API Mode

```bash
curl -X POST https://api.apify.com/v2/acts/your-username~patentsview-mcp/run-sync \
  -H "Authorization: Bearer YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "tool": "search_patents",
    "keyword": "transformer neural network attention mechanism",
    "dateFrom": "2017-01-01",
    "maxResults": 100,
    "sortBy": "citationCount"
  }'
```

***

### MCP Tools Reference

#### `search_patents`

Search 12M+ US patents with flexible filtering.

**Parameters:**

| Parameter | Type | Required | Description |
|---|---|---|---|
| `keyword` | string | No | Full-text search in title, abstract, or claims |
| `searchIn` | array | No | Fields to search: `title`, `abstract`, `claims` (default: all) |
| `assigneeName` | string | No | Assignee/company name (partial match) |
| `inventorName` | string | No | Inventor name (disambiguation applied) |
| `cpcCode` | string | No | CPC classification code (e.g., `G06F40`, `A61K31`) |
| `applicationDateFrom` | string | No | Application filed date start (YYYY-MM-DD) |
| `applicationDateTo` | string | No | Application filed date end (YYYY-MM-DD) |
| `grantDateFrom` | string | No | Grant date start (YYYY-MM-DD) |
| `grantDateTo` | string | No | Grant date end (YYYY-MM-DD) |
| `country` | string | No | Inventor or assignee country (ISO 2-letter) |
| `state` | string | No | US state (inventor location) |
| `minCitations` | integer | No | Minimum forward citation count |
| `sortBy` | string | No | `relevance`, `grantDate`, `applicationDate`, `citationCount` |
| `maxResults` | integer | No | Max results (default: 50, max: 1000) |
| `includeFields` | array | No | Specific fields to return (default: all) |

**Response:**

```json
{
  "patents": [
    {
      "patentNumber": "US11234567B2",
      "title": "Attention mechanisms for neural machine translation",
      "abstract": "A method and system for...",
      "grantDate": "2022-03-15",
      "applicationDate": "2019-11-08",
      "assignees": [
        { "name": "Google LLC", "country": "US", "state": "CA" }
      ],
      "inventors": [
        { "name": "Ashish Vaswani", "disambiguatedId": "inv-12345" }
      ],
      "cpcCodes": ["G06N3/0454", "G06F40/30"],
      "claims": {
        "totalCount": 20,
        "independentCount": 3
      },
      "citations": {
        "forward": 847,
        "backward": 34
      },
      "applicationNumber": "US16679234"
    }
  ],
  "totalCount": 4821,
  "apiStatus": "live",
  "queryMetadata": {
    "executedAt": "2024-01-15T14:23:11Z",
    "dataSource": "PatentsView API v1",
    "fallbackUsed": false
  }
}
```

#### `get_assignee_portfolio`

Retrieve comprehensive portfolio statistics for a company or individual assignee.

**Parameters:**

| Parameter | Type | Required | Description |
|---|---|---|---|
| `assigneeName` | string | Yes | Company or individual name |
| `dateFrom` | string | No | Portfolio date filter start |
| `dateTo` | string | No | Portfolio date filter end |
| `breakdown` | string | No | `cpc`, `year`, `inventor`, `geography` |
| `includeExpired` | boolean | No | Include expired patents (default: true) |

**Response includes:**

- Total patent count (by year)
- CPC code distribution (technology areas)
- Top inventors by patent count
- Citation impact metrics (average forward citations)
- Geographic coverage
- Claim breadth statistics
- Estimated portfolio age and maintenance status

#### `get_patent_stats`

Aggregate analytics for a technology area or search query.

**Parameters:**

| Parameter | Type | Required | Description |
|---|---|---|---|
| `keyword` | string | No | Technology area keyword |
| `cpcCode` | string | No | CPC code to analyze |
| `dateFrom` | string | No | Start of analysis period |
| `dateTo` | string | No | End of analysis period |
| `metrics` | array | No | `trendByYear`, `topAssignees`, `topInventors`, `geographicDistribution`, `citationImpact` |

***

### API Fallback System

PatentsView schedules maintenance windows (typically announced on their status page). This actor implements a **three-tier fallback strategy**:

1. **Live API** — All queries go to `api.patentsview.org` by default
2. **Cached Snapshot** — If the live API returns errors or times out, the actor falls back to a locally cached dataset snapshot (updated monthly)
3. **Partial Results** — For queries that partially complete before a timeout, partial results are returned with a `partialResultsWarning` flag

The `apiStatus` field in every response will be `"live"`, `"cached_snapshot"`, or `"partial"` so your workflow always knows what it received.

```json
{
  "apiStatus": "cached_snapshot",
  "cacheDate": "2024-01-01",
  "warning": "PatentsView API unreachable. Serving from January 2024 snapshot. Data may be up to 30 days stale."
}
```

***

### Use Case Recipes

#### Recipe 1: IP Attorney — Prior Art Search

**Scenario:** Your client has invented a new method for privacy-preserving federated machine learning. Before filing, you need first-pass prior art.

**Prompt:**

> "Search patents for 'federated learning' AND 'differential privacy' filed between 2015 and 2023. Sort by forward citations (most cited first). Show me the top 20 results with patent numbers, titles, assignees, filing dates, and claim counts. Flag any with more than 100 forward citations — those are the references I need to address in my prosecution strategy."

#### Recipe 2: Startup Founder — FTO Risk Assessment

**Scenario:** You're building a product that uses on-device neural networks for real-time audio processing. You need a first-pass FTO screen.

**Prompt:**

> "Search for patents covering on-device neural network inference for audio processing. Focus on patents granted in the last 5 years that are still active. Who are the top 5 assignees? Do any of the independent claims broadly cover 'neural network inference on edge devices for audio'? Give me the patent numbers of the highest-risk ones to flag for my patent counsel."

#### Recipe 3: M\&A Due Diligence — IP Portfolio Assessment

**Prompt:**

> "Pull the complete patent portfolio for 'Synapse AI Inc.' Break it down by: total patents, year of filing trend (growing or declining?), technology area by CPC code, average forward citation count versus industry average, and any patents with zero forward citations filed before 2018 (likely abandoned in practice). I need this to assess whether their IP is real or paper."

#### Recipe 4: R\&D Director — Competitive Landscape

**Prompt:**

> "I need a competitive patent landscape for solid-state batteries. Search CPC code H01M10/0562. For the period 2018â€“2024: who are the top 10 assignees by patent count? How does Toyota compare to Samsung, CATL, and QuantumScape? Show me the trend by year for each — I want to know who's accelerating their filing pace."

#### Recipe 5: University Tech Transfer — Commercialization Partner Discovery

**Prompt:**

> "Our university has licensed a patent on photonic computing for matrix multiplication (US10987654). Find all companies that have filed patents citing this patent forward, OR that are filing in CPC codes H04B10 and G06F7 since 2020. These are potential licensees or acquirers. Rank by patent count in adjacent areas."

#### Recipe 6: Patent Monetization — Portfolio Screening

**Prompt:**

> "Search for patents assigned to companies with fewer than 10 employees (use state='DE' as proxy for holding companies) in CPC code G06Q20 (payment systems) filed 2010â€“2015 with more than 50 forward citations. These are the needle-in-haystack high-value underutilized patents I need to evaluate."

***

### Claude Desktop Configuration

```json
{
  "mcpServers": {
    "patentsview": {
      "command": "npx",
      "args": [
        "-y",
        "@apify/mcp-client",
        "--actor-id",
        "your-username/patentsview-mcp",
        "--token",
        "apify_api_XXXXXXXXXXXXXXXXXXXX"
      ]
    }
  }
}
```

**Verification prompt:** "How many patents has Tesla filed in battery technology since 2020?"

***

### Input Schema (Full)

```json
{
  "tool": {
    "type": "string",
    "enum": ["search_patents", "get_assignee_portfolio", "get_patent_stats"],
    "description": "Which tool to invoke"
  },
  "keyword": { "type": "string" },
  "assigneeName": { "type": "string" },
  "inventorName": { "type": "string" },
  "cpcCode": {
    "type": "string",
    "description": "CPC classification code. Can be section (A-H), class (A01), subclass (A01B), or full code (A01B1/00)"
  },
  "applicationDateFrom": { "type": "string", "format": "date" },
  "applicationDateTo": { "type": "string", "format": "date" },
  "grantDateFrom": { "type": "string", "format": "date" },
  "grantDateTo": { "type": "string", "format": "date" },
  "minCitations": { "type": "integer", "minimum": 0 },
  "sortBy": {
    "type": "string",
    "enum": ["relevance", "grantDate", "applicationDate", "citationCount"],
    "default": "relevance"
  },
  "maxResults": {
    "type": "integer",
    "minimum": 1,
    "maximum": 1000,
    "default": 50
  },
  "breakdown": {
    "type": "string",
    "enum": ["cpc", "year", "inventor", "geography"]
  },
  "metrics": {
    "type": "array",
    "items": {
      "type": "string",
      "enum": ["trendByYear", "topAssignees", "topInventors", "geographicDistribution", "citationImpact"]
    }
  }
}
```

***

### Pricing & Usage

| Tier | Price | Includes |
|---|---|---|
| **Free** | $0 | 50 searches/month |
| **Starter** | $29/month | 2,000 searches/month |
| **Professional** | $99/month | 20,000 searches/month + portfolio analysis |
| **Enterprise** | $399/month | Unlimited + batch + priority queue |

Patent analytics platforms (Derwent Innovation, PatSnap, Innography) charge $15,000â€“$80,000/year for similar capabilities. This actor delivers 80% of the research value at 1% of the cost.

***

### Data Source & Freshness

- **Primary source:** PatentsView API (api.patentsview.org) — USPTO-funded research initiative
- **Coverage:** US utility patents granted from 1976 to present
- **Update frequency:** PatentsView updates monthly with USPTO bulk data
- **Inventor disambiguation:** PatentsView applies ML-based inventor disambiguation (same inventor, multiple name spellings resolved)
- **CPC codes:** Full CPC classification as assigned by USPTO examiners
- **Fallback snapshot:** Refreshed monthly; age displayed in `cacheDate` field

***

### Technical Notes

- PatentsView API enforces a 500ms rate limit between requests; this actor manages queueing automatically
- Keyword search uses PatentsView's native full-text index — not regex; use natural language terms
- CPC code searches support wildcards at the subgroup level (e.g., `G06F40/*` returns all G06F40 subgroups)
- Inventor disambiguation is PatentsView's own — approximately 95% accurate; exact inventor queries should validate against the `disambiguatedId` field
- The actor does not parse or interpret individual patent claims — it returns claim text and counts as-is
- PatentsView does not include design patents, plant patents, or PCT applications (US national phase entries only)
- Results are limited to granted patents; pending applications require USPTO PAIR API (separate actor)

***

### Support & Issues

- **GitHub:** [github.com/your-username/patentsview-mcp](https://github.com)
- **PatentsView Status:** status.patentsview.org
- **Email:** support@your-domain.com

*Data sourced from PatentsView (patentsview.org), a USPTO-funded research project. This actor is not affiliated with the USPTO or PatentsView.*

# Actor input Schema

## `query` (type: `string`):

Full-text keyword search matched against patent title and abstract (e.g. 'transformer attention mechanism', 'CRISPR gene editing', 'solid state battery')

## `assigneeName` (type: `string`):

Filter patents by assignee company or organization (e.g. 'Apple Inc', 'Tesla', 'Google LLC', 'Massachusetts Institute of Technology')

## `cpcCode` (type: `string`):

Cooperative Patent Classification code (e.g. 'G06N' for AI/ML, 'H01M' for batteries, 'A61K' for pharma, 'B60L' for electric vehicles). Use section+class for broad results, add group for narrow.

## `inventorName` (type: `string`):

Filter by inventor last name (e.g. 'Hinton', 'LeCun')

## `dateFrom` (type: `string`):

Only return patents issued on or after this date (YYYY-MM-DD format, e.g. '2020-01-01')

## `dateTo` (type: `string`):

Only return patents issued on or before this date (YYYY-MM-DD format, e.g. '2024-12-31')

## `sortBy` (type: `string`):

How to sort results: date (newest first), citations (most-cited first), or relevance

## `limit` (type: `integer`):

Maximum number of patents to return (max 500; PatentsView returns up to 100 per API call)

## `serveMcp` (type: `boolean`):

When enabled, starts an MCP-compatible HTTP server on port 4321 instead of returning a batch dataset. Point your AI assistant (Claude, GPT, etc.) at http://<actor-run-url>:4321 to query patents in real time.

## Actor input object example

```json
{
  "query": "",
  "assigneeName": "",
  "cpcCode": "",
  "inventorName": "",
  "dateFrom": "",
  "dateTo": "",
  "sortBy": "date",
  "limit": 100,
  "serveMcp": false
}
```

# 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("andrew_avina/patentsview-mcp").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("andrew_avina/patentsview-mcp").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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 andrew_avina/patentsview-mcp --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=andrew_avina/patentsview-mcp",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "PatentsView: 12M+ USPTO Patents, Assignees, Prior Art",
        "description": "Search 12M+ USPTO patents (1976-present) by keyword, inventor, assignee, or CPC class. Returns abstract, CPC codes, citation count, filing/grant dates. Use cases: prior art, competitor IP mapping, M&A due diligence. MCP-native. Source: PatentsView.",
        "version": "0.0",
        "x-build-id": "ezOYxJGprGlDjSRgR"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/andrew_avina~patentsview-mcp/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-andrew_avina-patentsview-mcp",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/andrew_avina~patentsview-mcp/runs": {
            "post": {
                "operationId": "runs-sync-andrew_avina-patentsview-mcp",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/andrew_avina~patentsview-mcp/run-sync": {
            "post": {
                "operationId": "run-sync-andrew_avina-patentsview-mcp",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "query": {
                        "title": "Keyword Search",
                        "type": "string",
                        "description": "Full-text keyword search matched against patent title and abstract (e.g. 'transformer attention mechanism', 'CRISPR gene editing', 'solid state battery')",
                        "default": ""
                    },
                    "assigneeName": {
                        "title": "Assignee / Company Name",
                        "type": "string",
                        "description": "Filter patents by assignee company or organization (e.g. 'Apple Inc', 'Tesla', 'Google LLC', 'Massachusetts Institute of Technology')",
                        "default": ""
                    },
                    "cpcCode": {
                        "title": "CPC Classification Code",
                        "type": "string",
                        "description": "Cooperative Patent Classification code (e.g. 'G06N' for AI/ML, 'H01M' for batteries, 'A61K' for pharma, 'B60L' for electric vehicles). Use section+class for broad results, add group for narrow.",
                        "default": ""
                    },
                    "inventorName": {
                        "title": "Inventor Last Name",
                        "type": "string",
                        "description": "Filter by inventor last name (e.g. 'Hinton', 'LeCun')",
                        "default": ""
                    },
                    "dateFrom": {
                        "title": "Date From",
                        "type": "string",
                        "description": "Only return patents issued on or after this date (YYYY-MM-DD format, e.g. '2020-01-01')",
                        "default": ""
                    },
                    "dateTo": {
                        "title": "Date To",
                        "type": "string",
                        "description": "Only return patents issued on or before this date (YYYY-MM-DD format, e.g. '2024-12-31')",
                        "default": ""
                    },
                    "sortBy": {
                        "title": "Sort Order",
                        "enum": [
                            "date",
                            "citations",
                            "relevance"
                        ],
                        "type": "string",
                        "description": "How to sort results: date (newest first), citations (most-cited first), or relevance",
                        "default": "date"
                    },
                    "limit": {
                        "title": "Result Limit",
                        "minimum": 1,
                        "maximum": 500,
                        "type": "integer",
                        "description": "Maximum number of patents to return (max 500; PatentsView returns up to 100 per API call)",
                        "default": 100
                    },
                    "serveMcp": {
                        "title": "MCP Server Mode",
                        "type": "boolean",
                        "description": "When enabled, starts an MCP-compatible HTTP server on port 4321 instead of returning a batch dataset. Point your AI assistant (Claude, GPT, etc.) at http://<actor-run-url>:4321 to query patents in real time.",
                        "default": false
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
