Easy, reliable access to FX and gold parity rates in Iranian Toman, plus global reference rates — all with an annual subscription of just 199 USDT.
Every day, at 10:00, 12:00 and 15:00 (Iran time), you receive an updated market data file covering USD, USDT, EUR, gold coins, bullion gold, silver, “tomorrow” (futures-style) quotes and premium/spread values.
Alongside that, you get a global reference data file with key FX rates (for example: EUR, TRY, GEL, AED, GBP, CAD, AUD, SAR, IQD, CNY, KWD and more) plus Bitcoin (BTC) and international gold and silver benchmarks (XAU, XAG), giving you everything you need for comparison, conversion and validation of your analyses.
With just these two data feeds you can power price displays on your website and bots, and at the same time feed your internal analytics, dashboards and reports.
To help you get started quickly, we provide ready-to-use Python and PHP sample scripts so you can easily configure your own code to fetch and consume the data.
To connect, simply choose a USER_CODE (6–10 characters, lowercase letters and digits) and a SECRET_KEY (exactly 10 characters, mixing uppercase letters, lowercase letters and digits), then send them to the Telegram account
@AdviranianX
or via DM to our X account
@iranianXsarrafi
Once payment is confirmed, your one-year subscription will be activated and you’ll receive full connection details plus the Python and PHP examples.
Using IranianX API with PHP:
<?php
/**
* iranianx_rate.php
*
* Example: how to call the IranianX unified rates API from PHP.
*
* How to use:
* 1) Save this file as iranianx_rate.php on a server with PHP 7.4+ (or 8.x).
* 2) Replace YOUR_USER_CODE and YOUR_SECRET_KEY with the values
* provided to you by IranianX.
* 3) Run it from the command line:
* php iranianx_rate.php
* or open it in a browser (it will print plain text).
*
* Notes:
* – Method: POST
* – Body: hash={SECRET_KEY} (application/x-www-form-urlencoded)
* – The API always returns the *latest available* rates snapshot.
* Internally, new snapshots are usually generated around
* 10:00, 12:00 and 15:00 Tehran time.
* For the freshest data, call the API shortly after those times,
* but you can call it at any time and you will still get
* the most recent snapshot.
*/
// Replace these with the values you receive from IranianX:
$USER_CODE = ‘YOUR_USER_CODE’; // e.g. client123
$SECRET_KEY = ‘YOUR_SECRET_KEY’; // e.g. Ab3kL9xT2q
// Base URL for the API:
// Prepare POST body (hash = SECRET_KEY)
$data = [‘hash’ => $SECRET_KEY];
$opts = [
‘http’ => [
‘method’ => ‘POST’,
‘header’ => “Content-type: application/x-www-form-urlencoded”,
‘content’ => http_build_query($data),
‘timeout’ => 10,
],
];
$context = stream_context_create($opts);
// Unified endpoint: /api/{USER_CODE}/rates
$url = $BASE_URL . ‘/rates’;
$content = @file_get_contents($url, false, $context);
if ($content === false) {
echo “[ERROR] Could not fetch data from IranianX API.\n”;
exit(1);
}
$data = json_decode($content, true);
if ($data === null && json_last_error() !== JSON_ERROR_NONE) {
echo “[ERROR] Invalid JSON received.\nRaw response:\n$content\n”;
exit(1);
}
// If the API returned an error structure, show it and exit.
if (isset($data[‘error’])) {
echo “[API ERROR] {$data[‘error’]}\n”;
if (isset($data[‘message’])) {
echo “Message: {$data[‘message’]}\n”;
}
// Optional extra fields (e.g. iran_hour / iran_minute) may exist too.
exit(1);
}
echo “Status: ” . ($data[‘status’] ?? ‘unknown’) . “\n”;
echo “User: ” . ($data[‘user’] ?? ‘unknown’) . “\n”;
echo “Time (Tehran): ” . ($data[‘generated_at_iran’] ?? ‘n/a’) . “\n\n”;
if (!isset($data[‘market’], $data[‘global’])) {
echo “[ERROR] Response does not contain ‘market’ or ‘global’ fields.\n”;
exit(1);
}
$market = $data[‘market’]; // original fi-t.json-like content
$global = $data[‘global’]; // original d1.json-like content
echo “Sample Iran market rates (Toman):\n”;
echo ” USD (cash): ” . ($market[‘values’][‘دلار’] ?? ‘n/a’) . “\n”;
echo ” USDT: ” . ($market[‘values’][‘تتر’] ?? ‘n/a’) . “\n”;
echo ” EUR: ” . ($market[‘values’][‘یورو’] ?? ‘n/a’) . “\n\n”;
$slot0Values = $global[‘slots’][0][‘values’] ?? [];
echo “Sample global reference rates:\n”;
echo ” EUR: ” . ($slot0Values[‘EUR’] ?? ‘n/a’) . “\n”;
echo ” TRY: ” . ($slot0Values[‘TRY’] ?? ‘n/a’) . “\n”;
echo ” BTC: ” . ($slot0Values[‘BTC’] ?? ‘n/a’) . “\n”;
echo ” XAU: ” . ($slot0Values[‘XAU’] ?? ‘n/a’) . “\n”;
// In your own code, you can store these values in a database,
// cache or render them directly on your website.
Using IranianX API with Python:
#!/usr/bin/env python3
“””
iranianx_rate.py
Example: how to call the IranianX unified rates API from Python.
How to use:
1) Make sure you have Python 3.8+ installed.
2) Save this file as iranianx_rate.py.
3) Replace YOUR_USER_CODE and YOUR_SECRET_KEY with the values
provided to you by IranianX.
4) Run:
python iranianx_rate.py
Notes:
– Method: POST
– Body: hash={SECRET_KEY} (application/x-www-form-urlencoded)
– The API always returns the *latest available* rates snapshot.
Internally, new snapshots are usually generated around
10:00, 12:00 and 15:00 Tehran time.
For the freshest data, call the API shortly after those times,
but you can call it at any time and you will still get
the most recent snapshot.
“””
import json
import sys
import urllib.request
import urllib.parse
import urllib.error
from typing import Any, Dict
# Replace these with the values you receive from IranianX:
USER_CODE = “YOUR_USER_CODE” # e.g. client123
SECRET_KEY = “YOUR_SECRET_KEY” # e.g. Ab3kL9xT2q
# Base URL for the API:
def fetch_rates() -> Dict[str, Any]:
“””Fetch unified rates from IranianX (market + global).”””
params = urllib.parse.urlencode({“hash”: SECRET_KEY}).encode(“utf-8”)
url = f”{BASE_URL}/rates”
req = urllib.request.Request(
url=url,
data=params,
headers={“Content-Type”: “application/x-www-form-urlencoded”},
method=”POST”,
)
try:
with urllib.request.urlopen(req, timeout=10) as r:
content = r.read().decode(“utf-8″, errors=”replace”)
except urllib.error.HTTPError as e:
print(f”[HTTP ERROR] {e.code} {e.reason}”)
sys.exit(1)
except urllib.error.URLError as e:
print(f”[NETWORK ERROR] {e}”)
sys.exit(1)
try:
data = json.loads(content)
except json.JSONDecodeError:
print(“[ERROR] Invalid JSON received.”)
print(“Raw response:”)
print(content)
sys.exit(1)
return data
def main() -> None:
data = fetch_rates()
# Handle potential API-level errors (e.g. wrong hash, unknown user code).
if isinstance(data, dict) and “error” in data:
print(“[API ERROR]”, data.get(“error”))
if “message” in data:
print(“Message:”, data[“message”])
# Optional: print extra diagnostic fields if present.
for k in (“iran_hour”, “iran_minute”):
if k in data:
print(f”{k}: {data[k]}”)
sys.exit(1)
status = data.get(“status”, “unknown”)
user = data.get(“user”, “unknown”)
generated_at_iran = data.get(“generated_at_iran”, “n/a”)
print(“Status:”, status)
print(“User: “, user)
print(“Time (Tehran):”, generated_at_iran)
if “market” not in data or “global” not in data:
print(“\n[ERROR] Response does not contain ‘market’ or ‘global’ fields.”)
sys.exit(1)
market = data[“market”] # original fi-t.json-like content
global_ = data[“global”] # original d1.json-like content
print(“\nSample Iran market rates (Toman):”)
values = market.get(“values”, {})
print(” USD (cash):”, values.get(“دلار”, “n/a”))
print(” USDT: “, values.get(“تتر”, “n/a”))
print(” EUR: “, values.get(“یورو”, “n/a”))
slots = global_.get(“slots”, [])
slot0_values = {}
if slots and isinstance(slots[0], dict):
slot0_values = slots[0].get(“values”, {})
print(“\nSample global reference rates:”)
print(” EUR:”, slot0_values.get(“EUR”, “n/a”))
print(” TRY:”, slot0_values.get(“TRY”, “n/a”))
print(” BTC:”, slot0_values.get(“BTC”, “n/a”))
print(” XAU:”, slot0_values.get(“XAU”, “n/a”))
# In your project, instead of printing, you can feed this data
# into your own database, cache or analytics pipeline.
if __name__ == “__main__”:
main()
A series of specialist reports from Binance, Chainalysis, CNN, IDNFinancials, CotiNews and the Jerusalem Institute for Strategy and Security describe how Iranian exchange Nobitex — one of Iran’s largest cryptocurrency exchanges — lost tens of millions of dollars in a politically motivated cyber attack linked to tensions between Iran and Israel. Investigators note that the hackers sent the stolen Bitcoin, Ethereum, Dogecoin and other assets to burner addresses, effectively destroying the funds rather than profiting from the crypto hack, and highlight the broader risks in Iran’s heavily sanctioned crypto ecosystem.
CNN and IDNFinancials: A pro-Israel hacker group known as Predatory Sparrow stole about USD 90 million in crypto from Iranian exchange Nobitex and disrupted Bank Sepah ATMs inside Iran. Link
Binance: Iranian exchange Nobitex is gradually restoring wallet access after the USD 90 million hack, prioritizing verified users and spot wallets in a phased recovery plan. Link
CotiNews: An USD 81 million hack on Iranian exchange Nobitex used politically charged vanity wallet addresses and burned much of the stolen cryptocurrency instead of cashing out. Link
JISS (Jerusalem Institute for Strategy and Security): A crisis analysis of Iran’s cryptocurrency economy shows how the USD 90 million Nobitex hack and pressure on Iranian exchange networks have turned crypto from a sanctions-evasion tool into a major risk for both the regime and ordinary users. Link
Chainalysis: Nobitex, Iran’s largest cryptocurrency exchange, is profiled as a key Iranian exchange hit by a major USD 90 million cyber attack in the “Iranian Exchange Nobitex: The $90M Exploit” report. Link
A recent blockchain analytics report from Elliptic analyzes a new U.S. Treasury sanctions action and explains how an Iranian shadow banking network of money launderers, financial facilitators and front companies used cryptocurrency and Iranian exchange houses to help Iran’s Quds Force and Ministry of Defense evade U.S. sanctions. The OFAC-focused report names seven sanctioned crypto addresses and describes how this crypto-enabled shadow banking system moved hundreds of millions of dollars for Iran’s military and defense sector. Link
The U.S. Financial Crimes Enforcement Network (FinCEN) has released an analytical report on Iranian shadow banking, based on Bank Secrecy Act (BSA) data filed by U.S. financial institutions. According to “Iranian Shadow Banking: Trends in Bank Secrecy Act Data”, roughly $9 billion in suspicious activity was identified in 2024, involving Iranian exchange houses, front companies and foreign intermediaries suspected of facilitating sanctions evasion. The network uses oil and petrochemical trading firms, paper companies, shipping companies and investment vehicles in jurisdictions such as the UAE, Hong Kong, Singapore, China, the United Kingdom and Switzerland to move funds through global correspondent banking channels. FinCEN warns that these structures help route money from Iranian oil and petrochemical sales into nuclear, missile and military programs, and urges banks, payment processors and virtual asset service providers to strengthen due diligence and monitoring of exposure to Iranian shadow banking.
Link