Quickstart
எந்த மொழியிலும் தொடங்குங்கள்
FXMacroData API என்பது ஒரு நிலையான JSON REST API. HTTP ஆதரவு கொண்ட எந்த மொழியும் செயல்படும். திறவுகோல் இல்லாமல் சமீபத்திய 90 நாட்களுக்கான ஃப்ரீமியம் டைம்-சீரிஸ் எண்ட்பாயிண்ட்டுகள் கிடைக்கின்றன. முழு வரலாறு மற்றும் கட்டண எண்ட்பாயிண்ட் குடும்பங்களைத் திறக்க தனிநபர் API திறவுகோலைச் சேர்க்கவும்.
அடிப்படை URL
https://api.fxmacrodata.com
அங்கீகாரம்
X-API-Key: YOUR_API_KEY
Authorization: Bearer YOUR_API_KEY
?api_key=YOUR_API_KEY
பதிலளிப்பு வடிவம்
JSON (Content-Type: application/json)
openapi-generator-cli 40+ மொழிகளில் கிளையண்டுகளைத் தானாக உருவாக்க.
Accept-Encoding: gzip ஒவ்வொரு கோரிக்கையிலும் (8–12× சிறிய பேலோட்கள்), மீண்டும் பயன்படுத்தவும் ETag பதிலுக்கான ஹெடர் இதில் If-None-Match மீண்டும் மீண்டும் செய்யப்படும் வாக்கெடுப்புகளில் (திரும்புவது 304 Not Modified உடல் (body) இல்லாமல்), மற்றும் கடத்தவும் ?limit=50 போன்ற ஒற்றை-குறிகாட்டி endpoints-களில் /v1/announcements/usd/inflation அல்லது /v1/predictions/usd/inflation உங்களுக்கு சமீபத்திய வரிசைகள் மட்டுமே தேவைப்படும்போது. முழு குறிப்பைப் பார்க்கவும் →
core_pce USD க்கு உள்ளது ஆனால் ஒவ்வொரு நாணயத்திற்கும் இல்லை. ஒரு நாணயம் ஆதரிக்கும் ஒவ்வொரு slug-ஐயும் பட்டியலிடவும் GET /v1/data_catalogue/{currency}, உதாரணமாக /v1/data_catalogue/usd. இதனுடன் ஒரு 404 error_code: NO_DATA_IN_REQUESTED_WINDOW என்றால் slug செல்லுபடியாகும் மற்றும் கோரப்பட்ட தேதி விண்டோ மட்டுமே காலியாக உள்ளது என்று அர்த்தம் — விரிவுபடுத்தவும் start_date/end_date URL ஐ மாற்றுவதற்கு பதிலாக.
data_quality பொருள். பேக்டெஸ்ட்கள் மற்றும் நிறுவன அறிக்கையிடலுக்கு, ஆய்வு செய்யவும் point_in_time_safe, has_announcement_datetime, source_type, மற்றும் is_stale.
முதல் API அழைப்பு
விரைவான கோரிக்கை (Quick Request)
நேரடி அறிவிப்பு endpoint-உடன் தொடங்கவும். அங்கீகாரம் (Authentication) இதில் இருக்கும் api_key நேரடி உலாவி மற்றும் ஸ்கிரிப்ட் சோதனைக்கான வினவல் அளவுரு (query parameter).
curl "https://api.fxmacrodata.com/v1/announcements/eur/inflation?api_key=YOUR_API_KEY"
Python கோரிக்கைகள்
நகலெடுக்கக்கூடிய Python API கோரிக்கைகள்
ஒரு SDK wrapper-க்கு பதிலாக மூல API கோரிக்கை தேவைப்படும்போது இந்த நேரடி REST உதாரணங்களைப் பயன்படுத்தவும். பாதுகாக்கப்பட்ட வழிகளில் (routes) மட்டும் YOUR_API_KEY ஐ மாற்றவும்.
USD பணவீக்க சந்தை ஒருமித்த கருத்து
உண்மையான அறிவிப்புகளுடன் இணைக்கப்பட்ட ஒருமித்த கருத்து, கணக்கெடுப்பு, மத்திய வங்கி, IMF மற்றும் FXMacroData முன்கணிப்புகள்.
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))
known-at கால முத்திரைகளுடன் USD பணவீக்கம்
point-in-time backtests-களுக்கான பொதுவான USD பணவீக்க பதிவுகள்.
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 ஸ்பாட் வரலாறு
ஜோடி வரைபடங்கள், மாதிரிகள் மற்றும் வெளியீட்டு மேல்தளங்களுக்கான தினசரி FX விலை வரலாறு.
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 கொள்கை-விகித வரலாறு
முன்னோக்கு இல்லாத ஆராய்ச்சிக்கு வெளியீட்டு நேரத்துடன் கூடிய மத்திய வங்கி முடிவு வரலாறு.
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 வரவிருக்கும் வெளியீட்டு அட்டவணை
எச்சரிக்கைகளைத் திட்டமிட, மாடல் புதுப்பிப்புகள் மற்றும் வர்த்தக மதிப்பாய்வுகளுக்காக UTC, சந்தை-உள்ளூர் மற்றும் கோரப்பட்ட நேர மண்டல புலங்களுடன் வரவிருக்கும் மேக்ரோ நிகழ்வுகள்.
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))
தங்கப் பொருள் விலைகள்
தினசரி மதிப்புகள் மற்றும் மாற்றப் புலங்களுடன் கூடிய அதிகாரப்பூர்வ விலைமதிப்பற்ற உலோக கால வரிசை.
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))
Python
அதிகாரப்பூர்வத்தை நிறுவுங்கள் fxmacrodata PyPI-லிருந்து தொகுப்பு. Sync மற்றும் async கிளையண்டுகள், pandas-க்கு ஏற்ற வெளியீடு.
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")
REST API ஐ நேரடியாகப் பயன்படுத்துகிறது
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 கிளையண்ட்
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())
முன்கணிப்புகள் & முன்கணிப்புகள்
அந்த /v1/predictions/{currency}/{indicator} எண்ட்பாயிண்ட் சந்தை ஒருமித்த கருத்து ஆய்வுகள், மத்திய வங்கி கணிப்புகள், IMF உலக பொருளாதார கண்ணோட்டம் மற்றும் தொழில்முறை கணிப்பாளர் ஆய்வுகளிலிருந்து முன்கணிப்பு தரவை வழங்குகிறது. குறிப்பிட்ட கரன்சி மற்றும் குறிகாட்டிக்கு கணிப்புகள் கோரப்படுகின்றன, உதாரணமாக https://api.fxmacrodata.com/v1/predictions/usd/inflation; கரன்சி-மட்டு முன்கணிப்பு கோரிக்கைகள் ஆதரிக்கப்படவில்லை. ஒவ்வொரு முன்கணிப்பும் அதன் அறிவிப்புடன் இணைக்கப்பட்டுள்ளது announcement_id, எனவே நீங்கள் முன்கணிப்புகளை உணரப்பட்ட அவதானிப்புகளுடன் இணைக்கலாம்.
prediction_type="fxmacrodata" என்பது FXMacroData-ஆல் உருவாக்கப்பட்ட மதிப்பீடு; உண்மையான தொகுக்கப்பட்ட consensus என்பது இவ்வாறு பெயரிடப்பட்டுள்ளது market_consensus. முன்கணிப்பு கிடைக்கும் தன்மை வெளியீட்டைப் பொறுத்து மாறுபடும் — சரிபார்க்கவும் கவரேஜ் மேட்ரிக்ஸ். லுக்-அஹெட்-ஃப்ரீ ஆராய்ச்சிக்காக, இதைப் பின்பற்றவும் point-in-time backtesting வழிகாட்டி.
Python — முன்கணிப்புகளை மீட்டெடுத்து உண்மையான மதிப்புகளுடன் இணைக்கவும்
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 — வகை வாரியாக கணிப்புகளைப் பெறவும்
# 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"
Prediction வகைகள் குறிப்பு
| prediction_type | விளக்கம் |
|---|---|
| market_consensus | கிடைக்கக்கூடிய இடங்களில், தொகுக்கப்பட்ட சந்தை அல்லது பொருளாதார நிபுணர் நிகழ்வு ஒருமித்த கருத்து |
| market_prediction | தொழில்முறை-முன்கணிப்பாளரின் புள்ளி கணிப்பு |
| model_nowcast | மத்திய வங்கி அல்லது ரிசர்வ் வங்கி மாதிரி nowcast |
| கணிப்பு (survey) | தொழில்முறை முன்கணிப்பாளர்களின் மத்திய வங்கி ஆய்வு (எ.கா. ECB SPF) |
| central_bank_forecast | அதிகாரப்பூர்வ மத்திய வங்கி கணிப்பு (உதாரணமாக RBNZ MPS, BoC MPR) |
| central_bank_projection | அதிகாரப்பூர்வ மத்திய வங்கி கணிப்பு |
| imf_weo | IMF உலக பொருளாதார கண்ணோட்டக் கணிப்பு |
| fxmacrodata | மத்திய வங்கி வழிகாட்டுதல், ஆய்வுகள் மற்றும் வரலாற்றுப் போக்குகளை ஒருங்கிணைத்து FXMacroData-ஆல் உருவாக்கப்பட்ட கணிப்பு |
cURL
நிறுவல் தேவையில்லை. எந்த டெர்மினலிலிருந்தும் இயங்கும்.
# 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
Node.js (18+), Deno, Bun மற்றும் Fetch API கொண்ட நவீன உலாவிகளில் இயங்குகிறது.
அதிகாரப்பூர்வ npm கிளையண்ட்
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-ஐ நேரடியாகப் பயன்படுத்துதல்
// 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());
செல்
வெளிப்புற தொகுப்புகள் தேவையில்லை — நிலையான நூலகமே அனைத்தையும் கையாள்கிறது.
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
தேவைப்படுகிறது 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
பயன்கள் java.net.http (Java 11+). வெளிப்புற நூலகங்கள் தேவையில்லை.
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
பயன்கள் 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
உள்ளமைக்கப்பட்டதைப் பயன்படுத்துகிறது webread செயல்பாடு (function).
% 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);
எந்தவொரு மொழிக்கும் டைப்டு கிளையண்ட்டை உருவாக்கவும்
FXMacroData API ஒரு முழுமையானதை வெளியிடுகிறது OpenAPI 3.1 விவரக்குறிப்பு. இதைப் பயன்படுத்தவும் openapi-generator Kotlin, Swift, Rust, Dart, Ruby, PHP, மற்றும் 40+ பிற மொழிகளுக்கு முழுமையாக டைப் செய்யப்பட்ட கிளையண்டுகளை உருவாக்க.
# 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
உருவாக்கத் தயாரா?
USD எண்ட் பாயிண்டுகள் ஒரு நாளைக்கு 100 கோரிக்கைகள் வரை கீ-இல்லாத மதிப்பீட்டை ஆதரிக்கின்றன. அதிக வரம்புகள் மற்றும் பல-நாணய அணுகலுக்கு சந்தா செய்யவும்.