By the end of this guide you will have a working OpenClaw AI agent that can fetch live macroeconomic indicators from FXMacroData on demand — answering questions like "What is the current AUD policy rate?" or "Give me the latest USD CPI reading" directly inside your OpenClaw chat interface.
Prerequisites
- • An OpenClaw account and a running OpenClaw instance (desktop app, Docker, or CLI install)
- • A FXMacroData API key — obtain one at fxmacrodata.com
- • Basic familiarity with JSON configuration files
- • An internet connection from your OpenClaw host to reach
fxmacrodata.com
Step 1 — Locate your FXMacroData API key
Sign in to your FXMacroData account and navigate to your profile settings to find your API key. Keep it handy — you will paste it into your OpenClaw configuration in Step 3. Every request to a non-USD endpoint must include this key as a query parameter:
https://fxmacrodata.com/api/{currency}/{indicator}?api_key=YOUR_API_KEY
For example, to pull the current AUD policy rate you would call:
https://fxmacrodata.com/api/aud/policy_rate?api_key=YOUR_API_KEY
USD endpoints are publicly accessible without a key, so you can test connectivity before adding your credentials. See the full endpoint reference at /api-data-docs/usd/policy_rate and explore other currencies from there.
Step 2 — Verify the API response format
Before wiring OpenClaw to FXMacroData it helps to confirm what the API returns.
Open a terminal and run a quick test with curl (replace YOUR_API_KEY):
curl "https://fxmacrodata.com/api/usd/cpi?api_key=YOUR_API_KEY"
You should receive a JSON array of historical records, each containing a date and the indicator value. For example:
[
{
"date": "2025-01-15",
"announcement_datetime": "2025-01-15T13:30:00Z",
"value": 3.1,
"previous": 3.0
},
...
]
The most recent record in the array is the latest available reading. OpenClaw will be configured to request and summarise this data in plain language.
Step 3 — Store your API key in OpenClaw
OpenClaw keeps sensitive credentials separate from skill definitions so they never appear in plain-text configuration files that might be shared or version-controlled.
Add your FXMacroData key using the OpenClaw CLI:
openclaw credentials set FXMACRODATA_API_KEY "YOUR_API_KEY"
Alternatively, open ~/.openclaw/credentials/ and create a file named
FXMACRODATA_API_KEY containing only the key value, with no trailing newline.
OpenClaw picks up credential files from this directory automatically on startup.
Step 4 — Create the FXMacroData skill definition
Skills are JSON (or YAML) files that teach OpenClaw how to call an external API. Create a new file
at ~/.openclaw/skills/fxmacrodata.json with the content below.
The {{FXMACRODATA_API_KEY}} placeholder is automatically substituted at runtime with the
credential you stored in Step 3.
{
"skill_id": "fxmacrodata",
"name": "FXMacroData",
"description": "Fetch live macroeconomic indicators for major currency pairs from FXMacroData.",
"base_url": "https://fxmacrodata.com/api",
"auth": {
"type": "query_param",
"param": "api_key",
"credential": "FXMACRODATA_API_KEY"
},
"endpoints": [
{
"id": "get_indicator",
"method": "GET",
"path": "/{currency}/{indicator}",
"description": "Return the latest historical data for one indicator and currency.",
"parameters": {
"currency": {
"type": "string",
"description": "ISO currency code, e.g. aud, eur, gbp, usd, nzd, cad, chf, jpy",
"required": true
},
"indicator": {
"type": "string",
"description": "Indicator name, e.g. policy_rate, cpi, gdp, unemployment_rate",
"required": true
}
}
}
]
}
Save the file, then reload skills from the OpenClaw admin dashboard or by running:
openclaw skills reload
Step 5 — Test the skill in the OpenClaw chat
With the skill loaded, open a chat session in OpenClaw (any connected channel — Discord, Telegram, WhatsApp, or the web interface) and ask a natural-language question:
What is the current AUD policy rate?
OpenClaw will map this to the get_indicator endpoint with
currency=aud and indicator=policy_rate, call the
AUD policy rate endpoint,
and return a plain-English summary of the latest value and announcement date.
Try a few more queries to confirm the integration is working:
Show me the latest EUR CPI reading.
What is the GBP unemployment rate?
Give me USD GDP data.
Alternate approach: Connect via MCP
If your OpenClaw build supports
Model Context Protocol (MCP),
you can expose FXMacroData as a native MCP server instead of a skill JSON file.
This lets OpenClaw (or any MCP-compatible agent such as Claude Desktop or Cursor) call
a typed get_indicator tool directly — no skill definition boilerplate required.
MCP server configuration
Add the following block to your OpenClaw MCP configuration file
(typically ~/.openclaw/mcp_servers.json or the equivalent path shown in your
OpenClaw settings). Replace YOUR_API_KEY with your FXMacroData API key.
{
"mcpServers": {
"fxmacrodata": {
"command": "uvx",
"args": ["fxmacrodata-mcp"],
"env": {
"FXMACRODATA_API_KEY": "YOUR_API_KEY"
}
}
}
}
Save the file and restart OpenClaw. The agent will start the MCP server process automatically and register the tools it exposes.
Tool schema exposed by the MCP server
The FXMacroData MCP server exposes a single get_indicator tool with the
following schema. OpenClaw reads this automatically — you do not need to define it manually.
{
"name": "get_indicator",
"description": "Fetch the latest historical data for a macroeconomic indicator and currency pair from FXMacroData.",
"inputSchema": {
"type": "object",
"properties": {
"currency": {
"type": "string",
"description": "ISO currency code — e.g. aud, eur, gbp, usd, nzd, cad, chf, jpy"
},
"indicator": {
"type": "string",
"description": "Indicator name — e.g. policy_rate, cpi, gdp, unemployment_rate"
}
},
"required": ["currency", "indicator"]
}
}
Verify the MCP connection
Once the server is registered, open an OpenClaw chat and ask a natural-language question. OpenClaw will route it through the MCP tool call automatically:
What is the current AUD policy rate?
Under the hood, the agent issues a tool call equivalent to:
{
"tool": "get_indicator",
"arguments": { "currency": "aud", "indicator": "policy_rate" }
}
The MCP server translates this into a request to
https://fxmacrodata.com/api/aud/policy_rate?api_key=…
and returns the JSON payload to OpenClaw, which then summarises it for you in plain English.
REST API vs MCP — which should you use?
- Skill JSON (REST API): works with any OpenClaw version; full control over auth, retries, and scheduling.
- MCP server: simpler setup for supported clients; the agent resolves currency and indicator names automatically from the tool schema; credentials are passed via environment variable rather than embedded in skill JSON files.
Both approaches use the same underlying FXMacroData REST endpoints — MCP just adds a typed abstraction layer on top.
Step 6 — Automate indicator alerts (optional)
Once the skill is verified you can set up scheduled workflow triggers so your OpenClaw agent
automatically monitors key indicators and pushes alerts to your preferred channel.
Create a workflow file at ~/.openclaw/workflows/fx_alerts.json:
{
"workflow_id": "fx_macro_alerts",
"schedule": "0 8 * * 1-5",
"description": "Post a morning FX macro briefing on weekdays at 08:00 UTC.",
"steps": [
{
"skill": "fxmacrodata",
"endpoint": "get_indicator",
"params": { "currency": "aud", "indicator": "policy_rate" },
"label": "AUD Policy Rate"
},
{
"skill": "fxmacrodata",
"endpoint": "get_indicator",
"params": { "currency": "eur", "indicator": "cpi" },
"label": "EUR CPI"
},
{
"skill": "fxmacrodata",
"endpoint": "get_indicator",
"params": { "currency": "gbp", "indicator": "unemployment_rate" },
"label": "GBP Unemployment"
}
],
"output_channel": "your-channel-id"
}
Adjust the schedule cron expression and output_channel to match your setup.
This workflow requests three indicators every weekday morning and posts a consolidated briefing —
useful before the London or New York session open.
Reload workflows after saving:
openclaw workflows reload
What you built
- ✓ Stored your FXMacroData API key securely in OpenClaw's credential store
- ✓ Defined a reusable FXMacroData skill covering all currency and indicator endpoints
- ✓ Verified live data retrieval through natural-language chat queries
- ✓ (Alternate) Configured FXMacroData as an MCP server for agents that support Model Context Protocol
- ✓ (Optional) Scheduled automated morning macro briefings via an OpenClaw workflow
Next steps
With live macro data flowing into OpenClaw you can go further:
- Extend the skill with additional endpoints such as GDP, 10-year bond yields, or trade balance data to build a richer briefing.
- Combine with a trading skill — wire OpenClaw to your broker's API alongside FXMacroData so the agent can surface a macro reading and a live price in the same response.
- Build conditional alerts — trigger a notification only when a policy rate changes or when CPI crosses a threshold you define in the workflow logic.
— The FXMacroData Team