---
title: "Get FX spot rates"
method: GET
path: "/v1/forex/{base}/{quote}"
tags: ["fx_markets"]
---

# Get FX spot rates

`GET /v1/forex/{base}/{quote}`

## Request

- Base URL: `https://api.fxmacrodata.com`
- URL: `https://api.fxmacrodata.com/v1/forex/{base}/{quote}`
- Auth: one of:
  - none
  - API key in header `X-API-Key`
  - HTTP bearer

Fetches daily FX spot rates between two currencies using official central-bank reference rates.

**Path Parameters:**
- `base`: Base currency code (e.g., AUD, USD).
- `quote`: Quote currency code (e.g., USD, EUR).

**Query Parameters:**
- `start_date`: Optional. Start date YYYY-MM-DD. Defaults to 365 days ago.
- `end_date`: Optional. End date YYYY-MM-DD. Defaults to today.

- `indicators`: Optional. Comma-separated list of technical indicators to compute from the spot-rate series and include in the response. Pass `all` to include every supported indicator. Supported values: `adx_14`, `atr_14`, `bollinger_bands`, `cci_20`, `donchian_20`, `ema_12`, `ema_20`, `ema_200`, `ema_26`, `ema_50`, `macd`, `macd_histogram`, `macd_signal`, `rsi_14`, `sma_20`, `sma_200`, `sma_50`, `stochastic_14_3`, `williams_r_14`, `all`.

**Daily reference OHLC:**
- On qualifying dates, `data[]` also includes `open`, `high`, `low`, and `close` built from timestamped eligible reference observations. These are `reference_observation_ohlc` bars, not executable-market candles. Rows without at least four observations omit the OHLC fields.

**FX source and derivation metadata:**
- FX values are official reference rates collected by FXMacroData. USD-quoted pairs are the base series; inverse and cross pairs are derived from those legs when the publisher does not provide the requested pair directly.
- Responses include `pair_metadata` and row-level `data[].source` with `direct_available`, `inverse_available`, `is_derived`, `derived_from_inverse`, `derived_from_cross`, `derived_from_source_legs`, `derivation_method`, `anchor_currency`, `source_pair`, `source_legs`, and `pair_consistency_check`.
- Upstream FX source priority is BIS XRU daily USD exchange rates where available, then official national-bank daily sources, explicitly labelled EUR/CAD-derived daily crosses, official USD pegs, BIS monthly averages expanded to business days, IMF IFS monthly rates, and World Bank annual rates. Lower-frequency expansions are labelled with `source_frequency` and `derivation_method`; they are not presented as true daily fixings.
- `data[].observation_datetime` is the UTC midnight timestamp for the FX reference date. It is an observation-date marker, not a publication timestamp.
- XAU/USD and USD/XAU use the stored gold series: the National Bank of Ukraine official accounting price of gold divided by the NBU official UAH/USD rate for the same official rate date (Narodowy Bank Polski gold only for dates the NBU did not supply). Source: National Bank of Ukraine (https://bank.gov.ua/en/open-data). No publication clock or LBMA auction price is asserted. Weekday-label coverage is included.

## Path parameters

- `base` 'AUD' | 'BRL' | 'CAD' | 'CHF' | 'CNH' | 'CNY' | 'DKK' | 'EUR' | 'GBP' | 'HUF' | 'ILS' | 'JPY' | 'KRW' | 'MYR' | 'NGN' | 'NOK' | 'NZD' | 'PEN' | 'SEK' | 'THB' | 'TWD' | 'USD', required: Base currency code
- `quote` 'AUD' | 'BRL' | 'CAD' | 'CHF' | 'CNH' | 'CNY' | 'DKK' | 'EUR' | 'GBP' | 'HUF' | 'ILS' | 'JPY' | 'KRW' | 'MYR' | 'NGN' | 'NOK' | 'NZD' | 'PEN' | 'SEK' | 'THB' | 'TWD' | 'USD', required: Quote currency code

## Query parameters

- `start_date` string: Start date YYYY-MM-DD
- `end_date` string: End date YYYY-MM-DD
- `limit` integer: Maximum rows to return. Defaults to 20. Maximum 100.
- `offset` integer: Number of rows to skip after most-recent-first ordering.
- `page` integer, nullable: One-based page number. When supplied, it takes precedence over offset.
- `indicators` string: Comma-separated technical indicators to compute (e.g. sma_20,rsi_14,macd,bollinger_bands). Use 'all' to request every supported indicator.
- `dataset_version` string, nullable: Pin the content version returned by the first page; changed history returns 409.
- `api_key` string: Your Individual or Business API key

## Response `200`

Daily FX spot-rate series with optional computed technical indicators.

- ForexResponse
  - `base` string, required
  - `quote` string, required
  - `source` string, required
  - `provenance` object, required
    - `publisher` string, nullable
    - `publisher_url` string, nullable
    - `storage` string, nullable: Data provider label for the served series. Always `FXMacroData`.
    - `served_by` string, nullable: FXMacroData endpoint that serves this series.
    - `timestamp_field` string, nullable
    - `value_field` string, nullable
  - `pair_metadata` object: Whether the pair is served directly, inverted, or crossed via an anchor.
    - `source_pair` string, nullable
    - `is_derived` boolean, nullable
    - `direct_available` boolean, nullable
    - `inverse_available` boolean, nullable
    - `original_pair_available` boolean, nullable
    - `original_inverse_pair_available` boolean, nullable
    - `derived_from_inverse` boolean, nullable
    - `derived_from_cross` boolean, nullable
    - `derived_from_source_legs` boolean, nullable
    - `derivation_method` string, nullable
    - `anchor_currency` string, nullable
    - `derived_value` union
      - integer
      - number
    - `pair_consistency_check` string, nullable
    - `source_note` string, nullable
    - `source_legs` FxSourceLeg[], nullable
      - `pair` string, nullable
      - `source_pair` string, nullable
      - `storage_path` string, nullable: Retained for compatibility. Always null.
      - `stored_source` string, nullable: Retained for compatibility. Always null.
      - `source_provider` string, nullable
      - `source_name` string, nullable
      - `source_url` string, nullable
      - `source_frequency` string, nullable
      - `source_type` string, nullable
      - `is_derived` boolean, nullable
      - `derivation_method` string, nullable
      - `anchor_currency` string, nullable
      - `data_policy` string, nullable
      - `last_updated` string, nullable
      - `backfill_window` object, nullable
      - `source_legs` object[], nullable
  - `data_quality` DataQuality, required
    - `source_freshness` string, nullable
    - `source_monitoring_complete` boolean, nullable
    - `known_source_gap` boolean, nullable
    - `source_checked_at` integer, nullable
    - `source_check_expires_at` integer, nullable
    - `latest_published_period` string, nullable
    - `source_permission_status` string, nullable
    - `commodity_coverage` CommodityCoverage
      - `scope` string, required
      - `requested_start` string, nullable
      - `requested_end` string, nullable
      - `available_start` string, nullable
      - `available_end` string, nullable
      - `input_row_count` integer, required
      - `row_count` integer, required
      - `distinct_date_count` integer, required
      - `duplicate_date_row_count` integer, required
      - `excluded_weekend_row_count` integer, required
      - `invalid_date_row_count` integer, required
      - `expected_weekday_label_count` integer, required
      - `missing_weekday_label_count` integer, required
      - `largest_missing_weekday_run` integer, required
      - `largest_calendar_gap_days` integer, required
      - `missing_weekday_ranges` CommodityMissingWeekdayRange[], required
        - `start_date` string, required
        - `end_date` string, required
        - `weekday_count` integer, required
      - `longest_continuous_weekday_segment` CommodityCoverageSegment, required
        - `start_date` string, nullable
        - `end_date` string, nullable
        - `row_count` integer, required
      - `latest_continuous_weekday_segment` CommodityCoverageSegment, required
        - `start_date` string, nullable
        - `end_date` string, nullable
        - `row_count` integer, required
      - `sparse_history` boolean, required
      - `coverage_basis` string, required
      - `continuous_coverage_verified` boolean
      - `reference_only` boolean
      - `executable_quotes` boolean
      - `provenance_version` integer, required
      - `repaired_excluded_weekend_row_count` integer
      - `repaired_invalid_date_row_count` integer
    - `stored_history_coverage` CommodityCoverage
      - `scope` string, required
      - `requested_start` string, nullable
      - `requested_end` string, nullable
      - `available_start` string, nullable
      - `available_end` string, nullable
      - `input_row_count` integer, required
      - `row_count` integer, required
      - `distinct_date_count` integer, required
      - `duplicate_date_row_count` integer, required
      - `excluded_weekend_row_count` integer, required
      - `invalid_date_row_count` integer, required
      - `expected_weekday_label_count` integer, required
      - `missing_weekday_label_count` integer, required
      - `largest_missing_weekday_run` integer, required
      - `largest_calendar_gap_days` integer, required
      - `missing_weekday_ranges` CommodityMissingWeekdayRange[], required
        - `start_date` string, required
        - `end_date` string, required
        - `weekday_count` integer, required
      - `longest_continuous_weekday_segment` CommodityCoverageSegment, required
        - `start_date` string, nullable
        - `end_date` string, nullable
        - `row_count` integer, required
      - `latest_continuous_weekday_segment` CommodityCoverageSegment, required
        - `start_date` string, nullable
        - `end_date` string, nullable
        - `row_count` integer, required
      - `sparse_history` boolean, required
      - `coverage_basis` string, required
      - `continuous_coverage_verified` boolean
      - `reference_only` boolean
      - `executable_quotes` boolean
      - `provenance_version` integer, required
      - `repaired_excluded_weekend_row_count` integer
      - `repaired_invalid_date_row_count` integer
    - `point_in_time_basis` string, nullable
    - `is_official` boolean, required
    - `is_proxy` boolean, required
    - `is_fallback` boolean, required
    - `is_stale` boolean, required
    - `has_announcement_datetime` boolean, required
    - `point_in_time_safe` boolean, required: Whether the returned values have verified availability and vintage evidence; estimated release times do not qualify.
    - `unverified_vintage_count` integer
    - `unknown_publication_time_count` integer
    - `latest_available_date` string, nullable
    - `last_updated` string, nullable
    - `data_lag_days` integer, nullable
    - `source_name` string, nullable
    - `source_type` 'official' | 'public' | 'fallback' | 'derived', required
    - `is_derived` boolean
    - `row_count` integer
    - `announcement_datetime_count` integer
    - `missing_announcement_datetime_count` integer
    - `has_assumed_release_times` boolean: True when at least one row in the quality scope carries a publication timestamp derived from the publication lag measured on that series' own confirmed releases, because no official release calendar reaches the period.
    - `assumed_release_time_count` integer: Number of rows in the quality scope whose publication timestamp was derived rather than captured. Compare against row_count to size the derived portion of the requested window.
    - `bounded_release_time_count` integer: Legacy rows carrying an upper-bound estimate flag; this does not certify replay safety.
    - `unbounded_release_time_count` integer: Assumed timestamps without proven availability bounds.
    - `quality_scope` string
    - `stale_after_days` integer, nullable
    - `requested_window_has_data` boolean, nullable
    - `requested_window_latest_date` string, nullable
    - `requested_window_includes_latest_available` boolean, nullable
    - `page_includes_latest_available` boolean, nullable
    - `returned_latest_available_before_window` boolean, nullable
    - `staleness_days` integer, nullable
    - `reason` string, nullable
    - `datetime_field` string, nullable
    - `datetime_precision` string, nullable
    - `datetime_semantics` string, nullable
    - `source_legs` object[], nullable
    - `historical_point_in_time` PointInTimeCompleteness: Coverage of source-confirmed publication timestamps for a dataset.
      - `row_count` integer, required
      - `announcement_datetime_count` integer, required
      - `missing_announcement_datetime_count` integer, required
      - `assumed_release_time_count` integer
      - `bounded_release_time_count` integer
      - `unbounded_release_time_count` integer
      - `unverified_vintage_count` integer
      - `unknown_publication_time_count` integer
      - `point_in_time_safe` boolean, required
  - `start_date` string, required
  - `end_date` string, required
  - `pagination` object, required: Offset pagination state for one page of results.
    - `limit` integer, nullable
    - `offset` integer, nullable
    - `returned_count` integer, nullable
    - `total_count` integer, nullable
    - `has_more` boolean, nullable
    - `next_offset` integer, nullable
    - `page_includes_latest_available` boolean, nullable
  - `data` ForexDataPoint[], required
    - `source_permission_status` string, nullable
    - `date` string, required
    - `val` number, nullable
    - `open` number, nullable
    - `high` number, nullable
    - `low` number, nullable
    - `close` number, nullable
    - `ohlc_point_count` integer, nullable
    - `ohlc_source_count` integer, nullable
    - `ohlc_timestamp_start_utc` string, nullable
    - `ohlc_timestamp_end_utc` string, nullable
    - `ohlc_type` string, nullable
    - `announcement_datetime` integer, nullable
    - `observation_datetime` integer, nullable
    - `observation_datetime_iso` string, nullable
    - `observation_datetime_precision` string, nullable
    - `source_type` string, nullable
    - `source_chart_timestamp` integer, nullable
    - `source_chart_timestamp_ms` integer, nullable
    - `source_chart_period` string, nullable
    - `quote_time_status` string, nullable
    - `sampling_method` string, nullable
    - `publication_time_status` string, nullable
    - `point_in_time_safe` boolean, nullable
    - `provenance_version` integer, nullable
    - `is_official` boolean, nullable
    - `source_series_id` string, nullable
    - `announcement_date` string, nullable
    - `announcement_timezone` string, nullable
    - `time_announced` boolean, nullable
    - `cross_check_divergence_pct` number, nullable
    - `cross_check_divergent` boolean, nullable
    - `source` object: How one observation was sourced.
      - `source_pair` string, nullable
      - `is_derived` boolean, nullable
      - `derived_from_source_legs` boolean, nullable
      - `derivation_method` string, nullable
      - `pair_consistency_check` string, nullable
      - `source_legs` FxSourceLeg[], nullable
        - `pair` string, nullable
        - `source_pair` string, nullable
        - `storage_path` string, nullable: Retained for compatibility. Always null.
        - `stored_source` string, nullable: Retained for compatibility. Always null.
        - `source_provider` string, nullable
        - `source_name` string, nullable
        - `source_url` string, nullable
        - `source_frequency` string, nullable
        - `source_type` string, nullable
        - `is_derived` boolean, nullable
        - `derivation_method` string, nullable
        - `anchor_currency` string, nullable
        - `data_policy` string, nullable
        - `last_updated` string, nullable
        - `backfill_window` object, nullable
        - `source_legs` object[], nullable
    - `sma_20` number, nullable
    - `sma_50` number, nullable
    - `sma_200` number, nullable
    - `ema_12` number, nullable
    - `ema_20` number, nullable
    - `ema_26` number, nullable
    - `ema_50` number, nullable
    - `ema_200` number, nullable
    - `rsi_14` number, nullable
    - `atr_14` number, nullable
    - `adx_14` number, nullable
    - `stoch_k_14` number, nullable
    - `stoch_d_3` number, nullable
    - `williams_r_14` number, nullable
    - `cci_20` number, nullable
    - `donchian_upper_20` number, nullable
    - `donchian_middle_20` number, nullable
    - `donchian_lower_20` number, nullable
    - `macd` number, nullable
    - `macd_signal` number, nullable
    - `macd_histogram` number, nullable
    - `bb_upper` number, nullable
    - `bb_middle` number, nullable
    - `bb_lower` number, nullable
  - `indicators` object, nullable
  - `daily_ohlc_basis` object, nullable
  - `technical_indicator_basis` object, nullable
  - `dataset_version` string, required
  - `coverage` object, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/fxmacrodata/apis/fx-macrodata-api.md) · [All operations](https://skmtc.dev/fxmacrodata/apis/fx-macrodata-api/llms.txt) · [OpenAPI document](https://skmtc.dev/fxmacrodata/apis/fx-macrodata-api/revisions/fadaa543b154?raw)
