---
title: "Get historical series for a data"
url: "https://developer.argaam.com/apis/market-data-layer-api-sandbox-v1/versions/76611d79-bb1b-44da-aed6-aca8b510fd74/operations/getSectorsDataByMarketIdHistory"
---

> Full API specification: https://developer.argaam.com/apis/market-data-layer-api-sandbox-v1/versions/76611d79-bb1b-44da-aed6-aca8b510fd74.md

# Get historical series for a data

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

Operation ID: `getSectorsDataByMarketIdHistory`

Returns the historical series for the data identified by `marketId`. 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

- `sectorId` (integer, int32, optional) - Numeric sector identifier. Use the sector endpoints to list valid values.
- `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-sandbox.argaam.com
    description: Argaam API Gateway (Sandbox)
paths:
  /api/v1.1/sectors/data/{marketId}/history:
    get:
      tags:
        - Sectors
      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: sectorId
          in: query
          schema:
            type: integer
            format: int32
          description: Numeric sector identifier. Use the sector endpoints to list valid
            values.
        - 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/SectorDataArchive"
      summary: Get historical series for a data
      description: |-
        Returns the historical series for the data identified by `marketId`.

        Bound the result with the `from` and `to` date parameters.
      operationId: getSectorsDataByMarketIdHistory
security:
  - ApiKeyAuth: []
components:
  schemas:
    SectorDataArchive:
      type: object
      properties:
        marketID:
          type: integer
          format: int32
        sectorID:
          type: integer
          format: int32
        bid:
          type: string
          nullable: true
        tradingDate:
          type: string
          nullable: true
        openValue:
          type: number
          format: double
          nullable: true
        closeValue:
          type: number
          format: double
          nullable: true
        high:
          type: number
          format: double
          nullable: true
        low:
          type: number
          format: double
          nullable: true
        volume:
          type: number
          format: double
          nullable: true
      additionalProperties: false
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: apikey
```
