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

# Search products

> Find products to buy, with prices and sellers.

Search for a product or category. Prices are quoted in the currency of `country`, which is the only thing that sets them; there is no separate currency parameter.

This listing returns a single page and offers no further results, so there is no `next_page` to follow. When a result includes an `id`, pass it unchanged to [product details](https://docs.sanfoundation.com/api-reference/shopping-details.md) to read the full listing and every seller. Some rows have no ID; only offer a follow-up when one is present.


## OpenAPI

````yaml https://api.sanfoundation.com/openapi.json GET /v1/shopping/search
openapi: 3.0.0
info:
  title: SAN API
  description: >-
    Web data and context for agents, served by a network of miners running real
    browsers on residential connections. One resource per thing an agent asks
    for: search the web, read the news, find places, hotels and flights, and
    quote a symbol. Present an API key as `Authorization: Bearer san_...`. Every
    response is snake_case JSON and every error is `{ error: { code, message,
    param } }`.
  version: 0.0.1
  contact: {}
servers: []
security: []
tags:
  - name: web
    description: Web search
  - name: news
    description: News search
  - name: places
    description: Places search
  - name: hotels
    description: Stays search
  - name: flights
    description: Flight search
  - name: finance
    description: Quotes and charts
  - name: shopping
    description: Products and sellers
  - name: account
    description: Plan and remaining budget
paths:
  /v1/shopping/search:
    get:
      tags:
        - shopping
      summary: Find products to buy
      description: >-
        Ranked products for a query, with the price, the headline seller, the
        rating and the delivery terms. One page: the listing offers no further
        results. Prices are quoted in the currency of `country`, which is the
        only thing that sets them.
      operationId: ShoppingController_search
      parameters:
        - name: country
          required: false
          in: query
          description: ISO 3166-1 alpha-2. Defaults to `us`.
          schema:
            type: string
            example: us
        - name: query
          required: true
          in: query
          description: What to shop for.
          schema:
            example: wireless headphones
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShoppingSearchResponseDto'
        '400':
          description: A parameter is missing, invalid or not recognized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicErrorDto'
        '401':
          description: Invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicErrorDto'
        '429':
          description: Monthly quota exhausted. Hard stop, no overage.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicErrorDto'
        '503':
          description: No miner and no fallback could serve the request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicErrorDto'
      security:
        - api_key: []
        - x-api-key: []
components:
  schemas:
    ShoppingSearchResponseDto:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Id of this request. Quote it when reporting a problem.
        took_ms:
          type: number
          example: 1420
          description: How long the request took, in milliseconds.
        request:
          type: object
          additionalProperties: true
          description: >-
            The parameters as accepted, after defaults and normalization. What
            the request actually ran with.
          example:
            query: coffee
            country: us
            page: 1
        next_page:
          type: number
          nullable: true
          example: 2
          description: >-
            The next page to ask for, or null when there is no further page.
            Never a page this endpoint would reject.
        results:
          type: array
          items:
            $ref: '#/components/schemas/ShoppingResultDto'
        currency:
          type: string
          example: USD
          description: >-
            ISO 4217 code the prices are quoted in. Prices follow `country`, so
            this is never absent and is not a parameter.
      required:
        - id
        - took_ms
        - request
        - next_page
        - results
        - currency
    PublicErrorDto:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/PublicErrorBodyDto'
      required:
        - error
    ShoppingResultDto:
      type: object
      properties:
        id:
          type: string
          example: san1.QkFEQ0FGRTAxMjM0NTY3ODk
          description: >-
            Opaque handle for this product, to pass to `/v1/shopping/{id}`.
            Absent when the listing named no product page, which is common for a
            single seller item.
        position:
          type: number
          example: 1
          description: Rank within this page, 1 based.
        title:
          type: string
          example: Sony PlayStation 5 Console Slim Digital Edition
        price:
          $ref: '#/components/schemas/MoneyDto'
        original_price:
          description: What the listing says the price used to be.
          allOf:
            - $ref: '#/components/schemas/MoneyDto'
        seller:
          type: string
          example: Best Buy
          description: >-
            The headline seller. A product may be offered by several; ask for
            the product to see them all.
        more_offers:
          type: boolean
          example: true
          description: >-
            More sellers than the one named are offering this product. Never a
            count.
        rating:
          type: number
          example: 4.3
          description: Out of 5.
        reviews:
          type: number
          example: 3400
          description: >-
            Review count. Listings abbreviate this above a thousand, so it can
            be rounded.
        delivery:
          type: string
          example: Free delivery by Mon
        returns:
          type: string
          example: 30-day returns
        condition:
          type: string
          example: Pre-owned
          description: Absent on a new item.
        tag:
          type: string
          example: 25% OFF
          description: A promotional badge, exactly as shown.
        thumbnail:
          type: string
          example: https://example.com/images/console.jpg
      required:
        - position
        - title
        - price
    PublicErrorBodyDto:
      type: object
      properties:
        code:
          type: string
          enum:
            - unauthorized
            - missing_parameter
            - invalid_parameter
            - not_found
            - quota_exceeded
            - rate_limited
            - unavailable
            - expired
            - internal_error
          example: missing_parameter
        message:
          type: string
          example: Missing parameter `query`.
        param:
          type: string
          example: query
          description: The parameter at fault, when one parameter is at fault.
      required:
        - code
        - message
    MoneyDto:
      type: object
      properties:
        amount:
          type: number
          example: 180
          description: The amount as a number.
        display:
          type: string
          example: $180
          description: The same amount as displayed, with its currency.
      required:
        - amount
        - display
  securitySchemes:
    api_key:
      scheme: bearer
      bearerFormat: JWT
      type: http
      description: 'Public API key: `Authorization: Bearer san_...`.'
    x-api-key:
      type: apiKey
      in: header
      name: X-Api-Key
      description: The same public API key, as a header.

````

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