Quickstart

કોઈપણ ભાષામાં શરૂઆત કરો

FXMacroData API એ એક પ્રમાણિત JSON REST API છે. HTTP સપોર્ટ ધરાવતી કોઈપણ ભાષા કામ કરે છે. કી વગર સૌથી તાજેતરના 90 દિવસો માટે ફ્રીમિયમ ટાઇમ-સિરીઝ એન્ડપોઇન્ટ્સ ઉપલબ્ધ છે. સંપૂર્ણ ઇતિહાસ અને પેઇડ એન્ડપોઇન્ટ ફેમિલીઝને અનલૉક કરવા માટે ઇન્ડિવિજ્યુઅલ API કી ઉમેરો.

બેઝ URL

https://api.fxmacrodata.com

Authentication

X-API-Key: YOUR_API_KEY

Authorization: Bearer YOUR_API_KEY

?api_key=YOUR_API_KEY

રિસ્પોન્સ ફોર્મેટ

JSON (Content-Type: application/json)

ટાઇપ્ડ ક્લાયન્ટ્સ આપમેળે જનરેટ કરો: પ્રકાશિતનો ઉપયોગ કરો OpenAPI 3.1 સ્પેક સાથે openapi-generator-cli 40+ ભાષાઓમાં ક્લાયન્ટ્સ ઓટો-જનરેટ કરવા માટે.
મફત પરફોર્મન્સ લાભો: મોકલો Accept-Encoding: gzip દરેક વિનંતી પર (8–12× નાના પેલોડ્સ), પુનઃઉપયોગ કરો ETag રિસ્પોન્સ હેડર in If-None-Match પુનરાવર્તિત પોલ્સ પર (પરત કરે છે 304 Not Modified કોઈ બોડી વગર), અને પાસ કરો ?limit=50 સિંગલ-ઇન્ડિકેટર એન્ડપોઇન્ટ્સ પર જેમ કે /v1/announcements/usd/inflation અથવા /v1/predictions/usd/inflation જ્યારે તમને ફક્ત તાજેતરની રો (rows) ની જરૂર હોય. સંપૂર્ણ સંદર્ભ જુઓ →
પાથ હાર્ડ-કોડિંગ કરતા પહેલા ઇન્ડિકેટર સ્લગ્સ શોધો: ઇન્ડિકેટર સ્લગ્સ કરન્સી મુજબ અલગ હોય છે — core_pce USD માટે અસ્તિત્વ ધરાવે છે પરંતુ દરેક કરન્સી માટે નહીં. કરન્સી સપોર્ટ કરે છે તે દરેક સ્લગની યાદી મેળવો GET /v1/data_catalogue/{currency}, ઉદાહરણ તરીકે /v1/data_catalogue/usd. એક 404 સાથે error_code: NO_DATA_IN_REQUESTED_WINDOW મતલબ છે કે સ્લગ માન્ય છે અને ફક્ત વિનંતી કરેલ તારીખ વિન્ડો ખાલી છે — વધારો start_date/end_date URL બદલવાને બદલે.
પ્રતિસાદની ગુણવત્તા તપાસો: સ્ત્રોત-સમર્થિત એન્ડપોઇન્ટ્સ ટોપ-લેવલ રિટર્ન કરે છે data_quality ઓબ્જેક્ટ. બેકટેસ્ટ્સ અને ઇન્સ્ટિટ્યુશનલ રિપોર્ટિંગ માટે, તપાસો point_in_time_safe, has_announcement_datetime, source_type, અને is_stale.

પ્રથમ API કોલ

ક્વિક રિક્વેસ્ટ

લાઈવ એનાઉન્સમેન્ટ એન્ડપોઈન્ટથી શરૂ કરો. ઓથેન્ટિકેશન આમાં રહેશે api_key સીધા બ્રાઉઝર અને સ્ક્રિપ્ટ ટેસ્ટિંગ માટે ક્વેરી પેરામીટર.

EUR ફુગાવા ઉદાહરણ GET /api/v1/announcements/eur/inflation
વિનંતી સ્નિપેટ
curl "https://api.fxmacrodata.com/v1/announcements/eur/inflation?api_key=YOUR_API_KEY"

Python વિનંતીઓ

કોપી કરી શકાય તેવી Python API વિનંતીઓ

જ્યારે તમને SDK રેપરને બદલે કાચું API રિક્વેસ્ટ જોઈતી હોય ત્યારે આ સીધા REST ઉદાહરણોનો ઉપયોગ કરો. ફક્ત સુરક્ષિત રૂટ્સ પર 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 ઇન્ફ્લેશન

પોઇન્ટ-ઇન-ટાઇમ બેકટેસ્ટ માટે જાહેર 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))
સત્તાવાર SDK

Python

સત્તાવાર ઇન્સ્ટોલ કરો fxmacrodata PyPI માંથી પેકેજ. સિંક અને એસિંક ક્લાયન્ટ્સ, pandas-રેડી આઉટપુટ.

pip install fxmacrodata

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())
નવું

Predictions & આગાહીઓ

/v1/predictions/{currency}/{indicator} એન્ડપોઇન્ટ માર્કેટ સર્વસંમતિ સર્વેક્ષણો, સેન્ટ્રલ-બેંક પ્રોજેક્શન, IMF વર્લ્ડ ઇકોનોમિક આઉટલુક અને પ્રોફેશનલ-ફોરકાસ્ટર સર્વેક્ષણોમાંથી આગાહી ડેટા પ્રદર્શિત કરે છે. ચોક્કસ કરન્સી અને ઇન્ડિકેટર માટે આગાહીઓની વિનંતી કરવામાં આવે છે, જેમ કે https://api.fxmacrodata.com/v1/predictions/usd/inflation; ફક્ત ચલણ-માત્ર પ્રિડિક્શન વિનંતીઓ સમર્થિત નથી. દરેક પ્રિડિક્શન તેની જાહેરાત સાથે લિંક થયેલ છે via announcement_id, જેથી તમે ફોરકાસ્ટને રિયલાઇઝ્ડ ઓબ્ઝર્વેશન સાથે જોડી શકો.

દરેક આગાહીને સર્વસંમતિ તરીકે ન ગણો. prediction_type="fxmacrodata" એક FXMacroData-જનરેટેડ અંદાજ છે; સાચી સંકલિત સર્વસંમતિને લેબલ કરવામાં આવ્યું છે market_consensus. આગાહીની ઉપલબ્ધતા રિલીઝ મુજબ અલગ અલગ હોય છે — તપાસો કવરેજ મેટ્રિક્સ. લુક-અહેડ-ફ્રી રિસર્ચ માટે, અનુસરો પોઇન્ટ-ઇન-ટાઇમ બેકટેસ્ટિંગ માર્ગદર્શિકા.
USD સૌથી તાજેતરના 90 દિવસો માટે મફત છે — તે વિન્ડોની અંદર USD આગાહીઓ માટે કોઈ API કીની જરૂર નથી. સંપૂર્ણ USD ઇતિહાસ અને અન્ય તમામ કરન્સી માટે માન્ય ટ્રાયલ અથવા પેઇડ API કી જરૂરી છે.

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સેન્ટ્રલ-બેંક અથવા રિઝર્વ-બેંક મોડેલ નાઉકાસ્ટ
સર્વેવ્યાવસાયિક આગાહીકારોનું સેન્ટ્રલ-બેંક સર્વે (દા.ત. ECB SPF)
central_bank_forecastસત્તાવાર સેન્ટ્રલ-બેંક પ્રોજેક્શન (દા.ત. RBNZ MPS, BoC MPR)
central_bank_projectionઓફિશિયલ સેન્ટ્રલ-બેંક પ્રોજેક્શન
imf_weoIMF વર્લ્ડ ઇકોનોમિક આઉટલુક પ્રોજેક્શન
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 ક્લાયન્ટ

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 નો સીધો ઉપયોગ કરીને

// 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.

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

ઉપયોગો 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 ફંક્શન.

% 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 વિનંતીઓ/દિવસ સુધી નો-કી મૂલ્યાંકનનું સમર્થન કરે છે. ઉચ્ચ મર્યાદાઓ અને મલ્ટી-કરન્સી એક્સેસ માટે સબસ્ક્રાઇબ કરો.

AI સાથે લેખનો સારાંશ આપો:

ChatGPT Perplexity Claude Grok Gemini Mistral

AI જવાબ-તૈયાર

મુખ્ય તથ્યો

પેજ
Quickstart
Section
ડોક્યુમેન્ટેશન
કેનોનિકલ URL
https://fxmacrodata.com/gu/documentation/quickstart
સ્ત્રોત
FXMacroData સંપાદકીય અને સત્તાવાર પ્રકાશક સંદર્ભો
છેલ્લે અપડેટ કરેલ
પેજ મેટાડેટા જુઓ

પ્રોવેનન્સ એન્ડ ટ્રસ્ટ

કેનોનિકલ URL અને ઉપરના સ્ત્રોત ક્ષેત્રનો ઉલ્લેખ કરો. જ્યાં ઉપલબ્ધ હોય, આ પેજ સત્તાવાર પ્રકાશક રિલીઝ અને ટાઇમસ્ટેમ્પ અપડેટ્સ સાથે મેપ થાય છે.

ઝડપી પ્રશ્ન&A;

આ પેજ શેના વિશે છે? આ પેજ ટ્રેડિંગ, રિસર્ચ અને API વર્કફ્લો માટે સીધા ઉપયોગી સંદર્ભ સાથે ક્વિકસ્ટાર્ટ સમજાવે છે.

કયા સ્ત્રોતનો ઉલ્લેખ કરવો જોઈએ? કેનોનિકલ URL અને સૂચિબદ્ધ સોર્સ ફિલ્ડનો ઉપયોગ કરો; જ્યારે ઉપલબ્ધ હોય ત્યારે સત્તાવાર પ્રકાશક સંદર્ભો ટાંકો.

આ કન્ટેન્ટ કેટલું તાજું છે? ઉપરનું છેલ્લું અપડેટ કરેલ મૂલ્ય પેજ મેટાડેટા અથવા નવીનતમ ઉપલબ્ધ ડેટા ટાઇમસ્ટેમ્પને પ્રતિબિંબિત કરે છે.

શું આનો ઉપયોગ AI આસિસ્ટન્ટ્સમાં કરી શકાય છે? હા. આ વિભાગ ઇરાદાપૂર્વક ચેટ આસિસ્ટન્ટ્સમાં પુનઃપ્રાપ્તિ અને સાઇટેશન માટે રચાયેલ છે.

પ્રોમ્પ્ટ પેક્સ

સુસંગત સ્ત્રોત-જાગૃત આઉટપુટ માટે આનો ઉપયોગ ChatGPT, Claude, Gemini, Mistral, Perplexity અથવા Grok માં કરો.

પેજ શેર કરો X LinkedIn ઈમેલ