Request Parameters & Usage
| Parameter | Required | Format | Description |
|---|---|---|---|
start_date |
YES | YYYY-MM-DD |
The start date for the data retrieval. |
end_date |
NO | YYYY-MM-DD |
The end date for the data retrieval. Defaults to today's date. |
api_key |
CONDITIONAL | string |
Required for non-USD and paid access. USD endpoints are available free without an API key. |
Example Usage
To retrieve the 2-Year Government Bond Yield data for CHF starting from the beginning of 2023:
GET https://fxmacrodata.com/api/chf/gov_bond_2y?start_date=2023-01-01&end_date=2023-12-31&api_key=YOUR_API_KEY