---
title: "Get historical series for a market"
url: "https://developer.argaam.com/apis/market-data-layer-api-production-v1/versions/ca86b5b0-4709-486f-b41b-f80ad96b0d25/operations/getMarketsByMarketIdDataHistory"
---

> Full API specification: https://developer.argaam.com/apis/market-data-layer-api-production-v1/versions/ca86b5b0-4709-486f-b41b-f80ad96b0d25.md

# Get historical series for a market

`GET` `/api/v1.1/markets/{marketId}/data/history`

Operation ID: `getMarketsByMarketIdDataHistory`

Returns the historical series for the market identified by `marketSymbol`. Bound the result with the `from` and `to` date parameters.

## Path parameters

- `marketId` (integer, int32, required) - Numeric market identifier (e.g. `1` = Tadawul / Saudi main market). Use `GET /api/v1.1/markets` to list valid values.

## Query parameters

- `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: Market Data Layer API
  version: v1.1
servers:
  - url: https://api.argaam.com
    description: Argaam API Gateway (Production)
paths:
  /api/v1.1/markets/{marketId}/data/history:
    get:
      tags:
        - Markets
      parameters:
        - name: marketId
          in: path
          required: true
          schema:
            type: integer
            format: int32
          description: Numeric market identifier (e.g. `1` = Tadawul / Saudi main market).
            Use `GET /api/v1.1/markets` to list valid values.
          example: 3
        - 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:
                $ref: "#/components/schemas/ApiV1Response"
      summary: Get historical series for a market
      description: >-
        Returns the historical series for the market identified by
        `marketSymbol`.


        Bound the result with the `from` and `to` date parameters.
      operationId: getMarketsByMarketIdDataHistory
security:
  - ApiKeyAuth: []
components:
  schemas:
    ApiV1Response:
      type: object
      properties:
        success:
          type: boolean
        apiVersion:
          type: string
          nullable: true
        timestamp:
          type: string
          format: date-time
        requestId:
          type: string
          nullable: true
        data:
          nullable: true
        meta:
          $ref: "#/components/schemas/ApiV1Meta"
        rateLimit:
          $ref: "#/components/schemas/ApiV1RateLimit"
      additionalProperties: false
    ApiV1Meta:
      type: object
      properties:
        page:
          type: integer
          format: int32
        pageSize:
          type: integer
          format: int32
        totalRecords:
          type: integer
          format: int32
        totalPages:
          type: integer
          format: int32
          readOnly: true
        hasNextPage:
          type: boolean
          readOnly: true
        hasPreviousPage:
          type: boolean
          readOnly: true
      additionalProperties: false
    ApiV1RateLimit:
      type: object
      properties:
        limit:
          type: integer
          format: int32
        remaining:
          type: integer
          format: int32
        reset:
          type: string
          format: date-time
      additionalProperties: false
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: apikey
```
