> ## Documentation Index
> Fetch the complete documentation index at: https://komga-sdk.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# List duplicate books

> Return books that have the same file hash.

Required role: **ADMIN**



## OpenAPI

````yaml https://raw.githubusercontent.com/gotson/komga/1.25.0/komga/docs/openapi.json get /api/v1/books/duplicates
openapi: 3.1.0
info:
  description: >-
    Komga REST API.


    ## Reference


    Check the API reference:

    - on the [Komga website](https://komga.org/docs/openapi/komga-api)

    - on any running Komga instance at `/swagger-ui.html`

    - on
    [GitHub](https://raw.githubusercontent.com/gotson/komga/refs/heads/master/komga/docs/openapi.json)


    ## Authentication


    Most endpoints require authentication. Authentication is done using either:

    - Basic Authentication

    - Passing an API Key in the `X-API-Key` header


    ## Sessions


    Upon successful authentication, a session is created, and can be reused.


    - By default, a `KOMGA-SESSION` cookie is set via `Set-Cookie` response
    header. This works well for browsers and clients that can handle cookies.

    - If you specify a header `X-Auth-Token` during authentication, the session
    ID will be returned via this same header. You can then pass that header
    again for subsequent requests to reuse the session.


    If you need to set the session cookie later on, you can call
    `/api/v1/login/set-cookie` with `X-Auth-Token`. The response will contain
    the `Set-Cookie` header.


    ## Remember Me


    During authentication, if a request parameter `remember-me` is passed and
    set to `true`, the server will also return a `komga-remember-me` cookie.
    This cookie will be used to login automatically even if the session has
    expired.


    ## Logout


    You can explicitly logout an existing session by calling `/api/logout`. This
    would return a `204`.


    ## Deprecation


    API endpoints marked as deprecated will be removed in the next major
    version.
  license:
    name: MIT
    url: https://github.com/gotson/komga/blob/master/LICENSE
  title: Komga API
  version: 1.25.0
servers:
  - url: https://demo.komga.org
    description: Demo server
  - url: http://localhost:{port}
    description: Local development server
    variables:
      port:
        enum:
          - '8080'
          - '25600'
        default: '25600'
security:
  - basicAuth: []
  - apiKey: []
tags:
  - name: Deprecated
  - description: Manage libraries.
    name: Libraries
  - description: Manage series.
    name: Series
  - description: Manage posters for series.
    name: Series Poster
  - description: Manage books.
    name: Books
  - description: Manage posters for books.
    name: Book Poster
  - name: Book Pages
  - name: WebPub Manifest
  - name: Import
  - description: Provide font files and CSS for the Epub Reader.
    name: Fonts
  - description: Manage duplicate pages. Duplicate pages are identified by a page hash.
    name: Duplicate Pages
  - description: Manage collections.
    name: Collections
  - description: Manage posters for collections.
    name: Collection Poster
  - name: Collection Series
  - description: Manage readlists.
    name: Readlists
  - description: Manage posters for readlists.
    name: Readlist Poster
  - name: Readlist Books
  - description: Retrieve referential metadata from all items in the Komga server.
    name: Referential metadata
  - description: Manage current user.
    name: Current user
  - description: Manage users.
    name: Users
  - description: Manage API Keys
    name: API Keys
  - name: User session
  - description: List registered OAuth2 providers
    name: OAuth2
  - description: Sync points are automatically created during a Kobo sync.
    name: Sync points
  - description: Claim a freshly installed Komga server.
    name: Claim
  - description: Manage server tasks
    name: Tasks
  - description: Server events history
    name: History
  - description: List files from the host server's file system
    name: File system
  - description: Store and retrieve server settings
    name: Server settings
  - description: Retrieve releases information
    name: Releases
  - description: Retrieve announcements from the Komga website
    name: Announcements
  - description: Manage server
    name: Management
  - name: Mihon
  - name: ComicRack
  - description: >-
      Store and retrieve global and per-user settings. Those settings are not
      used by Komga itself, but can be stored for convenience by client
      applications.
    name: Client settings
externalDocs:
  description: Komga documentation
  url: https://komga.org
paths:
  /api/v1/books/duplicates:
    get:
      tags:
        - Books
      summary: List duplicate books
      description: |-
        Return books that have the same file hash.

        Required role: **ADMIN**
      operationId: getBooksDuplicates
      parameters:
        - in: query
          name: unpaged
          required: false
          schema:
            type: boolean
        - description: Zero-based page index (0..N)
          in: query
          name: page
          schema:
            type: integer
        - description: The size of the page to be returned
          in: query
          name: size
          schema:
            type: integer
        - description: >-
            Sorting criteria in the format: property(,asc|desc). Default sort
            order is ascending. Multiple sort criteria are supported.
          in: query
          name: sort
          schema:
            type: array
            items:
              type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PageBookDto'
          description: OK
        '400':
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ValidationErrorResponse'
          description: Bad Request
components:
  schemas:
    PageBookDto:
      type: object
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/BookDto'
        empty:
          type: boolean
        first:
          type: boolean
        last:
          type: boolean
        number:
          type: integer
          format: int32
        numberOfElements:
          type: integer
          format: int32
        pageable:
          $ref: '#/components/schemas/PageableObject'
        size:
          type: integer
          format: int32
        sort:
          $ref: '#/components/schemas/SortObject'
        totalElements:
          type: integer
          format: int64
        totalPages:
          type: integer
          format: int32
    ValidationErrorResponse:
      type: object
      properties:
        violations:
          type: array
          items:
            $ref: '#/components/schemas/Violation'
      required:
        - violations
    BookDto:
      type: object
      properties:
        created:
          type: string
          format: date-time
        deleted:
          type: boolean
        fileHash:
          type: string
        fileLastModified:
          type: string
          format: date-time
        id:
          type: string
        lastModified:
          type: string
          format: date-time
        libraryId:
          type: string
        media:
          $ref: '#/components/schemas/MediaDto'
        metadata:
          $ref: '#/components/schemas/BookMetadataDto'
        name:
          type: string
        number:
          type: integer
          format: int32
        oneshot:
          type: boolean
        readProgress:
          $ref: '#/components/schemas/ReadProgressDto'
        seriesId:
          type: string
        seriesTitle:
          type: string
        size:
          type: string
        sizeBytes:
          type: integer
          format: int64
        url:
          type: string
      required:
        - created
        - deleted
        - fileHash
        - fileLastModified
        - id
        - lastModified
        - libraryId
        - media
        - metadata
        - name
        - number
        - oneshot
        - seriesId
        - seriesTitle
        - size
        - sizeBytes
        - url
    PageableObject:
      type: object
      properties:
        offset:
          type: integer
          format: int64
        pageNumber:
          type: integer
          format: int32
        pageSize:
          type: integer
          format: int32
        paged:
          type: boolean
        sort:
          $ref: '#/components/schemas/SortObject'
        unpaged:
          type: boolean
    SortObject:
      type: object
      properties:
        empty:
          type: boolean
        sorted:
          type: boolean
        unsorted:
          type: boolean
    Violation:
      type: object
      properties:
        fieldName:
          type: string
        message:
          type: string
    MediaDto:
      type: object
      properties:
        comment:
          type: string
        epubDivinaCompatible:
          type: boolean
        epubIsKepub:
          type: boolean
        mediaProfile:
          type: string
        mediaType:
          type: string
        pagesCount:
          type: integer
          format: int32
        status:
          type: string
      required:
        - comment
        - epubDivinaCompatible
        - epubIsKepub
        - mediaProfile
        - mediaType
        - pagesCount
        - status
    BookMetadataDto:
      type: object
      properties:
        authors:
          type: array
          items:
            $ref: '#/components/schemas/AuthorDto'
        authorsLock:
          type: boolean
        created:
          type: string
          format: date-time
        isbn:
          type: string
        isbnLock:
          type: boolean
        lastModified:
          type: string
          format: date-time
        links:
          type: array
          items:
            $ref: '#/components/schemas/WebLinkDto'
        linksLock:
          type: boolean
        number:
          type: string
        numberLock:
          type: boolean
        numberSort:
          type: number
          format: float
        numberSortLock:
          type: boolean
        releaseDate:
          type: string
          format: date
        releaseDateLock:
          type: boolean
        summary:
          type: string
        summaryLock:
          type: boolean
        tags:
          type: array
          items:
            type: string
          uniqueItems: true
        tagsLock:
          type: boolean
        title:
          type: string
        titleLock:
          type: boolean
      required:
        - authors
        - authorsLock
        - created
        - isbn
        - isbnLock
        - lastModified
        - links
        - linksLock
        - number
        - numberLock
        - numberSort
        - numberSortLock
        - releaseDateLock
        - summary
        - summaryLock
        - tags
        - tagsLock
        - title
        - titleLock
    ReadProgressDto:
      type: object
      properties:
        completed:
          type: boolean
        created:
          type: string
          format: date-time
        deviceId:
          type: string
        deviceName:
          type: string
        lastModified:
          type: string
          format: date-time
        page:
          type: integer
          format: int32
        readDate:
          type: string
          format: date-time
      required:
        - completed
        - created
        - deviceId
        - deviceName
        - lastModified
        - page
        - readDate
    AuthorDto:
      type: object
      properties:
        name:
          type: string
        role:
          type: string
      required:
        - name
        - role
    WebLinkDto:
      type: object
      properties:
        label:
          type: string
        url:
          type: string
      required:
        - label
        - url
  securitySchemes:
    basicAuth:
      scheme: basic
      type: http
    apiKey:
      in: header
      name: X-API-Key
      type: apiKey

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.