[P075]Search the patent nested version with a search formula

post
https://connect.patsnap.com/search/patent/nested-search-patent

Search PatSnap's global patent database using standard text queries. Read about the search syntax supported in PatSnap here - https://analytics.patsnap.com/search_helper. This includes patent count, patent number, and patent ID.

The limit for one-dimensional analysis of field type does not exceed 500

The limit for two-dimensional analysis of field type does not exceed 100

It supports up to two-dimensional analysis

aggregate does not support nesting

The number of Facets at the same level shall not exceed 5

Request Parameters

List of parameters supported by this API endpoint

Name Type Example Description
facet
arrayPlease check the form: Facet

Nested statistical configuration

Supports four types:

field - Field statistics

range - Range statistics

query - Query statistics

aggregate - Aggregate statistics

1. field (Field statistics)

{ "type": "field", "tag": "patent_type", "field": "PATENT_TYPE", "limit": 10, "mincount": 1, "offset": 0, "num_buckets": true}

2. range (Range statistics)

{ "type": "range", "tag": "apd_year", "field": "APD_YEAR", "start": 2000, "end": 2018, "gap": 1}

3. query (Query statistics)

{ "type": "query", "tag": "patent_type", "query": "PV:[0 TO 100000]"}

4. aggregate (Aggregate statistics)

{ "type": "aggregate", "tag": "avg_pv", "expr": "avg(PV)" }

limit
integer<int32>10
Return the number of documents.
offset
integer<int32>-
offset
query_text
Required
stringTTL:car
Search expression text. Refer to : https://analytics.patsnap.com/search_helper
sort
array[ { "field": "SCORE", "order": "DESC" } ]
sort
stemming
boolean-
Whether to enable word segmentation, after enabling it, support the same stem query (for example: "cars" can be searched by "car"). By default, it is not enabled. Currently, only fields related to TTL/ABST/CLMS/DESC are supported
end
integer<int32>2018
Range end value (not included) (when type is range)
expr
stringavg(PV)
aggregate expressions support nesting. aggregate function currently supports five types: avg/min/max/sum/unique (when type is query)
facet
array[ { "end": 2018, "gap": 1, "tag": "apd_year", "type": "range", "field": "APD_YEAR", "start": 2000 } ]
Nested statistical configuration
field
stringANCS
The name of the field to be counted (when type is field and range). Refer to : https://analytics.patsnap.com/search_helper
gap
integer<int32>1
Range step value, default is 1 (when type is range)
limit
integer<int32>10
How many statistical results need to be returned (when type is field)
mincount
integer<int32>1
The minimum value that can be returned for statistics is set to 1 by default (when type is field)
num_buckets
boolean-
Count number of buckets for the facet, which defaults to false. The returned format is tag_num_buckets (when type is field)
offset
integer<int32>10
The offset of the statistics, used for pagination, is set to 0 by default (when type is field)
query
stringPV:[0 TO 100000]
Queries that need to be statistically analyzed (when type is query)
start
integer<int32>2000
Range starting value (when type is range)
tag
Required
stringancs
The current statistics of custom aliases (alias names cannot be name or count)
type
Required
stringfield

Retrieval statistical type:

field - Statistics of field values, equivalent to the traditional facet field

range - range statistics for numerical fields will be automatically completed, equivalent to the traditional range facet

query - Statistics on query, equivalent to the traditional facet query

aggregate - Perform statistics such as min/max/sum on fields

field
stringSCORE
sort field
order
stringDESC
sort order

Response Schema

Structure of the API response data

Field Name Type Example Description
data
object-
response data
facets
object{ "PUM_PROP_ID_CN": [ { "name": "af1d2b97-6078-514c-a2f1-9d930de64767", "count": 158 }, { "name": "6979882c-f05c-516e-9bab-723396999f87", "count": 80 } ], "PUM_PROP_ID_CN_num_buckets": 131 }
statistical result(Dynamic key, defined based on the tag in the input parameter)
num_found
integer<int32>1000
Total search result count
id_mapping
objectAnsEntity
When ANS is triggered, ANS information will be returned.
status
Required
booleanfalse
Status
error_msg
stringThe request parameter format is incorrect!
Error Message
error_code
Required
integer0
Error Code

Success Response Example

Example of a successful API response

JSON
{
  "data": {
    "facets": {
      "PUM_PROP_ID_CN": [
        {
          "name": "af1d2b97-6078-514c-a2f1-9d930de64767",
          "count": 158
        },
        {
          "name": "6979882c-f05c-516e-9bab-723396999f87",
          "count": 80
        }
      ],
      "PUM_PROP_ID_CN_num_buckets": 131
    },
    "num_found": 1000,
    "id_mapping": "AnsEntity"
  },
  "status": true,
  "error_code": 0
}

Error Codes

List of possible error codes returned by this endpoint

Business Errors

Error Code Description
68300004Invalid parameter!
68300005Search api failure!
68300006Analytic basic access error!
68300007Bad request!
68300008Service error, please try again later!
68300010The file does not comply with upload specifications!

Platform Errors

Error Code Description
67200000API call exceeds the total limit set by the platform!
67200001API call exceeds the total limit set by the platform!
67200002The current call rate is too fast, exceeding the current configuration limit QPS!
67200003The key and secret parameters for applying for the token are incorrect or the client has been disabled!
67200004The requested api does not have permission. Please contact our support personnel!
67200005Insufficient account balance/number of calls!
67200006The client has exceeded the activation validity period!
67200007The current call exceeds the configured usage limit of the day!
67200008Please check if the required apikey in the query parameter has been transmitted!
67200009The apikey does not match the passed bearerToken. Please check if a valid token is being used!
67200012The request is illegal!
67200100The current server status is busy, request response timeout!
67200101The API requested currently does not exist. Please check the request path!

HTTP Status Codes

Status Code Description
0Success
201Created
401Unauthorized
403Forbidden
404Not Found

Performance Metrics

Expected performance characteristics for this endpoint

Normal Response Time

5000 ms

Max Response Time

10000 ms