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

# Get Units Sold History Estimate

> This endpoint returns estimated sales history for a specific Walmart product.

<Warning>
  **🚧 Coming Soon**: This endpoint is currently in development and will be available soon. Stay tuned for updates!
</Warning>

<Note>
  **Rate Limit**: This endpoint has a default rate limit of **10 products/second** per account. Need higher limits? [Contact our support team](https://cal.com/rivin-ai/30min) - we can accommodate any rate limit requirements on request.
</Note>

<Note>
  **Credit Cost**: This endpoint costs range from **5 to 150 credits** depending on the time period requested:

  * **1 month**: 5 credits
  * **6 months**: 25 credits
  * **1 year**: 50 credits
  * **3 years**: 100 credits
  * **All time**: 150 credits

  Credits are only deducted when the API call succeeds and returns product data. Failed requests (errors, rate limits, etc.) do not consume credits.
</Note>

<RequestExample>
  ```bash Example request theme={null}
  curl -X GET "http://rivin.ai/api/walmart/product/units-sold-history?walmart_product_code=1370971228&time_period=6months" \
    -H "Content-Type: application/json" \
    -H "x-api-key: (YOUR_API_KEY_HERE)"
  ```
</RequestExample>

<ResponseExample>
  ```json API Response theme={null}
  {
    "walmart_product_code": "1370971228",
    "time_period": "6months",
    "credit_cost": 25,
    "sales_history": [
      {
        "date": "2024-01-15",
        "units_sold": 25
      },
      {
        "date": "2024-01-14",
        "units_sold": 18
      },
      {
        "date": "2024-01-13",
        "units_sold": 32
      }
    ]
  }
  ```
</ResponseExample>

<Note>
  **Time Periods**: The `time_period` query parameter is required and specifies how much historical data you need. Longer time periods provide more comprehensive insights but cost more credits.
</Note>

<Note>
  **Sales Estimates**: This endpoint provides estimated daily sales data based on various factors including market analysis, historical trends, and available data sources.
</Note>


## OpenAPI

````yaml GET /walmart/product/units-sold-history
openapi: 3.1.0
info:
  title: Rivin.ai Walmart API
  description: >-
    API for retrieving Walmart product information, price history, and managing
    oversight tracking
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://rivin.ai/api
    description: Production API server
security: []
paths:
  /walmart/product/units-sold-history:
    get:
      tags:
        - Walmart Products
      summary: Get Units Sold History Estimate
      description: >-
        This endpoint returns estimated sales history for a specific Walmart
        product.
      operationId: getWalmartProductUnitsSoldHistory
      parameters:
        - name: x-api-key
          in: header
          description: >-
            Your unique API key for authentication. This key is required in the
            header of all API requests, to authenticate your account and access
            Rivin.ai's services. Get your API key through the
            [Settings](https://rivin.ai/settings) page.
          required: true
          schema:
            type: string
        - name: walmart_product_code
          in: query
          description: The Walmart product code to get sales history for.
          required: true
          schema:
            type: string
          example: '1370971228'
        - name: time_period
          in: query
          description: >-
            The time period for sales history data. Different periods have
            different credit costs: 1 month (5 credits), 6 months (25 credits),
            1 year (50 credits), 3 years (100 credits), all time (150 credits).
          required: true
          schema:
            type: string
            enum:
              - 1month
              - 6months
              - 1year
              - 3years
              - alltime
          example: 6months
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnitsSoldHistory'
        '400':
          description: Bad request - Invalid product code
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    UnitsSoldHistory:
      type: object
      properties:
        walmart_product_code:
          description: The Walmart product code.
          type: string
        time_period:
          description: The time period for which sales history was requested
          type: string
          enum:
            - 1month
            - 6months
            - 1year
            - 3years
            - alltime
        credit_cost:
          description: The number of credits consumed for this request
          type: integer
        sales_history:
          description: Array of sales data over time
          type: array
          items:
            type: object
            properties:
              date:
                type: string
                format: date
                description: Date of the sales data
              units_sold:
                type: integer
                description: Estimated units sold on that date
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: integer
          format: int32
        message:
          type: string

````