uspto.yaml 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. openapi: 3.0.1
  2. servers:
  3. - url: '{scheme}://developer.uspto.gov/ds-api'
  4. variables:
  5. scheme:
  6. description: 'The Data Set API is accessible via https and http'
  7. enum:
  8. - 'https'
  9. - 'http'
  10. default: 'https'
  11. info:
  12. description: >-
  13. The Data Set API (DSAPI) allows the public users to discover and search
  14. USPTO exported data sets. This is a generic API that allows USPTO users to
  15. make any CSV based data files searchable through API. With the help of GET
  16. call, it returns the list of data fields that are searchable. With the help
  17. of POST call, data can be fetched based on the filters on the field names.
  18. Please note that POST call is used to search the actual data. The reason for
  19. the POST call is that it allows users to specify any complex search criteria
  20. without worry about the GET size limitations as well as encoding of the
  21. input parameters.
  22. version: 1.0.0
  23. title: USPTO Data Set API
  24. contact:
  25. name: Open Data Portal
  26. url: 'https://developer.uspto.gov'
  27. email: developer@uspto.gov
  28. tags:
  29. - name: metadata
  30. description: Find out about the data sets
  31. - name: search
  32. description: Search a data set
  33. paths:
  34. /:
  35. get:
  36. tags:
  37. - metadata
  38. operationId: list-data-sets
  39. summary: List available data sets
  40. responses:
  41. '200':
  42. description: Returns a list of data sets
  43. content:
  44. application/json:
  45. schema:
  46. $ref: '#/components/schemas/dataSetList'
  47. example:
  48. {
  49. "total": 2,
  50. "apis": [
  51. {
  52. "apiKey": "oa_citations",
  53. "apiVersionNumber": "v1",
  54. "apiUrl": "https://developer.uspto.gov/ds-api/oa_citations/v1/fields",
  55. "apiDocumentationUrl": "https://developer.uspto.gov/ds-api-docs/index.html?url=https://developer.uspto.gov/ds-api/swagger/docs/oa_citations.json"
  56. },
  57. {
  58. "apiKey": "cancer_moonshot",
  59. "apiVersionNumber": "v1",
  60. "apiUrl": "https://developer.uspto.gov/ds-api/cancer_moonshot/v1/fields",
  61. "apiDocumentationUrl": "https://developer.uspto.gov/ds-api-docs/index.html?url=https://developer.uspto.gov/ds-api/swagger/docs/cancer_moonshot.json"
  62. }
  63. ]
  64. }
  65. /{dataset}/{version}/fields:
  66. get:
  67. tags:
  68. - metadata
  69. summary: >-
  70. Provides the general information about the API and the list of fields
  71. that can be used to query the dataset.
  72. description: >-
  73. This GET API returns the list of all the searchable field names that are
  74. in the oa_citations. Please see the 'fields' attribute which returns an
  75. array of field names. Each field or a combination of fields can be
  76. searched using the syntax options shown below.
  77. operationId: list-searchable-fields
  78. parameters:
  79. - name: dataset
  80. in: path
  81. description: 'Name of the dataset.'
  82. required: true
  83. example: "oa_citations"
  84. schema:
  85. type: string
  86. - name: version
  87. in: path
  88. description: Version of the dataset.
  89. required: true
  90. example: "v1"
  91. schema:
  92. type: string
  93. responses:
  94. '200':
  95. description: >-
  96. The dataset API for the given version is found and it is accessible
  97. to consume.
  98. content:
  99. application/json:
  100. schema:
  101. type: string
  102. '404':
  103. description: >-
  104. The combination of dataset name and version is not found in the
  105. system or it is not published yet to be consumed by public.
  106. content:
  107. application/json:
  108. schema:
  109. type: string
  110. /{dataset}/{version}/records:
  111. post:
  112. tags:
  113. - search
  114. summary: >-
  115. Provides search capability for the data set with the given search
  116. criteria.
  117. description: >-
  118. This API is based on Solr/Lucense Search. The data is indexed using
  119. SOLR. This GET API returns the list of all the searchable field names
  120. that are in the Solr Index. Please see the 'fields' attribute which
  121. returns an array of field names. Each field or a combination of fields
  122. can be searched using the Solr/Lucene Syntax. Please refer
  123. https://lucene.apache.org/core/3_6_2/queryparsersyntax.html#Overview for
  124. the query syntax. List of field names that are searchable can be
  125. determined using above GET api.
  126. operationId: perform-search
  127. parameters:
  128. - name: version
  129. in: path
  130. description: Version of the dataset.
  131. required: true
  132. schema:
  133. type: string
  134. default: v1
  135. - name: dataset
  136. in: path
  137. description: 'Name of the dataset. In this case, the default value is oa_citations'
  138. required: true
  139. schema:
  140. type: string
  141. default: oa_citations
  142. responses:
  143. '200':
  144. description: successful operation
  145. content:
  146. application/json:
  147. schema:
  148. type: array
  149. items:
  150. type: object
  151. additionalProperties:
  152. type: object
  153. '404':
  154. description: No matching record found for the given criteria.
  155. requestBody:
  156. content:
  157. application/x-www-form-urlencoded:
  158. schema:
  159. type: object
  160. properties:
  161. criteria:
  162. description: >-
  163. Uses Lucene Query Syntax in the format of
  164. propertyName:value, propertyName:[num1 TO num2] and date
  165. range format: propertyName:[yyyyMMdd TO yyyyMMdd]. In the
  166. response please see the 'docs' element which has the list of
  167. record objects. Each record structure would consist of all
  168. the fields and their corresponding values.
  169. type: string
  170. default: '*:*'
  171. start:
  172. description: Starting record number. Default value is 0.
  173. type: integer
  174. default: 0
  175. rows:
  176. description: >-
  177. Specify number of rows to be returned. If you run the search
  178. with default values, in the response you will see 'numFound'
  179. attribute which will tell the number of records available in
  180. the dataset.
  181. type: integer
  182. default: 100
  183. required:
  184. - criteria
  185. components:
  186. schemas:
  187. dataSetList:
  188. type: object
  189. properties:
  190. total:
  191. type: integer
  192. apis:
  193. type: array
  194. items:
  195. type: object
  196. properties:
  197. apiKey:
  198. type: string
  199. description: To be used as a dataset parameter value
  200. apiVersionNumber:
  201. type: string
  202. description: To be used as a version parameter value
  203. apiUrl:
  204. type: string
  205. format: uriref
  206. description: "The URL describing the dataset's fields"
  207. apiDocumentationUrl:
  208. type: string
  209. format: uriref
  210. description: A URL to the API console for each API