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

# Get search history

> Retrieve the user's search history, sorted by most recently used. Returns searches for the current organization and user.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/search/history
openapi: 3.0.0
info:
  title: Amazonomics API
  version: 0.0.1
  description: The Amazonomics REST API. All endpoints need an API key.
servers:
  - url: https://api.amazonomics.com
security:
  - bearerAuth: []
paths:
  /v1/search/history:
    get:
      tags:
        - Search
      summary: Get search history
      description: >-
        Retrieve the user's search history, sorted by most recently used.
        Returns searches for the current organization and user.
      parameters:
        - schema:
            type: string
            enum:
              - keyword
              - asin
            description: Filter by search type
            example: keyword
          required: false
          description: Filter by search type
          name: type
          in: query
        - schema:
            type: string
            description: >-
              Free-text filter against the stored search params (matches
              keywords, ASINs, brands, methods, etc., case-insensitive).
            example: laptop
          required: false
          description: >-
            Free-text filter against the stored search params (matches keywords,
            ASINs, brands, methods, etc., case-insensitive).
          name: q
          in: query
        - schema:
            type: integer
            minimum: 1
            maximum: 200
            description: 'Maximum number of results to return (default: 50, max: 200)'
            example: 50
          required: false
          description: 'Maximum number of results to return (default: 50, max: 200)'
          name: limit
          in: query
      responses:
        '200':
          description: Search history retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchHistoryResponse'
        '401':
          description: Unauthorized - Organization ID is required.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchHistoryResponse'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchHistoryResponse'
components:
  schemas:
    SearchHistoryResponse:
      type: object
      properties:
        data:
          type: array
          nullable: true
          items:
            $ref: '#/components/schemas/SearchHistoryItem'
        error:
          type: object
          nullable: true
          properties:
            code:
              type: string
              description: The error code
            message:
              type: string
              description: The error message
            hint:
              type: string
              description: A hint to help the user fix the error
            docs:
              type: string
              description: A link to the documentation for the error
          required:
            - code
            - message
      required:
        - data
    SearchHistoryItem:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the search history item
          example: 123e4567-e89b-12d3-a456-426614174000
        search_type:
          type: string
          enum:
            - keyword
            - asin
          description: Type of search
          example: keyword
        search_params:
          type: object
          additionalProperties:
            nullable: true
          description: Normalized search parameters (excluding pagination)
          example:
            keywords:
              - laptop
            type: monthly
            method: similar
        last_used_at:
          type: string
          description: ISO 8601 timestamp of when this search was last used
          example: '2024-01-15T10:30:00Z'
        created_at:
          type: string
          description: ISO 8601 timestamp of when this search was first created
          example: '2024-01-10T08:00:00Z'
        use_count:
          type: integer
          minimum: 1
          description: Number of times this search has been performed
          example: 5
      required:
        - id
        - search_type
        - search_params
        - last_used_at
        - created_at
        - use_count
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````