Skip to content

About

USPTO trademark scraper for Node.js: query U.S. federal marks by wording, owner or serial number and get status, classes, owner and TSDR links as JSON for docket tools, alerts and backends. JavaScript example for the Devil Scrapes Apify Actor.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

1 Commit

Folders and files

Repository files navigation

USPTO Trademark Scraper β€” JavaScript example

USPTO Trademark Scraper for JavaScript and Node.js: U.S. trademark status for your app

Run on Apify JavaScript MIT license CI

Use this repository to query U.S. federal trademarks from Node.js through the USPTO Trademark Scraper. It is one ES module around the official apify-client: send a brand name like PATAGONIA, a batch of serial numbers or a batch of registration numbers, and receive JSON objects with status, classes, goods, owner, attorney and a TSDR link for each mark. Apify does the fetching and the pacing, so your API route, queue worker or serverless function does not need a USPTO key or its own rate limiter. Everything ends up in results.json and results.csv unless you import the call and keep the objects.

Actor: USPTO Trademark Scraper Β· Publisher: Devil Scrapes Β· Also in Python: uspto-trademark-scraper-python

πŸ”₯ What you get

  • Three ways in, one row format: a phrase searched against mark wording and owner names, a list of 8-digit application serial numbers, and a list of registration numbers can all go into the same run.
  • Forgiving number input: anything that is not a digit is stripped, so 88/148,890 and 88148890 are the same request.
  • The prosecution essentials per mark: current status text and its date, filing, publication and registration dates, register, Nice classes, goods and services wording, first-use dates, filing basis, owner, owner address and attorney of record.
  • Readable codes: filing basis comes back as words like USE_IN_COMMERCE, INTENT_TO_USE or MADRID_PROTOCOL instead of 1(a) and 66(a), and classes are zero-padded strings such as 025.
  • Live/dead filter: statusFilter keeps only marks whose status wording does or does not mention abandonment, cancellation or expiry.
  • A deep link for every row: tsdr_url opens the mark's official case-status record, which is the page an attorney will ask for.
  • Polite by default: number lookups are spaced about a second apart and throttling responses are retried with back-off, so long dockets finish without manual babysitting.

🎯 Use cases

Power a trademark docket in a legal-tech product

Store each client's serial numbers, run them nightly from a job queue and upsert the rows by serial_number. Your matter pages then show current status, register and registration date pulled from USPTO data rather than typed in by staff.

Send alerts when a mark changes status

Diff today's status per serial against yesterday's and post the differences to Slack, Teams or a webhook. A move to an abandonment or cancellation status is the kind of event an IP team wants to hear about the same day.

Add a name check to a signup or naming tool

When a user proposes a brand name, call the Actor with that phrase and a small maxResults, then show which live U.S. marks already use the wording and in which classes. Label it as a preliminary check and link each row's tsdr_url for the official record.

Enrich a CRM with brand ownership

Search the company names already in your CRM and attach the number of live marks and the classes they cover. Sales and partnership teams get a quick signal of how brand-active an account is.

⚑ Quick start

You need an Apify account and an API token from Console β†’ Settings β†’ Integrations. Apify's free plan includes monthly usage credit; this Actor's event prices are listed under Pricing below.

git clone https://github.com/devilscrapes/uspto-trademark-scraper-javascript.git
cd uspto-trademark-scraper-javascript
npm install
export APIFY_TOKEN=your_token_here
node index.js                       # uses input.json
node index.js my-input.json --out data --max-charge 2

The script starts the USPTO Trademark Scraper, waits for it to finish, prints a link to the run in Apify Console and saves every result to results.json and results.csv. It exits with code 1 and the run's status message if the run fails.

🧩 The core call

Underneath the CLI wrapper, the whole job is a client, one call() that waits for the run and one listItems() that reads the result rows.

import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });
const run = await client.actor('DevilScrapes/uspto-trademark-scraper').call({"query": "PATAGONIA", "statusFilter": "any", "maxResults": 10, "proxyConfiguration": {"useApifyProxy": false}});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);

πŸ“₯ Input

index.js sends input.json as is. The sample looks up PATAGONIA and stops at ten hits in any status, enough to see real rows for a few cents. Because the phrase is compared with both mark wording and owner names, expect an occasional row from another company and filter it in code. Number lists are always processed in full and ignore maxResults.

{
  "query": "PATAGONIA",
  "statusFilter": "any",
  "maxResults": 10,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
Field Type Required Default Allowed values
query string no "BLINKING NAILS" β€”
serialNumbers array no ["88148890"] β€”
registrationNumbers array no ["5912174"] β€”
statusFilter string no "any" any, live, dead
maxResults integer no 20 β€”
proxyConfiguration object no {"useApifyProxy": false} β€”

πŸ“€ Output

Every object is one trademark application. Dates are ISO strings, international_classes and filing_basis are arrays, and anything the source record leaves blank is null. Treat serial_number as the primary key: the same mark can show up twice when it is reached by number and by phrase in one run.

Field Type Always present
serial_number string yes
registration_number string or null no
mark_text string yes
mark_type string or null no
standard_character_claim boolean or null no
description_of_mark string or null no
status string or null no
status_date string or null no
filing_date string or null no
registration_date string or null no
publication_date string or null no
register string or null no
international_classes array no
goods_services string or null no
first_use_date string or null no
use_in_commerce_date string or null no
filing_basis array no
owner_name string or null no
owner_address string or null no
attorney_name string or null no
tsdr_url string yes
scraped_at string yes

πŸ’° Pricing

Event Price (USD)
Actor start $0.2
Result emitted $0.005

Prices as configured on 2026-08-20. The Actor page always shows the current price. Runs are billed to the Apify account that owns the token. Use --max-charge to cap what a single run can cost.

πŸ› οΈ Working with the data in JavaScript

This watcher is the core of a status-change notifier. It keeps the last known status per serial in status-snapshot.json, reports new marks and changed statuses with their TSDR link, and saves the new snapshot. Node.js built-ins only.

import { readFile, writeFile } from 'node:fs/promises';

const rows = JSON.parse(await readFile('results.json', 'utf8'));
const snapshotPath = 'status-snapshot.json';
const previous = JSON.parse(await readFile(snapshotPath, 'utf8').catch(() => '{}'));

const current = {};
const events = [];
for (const row of rows) {
    const status = row.status ?? 'unknown';
    current[row.serial_number] = status;
    const before = previous[row.serial_number];
    if (before === status) continue;
    events.push({
        serial: row.serial_number,
        mark: row.mark_text,
        owner: row.owner_name,
        change: before === undefined ? `new: ${status}` : `${before} -> ${status}`,
        link: row.tsdr_url,
    });
}

await writeFile(snapshotPath, JSON.stringify({ ...previous, ...current }, null, 2));
if (events.length) console.table(events);
else console.log(`No changes across ${rows.length} marks`);

❓ FAQ

Will a long serial list fit inside a Lambda or Vercel time limit?

Phrase searches with a small maxResults usually return fast. Long serial lists take about a second per number because of pacing, so for those use start() and an Apify webhook that calls your endpoint when the run is done.

Does the run fail if one serial number is wrong?

No. A number USPTO does not know is skipped with a log line and the rest continue. Only a run that yields no rows at all ends as failed, which your code can detect from the run status.

Is there TypeScript support?

apify-client ships its own typings. Declare an interface for the row fields you use, such as serial_number, status and tsdr_url, and cast the dataset items to it.

Can I rely on this for legal decisions?

Use it for monitoring and research. The rows mirror what USPTO publishes, but a clearance opinion or an opposition strategy still belongs with a registered trademark attorney who reviews the official file.

🧯 Troubleshooting

  • Set APIFY_TOKEN first: export the token in the same shell, or put it in a local .env file your shell loads. Never commit it.
  • Run finished with FAILED or ABORTED: open the printed Console link; the run log says why. Input validation errors name the field.
  • Fewer rows than expected: a --max-charge cap also limits how many results can be charged. Raise the cap or lower the limits in your input.
  • Something looks wrong in the data: open an issue on the Actor page so the maintainers see it.

πŸ”— More from Devil Scrapes

Related Actors:


MIT licensed example code. The Actor itself runs on Apify and is maintained by Devil Scrapes. Not affiliated with the United States Patent and Trademark Office (USPTO).

About

USPTO trademark scraper for Node.js: query U.S. federal marks by wording, owner or serial number and get status, classes, owner and TSDR links as JSON for docket tools, alerts and backends. JavaScript example for the Devil Scrapes Apify Actor.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages