> ## 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.

# Search Papers, for Agents

> Retrieves relevant abstracts and paper metadata by a search. Generates an answer using LLMs if generative_mode is set to true.
For an API meant for faster and more replete data retrieval, use /api/fast_paper_search



## OpenAPI

````yaml get /api/abstracts
openapi: 3.1.0
info:
  title: No title
  version: No version
servers:
  - url: https://api.scholarai.io
security:
  - ApiKeyAuth: []
tags:
  - name: Api
paths:
  /api/abstracts:
    get:
      tags:
        - Api
      summary: Search Papers, for Agents
      description: >-
        Retrieves relevant abstracts and paper metadata by a search. Generates
        an answer using LLMs if generative_mode is set to true.

        For an API meant for faster and more replete data retrieval, use
        /api/fast_paper_search
      operationId: api_get_abstract
      parameters:
        - in: query
          name: keywords
          description: >-
            Keywords of inquiry which should appear in the article. Must be in
            English.
          schema:
            type: string
          required: true
        - in: query
          name: sort
          description: >-
            The sort order for results. Valid values are relevance,
            cited_by_count, publication_date. Defaults to relevance.
          schema:
            type: string
            default: relevance
          required: false
        - in: query
          name: query
          description: >-
            The user query, as a natural language question. E.g. 'Tell me about
            recent drugs for cancer treatment'
          schema:
            type: string
          required: true
        - in: query
          name: peer_reviewed_only
          description: >-
            Whether to only return peer-reviewed articles. Defaults to true,
            ChatGPT should cautiously suggest this value can be set to false
          schema:
            type: boolean
            default: true
          required: false
        - in: query
          name: start_year
          description: >-
            The first year, inclusive, to include in the search range. Excluding
            this value will include all years.
          schema:
            type: integer
          required: false
        - in: query
          name: end_year
          description: >-
            The last year, inclusive, to include in the search range. Excluding
            this value will include all years.
          schema:
            type: integer
          required: false
        - in: query
          name: offset
          description: The offset of the first result to return. Defaults to 0.
          schema:
            type: integer
            default: 0
          required: false
        - in: query
          name: generative_mode
          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.
          schema:
            type: boolean
            default: true
          required: false
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PaperMetadataResponse'
          description: OK
components:
  schemas:
    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

````