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

# Get Market Data

> Returns market data for an instrument



## OpenAPI

````yaml GET /market/data/{instrumentId}
openapi: 3.0.0
info:
  title: Pipevest Investment API
  description: Connecting millions of Africans to the global economy
  version: 0.0.1
servers:
  - url: https://api.pipevest.com/v1
    description: Production server
  - url: https://api.staging.pipevest.com/v1
    description: Staging server
security:
  - BearerAuth: []
paths:
  /market/data/{instrumentId}:
    parameters:
      - $ref: '#/components/parameters/Signature'
      - $ref: '#/components/parameters/SignatureInput'
      - $ref: '#/components/parameters/XCliendId'
    get:
      tags:
        - Market Data
      summary: Returns market data for an instrument
      parameters:
        - name: instrumentId
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/InstrumentId'
        - name: start
          in: query
          required: true
          schema:
            $ref: '#/components/schemas/StartDate'
        - name: end
          in: query
          required: true
          schema:
            $ref: '#/components/schemas/EndDate'
        - name: timeFrame
          in: query
          required: true
          schema:
            $ref: '#/components/schemas/TimeFrame'
      responses:
        '200':
          description: Market data for an instrument
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Success'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/MarketData'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    Signature:
      in: header
      name: Signature
      schema:
        type: string
        example: 'sig1=:OTEyMjY4...A5NTNDMEQ=:'
        description: >
          Base64 encoded signed hash of the http message request components.


          [Learn how signatures
          work](/concepts/http-signature/message-signature)
      required: true
    SignatureInput:
      in: header
      name: Signature-Input
      schema:
        type: string
        example: sig1=("Content-Type" "Content-Digest"...expires=<expires>
        description: >
          An ordered list of components that make up the signature base. It is
          used to recompute and verify the `Signature`


          [Learn how signatures
          work](/concepts/http-signature/message-signature)
      required: true
    XCliendId:
      in: header
      name: X-Client-Id
      schema:
        $ref: '#/components/schemas/ClientId'
      example: client-id
      required: true
  schemas:
    InstrumentId:
      description: Unique instrument identifier
      type: integer
      example: 123456
    StartDate:
      description: Market data start date as UNIX timestamp
      type: integer
      example: 1234567890
    EndDate:
      description: Market data end date as UNIX timestamp
      type: integer
      example: 1234567890
    TimeFrame:
      description: The time frames used to determine instrument market data
      enum:
        - 1D
        - 5D
        - 3M
        - 6M
        - YTD
        - 1Y
        - 5Y
        - ALL
      example: 1D
    Success:
      type: object
      properties:
        data:
          oneOf:
            - type: object
            - type: array
        code:
          $ref: '#/components/schemas/ResponseCode'
        message:
          $ref: '#/components/schemas/ResponseMessage'
      required:
        - data
        - code
        - message
    MarketData:
      type: object
      properties:
        marketDataId:
          $ref: '#/components/schemas/MarketDataId'
        instrumentId:
          $ref: '#/components/schemas/InstrumentId'
        name:
          $ref: '#/components/schemas/AssetName'
        currency:
          $ref: '#/components/schemas/Currency'
        symbol:
          $ref: '#/components/schemas/InstrumentSymbol'
        open:
          $ref: '#/components/schemas/InstrumentOpen'
        high:
          $ref: '#/components/schemas/InstrumentHigh'
        low:
          $ref: '#/components/schemas/InstrumentLow'
        close:
          $ref: '#/components/schemas/InstrumentClose'
        volume:
          $ref: '#/components/schemas/InstrumentVolume'
        start:
          $ref: '#/components/schemas/StartDate'
        end:
          $ref: '#/components/schemas/EndDate'
        timeFrame:
          $ref: '#/components/schemas/TimeFrame'
        createdAt:
          $ref: '#/components/schemas/CreatedAt'
        updatedAt:
          $ref: '#/components/schemas/UpdatedAt'
      required:
        - marketDataId
        - instrumentId
        - name
        - currency
        - symbol
        - open
        - high
        - low
        - close
        - volume
        - start
        - end
        - timeFrame
        - createdAt
        - updatedAt
    ClientId:
      description: Unique identifier assigned to the client
      type: string
      example: client-id
    ResponseCode:
      description: Request response code
      type: string
      example: 200
    ResponseMessage:
      description: Request response message
      type: string
      example: Success
    MarketDataId:
      description: Unique market data identifier
      type: integer
      example: 123456
    AssetName:
      description: The display name of the asset
      type: string
      example: Apple Inc.
    Currency:
      description: Associated currency
      enum:
        - USD
        - EUR
        - ZK
      example: ZK
    InstrumentSymbol:
      description: The symbol associated by the instrument
      type: string
      example: APPL
    InstrumentOpen:
      description: Instrument opening trade value
      type: integer
      example: 500
    InstrumentHigh:
      description: Instrument highest trade value
      type: integer
      example: 1000
    InstrumentLow:
      description: Instrument lowest trade value
      type: integer
      example: 200
    InstrumentClose:
      description: Instrument closing trade value
      type: integer
      example: 200
    InstrumentVolume:
      description: Instrument trade volume
      type: integer
      example: 200
    CreatedAt:
      description: Created at unix timestamp
      type: integer
      example: 1234567890
    UpdatedAt:
      description: Updated at unix timestamp
      type: integer
      example: 1234567890
    Error:
      type: object
      properties:
        code:
          allOf:
            - $ref: '#/components/schemas/ResponseCode'
            - example: 401
        message:
          allOf:
            - $ref: '#/components/schemas/ResponseMessage'
            - example: Unauthorized
      required:
        - code
        - message
  responses:
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: The specified resource was not found
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Error'
              - type: object
                properties:
                  code:
                    type: string
                    example: 404
                  message:
                    type: string
                    example: Not Found
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````