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

# Retrieve FX observations for an inclusive date range.

> Use this operation to retrieve historical FX market data for one or more conventional six-character pair
codes. Results are keyed by the same conventional pair codes supplied by the caller. The operation reads
data only and does not use the provider fields on the request.



## OpenAPI

````yaml /risk-and-pricing/atoti-risk-services/apis-endpoints/openapi/openapi.mintlify.json post /api/MarketData/GetFxData
openapi: 3.0.4
info:
  title: Derivitec Api 1.0
  version: '1.0'
servers:
  - url: https://api.riskportal.activeviam.com
security:
  - oauth2: []
  - apikey: []
tags:
  - name: AdminUser
  - name: AtotiReport
  - name: AtotiSession
  - name: BloombergOAuth
  - name: Bond
  - name: BondYieldCurvePage
  - name: BookAccess
  - name: Books
  - name: Commodity
  - name: Counterparties
  - name: Currencies
  - name: Equity
  - name: EquityDividend
  - name: EquityPage
  - name: FeatureFlag
  - name: Fx
  - name: FxPage
  - name: GroupAccess
  - name: Home
  - name: LegacyPosition
  - name: MarketData
  - name: MarketDataProvider
  - name: MarketDataProviderAccess
  - name: Meta
  - name: Notification
  - name: Organisation
  - name: PnLReport
  - name: PortfolioAccess
  - name: Portfolios
  - name: Position
  - name: PositionFilter
  - name: PricingEnvironment
  - name: PricingEnvironmentAccess
  - name: RateAsset
  - name: RateAssetPage
  - name: Report
  - name: ReportDefinition
  - name: ReportHistoryLauncherQuery
  - name: ReportLauncher
  - name: ReportQuery
  - name: ReportQueryViewUser
  - name: ReportRestriction
  - name: ReportView
  - name: RiskReport
  - name: Tradable
  - name: TradeBooking
  - name: User
  - name: VarReport
  - name: VarReportQuery
  - name: YieldCurvePage
paths:
  /api/MarketData/GetFxData:
    post:
      tags:
        - MarketData
      summary: Retrieve FX observations for an inclusive date range.
      description: >-
        Use this operation to retrieve historical FX market data for one or more
        conventional six-character pair

        codes. Results are keyed by the same conventional pair codes supplied by
        the caller. The operation reads

        data only and does not use the provider fields on the request.
      operationId: GetFxData
      requestBody:
        description: >-
          The query payload. `FxPairs` must be non-empty and contain FX pair
          codes such as `GBPUSD`; `StartDate` and `EndDate` are required ISO
          8601 date/time bounds.
        content:
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/ApiGetFxDataRequest'
          application/json:
            schema:
              $ref: '#/components/schemas/ApiGetFxDataRequest'
          text/json:
            schema:
              $ref: '#/components/schemas/ApiGetFxDataRequest'
          application/*+json:
            schema:
              $ref: '#/components/schemas/ApiGetFxDataRequest'
      responses:
        '200':
          description: >-
            Returns the available FX observations keyed by conventional pair
            code, plus any lookup errors.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiGetFxDataResponse'
        '400':
          description: BadRequest
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
      security:
        - oauth2: []
        - apikey: []
components:
  schemas:
    ApiGetFxDataRequest:
      required:
        - $type
      type: object
      properties:
        market_data_environment_name:
          type: string
          description: >-
            Name of the market-data environment to use. Supply either this name
            or `provider_id`, not both.
          nullable: true
          example: Example market data
        provider_id:
          type: string
          description: >-
            Opaque identifier of the market-data provider to use. Supply either
            this identifier or `market_data_environment_name`, not both.
          nullable: true
        fx_pairs:
          type: array
          items:
            type: string
          description: >-
            Conventional six-character currency pairs, such as GBPUSD, that
            narrow the FX operation.
          nullable: true
        start_date:
          type: string
          description: >-
            Required ISO 8601 date/time value whose calendar date is the
            inclusive lower boundary.
          format: date-time
        end_date:
          type: string
          description: >-
            Required ISO 8601 date/time value whose calendar date is the
            inclusive upper boundary.
          format: date-time
        $type:
          type: string
          enum:
            - >-
              Derivitec.Web.Core.MarketData.ApiGetFxDataRequest,
              Derivitec.Web.Core
      additionalProperties: false
      description: Queries dated FX observations by currency pair and date range.
    ApiGetFxDataResponse:
      required:
        - $type
      type: object
      properties:
        is_success:
          type: boolean
          description: >-
            Whether the operation completed successfully. The default is `true`;
            error outcomes set it to `false`.
          example: true
        error_messages:
          type: array
          items:
            type: string
          description: >-
            Messages explaining operation-level failures. The collection is
            empty by default.
          nullable: true
        fx_data:
          type: array
          items:
            $ref: '#/components/schemas/StringFxDataIEnumerableKeyValuePair'
          description: FX observations returned by the query.
          nullable: true
        $type:
          type: string
          enum:
            - >-
              Derivitec.Web.Core.MarketData.ApiGetFxDataResponse,
              Derivitec.Web.Core
      additionalProperties: false
      description: Returns dated FX observations.
    StringFxDataIEnumerableKeyValuePair:
      type: object
      properties:
        key:
          type: string
          nullable: true
        value:
          type: array
          items:
            $ref: '#/components/schemas/FxData'
          nullable: true
      additionalProperties: false
    FxData:
      required:
        - $type
      type: object
      properties:
        provider_id:
          type: string
          description: >-
            Market-data provider code recorded as the source of the
            contribution. Defaults to Derivitec.
          nullable: true
        derivitec_created:
          type: string
          description: Timestamp at which the market-data record was created.
        derivitec_modified:
          type: string
          description: Optional timestamp of the record's latest modification.
          nullable: true
        uploaded_date_time:
          type: string
          description: >-
            Optional timestamp at which the contribution was uploaded.
            UploadRateAssets ignores the supplied value on each rate asset and
            stores the current UTC time.
          nullable: true
        derivitec_modified_by:
          type: string
          description: >-
            Principal recorded as the latest modifier. UploadRateAssets ignores
            the supplied value on each rate asset and stores the authenticated
            user identifier.
          nullable: true
        uploaded_by:
          type: string
          description: >-
            Principal recorded as the uploader. UploadRateAssets ignores the
            supplied value on each rate asset and stores the authenticated user
            identifier.
          nullable: true
        rolled:
          type: boolean
          description: Whether the contribution has been rolled.
          example: false
        close:
          type: number
          description: Close observation for the FX pair and date.
          format: double
        open:
          type: number
          description: Optional open observation for the FX pair and date.
          format: double
          nullable: true
        high:
          type: number
          description: Optional high observation for the FX pair and date.
          format: double
          nullable: true
        low:
          type: number
          description: Optional low observation for the FX pair and date.
          format: double
          nullable: true
        date:
          type: string
          description: Date of the FX observation.
          format: date-time
        fx_pair:
          type: string
          description: Currency-pair code for the observation.
          nullable: true
        fixing_type:
          type: string
          description: Fixing or cut label for the observation.
          nullable: true
        $type:
          type: string
          enum:
            - Derivitec.Web.Core.MarketData.FxData, Derivitec.Web.Core
      additionalProperties: false
      description: >-
        Dated FX observation with fixing label and optional open, high, and low
        values.
  securitySchemes:
    oauth2:
      type: oauth2
      description: >-
        OAuth2 access-token requested from AWS Cognito and provided as a Auth
        Bearer header
      flows:
        implicit:
          authorizationUrl: https://auth.riskportal.derivitec.com/oauth2/authorize
          scopes: {}
    apikey:
      type: apiKey
      description: API-Key requested via the site and provided as a header
      name: x-api-key
      in: header

````