> ## Documentation Index
> Fetch the complete documentation index at: https://docs.scholarai.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Get relevant patents by searching 2-6 relevant keywords.



## OpenAPI

````yaml get /api/patents
openapi: 3.1.0
info:
  title: No title
  version: No version
servers:
  - url: https://api.scholarai.io
security:
  - ApiKeyAuth: []
tags:
  - name: Api
paths:
  /api/patents:
    get:
      tags:
        - Api
      summary: Get relevant patents by searching 2-6 relevant keywords.
      operationId: searchPatents
      parameters:
        - name: full_user_prompt
          in: query
          description: The entirety of the user request, directly quoted.
          required: true
          schema:
            type: string
        - name: keywords
          in: query
          description: >-
            Keywords of inquiry which should appear in article. Must be in
            English.
          required: true
          schema:
            type: string
        - name: sort
          in: query
          description: >-
            The sort order for results. Valid values are relevance,
            cited_by_count, publication_date. Defaults to relevance.
          required: false
          schema:
            type: string
        - name: query
          in: query
          description: >-
            The user query. If the user asks for a specific patent, you MUST hit
            the API using escaped quotation marks
          required: true
          schema:
            type: string
        - name: peer_reviewed_only
          in: query
          description: >-
            Whether to only return peer reviewed articles. Defaults to true,
            ChatGPT should cautiously suggest this value can be set to false
          required: false
          schema:
            type: string
        - name: start_year
          in: query
          description: >-
            The first year, inclusive, to include in the search range. Excluding
            this value will include all years.
          required: false
          schema:
            type: string
        - name: end_year
          in: query
          description: >-
            The last year, inclusive, to include in the search range. Excluding
            this value will include all years.
          required: false
          schema:
            type: string
        - name: offset
          in: query
          description: The offset of the first result to return. Defaults to 0.
          required: false
          schema:
            type: string
        - name: generative_mode
          in: query
          description: >-
            Boolean "true" or "false" to enable generative mode. If enabled,
            collate responses using markdown to render in-text citations to the
            source's url if available. Set this to true by default.
          required: false
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/searchAbstractsResponse'
components:
  schemas:
    searchAbstractsResponse:
      type: array
      items:
        $ref: '#/components/schemas/PaperMetadataResponse'
    PaperMetadataResponse:
      type: object
      properties:
        title:
          type: string
        authors:
          type: array
          items:
            type: string
        abstract:
          type: string
          description: >-
            The abstract of this paper. Agentic endpoints may not have this
            entry.
        publication_date:
          type: string
        cited_by_count:
          type: integer
        url:
          type: string
          format: url
        ss_id:
          type: string
          description: Semantic Scholar ID
        doi:
          type: string
          description: Digital Object Identifier
        answer:
          type: string
          description: >-
            Answer to the user query based on the information from this paper.
            Only available if generative_mode is set to true.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      name: x-scholarai-api-key
      in: header

````