---
title: "Historical prices for a petrochemical product (custom date range)."
url: "https://developer.argaam.com/apis/macroeconomic-layer-api-production-v1/versions/eeada0b4-178b-4972-8713-f497c9940530/operations/getPetrochemicalsProductsByProductIdPricesHistory"
---

> Full API specification: https://developer.argaam.com/apis/macroeconomic-layer-api-production-v1/versions/eeada0b4-178b-4972-8713-f497c9940530.md

# Historical prices for a petrochemical product (custom date range).

`GET` `/api/v1.1/petrochemicals/products/{productId}/prices/history`

Operation ID: `getPetrochemicalsProductsByProductIdPricesHistory`

Like `/products/{id}/prices` but takes an explicit `from`/`to` window for arbitrary historical analysis. ### Example ``` GET /api/v1.1/petrochemicals/products/12/prices/history?regionId=1&from=2023-01-01&to=2023-12-31 ```

## Path parameters

- `productId` (integer, int32, required) - Numeric petrochemical product identifier.

## Query parameters

- `regionId` (integer, int32, optional) - Numeric region identifier.
- `from` (string, optional) - Start of the date range, inclusive. Format `YYYY-MM-DD`.
- `to` (string, optional) - End of the date range, inclusive. Format `YYYY-MM-DD`.

## Responses

- `200` - Success

## OpenAPI definition

````yaml
openapi: 3.0.1
info:
  title: Macroeconomic Layer API
  version: v1.1
servers:
  - url: https://api.argaam.com
    description: Argaam API Gateway (Production)
paths:
  /api/v1.1/petrochemicals/products/{productId}/prices/history:
    get:
      tags:
        - Petrochemicals
      parameters:
        - name: productId
          in: path
          required: true
          schema:
            type: integer
            format: int32
          description: Numeric petrochemical product identifier.
        - name: regionId
          in: query
          schema:
            type: integer
            format: int32
          example: 1
          description: Numeric region identifier.
        - name: from
          in: query
          schema:
            type: string
          example: 2024-01-01
          description: Start of the date range, inclusive. Format `YYYY-MM-DD`.
        - name: to
          in: query
          schema:
            type: string
          example: 2024-03-31
          description: End of the date range, inclusive. Format `YYYY-MM-DD`.
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/PetrochemicalsProductPrices"
      summary: Historical prices for a petrochemical product (custom date range).
      description: "Like `/products/{id}/prices` but takes an explicit\r

        `from`/`to` window for arbitrary historical analysis.\r

        \            \r

        ### Example\r

        ```\r

        GET
        /api/v1.1/petrochemicals/products/12/prices/history?regionId=1&from=202\
        3-01-01&to=2023-12-31\r

        ```"
      operationId: getPetrochemicalsProductsByProductIdPricesHistory
security:
  - ApiKeyAuth: []
components:
  schemas:
    PetrochemicalsProductPrices:
      type: object
      properties:
        productPriceID:
          type: integer
          format: int32
        regionID:
          type: integer
          format: int32
        categoryID:
          type: integer
          format: int32
        productID:
          type: integer
          format: int32
        productPrice:
          type: number
          format: double
        measuringUnitID:
          type: integer
          format: int32
        currencyID:
          type: integer
          format: int32
        entryDate:
          type: string
          format: date-time
        changeInPrice:
          type: number
          format: double
          nullable: true
        regionNameAr:
          type: string
          nullable: true
        regionNameEn:
          type: string
          nullable: true
        categoryNameAr:
          type: string
          nullable: true
        categoryNameEn:
          type: string
          nullable: true
        productNameAr:
          type: string
          nullable: true
        productNameEn:
          type: string
          nullable: true
        change:
          type: number
          format: double
          nullable: true
      additionalProperties: false
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: apikey
````
