Endpoint

GET https://altinapi.com/api/prices/EURTRY

cURL

bash
curl -H "x-api-key: hapi_xxxx" \
     https://altinapi.com/api/prices/EURTRY

JSON Yanıt

JSON
{
  "symbol":    "EURTRY",
  "category": "DOVIZ",
  "bid":      41.18,   // alış fiyatı (TRY/EUR)
  "ask":      41.25,   // satış fiyatı (TRY/EUR)
  "timestamp": 1741784400000  // Unix ms
}

Python

Python
import requests

API_KEY = "hapi_xxxx"
url     = "https://altinapi.com/api/prices/EURTRY"

resp = requests.get(url, headers={"x-api-key": API_KEY}, timeout=5)
data = resp.json()

print(f"EUR/TRY alış: {data['bid']}")
print(f"EUR/TRY satış: {data['ask']}")

JavaScript

JavaScript (fetch)
const resp = await fetch("https://altinapi.com/api/prices/EURTRY", {
  headers: { "x-api-key": "hapi_xxxx" },
});
const data = await resp.json();

console.log(`EUR/TRY alış: ${data.bid}`);
console.log(`EUR/TRY satış: ${data.ask}`);

WebSocket Aboneliği

Fiyat her değiştiğinde anlık almak için WebSocket kullanın:

JavaScript (socket.io-client)
import { io } from "socket.io-client";

const socket = io("https://altinapi.com", {
  auth: { apiKey: "hapi_xxxx" },
});

socket.on("connect", () => {
  socket.emit("subscribe", ["EURTRY"]);
});

socket.on("prices:update", ({ data }) => {
  const eurtry = data.find(p => p.symbol === "EURTRY");
  if (eurtry) console.log(eurtry.bid, eurtry.ask);
});

Tüm Fiyatlarla Birlikte

Tek istekte tüm kategorileri çekmek için /api/prices kullanın:

GET https://altinapi.com/api/prices

Yanıtta category: "DOVIZ" olanları filtreleyin — EURTRY bu grupta yer alır.

İlgili Semboller