Snelstart

Aan de slag in elke taal

De FXMacroData API is een standaard JSON REST API. Elke taal met HTTP ondersteuning werkt. Freemium tijdreeks endpoints zijn beschikbaar voor de meest recente 90 dagen zonder sleutel. Voeg een Individuele API sleutel toe om de volledige geschiedenis en betaalde endpoint families te ontgrendelen.

Basis URL

https://api.fxmacrodata.com

Authenticatie

X-API-Sleutel: YOUR_API_KEY

Authorization: Bearer YOUR_API_KEY

?api_key=YOUR_API_KEY

Responsformat

JSON (Content-Type: application/json)

Genereer automatisch getypeerde clients: Gebruik de gepubliceerde OpenAPI 3.1 specificatie met openapi-generator-cli om automatisch clients te genereren in 40+ talen.
Gratis prestatievoordelen: Verzenden Accept-Encoding: gzip op elke request (8–12× kleinere payloads), hergebruik de ETag responsheader in If-None-Match op herhaalde peilingen (geeft terug 304 Not Modified zonder body), en geef ?limit=50 op single-indicator endpoints zoals /v1/announcements/usd/inflation of /v1/predictions/usd/inflation wanneer u alleen recente rijen nodig heeft. Bekijk de volledige referentie →
Ontdek indicator slugs voordat u paden hard-codeert: Indicator slugs variëren per valuta — core_pce bestaat voor USD maar niet voor elke valuta. Lijst elke slug die een valuta ondersteunt met GET /v1/data_catalogue/{currency}, bijvoorbeeld /v1/data_catalogue/usd. Een 404 met error_code: NO_DATA_IN_REQUESTED_WINDOW betekent dat de slug geldig is en alleen het gevraagde datavenster leeg is — verbreden start_date/end_date in plaats van de URL te wijzigen.
Controleer responskwaliteit: Bron-ondersteunde endpoints retourneren een top-level data_quality object. Voor backtests en institutionele rapportage, inspecteer point_in_time_safe, has_announcement_datetime, source_type, en is_stale.

Eerste API call

Snel Verzoek

Begin met een live aankondigings-endpoint. Authenticatie blijft in de api_key query parameter voor directe browser- en scripttesten.

EUR inflatie voorbeeld GET /api/v1/announcements/eur/inflation
Verzoek snippet
curl "https://api.fxmacrodata.com/v1/announcements/eur/inflation?api_key=YOUR_API_KEY"

Python verzoeken

Kopieerbare Python API requests

Gebruik deze directe REST voorbeelden wanneer u de ruwe API request wilt in plaats van een SDK wrapper. Vervang YOUR_API_KEY alleen op beschermde routes.

USD inflatie marktconsensus

Consensus, enquête, centrale bank, IMF, en FXMacroData voorspellingen gekoppeld aan gerealiseerde aankondigingen.

import requests

url = "https://api.fxmacrodata.com/v1/predictions/usd/inflation"
response = requests.get(url, timeout=20)
response.raise_for_status()
payload = response.json()

print(payload.get("data", payload))

USD inflatie met bekende tijdstempels

Publieke USD inflatiegegevens voor point-in-time backtests.

import requests

url = "https://api.fxmacrodata.com/v1/announcements/usd/inflation"
response = requests.get(url, timeout=20)
response.raise_for_status()
payload = response.json()

print(payload.get("data", payload))

EUR/USD FX spot geschiedenis

Dagelijkse FX prijsgeschiedenis voor paar-grafieken, modellen en release overlays.

import requests

url = "https://api.fxmacrodata.com/v1/forex/eur/usd"
params = {
    "api_key": "YOUR_API_KEY",
}
response = requests.get(url, params=params, timeout=20)
response.raise_for_status()
payload = response.json()

print(payload.get("data", payload))

AUD beleidsrente geschiedenis

Beslissingsgeschiedenis van centrale banken met release-timing voor onderzoek zonder lookahead.

import requests

url = "https://api.fxmacrodata.com/v1/announcements/aud/policy_rate"
params = {
    "api_key": "YOUR_API_KEY",
}
response = requests.get(url, params=params, timeout=20)
response.raise_for_status()
payload = response.json()

print(payload.get("data", payload))

JPY komende publicatieschema

Aankomende macro-evenementen met UTC, market-local, en requested-timezone velden voor planning van alerts, modelverversingen en trading reviews.

import requests

url = "https://api.fxmacrodata.com/v1/calendar/jpy"
params = {
    "timezone": "Asia/Tokyo",
    "api_key": "YOUR_API_KEY",
}
response = requests.get(url, params=params, timeout=20)
response.raise_for_status()
payload = response.json()

print(payload.get("data", payload))

Goudgrondstoffenprijzen

Officiële edelmetalen tijdreeksen met dagelijkse waarden en wijzigingsvelden.

import requests

url = "https://api.fxmacrodata.com/v1/commodities/gold"
params = {
    "api_key": "YOUR_API_KEY",
}
response = requests.get(url, params=params, timeout=20)
response.raise_for_status()
payload = response.json()

print(payload.get("data", payload))
Officiële SDK

Python

Installeer de officiële fxmacrodata package van PyPI. Sync en async clients, pandas-ready output.

pip install fxmacrodata

Gebruik van de SDK

from fxmacrodata import Client

client = Client(api_key="YOUR_API_KEY")

# USD inflation — no-key evaluation, up to 100 requests/day
data = client.get_indicator("usd", "inflation")

# EUR policy rate — requires API key
rate = client.get_indicator("eur", "policy_rate")

# Forex price data — requires API key
fx = client.get_fx_price("usd", "jpy")

De REST API direct gebruiken

import requests

resp = requests.get(
    "https://api.fxmacrodata.com/v1/announcements/usd/inflation",
    timeout=30,
)
resp.raise_for_status()
payload = resp.json()
print(payload["data_quality"]["point_in_time_safe"], payload["data"][0])

Async-client

import asyncio
from fxmacrodata import AsyncClient

async def main():
    async with AsyncClient(api_key="YOUR_API_KEY") as client:
        data = await client.get_indicator("eur", "inflation")
        print(data)

asyncio.run(main())
Nieuw

Voorspellingen & Voorspellingen

De /v1/predictions/{currency}/{indicator} endpoint voorspelt forecast data van marktconsensus-enquêtes, centrale bank-projecties, IMF World Economic Outlook, en professionele voorspellers-enquêtes. Voorspellingen worden aangevraagd voor een specifieke valuta en indicator, zoals https://api.fxmacrodata.com/v1/predictions/usd/inflation; aanvragen voor alleen valuta-voorspellingen worden niet ondersteund. Elke voorspelling is gekoppeld aan de aankondiging via announcement_id, zodat u prognoses kunt koppelen aan gerealiseerde waarnemingen.

Behandel elke forecast niet als consensus. prediction_type="fxmacrodata" is een door FXMacroData gegenereerde schatting; een echte samengestelde consensus wordt gelabeld market_consensus. De beschikbaarheid van prognoses varieert per publicatie — controleer de dekking matrix. Voor onderzoek zonder look-ahead, volg de point-in-time backtesting gids.
USD is gratis voor de meest recente 90 dagen — geen API sleutel nodig voor USD voorspellingen binnen die periode. De volledige USD geschiedenis en alle andere valuta vereisen een geldige proefperiode of betaalde API sleutel.

Python — voorspellingen ophalen en samenvoegen met werkelijke waarden

import requests

# Predictions for USD inflation — no-key evaluation, up to 100 requests/day
preds = requests.get(
    "https://api.fxmacrodata.com/v1/predictions/usd/inflation",
    timeout=30,
).json()

for group in preds["data"]:
    print(group["announcement_id"], group["date"])
    for p in group["predictions"]:
        print(f"  {p['prediction_source_label']}: {p['predicted_value']}")

# Filter by prediction type
market = requests.get(
    "https://api.fxmacrodata.com/v1/predictions/usd/inflation",
    params={"prediction_type": "market_consensus"},
    timeout=30,
).json()

# Join predictions with actuals using announcement_id
actuals = requests.get(
    "https://api.fxmacrodata.com/v1/announcements/usd/inflation",
    timeout=30,
).json()
actuals_by_id = {row["announcement_id"]: row for row in actuals["data"]}

for group in preds["data"]:
    actual = actuals_by_id.get(group["announcement_id"])
    if actual:
        print(f"{group['date']}: actual={actual['val']}, forecast={group['predictions'][0]['predicted_value']}")

cURL — voorspellingen ophalen per type

# All USD inflation predictions — free
curl "https://api.fxmacrodata.com/v1/predictions/usd/inflation"

# Filter by prediction type: market_consensus, imf_weo, central_bank_forecast, survey
curl "https://api.fxmacrodata.com/v1/predictions/usd/inflation?prediction_type=market_consensus"

# EUR predictions — requires API key
curl "https://api.fxmacrodata.com/v1/predictions/eur/inflation?api_key=YOUR_API_KEY"

# USD policy-rate predictions
curl "https://api.fxmacrodata.com/v1/predictions/usd/policy_rate"

Voorspellings types referentie

prediction_typeBeschrijving
market_consensusSamengestelde markt- of econoom event consensus, waar beschikbaar
market_predictionPuntvoorspelling van professionele voorspellers
model_nowcastCentrale bank of reservebank model nowcast
enquêteCentrale bank enquête onder professionele voorspellers (bijv. ECB SPF)
central_bank_forecastOfficiële centrale bank projectie (bijv. RBNZ MPS, BoC MPR)
central_bank_projectionOfficiële centrale bank-projectie
imf_weoIMF World Economic Outlook projectie
fxmacrodataDoor FXMacroData gegenereerde voorspelling die centrale bank-begeleiding, enquêtes en historische trends combineert

cURL

Geen installatie nodig. Werkt vanuit elke terminal.

# USD inflation — no-key evaluation, up to 100 requests/day
curl "https://api.fxmacrodata.com/v1/announcements/usd/inflation"

# EUR policy rate — pass your API key as a query parameter
curl "https://api.fxmacrodata.com/v1/announcements/eur/policy_rate?api_key=YOUR_API_KEY"

# Release calendar for Australia
curl "https://api.fxmacrodata.com/v1/calendar/aud?api_key=YOUR_API_KEY"

# Release calendar converted to a requested IANA timezone
curl "https://api.fxmacrodata.com/v1/calendar/usd?indicator=gdp&timezone=America/Sao_Paulo"

# Forex price history — requires API key
curl "https://api.fxmacrodata.com/v1/forex/usd/jpy?api_key=YOUR_API_KEY"

# Data catalogue (discover available indicators for USD)
curl "https://api.fxmacrodata.com/v1/data_catalogue/usd"

JavaScript / TypeScript

Werkt in Node.js (18+), Deno, Bun en moderne browsers met de Fetch API.

Officiële npm client

npm install @fxmacrodata/client
import { FXMacroDataClient } from "@fxmacrodata/client";

const client = new FXMacroDataClient({
  apiKey: "YOUR_API_KEY",
});

// Public endpoint example
const usdInflation = await client.announcements("usd", "inflation");

// Non-USD endpoint example (requires paid key)
const eurRate = await client.announcements("eur", "policy_rate");

console.log(usdInflation, eurRate);

Fetch direct gebruiken

// USD inflation — no-key evaluation, up to 100 requests/day
const res = await fetch(
  "https://api.fxmacrodata.com/v1/announcements/usd/inflation"
);
const data = await res.json();
console.log(data);

// With API key for non-USD
const API_KEY = "YOUR_API_KEY";
const eur = await fetch(
  `https://api.fxmacrodata.com/v1/announcements/eur/policy_rate?api_key=${API_KEY}`
);
console.log(await eur.json());

Ga

Geen externe pakketten nodig — de standaardbibliotheek regelt alles.

package main

import (
    "encoding/json"
    "fmt"
    "net/http"
    "io"
)

func main() {
    // USD inflation — no-key evaluation, up to 100 requests/day
    resp, err := http.Get("https://api.fxmacrodata.com/v1/announcements/usd/inflation")
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()

    body, _ := io.ReadAll(resp.Body)

    var result map[string]interface{}
    json.Unmarshal(body, &result;)
    fmt.Println(result)
}

R

Vereist httr en jsonlite.

install.packages(c("httr", "jsonlite"))
library(httr)
library(jsonlite)

# USD inflation — no-key evaluation, up to 100 requests/day
res <- GET("https://api.fxmacrodata.com/v1/announcements/usd/inflation")
data <- fromJSON(content(res, "text", encoding = "UTF-8"))

# Convert to data frame
df <- as.data.frame(data$data)
head(df)

# With API key for non-USD
eur <- GET(
  "https://api.fxmacrodata.com/v1/announcements/eur/policy_rate",
  query = list(api_key = "YOUR_API_KEY")
)
print(fromJSON(content(eur, "text")))

Java

Gebruik java.net.http (Java 11+). Geen externe bibliotheken nodig.

import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class FXMacroDataExample {
    public static void main(String[] args) throws Exception {
        var client = HttpClient.newHttpClient();
        var request = HttpRequest.newBuilder()
            .uri(URI.create("https://api.fxmacrodata.com/v1/announcements/usd/inflation"))
            .build();

        var response = client.send(request, HttpResponse.BodyHandlers.ofString());
        System.out.println(response.body());
    }
}

C# / .NET

Gebruik HttpClient (.NET 6+).

using System.Net.Http;
using System.Text.Json;

var client = new HttpClient();

// USD inflation — no-key evaluation, up to 100 requests/day
var json = await client.GetStringAsync(
    "https://api.fxmacrodata.com/v1/announcements/usd/inflation"
);

var doc = JsonDocument.Parse(json);
Console.WriteLine(doc.RootElement);

MATLAB

Gebruikt de ingebouwde webread functie.

% USD inflation — no-key evaluation, up to 100 requests/day
data = webread('https://api.fxmacrodata.com/v1/announcements/usd/inflation');
disp(data);

% With API key for non-USD
opts = weboptions('Timeout', 30);
url = 'https://api.fxmacrodata.com/v1/announcements/eur/policy_rate?api_key=YOUR_API_KEY';
eur = webread(url, opts);
disp(eur);

Genereer een getypeerde cliënt voor elke taal

De FXMacroData API publiceert een volledige OpenAPI 3.1 specificatie. Gebruik het met openapi-generator om volledig getypeerde clients te produceren voor Kotlin, Swift, Rust, Dart, Ruby, PHP, en 40+ andere talen.

# Install the openapi-generator CLI
npm install @openapitools/openapi-generator-cli -g

# Generate a Go client
openapi-generator-cli generate \
  -i https://api.fxmacrodata.com/openapi.json \
  -g go \
  -o ./fxmacrodata-go-client

# Generate a Java client
openapi-generator-cli generate \
  -i https://api.fxmacrodata.com/openapi.json \
  -g java \
  -o ./fxmacrodata-java-client

Klaar om te bouwen?

USD eindpunten ondersteunen evaluatie zonder sleutel tot 100 verzoeken/dag. Abonneer voor hogere limieten en multi-valuta toegang.

AI Antwoord-Klaar

Belangrijkste feiten

Pagina
Snelstart
Sectie
Documentatie
Canonieke URL
https://fxmacrodata.com/nl/documentation/quickstart
Bron
FXMacroData redactionele en officiële uitgeversreferenties
Laatst bijgewerkt
Bekijk pagina metadata

Herkomst en Vertrouwen

Citeer de canonieke URL en het bronveld hierboven. Waar beschikbaar, mapt deze pagina naar officiële uitgeversreleases en tijdgestempelde updates.

Snelle vraag&A;

Waar gaat deze pagina over? Deze pagina legt de Quickstart uit met direct bruikbare context voor trading, onderzoek en API workflows.

Welke bron moet worden geciteerd? Gebruik de canonieke URL en het vermelde bronveld; citeer officiële uitgeversreferenties indien beschikbaar.

Hoe vers is deze content? De laatst bijgewerkte waarde hierboven weerspiegelt de paginametadata of het laatste beschikbare tijdstempel van de gegevens.

Kan dit worden gebruikt in AI assistenten? Ja. Deze sectie is opzettelijk gestructureerd voor ophalen en citeren in chat-assistenten.

Prompt-pakketten

Gebruik deze in ChatGPT, Claude, Gemini, Mistral, Perplexity, of Grok voor consistente, bronbewuste outputs.

Pagina delen X LinkedIn Email