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

# Scrape Costco product search

> Searches Costco (costco.com, or costco.ca with `domain=ca`) for `query` and returns `products`: `productId`, `itemNumber`, `title`, `brand`, `url`, `image`, `price` (and `priceMax` for a price range), `wasPrice`, `currency`, `promotions`, `marketingStatement`, `rating`, `reviewCount`, `memberOnly`, `onlineOnly`, `warehouseOnly`, `badges`, `availability`, `inWarehouse`, `shipIt`, `buyableOnline`, `priceShownInCartOnly`, `model`, `features`, `category`, `categoryPath` and `variantCount`, plus `totalResults`. A keyword Costco sends to a category page (e.g. 'tv') returns that category, named in `redirectedTo`. `availability` is for the delivery location in `deliveryLocation`. Sort with `sort`, start at `page` and collect up to `max_results`.



## OpenAPI

````yaml /api-reference/openapi.json post /marketplace/costco-search
openapi: 3.1.0
info:
  title: ScrapeUnblocker API
  description: >-
    Public API for the ScrapeUnblocker proxy/anti-bot service. Authenticate
    every request with the `x-scrapeunblocker-key` header. Documented here:
    page-source extraction, Google SERP scraping, image fetch, and the dedicated
    plugin endpoints (search engines, marketplaces, reviews, travel, social and
    more). All other paths exist for internal operations and are intentionally
    hidden from this spec.
  version: 3.0.0
servers:
  - url: https://api.scrapeunblocker.com
    description: Production
security: []
paths:
  /marketplace/costco-search:
    post:
      tags:
        - Plugins
      summary: Scrape Costco product search
      description: >-
        Searches Costco (costco.com, or costco.ca with `domain=ca`) for `query`
        and returns `products`: `productId`, `itemNumber`, `title`, `brand`,
        `url`, `image`, `price` (and `priceMax` for a price range), `wasPrice`,
        `currency`, `promotions`, `marketingStatement`, `rating`, `reviewCount`,
        `memberOnly`, `onlineOnly`, `warehouseOnly`, `badges`, `availability`,
        `inWarehouse`, `shipIt`, `buyableOnline`, `priceShownInCartOnly`,
        `model`, `features`, `category`, `categoryPath` and `variantCount`, plus
        `totalResults`. A keyword Costco sends to a category page (e.g. 'tv')
        returns that category, named in `redirectedTo`. `availability` is for
        the delivery location in `deliveryLocation`. Sort with `sort`, start at
        `page` and collect up to `max_results`.
      operationId: costco_search_marketplace_costco_search_post
      parameters:
        - name: query
          in: query
          required: true
          schema:
            type: string
            description: >-
              What to search for, e.g. 'paper towels', 'kirkland coffee' or
              'tv'.
            title: Query
          description: What to search for, e.g. 'paper towels', 'kirkland coffee' or 'tv'.
        - name: sort
          in: query
          required: false
          schema:
            type: string
            description: >-
              Result order: relevance, price_low, price_high, rating, newest,
              brand.
            default: relevance
            title: Sort
          description: >-
            Result order: relevance, price_low, price_high, rating, newest,
            brand.
        - name: page
          in: query
          required: false
          schema:
            type: integer
            description: >-
              1-based results page to start from (24 products per page, as on
              costco.com).
            default: 1
            title: Page
          description: >-
            1-based results page to start from (24 products per page, as on
            costco.com).
        - name: max_results
          in: query
          required: false
          schema:
            type: integer
            description: >-
              Products to collect from `page` on, 1-240. Up to 120 are billed as
              one request.
            default: 24
            title: Max Results
          description: >-
            Products to collect from `page` on, 1-240. Up to 120 are billed as
            one request.
        - name: include_out_of_stock
          in: query
          required: false
          schema:
            type: boolean
            description: >-
              Also return products that are out of stock (Costco hides them by
              default).
            default: false
            title: Include Out Of Stock
          description: >-
            Also return products that are out of stock (Costco hides them by
            default).
        - name: domain
          in: query
          required: false
          schema:
            type: string
            description: >-
              Costco storefront: com, ca ('com' is costco.com, 'ca' is
              costco.ca).
            default: com
            title: Domain
          description: 'Costco storefront: com, ca (''com'' is costco.com, ''ca'' is costco.ca).'
        - name: proxy_country
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Proxy country the request is sent from (ISO-2, e.g. 'US'). Leave
              blank to let the API pick. Costco computes `availability` for the
              delivery location it derives from the visitor; it is named in
              `deliveryLocation`.
            title: Proxy Country
          description: >-
            Proxy country the request is sent from (ISO-2, e.g. 'US'). Leave
            blank to let the API pick. Costco computes `availability` for the
            delivery location it derives from the visitor; it is named in
            `deliveryLocation`.
      responses:
        '200':
          description: >-
            JSON with a `products` array. A search with no matches answers 200
            with an empty `products` list.
          content:
            application/json:
              schema: {}
        '400':
          description: Invalid parameters.
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '502':
          description: >-
            Blocked by Costco, no results returned, or the call did not finish
            in time.
      security:
        - ScrapeUnblockerKey: []
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ScrapeUnblockerKey:
      type: apiKey
      in: header
      name: x-scrapeunblocker-key
      description: Your ScrapeUnblocker API key. Apply on every request.

````

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