Use FXMacroData in Pipedream
Read an indicator's release history, an FX pair, a commodity, a release calendar or COT positioning inside a Pipedream workflow, and start workflows when a new release is published or a new event is added to a release calendar. Every request runs on Pipedream's servers.
Free USD data
Without an API key, USD indicators, the USD release calendar and USD COT positioning are available for the last 90 days, with a 15-minute delay after each release. The indicator list is free for every currency.
Subscription data
Other currencies, FX rates, commodities, full history and release webhooks need an API key from a subscription.
Key handling
The key is stored in your connected FXMacroData account and sent only in the X-API-Key header, never as a query parameter. The key is optional: leave it empty to use free USD data.
Get started
- Connect your FXMacroData account in Pipedream and paste your API key from your account page, or leave the key empty for free USD data.
- Add an FXMacroData action to a workflow, for example Get Indicator with currency
USDand indicatorinflation. - To start workflows on releases, use New Indicator Release, which checks on a schedule, or New Indicator Release (Instant), which receives a signed webhook the moment a release is recorded.
Actions
List actions page through results 100 rows at a time up to Max Results (default 100, maximum 5,000), newest first.
| Action | Returns | Access |
|---|---|---|
| Get Indicator | Release history for a macro indicator such as inflation, GDP, policy rate or unemployment: period date, value, previous value, change and release time. | USD free |
| Get FX Rate | Daily FX rates for a currency pair, with open, high, low and close. | Subscription |
| Get Commodity | Price or inventory history for gold, silver, platinum, WTI, Brent, natural gas and US energy inventories. | Subscription |
| Get Release Calendar | Scheduled releases and central-bank decisions for a currency from official publisher schedules, optionally filtered by indicator and importance. | USD free |
| Get COT Positioning | Weekly CFTC positioning: open interest and net positions for non-commercial, commercial, leveraged funds, asset managers and dealers. | USD free |
| List Indicators | The indicators published for a currency, with name, unit and frequency. | Free, every currency |
Triggers
| Trigger | How it works |
|---|---|
| New Indicator Release | Checks every 15 minutes (you can change the timer) and emits each new period of the chosen indicator, for example a CPI print or a policy-rate decision. A revision to a period already emitted is not emitted again. USD works without an API key. |
| New Calendar Event | Checks every 15 minutes and emits each release or central-bank decision added to a currency's official release calendar, optionally filtered by importance. A rescheduled event is emitted again with its new time. |
| New Indicator Release (Instant) | Creates an FXMacroData webhook subscription when you deploy it and deletes it when you remove it. Each delivery is checked against its X-FXMD-Signature header and a five-minute timestamp window before it is emitted. Filter by currencies and indicators, or leave the filters empty to receive every release. Needs a subscription that includes webhook delivery. |
When a polling trigger is first deployed it emits the 10 most recent (or soonest) items, then only new ones. Each emitted event is de-duplicated on its period or event ID.
Example workflows
- Release alerts: when US CPI or a policy-rate decision is published, post the value, the previous value and the change to Slack, Discord or email.
- Spreadsheet sync: append each new release to Google Sheets or Airtable so a model or dashboard always has the latest print.
- Event-risk calendar: add each scheduled high-importance release to a shared Google Calendar.
- Research pipelines: pull FX rates and COT positioning on a schedule and write them to a database for analysis.
Call the API from a code step
Any endpoint in the API reference can also be called from a Node.js code step. Store your key as a Pipedream environment variable named FXMD_API_KEY and send it in the header.
Node.js code step
import { axios } from "@pipedream/platform";
export default defineComponent({
async run({ steps, $ }) {
const headers = process.env.FXMD_API_KEY
? { "X-API-Key": process.env.FXMD_API_KEY }
: {};
return await axios($, {
url: "https://api.fxmacrodata.com/v1/announcements/usd/inflation",
headers,
params: { fields: "compact", limit: 12 },
});
},
});
To receive releases on an HTTP trigger of your own, create a webhook with the Your server (signed JSON) destination in API management, paste the trigger URL, and verify each delivery as described in webhook signatures.
Troubleshooting
- "This data needs an FXMacroData subscription key": the request is outside the free tier, such as a non-USD currency, an FX pair, a commodity or history older than 90 days. Add a subscription key to the connection.
- Rate limit reached (HTTP 429): wait a minute and run the step again, or lower Max Results.
- The instant trigger does not activate: webhook delivery needs a paid plan. New Indicator Release works on every plan.
- The instant trigger receives nothing: check the currency and indicator filters, or leave them empty to receive every release.
Related docs
Questions about a Pipedream setup? Contact info@fxmacrodata.com.