---
title: "P055 Create export task by query"
method: POST
path: "/patent-search/export"
tags: ["Patent Monitor and Export"]
---

# P055 Create export task by query

`POST /patent-search/export`

## Request

- Base URL: `https://connect.patsnap.com`
- URL: `https://connect.patsnap.com/patent-search/export`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/patsnap/apis/patsnap-open-platform-api/docs/patent-search/export/post.ts> (a function with typed inputs; its response is checked against the schema)

Allows to search our global patent repository using the standard PatSnap search query and retrieve the resulting data in bulk. Query syntax can be as simple as a list of keywords or as complex as a 12,000 character boolean query. To find more information about PatSnap search syntax, refer to https://analytics.patsnap.com/search_helper. Allows to select what patent fields should be returned in response to the query and, thus, allows control over the size of the response payload to help optimize performance, fields that are allowed to be exported, the fields and field levels that are allowed to be exported (different levels of fields have different calling fees). please link the <a href="/tutorials/exportFields" target="_blank">export instructions</a>.

## Request body

- P055PatentSearchExportRequest
  - `query_text` string, required: Patent search query, detailed syntax reference can be found at https://analytics.patsnap.com/search_helper
  - `fields` string, required: Fields that are allowed to be exported. See <a href="/devportal/data-reference/export-fields" target="_blank">export instructions</a> for details. Separate multiple export fields in English,.
  - `export_type` string, required: File formats that are allowed to be exported. You can choose json, csv, xls, pdf, full_text, xml. Only 1 can be selected.<p>For full_text export type, only the following four fields PN, ABST, CLMS, DESC are supported. The field DESC is only supported by the full_text export type. The field CLMS is only supported by the full_text/pdf export type. Result of the full_text export type is a ZIP file including some xml files named by PN.</p>
  - `rows` integer, required: rows >= 1 , Single maximum export (csv/xls/json/xml: 100k , pdf/full_text: 1k)
  - `apdt_from` string: Application date start. Format: 'yyyyMMdd', or * means time is unlimited
  - `apdt_to` string: Application date end. Format: 'yyyyMMdd', or * means time is unlimited
  - `pbdt_from` string: Publication date start. Format: 'yyyyMMdd', or * means time is unlimited
  - `pbdt_to` string: Publication date end. Format: 'yyyyMMdd', or * means time is unlimited
  - `collapse_type` string: Sets criterias for choosing representative documents that matching query conditions along with collapse_by and collapse_order. The valid value should be one of ALL indicating results will not be collapsed, APNO indicating only one document will be returned for each application, DOCDB indicating only one representative document will be returned for each simple family, INPADOC indicating only one representative document will be returned for each INPADOC family and EXTEND indicating only one representative document will be returned for each extended family. If provided collapse_type is null, the default value ALL will be used.
  - `collapse_by` string: Sets criterias for choosing representative documents that matching query conditions along with collapse_type and collapse_order. Controls the sort field when collapsing documents. The valid value should be one of APD indicating the application date, PBD indicating the publication date, AUTHORITY indicating the jurisdiction, and SCORE indicating the relevance between the query conditions and documents. If the collapse_type is ALL or APNO, the value of collapse_by will be ignored.
  - `collapse_order` string: Sets criterias for choosing representative documents that matching query conditions along with collapse_type and collapse_by. Controls the sort order when collapsing documents. If the collapse_type is APNO, or the collapse_by is APD or PBD, the valid value should be one of OLDEST and LATEST. Otherwise, the value of collapse_order will be ignored
  - `lang` string: Select the language , the default language is en, you can choose cn, en, jp, de, fr, kr.
  - `trans_lang` string: Select the translation language , the default language is en, you can choose cn, en, jp.
  - `offset` integer: 0 <= rows + offset <= 100000, default is 0 If you want to get patents that are ranked lower than 100, you can set offset=100
  - `stemming` integer: <p>Whether to turn on the stemming function, 1: turn on; 0: turn off. Off by default</p><p>Note: </p><p>Stemming ON will search for the original word and expand the search to consider singular, plural, and tense variations e.g. a search for "come" will expand to "comes", "came", "coming" and so on.</p><p>Stemming OFF will only search for exact matches of the keywords entered.</p><p>The use of wildcards in keywords within a search query will impact the effect of stemming.</p><p>Stemming ON only supports English words. Stemming does not apply to Assignees, Inventors, or any other person-related fields.</p>

## Response `200`

Successful p055 create export task by query response.

- P055PatentSearchExportResponse
  - `data` P055PatentSearchExportExportTaskResponse
    - `count` integer: Export number of patents
    - `task_id` string: Task ID is valid for 24 hours
  - `status` boolean, required: Status
  - `error_msg` string: Error Message
  - `error_code` integer, required: Error Code

## Other responses

- `201`: Created.
- `401`: Unauthorized.
- `403`: Forbidden.
- `404`: Not Found.

---

[API](https://skmtc.dev/patsnap/apis/patsnap-open-platform-api.md) - [All operations](https://skmtc.dev/patsnap/apis/patsnap-open-platform-api/llms.txt) - [OpenAPI document](https://skmtc.dev/patsnap/apis/patsnap-open-platform-api/revisions/c2264a0de595?raw)
