# USPTO Patent & Trademark Scraper (`solidcode/uspto-patent-trademark-scraper`) Actor

\[💰 $3.50 / 1K] Search and extract US patent and trademark records from the USPTO. Look up by keyword, inventor, assignee, or classification, or pull specific patent and trademark numbers — get titles, abstracts, owners, inventors, dates, status, and classifications.

- **URL**: https://apify.com/solidcode/uspto-patent-trademark-scraper.md
- **Developed by:** [SolidCode](https://apify.com/solidcode) (community)
- **Categories:** Developer tools, Automation, Other
- **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 records

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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

## USPTO Patent & Trademark Scraper

Pull live US patent and federal trademark records straight from the United States Patent and Trademark Office — granted patents, published applications, and the full federal trademark register, all in one run. Search by keyword, inventor, owner, or classification, look up exact patent and trademark numbers, and get clean structured records with inventors, classification codes, owners, status, and ready-to-open USPTO links. Built for patent attorneys, IP and competitive-intelligence analysts, and brand-protection teams who need official USPTO data without manual TSDR lookups, page-by-page searching, or chasing API keys.

### Why This Scraper?

- **Two USPTO databases in one run** — pull granted US patents, pre-grant published applications, and the entire federal trademark register of millions of marks together, or pick just patents or just trademarks with a single dropdown. No sampling, no demo data.
- **Patent search across six dimensions** — full-text keyword, inventor name, owner/assignee, CPC classification, granted-vs-published status, and a date range, combined into one query. Search an inventor and every row comes back with the patent's complete inventor list, so the person you searched for is visible even when they are the fifth name on the document.
- **Full-text keyword search, not title-only** — your keywords are matched against every word of the patent document: title, abstract, claims *and* the detailed description. That surfaces patents that never say your term in the title, which title-only tools miss entirely.
- **CPC routing done right** — search a full subgroup like `H04L9/06` or a whole class like `H04L`; the scraper picks the correct USPTO classification index for each so you get the matching corpus, not zero results.
- **Direct number lookup, no search needed** — paste exact patent numbers, or trademark serial or registration numbers, and pull those records straight out, bypassing keyword search entirely. `US10,123,456 B2`, `10123456` and `US10123456B2` all resolve to the same record.
- **Trademark status in plain words, not just Live/Dead** — every mark also carries USPTO's own status code and its wording, so you can tell `REGISTERED AND RENEWED` from `CANCELLED - SECTION 8` or `ABANDONED - NO STATEMENT OF USE FILED` without a single TSDR lookup.
- **Grants and applications never get confused** — USPTO publishes most applications about 18 months after filing, so any honest patent search returns a mix. Every row here is labelled `Granted patent` or `Published application`, only granted rows carry a `grantDate`, and one dropdown limits a whole run to grants alone.
- **Rich patent records** — patent or publication number, title, owner, inventors, publication, grant and filing dates, CPC classification codes, forward-citation count, design/plant/utility type, and a ready Google Patents link on every row.
- **Full abstracts on demand** — flip one switch and every patent row carries USPTO's complete abstract text (700+ characters on a typical record), so you can screen results by what the invention actually does instead of guessing from the title.

### Use Cases

**IP & Competitive Intelligence**

- Map a competitor's entire patent portfolio by searching their company name as the owner
- Track new grants in a CPC technology area to watch a field as it develops
- Build inventor profiles by pulling every patent listing a named inventor
- Benchmark filing activity across rivals with grant-date-range searches

**Legal & Patent Prosecution**

- Pull exact patents by number for prior-art review and freedom-to-operate analysis
- Gather forward-citation counts to gauge the influence of a reference
- Assemble classification-based prior-art sets before drafting claims
- Verify grant and filing dates for docketing and deadline calculations

**Brand Protection & Trademark Clearance**

- Look up a trademark by serial or registration number to confirm live/dead status
- Pull goods & services and international class for clearance and watch reports
- Search the federal register by wordmark to spot confusingly similar marks
- Monitor owner names to track a brand's mark portfolio

**Market & Technology Research**

- Quantify innovation in a sector by counting grants in target CPC classes
- Identify emerging assignees entering a technology space
- Feed patent and trademark records into trend dashboards and analytics tools
- Track date-ranged grant volume as an indicator of R\&D output

**Academic & Data Analysis**

- Build structured patent datasets for bibliometric and citation studies
- Compile trademark datasets by class for brand and marketing research
- Export clean, normalized records for statistical analysis and visualization

### Getting Started

#### Simple patent keyword search

Just keywords and a result cap:

```json
{
    "dataType": "patents",
    "searchQuery": "machine learning",
    "maxResults": 50
}
```

#### Filtered search for granted patents only

Combine an owner, a CPC class, and a grant-date window, and exclude pre-grant applications so every row is a real grant:

```json
{
    "dataType": "patents",
    "searchQuery": "neural network",
    "assignee": "NVIDIA",
    "cpcClass": "H04L",
    "patentStatus": "granted",
    "dateFrom": "2022-01-01",
    "dateTo": "2023-12-31",
    "maxResults": 200
}
```

#### Look up specific numbers

Pull exact patents and trademarks by number — no search runs:

```json
{
    "dataType": "both",
    "patentNumbers": ["10123456", "US9876543B2"],
    "trademarkNumbers": ["78787878", "2345678"]
}
```

#### Patents and trademarks together

Search both databases in one run:

```json
{
    "dataType": "both",
    "searchQuery": "coffee",
    "maxResults": 100
}
```

### Input Reference

#### What to Collect

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `dataType` | select | `Patents only` | Which records to collect: `Patents only`, `Trademarks only`, or `Patents and trademarks`. Patents and trademarks come back as separate record types. |
| `searchQuery` | string | `"machine learning"` | Words to match anywhere in the full text of a patent document — title, abstract, claims and the detailed description (e.g. "solar panel coating"), returned newest publication first. For trademarks, matches the mark wording (e.g. "Nike"), returned newest filing first. Leave empty when looking up specific numbers. |
| `patentNumbers` | string\[] | `[]` | Look up specific patents or published applications by number (e.g. "10123456" or "US10123456B2" for a grant, "20230123456" for a published application). One per line. Overrides the keyword search. |
| `trademarkNumbers` | string\[] | `[]` | Look up specific trademarks by serial number (e.g. "78787878") or registration number (e.g. "2345678"). One per line. Overrides the keyword search. |

#### Patent Filters

Filters apply to patent keyword searches only and are ignored when you look up specific numbers.

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `inventor` | string | — | Only return patents listing this inventor (e.g. "Jane Smith"). |
| `assignee` | string | — | Only return patents owned by or assigned to this company or person (e.g. "Apple Inc"). |
| `cpcClass` | string | — | Only return patents in this Cooperative Patent Classification code. Use a subgroup like "H04L9/06" or a class like "H04L". |
| `patentStatus` | select | `Granted patents and published applications` | Which kind of patent document to return: both, `Granted patents only`, or `Published applications only`. Every row also states its own kind in `documentType`. |
| `dateFrom` | string | — | Only include patent documents published on or after this date — the grant date for a granted patent, the publication date for a published application. Format: YYYY-MM-DD. Pair with `patentStatus: "granted"` for a clean grant-date window. |
| `dateTo` | string | — | Only include patent documents published on or before this date — the grant date for a granted patent, the publication date for a published application. Format: YYYY-MM-DD. |

#### Extra Detail

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `includeAbstracts` | boolean | `false` | Add the full abstract text to every patent record. USPTO serves abstracts one patent at a time, so this adds roughly a second per patent — leave it off for the fastest runs. No effect on trademarks. |
| `includeAllInventors` | boolean | `false` | List every inventor on each patent instead of the first one plus an `"et al."` marker. Adds roughly a second per patent. Not needed for inventor-name searches — those always return the complete list. |

#### Results

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `maxResults` | integer | `100` | Maximum records to return per search. Set to 0 to collect every match — broad searches can have hundreds of thousands of results, so set a number to cap. Start with 10–50 to test, then increase. On patent searches the cap keeps the most recently published patents and on trademark searches the most recently filed marks, and the run says so when it stops short of the full match count. |

### Output

Patents and trademarks are returned as two record types, distinguished by the `recordType` field. Each is shown below.

#### Patent record

```json
{
    "recordType": "patent",
    "documentType": "Granted patent",
    "patentNumber": "11500000",
    "applicationNumber": "16987654",
    "title": "Neural network accelerator with configurable dataflow",
    "assignee": "NVIDIA Corporation",
    "inventors": ["Jane Smith", "Robert Chen", "Maria Lopez"],
    "publicationDate": "2022-11-15",
    "grantDate": "2022-11-15",
    "filingDate": "2020-08-07",
    "cpcClasses": ["G06N3/063", "G06F9/3001"],
    "patentType": "Utility (granted)",
    "citedByCount": 14,
    "url": "https://patents.google.com/patent/US11500000B2"
}
```

| Field | Type | Description |
|-------|------|-------------|
| `recordType` | string | Always `"patent"`. |
| `documentType` | string | `"Granted patent"` or `"Published application"` — on every row, so you always know which you are looking at. |
| `patentNumber` | string | The document's USPTO number: the granted patent number when `documentType` is `"Granted patent"`, or the pre-grant publication number (an 11-digit number such as `20230123456`) when it is `"Published application"`. |
| `applicationNumber` | string | Application number. |
| `title` | string | Patent title. |
| `abstract` | string | Full abstract text. Present on every patent row when `includeAbstracts` is turned on; omitted when it is off. |
| `assignee` | string | Owner / assignee (organization or person). |
| `inventors` | string\[] | Every inventor named on the patent whenever the full list was retrieved — that is, on every inventor-name search, and on any run with `includeAllInventors` or `includeAbstracts` turned on. On other runs it holds the first-named inventor, followed by `"et al."` when the patent has more. |
| `publicationDate` | string | The date USPTO published this document (YYYY-MM-DD). On every row, and the date the `dateFrom` / `dateTo` window filters on. |
| `grantDate` | string | Grant date (YYYY-MM-DD). **Present only on granted patents** — a published application has not been granted, so the field is left out rather than filled with its publication date. |
| `filingDate` | string | Filing date (YYYY-MM-DD). |
| `cpcClasses` | string\[] | CPC classification codes. |
| `patentType` | string | The document's patent family: `"Utility (granted)"`, `"Utility (published application)"`, `"Design"`, or `"Plant"`. Design and plant rows carry the bare family name, so read `documentType` — present on every row — for the granted vs. published application answer. |
| `citedByCount` | integer | Number of forward citations, when available. |
| `url` | string | Ready-to-open Google Patents link. |

Sort or filter on `grantDate` and you get grants only, by definition. Use `publicationDate` when you want one complete date column across every row. Patent search results arrive newest publication first, so a capped run returns the recent end of the match set rather than a spread across it; widen `maxResults`, or set `dateFrom` and `dateTo`, to work back through older patents. Turn on `includeAbstracts` to add the `abstract` field to every patent row — it is left out by default because USPTO serves abstracts one record at a time. The full inventor list arrives the same way, which is why it is automatic on inventor-name searches and opt-in elsewhere.

#### Trademark record

```json
{
    "recordType": "trademark",
    "serialNumber": "97868352",
    "registrationNumber": "2345678",
    "markText": "BLUE BOTTLE",
    "owner": "Blue Bottle Coffee, LLC",
    "status": "Live",
    "statusCode": 700,
    "statusDescription": "REGISTERED",
    "filingDate": "2023-04-01",
    "registrationDate": "2024-02-06",
    "goodsAndServices": ["Coffee; coffee beverages", "Cafe and coffee shop services"],
    "internationalClass": ["030", "043"],
    "url": "https://tsdr.uspto.gov/#caseNumber=97868352&caseType=SERIAL_NO&searchType=statusSearch"
}
```

| Field | Type | Description |
|-------|------|-------------|
| `recordType` | string | Always `"trademark"`. |
| `serialNumber` | string | Application serial number. |
| `registrationNumber` | string | Registration number, when the mark is registered. |
| `markText` | string | Mark wording / literal element. |
| `owner` | string | Current owner name. |
| `status` | string | Federal-register status — `"Live"` or `"Dead"`. |
| `statusCode` | integer | USPTO's own status code, e.g. `700` registered, `606` abandoned, `710` cancelled. |
| `statusDescription` | string | What that code means in words, e.g. `"REGISTERED AND RENEWED"`, `"CANCELLED - SECTION 8"`. |
| `filingDate` | string | Application filing date (YYYY-MM-DD). |
| `registrationDate` | string | Registration date, when registered (YYYY-MM-DD). |
| `goodsAndServices` | string\[] | Goods and services descriptions by class. |
| `internationalClass` | string\[] | International class numbers. |
| `url` | string | Direct USPTO TSDR status link. |

Pending marks omit `registrationNumber` and `registrationDate`. `statusCode` and `statusDescription` are on every trademark row. Trademark search results arrive newest filing first, so a capped run returns the most recently filed marks of the match set; sort your rows on `filingDate` or `registrationDate` to work back through the older, registered ones.

### Tips for Best Results

- **Start small, then scale** — set `maxResults` to 10–50 on your first run to confirm the records match what you need, then raise the cap. Setting it to 0 pulls *everything*, which on a broad search can be hundreds of thousands of records — prefer a finite cap unless you truly want the full set.
- **Match CPC granularity to intent** — a subgroup like `H04L9/06` returns a tight, on-point set, while a class like `H04L` sweeps a whole technology area (often over a million patents). Pick the level that fits your study before raising the result cap.
- **A capped portfolio sweep is the newest slice, not a sample** — patents come back newest publication first, so `assignee: "Apple"` at `maxResults: 150` returns about a fortnight of grant Tuesdays out of a 43,000-patent portfolio, not a cross-section of it. The run tells you when this happens. To study a period rather than the present, set `dateFrom` and `dateTo` and let the cap fill that window; to study the whole portfolio, raise the cap.
- **Use number lookup for known records** — when you already have patent numbers or trademark serial/registration numbers, paste them into `patentNumbers` or `trademarkNumbers` rather than searching; it goes straight to the exact records and ignores the filters.
- **Set `patentStatus` to match the question you are asking** — counting issued grants or building a grant-date timeline? Choose `Granted patents only`, and the date window then means grant dates exactly. Watching what rivals are *about* to secure? Choose `Published applications only` and you see filings 18 months ahead of any grant. Leave it on both for the widest view of a technology.
- **Keep mark wording short** — for trademark searches, a concise term like "coffee" or a brand name matches the register far better than a long phrase.
- **Raise the cap before you call a trademark field open** — mark results come newest filing first, so a capped search on a common word like "pickleball" hands back the last few months of applications, most of which are still pending. Marks filed years ago are the registered ones that would actually block you, and they sit further down the match count. For a clearance read, either set `maxResults` to 0 on a narrow term or use a more specific mark term so the whole match set fits under your cap.
- **Screen on status codes, not just Live/Dead** — a mark reading `710 / CANCELLED - SECTION 8` lapsed on a missed maintenance filing and may be free to claim, while `700 / REGISTERED` is actively defended. Filter on `statusCode` to separate the two in seconds.
- **Turn abstracts on for keyword runs, off for bulk pulls** — a keyword search matches the whole patent document, so abstracts are what let you tell a real hit from a passing mention. For a broad portfolio sweep by owner or classification, leave them off and the run finishes far faster. The same trade applies to `includeAllInventors`: switch it on when you are mapping who works with whom, off when you just need volume.

### Pricing

**From $3.50 per 1,000 results** — that is the Gold-tier rate for trademark records; patent records are $4.00 per 1,000 at the same tier. Official USPTO data at a flat per-record rate, with no charge for compute or run time. Bronze, Silver, and Gold subscribers pay progressively less; the tables below show total cost at each discount tier.

Results are billed as two events — **patent records** and **trademark records** — so your invoice shows the split between them, and the discount tiers apply to both.

**Patent records** ($4.00 per 1,000 at the Gold tier):

| Results | No discount | Bronze | Silver | Gold |
|---------|-------------|--------|--------|------|
| 100 | $0.48 | $0.45 | $0.43 | $0.40 |
| 1,000 | $4.80 | $4.52 | $4.28 | $4.00 |
| 10,000 | $48.00 | $45.20 | $42.80 | $40.00 |
| 100,000 | $480.00 | $452.00 | $428.00 | $400.00 |

**Trademark records** ($3.50 per 1,000 at the Gold tier):

| Results | No discount | Bronze | Silver | Gold |
|---------|-------------|--------|--------|------|
| 100 | $0.42 | $0.40 | $0.38 | $0.35 |
| 1,000 | $4.20 | $3.95 | $3.75 | $3.50 |
| 10,000 | $42.00 | $39.50 | $37.50 | $35.00 |
| 100,000 | $420.00 | $395.00 | $375.00 | $350.00 |

**No compute or time-based charges — you pay per result, plus a fixed $0.005 start fee per run.**

### Integrations

Export data in JSON, CSV, Excel, XML, or RSS. Connect to 1,500+ apps via:

- **Zapier** / **Make** / **n8n** — Workflow automation
- **Google Sheets** — Direct spreadsheet export
- **Slack** / **Email** — Notifications on new results
- **Webhooks** — Trigger custom APIs on run completion
- **Apify API** — Full programmatic access

### Legal & Ethical Use

USPTO patent and trademark records are public US government data. This actor is designed for legitimate IP research, prior-art review, brand protection, and market analysis. Users are responsible for complying with applicable laws and the USPTO's terms of use, and for using the data responsibly. Do not use extracted data for spam, harassment, or any unlawful purpose.

# Actor input Schema

## `dataType` (type: `string`):

Choose whether to collect patents, trademarks, or both. Patents and trademarks are returned as separate record types in your results.

## `searchQuery` (type: `string`):

Words to search for anywhere in the full text of a patent document — title, abstract, claims and the detailed description (e.g. 'solar panel coating'). Because the whole document is searched, a match is often deep in the description rather than in the title, so turn on 'Include patent abstracts' to see why each result matched. Patent results come back newest first, so if you cap the results you get the most recently published patents rather than a spread across the whole match set. For trademarks, this matches the mark wording (e.g. 'Nike'), and marks come back newest first — so if you cap the results, you get the most recently filed marks rather than a spread across the whole register. Leave empty if you are looking up specific patent or trademark numbers instead.

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

Look up specific patents or published applications by number (e.g. '10123456' or 'US10123456B2' for a grant, '20230123456' for a published application). One per line. Overrides the keyword search when provided.

## `trademarkNumbers` (type: `array`):

Look up specific trademarks by serial number (e.g. '78787878') or registration number (e.g. '2345678'). One per line. Overrides the keyword search when provided.

## `inventor` (type: `string`):

Only return patents listing this inventor (e.g. 'Jane Smith'). Applies to patents only.

## `assignee` (type: `string`):

Only return patents owned by or assigned to this company or person (e.g. 'Apple Inc'). Applies to patents only.

## `cpcClass` (type: `string`):

Only return patents in this Cooperative Patent Classification code (e.g. 'H04L' for digital data transmission). Applies to patents only.

## `patentStatus` (type: `string`):

USPTO publishes most applications about 18 months after filing, long before (and sometimes instead of) a patent being granted. Choose whether you want granted patents, those pre-grant published applications, or both. Every patent record tells you which it is in its 'documentType' field, and only granted records carry a grant date.

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

Only include patent documents published on or after this date — that is the grant date for a granted patent, and the publication date for a published application. Format: YYYY-MM-DD (e.g. '2020-01-01'). Pair it with 'Patent status' set to 'Granted patents only' to get a clean grant-date window.

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

Only include patent documents published on or before this date — the grant date for a granted patent, the publication date for a published application. Format: YYYY-MM-DD (e.g. '2023-12-31').

## `includeAbstracts` (type: `boolean`):

Add the full abstract text to every patent record, so you can see what each invention actually covers. USPTO sends abstracts one patent at a time, so this adds about a second per patent — leave it off for the fastest runs and turn it on when you need to read or screen the results. Has no effect on trademarks.

## `includeAllInventors` (type: `boolean`):

List every inventor named on each patent, instead of just the first one plus an 'et al.' marker. USPTO sends the full list one patent at a time, so this adds about a second per patent. You do not need this when you search by inventor name — those runs always return the complete list, so the inventor you searched for is on every row.

## `maxResults` (type: `integer`):

Maximum number of records to return per search. Set to 0 to collect every match — but note that broad searches can have hundreds of thousands of results, so set a number to cap how many are returned. Tip: start with 10-50 to test, then increase. On patent searches the cap takes the most recently published patents, so a capped run on a large portfolio or a broad classification can be just the last few weeks of grants — set 'Date from' and 'Date to' to pull the period you actually want instead. On trademark searches the cap takes the most recently filed marks: recently filed marks are usually still pending, so for a clearance check on a common word raise the cap or use a narrower mark term to reach the older, registered ones.

## Actor input object example

```json
{
  "dataType": "patents",
  "searchQuery": "machine learning",
  "patentNumbers": [],
  "trademarkNumbers": [],
  "patentStatus": "all",
  "includeAbstracts": false,
  "includeAllInventors": false,
  "maxResults": 100
}
```

# Actor output Schema

## `patents` (type: `string`):

Granted patents and pre-grant published applications, each labelled with its document type, plus titles, inventors, owners, publication and grant dates, classifications, and the full abstract text when you turn abstracts on. Search results come back newest publication first, so a capped search returns the recent end of the match set rather than a spread across it.

## `trademarks` (type: `string`):

Trademark records with mark wording, owner, Live/Dead status, USPTO status code and description, filing and registration dates. Search results are ordered newest filing first.

# 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 = {
    "dataType": "patents",
    "searchQuery": "machine learning",
    "patentNumbers": [],
    "trademarkNumbers": [],
    "patentStatus": "all",
    "includeAbstracts": false,
    "includeAllInventors": false,
    "maxResults": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("solidcode/uspto-patent-trademark-scraper").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 = {
    "dataType": "patents",
    "searchQuery": "machine learning",
    "patentNumbers": [],
    "trademarkNumbers": [],
    "patentStatus": "all",
    "includeAbstracts": False,
    "includeAllInventors": False,
    "maxResults": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("solidcode/uspto-patent-trademark-scraper").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 '{
  "dataType": "patents",
  "searchQuery": "machine learning",
  "patentNumbers": [],
  "trademarkNumbers": [],
  "patentStatus": "all",
  "includeAbstracts": false,
  "includeAllInventors": false,
  "maxResults": 100
}' |
apify call solidcode/uspto-patent-trademark-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,solidcode/uspto-patent-trademark-scraper"
        }
    }
}

```

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/08JYjaaZ0x3Cjl4xV/builds/YWKoX0MSFBhaYSBMp/openapi.json
