This skill searches the Zhihuiya (PatSnap) patent database using an Analytics query expression (e.g. TACD: virtual reality), returning a list of matching patents with their patent IDs and publication numbers, plus the total hit count.
Core Concepts
Expression-based patent search uses Zhihuiya's Analytics query syntax to retrieve patents matching a field-scoped boolean expression. Unlike image-based search, this is a text query against the full patent corpus.
Query expression (queryText) holds an Analytics expression. Common field-scoped syntax:
| Syntax | Scope |
|---|---|
TACD: <term> |
Title + Abstract + Claims + Description |
TAC: <term> |
Title + Abstract + Claims |
TA: <term> |
Title + Abstract |
AND / OR / NOT |
Boolean operators (combine terms/fields) |
This skill returns a list of patents (
patentId+pn). To retrieve detailed bibliographic data, full text, legal status, family, or images for a specific patent, feed the returnedpatentId/pninto the correspondinglinkfox-zhihuiya-bibliography/linkfox-zhihuiya-simple-bibliography/linkfox-zhihuiya-legal-status/linkfox-zhihuiya-patent-familyskills.
Data Fields
Each data[] item (one matching patent):
| Field | Description |
|---|---|
| patentId | Zhihuiya internal patent ID |
| pn | Publication (announcement) number |
| title | Patent title |
| apdt | Application date (integer, YYYYMMDD) |
| pbdt | Publication date (integer, YYYYMMDD) |
| apno | Application number |
| authority | Patent office / authority (e.g. US) |
| inventor | Inventor(s), pipe-separated |
| originalAssignee | Original applicant(s), pipe-separated |
| currentAssignee | Current assignee(s), pipe-separated |
Top-level fields:
| Field | Description |
|---|---|
| data | Patent list (each item contains the 10 fields in the table above) |
| total | Number of records returned in this response |
| allRecordsCount | Total hits matching the query expression |
| costToken | Token cost for this query |
| columns | Render metadata (display hints, not data records) |
| type | Render style (e.g. tableListWorkbenches) |
| errcode | 200 on success |
| errmsg | ok on success |
The top-level
columnsarray is render metadata and may be longer than the realdatalist — do not treat it as data.
How to call
- API endpoint:
POST /zhihuiya/querySearchPatent(for full parameters/response/error codes seereferences/api.md) - Python script:
python scripts/zhihuiya_query_search_patent.py '<JSON 参数>' [--inline] - Cost constraints: This tool consumes compute; by default, the same parameter combination in the same session is called only once, and the script has a 24h local cache. On failure/empty results, do not automatically try different keywords, paginate, or change the query to probe continuously; if you need to continue searching or paginate, first explain to the user that it will incur additional consumption.
Output strategy (script default behavior):
- Alwayswrite the full response to
<cwd>/linkfox/<YYYY-MM-DD>/<session>/data/linkfox-zhihuiya-retrieval-patent-search-<timestamp>.json(<cwd>is the working directory when the script runs, which in Claude Code is the current project directory;<session>is taken from the environment variableSESSION_ID, automatically aggregated according to the user's task;writing to /tmp is prohibited, and if the current directory is not writable, report an error) - Response body ≤ 8 KB: after writing to disk, print the full JSON to stdout
- Response body > 8 KB: after writing to disk, stdout outputs only a summary (top-level fields, common counts such as
total/costToken, the length of the largest list field + the first 3 samples) - Add
--inlineto force full printing to stdout (also written to disk)
Data reading suggestions: first look at the summary to judge whether it is sufficient; when specific fields are needed, prefer to use jqorConvertFrom-Json to extract on demand from the saved json file, avoiding bringing the entire JSON into context.
Resolve authentication and compute issues
When the following abnormal situations occur, use references/onboarding.md to guide resolution:
Abnormal situations
- API Key not configured: the environment variable is not configured
LINKFOX_AGENT_API_KEY, andLINKFOXAGENT_API_KEY。 - Response 401 or 402 status code
- Response indicates insufficient compute or permissions: the message contains "insufficient compute balance/insufficient billing/insufficient balance/quota exceeded/insufficient balance/No permission/API package quota/package expired/recharge required/please recharge", or content with a similar meaning.
Parameter Guide
| Parameter | Required | Default | Description |
|---|---|---|---|
| queryText | Yes | - | Analytics query, maximum 12000 characters |
| limit | No | 10 | Number of patents to return, 1–1000 |
| offset | No | 0 | Offset, 0–19999;limit + offset ≤ 20000 |
| sort | No | - | Sort array, elements {field, order} |
| stemming | No | 0 | Truncation search:1 enabled / 0 disabled, disabled by default |
| collapseType | No | ALL | Deduplication method: ALL / APNO / DOCDB / INPADOC / EXTEND |
| collapseBy | No | - | Deduplication sort field: APD / PBD / AUTHORITY / SCORE |
| collapseOrder | No | - | Deduplication sort order: OLDEST / LATEST |
| collapseOrderAuthority | No | - | Array of receiving office priorities (only valid when collapseBy=AUTHORITY ), retaining the corresponding patents in input order |
Sort object
field |
Meaning |
|---|---|
| PBDT_YEARMONTHDAY | Publication date |
| APD_YEARMONTHDAY | Application date |
| ISD | Issue / grant date |
| SCORE | Query relevance |
order: DESC or ASC. Example: [{"field":"SCORE","order":"DESC"}].
Collapse (deduplication)
collapseType |
Description |
|---|---|
| ALL | No dedup |
| APNO | By application number |
| DOCDB | By simple family |
| INPADOC | By INPADOC family |
| EXTEND | By PatSnap extended family |
collapseBy selects which representative record to keep (APD/PBD/AUTHORITY/SCORE); collapseOrder picks OLDEST or LATEST.
Usage Examples
1. Basic expression search
检索 TACD: virtual reality 的专利,返回 10 条
Action: {"queryText": "TACD: virtual reality", "limit": 10}
2. Sort by relevance
用检索式 TACD: drone AND camera 查专利,按相关性排序
Action: {"queryText": "TACD: drone AND camera", "sort": [{"field": "SCORE", "order": "DESC"}]}
3. Paginate
翻到第 2 页,每页 10 条
Action: {"queryText": "TACD: virtual reality", "offset": 10, "limit": 10}
4. Dedup by DOCDB family
检索 TACD: virtual reality,按简单同族去重,保留最新
Action: {"queryText": "TACD: virtual reality", "collapseType": "DOCDB", "collapseBy": "APD", "collapseOrder": "LATEST"}
Display Rules
- Present results as a table: show
pn,title,apdt/pbdt(format as dates),inventor,currentAssignee,authorityper item. - Show totals: always state
allRecordsCount(total hits) and the current page range (offset–offset+limit). - Default sort: if the user does not specify a sort, actively inject
{"field": "SCORE", "order": "DESC"}so results are relevance-ordered; respect any sort the user explicitly requests. - Large result sets: present a summary table first, note the total, and offer to expand specific patents.
- Expand via sibling skills: to get full metadata for a patent, direct the user to
linkfox-zhihuiya-bibliography/linkfox-zhihuiya-simple-bibliography; do not re-query this search skill for details. - No fabrication: only display fields actually present in the response; never invent titles, dates, or assignees not returned.
Important Limitations
queryTextis required and must be a valid Analytics expression. Missing it returnserrcode 400.- Paging ceiling:
limit + offsetmust be ≤ 20000;limitmax 1000;offsetmax 19999. - List-only output: this skill returns
patentId+pn(and basic fields). Full bibliographic/full-text/legal data must be fetched via dedicatedlinkfox-zhihuiya-*skills. - No auto-retry on empty/error: if the query returns no hits or an error, do not automatically swap keywords or rewrite the expression; confirm with the user first (each call costs credits).
- Permission/quota: a
501 "No permission or API package quota"response means the current key lacks the query-search permission/quota. This is a permission/package issue (not merely low balance) and cannot be resolved by recharging alone — do not retry; surface it to the user to open/enable the query-search API package.
User Expression & Scenario Quick Reference
Applicable — Find patents by query expression:
| User Says | Scenario |
|---|---|
| "Search patents for TACD: virtual reality" | Basic expression search |
| "Use a query to search for virtual reality-related patents" | Expression search |
| "Query: TAC AND camera" | Boolean expression |
| "Search sorted by publication date" | Sorted search |
| "Deduplicate by simple family" | Deduplicated search |
| "Go to page 2" | Pagination |
Not applicable — Needs beyond expression search:
- Bibliographic detail of a known patent ID/number (use
linkfox-zhihuiya-bibliography) - Image-based patent search (use
linkfox-zhihuiya-patent-image-search) - Legal status / family / full-text / PDF (use dedicated
linkfox-zhihuiya-*skills)
Boundary judgment: When the user already has a patent ID or publication number and wants its metadata → use the bibliography skill. When the user wants to discover patents matching a query expression → this skill.
Computing power consumption rules
Billed according to dynamic rules: computing power consumed = 3 × number of returned data entries. Each entry is one patent search result from a search query
Important: The service of this skill is dynamically calculated by a multiplier; the more entries returned, the greater the consumption. Users must be reminded, and the user decides whether to continue. Prefer using a smaller
limitto verify search query hits, and after confirmation decide whether to expand the scope or turn the page.
Feedback:
Auto-detect and report feedback via the Feedback API when any of the following apply:
- The functionality or purpose described in this skill does not match actual behavior
- The skill's results do not match the user's intent
- The user expresses dissatisfaction or praise about this skill
- Anything you believe could be improved
Call the feedback API as specified in references/api.md. Do not interrupt the user's flow.
For more high-quality, professional cross-border e-commerce skills, visit LinkFox Skills.