Skip to main content
GET
/
openapi
/
v1
/
macro
/
exchange-rate
Exchange rate series
curl --request GET \
  --url https://api.hayinsights.com/openapi/v1/macro/exchange-rate \
  --header 'X-API-Key: <api-key>'
{
  "success": true,
  "statusCode": 200,
  "data": [
    {
      "date": "2024-01-12",
      "close": 144.89,
      "exchangeRateName": "USD/JPY"
    },
    {
      "date": "2024-01-15",
      "close": 148.5,
      "exchangeRateName": "USD/JPY"
    }
  ],
  "meta": {
    "timestamp": "2026-06-19T08:50:42.493Z"
  }
}

Authorizations

X-API-Key
string
header
required

Your HayInsights API key (prefixed apk_). Create and manage keys in the HayInsights dashboard (Account → API keys).

Send it in the X-API-Key header on every request to /openapi/v1/*. Which data domains you may access and your request quota are both governed by the subscription plan attached to the key — see the Plans & features and Rate limits guides.

Query Parameters

currency1
string
required

Base currency code.

Example:

"USD"

currency2
string
required

Quote currency code.

Example:

"JPY"

period
enum<string>

Look-back window.

ValueDescription
1MLast 1 month
3MLast 3 months
6MLast 6 months
1YLast 1 year
3YLast 3 years
5YLast 5 years
10YLast 10 years
20YLast 20 years
Available options:
1M,
3M,
6M,
1Y,
3Y,
5Y,
10Y,
20Y
Example:

"1Y"

before
string<date>

Return only observations dated before this date.

Example:

"2024-01-01"

Response

Closing exchange-rate series for the pair.

Standard success envelope shared by every endpoint. Each operation's response wrapper extends this (via allOf) and adds a typed data property.

success
boolean
required

Always true for a successful response.

Example:

true

statusCode
integer
required

Mirrors the HTTP status code.

Example:

200

data
object[]
required
meta
object

Response metadata. Always present; timestamp is the server time the response was generated.