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

# Search Media

> Finds the project's indexed images by a plain-language description, best first. Works without tags. Only indexed images can match. Searching is free; indexing is charged per image.


Finds the project's indexed images by a plain-language description, best
first. It doesn't need tags. Only [indexed](https://docs.dreep.cloud/api-reference/image-search/index-media.md)
images can match.

Searching is free. Indexing is charged per image.

```bash theme={null}
curl -G "https://api.dreep.cloud/api/v1/media/search" \
  -H "Authorization: Bearer drp_live_xxxxx" \
  --data-urlencode "q=dog on a beach" \
  --data-urlencode "limit=10"
```

Text matches usually score 0.2 to 0.35, even when they're good, so set
`minScore` lower than you would for similar images. See
[Results and scores](https://docs.dreep.cloud/guides/image-search.md#results-and-scores).


## OpenAPI

````yaml GET /api/v1/media/search
openapi: 3.0.0
info:
  title: Dreep API
  description: The universal media processing and storage API.
  version: 1.0.0
servers:
  - url: https://api.dreep.cloud
    description: Production
security:
  - ApiKeyAuth: []
paths:
  /api/v1/media/search:
    get:
      tags:
        - Image Search
      summary: Search Media
      description: >
        Finds the project's indexed images by a plain-language description, best
        first. Works without tags. Only indexed images can match. Searching is
        free; indexing is charged per image.
      parameters:
        - name: q
          in: query
          required: true
          description: >-
            What to find, e.g. "red sneakers on a white background". Up to 300
            characters.
          schema:
            type: string
            maxLength: 300
        - name: limit
          in: query
          schema:
            type: integer
            default: 20
            maximum: 100
        - name: minScore
          in: query
          description: Leave out matches scoring below this, from 0 to 1.
          schema:
            type: number
            minimum: 0
            maximum: 1
      responses:
        '200':
          description: Matching images, best first
          content:
            application/json:
              schema:
                type: object
                properties:
                  assets:
                    type: array
                    items:
                      $ref: '#/components/schemas/SearchResult'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '502':
          description: The search couldn't run. Try again.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: Image search isn't available right now.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    SearchResult:
      type: object
      properties:
        id:
          type: string
          format: uuid
        filename:
          type: string
          example: red-sneaker.jpg
        url:
          type: string
          description: Ready-to-use delivery URL for the image.
          example: https://cdn.dreep.cloud/api/v1/fetch/2f928a3f-1d2a-4a2b
        type:
          type: string
          example: image/jpeg
        sizeBytes:
          type: string
          description: Size in bytes, as a string (a BIGINT column).
          example: '56696'
        assetType:
          type: string
          enum:
            - image
        folder:
          type: string
          example: products
        folderId:
          type: string
          format: uuid
          nullable: true
        createdAt:
          type: string
          format: date-time
        tags:
          type: array
          items:
            type: string
          example:
            - sneaker
            - red
        score:
          type: number
          description: >
            How close the match is, up to 1. Similar images usually score 0.8
            and up; text matches score much lower, usually 0.2 to 0.35.
          example: 0.31
    Error:
      type: object
      properties:
        error:
          type: boolean
          example: true
        message:
          type: string
          example: Invalid request parameters
        code:
          type: string
          example: invalid_request
  responses:
    BadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer

````

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