EZRate
Sign in

EZRate API Quickstart: From API Key to Your First Live Request in 5 Minutes

EZRate API quickstart: create an account, generate an API key, make your first request with curl, Python, JavaScript or PHP and check your usage.

Ersan Fazli
· Web Developer
Published 20 October 2026, 20:00 · 3 min read
EZRate API Quickstart: From API Key to Your First Live Request in 5 Minutes
Key takeaways
  • Sign up, open “API keys” in the panel and create a key — optionally restricted to your server IPs.
  • Send `GET https://api.ezrate.me/v1/rates?symbols=usd` with header `X-API-Key`.
  • Read `buy`, `sell`, `updated_at` and `sources`, check `/usage`, then follow the integration guides.

This EZRate API quickstart gets you from zero to a live Tehran free-market dollar rate in five minutes. No SDK needed — any HTTP client works.

★
Short answer
1) Create an EZRate account. 2) In the user panel open “API keys” and create a key. 3) Run curl -H "X-API-Key: YOUR_KEY" "https://api.ezrate.me/v1/rates?symbols=usd,eur,g18". 4) Read buy/sell (Toman by default), updated_at and sources. 5) Check your quota with /usage.

Step 1: create an account and a key

  1. Go to the API page and sign up (email, Google or Telegram login).
  2. Open the user panel → API keys → New key.
  3. Name it after its use (e.g. “production-backend”) and, ideally, restrict it to your server IPs.
  4. Copy the key and store it as an environment variable. Never commit it.
User panel API keys page with the “New key” dialog
Creating an API key in the panel
bash
export EZRATE_KEY="paste-your-key-here"

Step 2: your first request

bash
curl -s -H "X-API-Key: $EZRATE_KEY" \
  "https://api.ezrate.me/v1/rates?symbols=usd,eur,g18&lang=en"
json
{
  "data": [
    { "symbol": "usd", "code": "USD", "name": "US Dollar", "market": "tehran",
      "buy": 0, "sell": 0, "change_pct": 0.0, "sources": 12, "low_sources": false,
      "updated_at": "…", "quote": "IRT" },
    { "symbol": "eur", "…": "…" },
    { "symbol": "g18", "…": "…" }
  ],
  "meta": { "as_of": "…", "freshness_sec": 60, "quote": "IRT" }
}

The same request in your language

Python

python
import os, requests
r = requests.get("https://api.ezrate.me/v1/rates", params={"symbols": "usd"},
                 headers={"X-API-Key": os.environ["EZRATE_KEY"]}, timeout=10)
print(r.json()["data"][0]["sell"])

JavaScript (Node 18+)

javascript
const r = await fetch("https://api.ezrate.me/v1/rates?symbols=usd",
  { headers: { "X-API-Key": process.env.EZRATE_KEY } });
console.log((await r.json()).data[0].sell);

PHP

php
$ctx = stream_context_create(['http' => ['header' => "X-API-Key: ".getenv('EZRATE_KEY')]]);
$body = json_decode(file_get_contents('https://api.ezrate.me/v1/rates?symbols=usd', false, $ctx), true);
echo $body['data'][0]['sell'];

Step 3: read the response

FieldWhat to do with it
buy / sellShow both; customers buying currency pay sell
quoteThe unit — IRT (Toman) by default; use quote=IRR for Rial
updated_atShow it next to the price
sources / low_sourcesConfidence; badge the price when low_sources is true
meta.freshness_secCache for at least this long

Step 4: check your usage

bash
curl -s -H "X-API-Key: $EZRATE_KEY" https://api.ezrate.me/v1/usage

/usage does not count against your quota. Rate-limit headers (X-RateLimit-Remaining-Day, …-Month) come with every response.

US Dollar263,730Toman+0.21%

Common first-run errors

ErrorFix
401 invalid_api_keyCheck the header name and that the key was copied fully
403 forbiddenYour IP is not in the key’s allowed list
422 validation_failedCheck parameter values; fields tells you which
429 rate_limitedSlow down and cache; wait Retry-After seconds

Next steps

  • Full schema and every endpoint: JSON reference.
  • Concepts (free market vs official, Rial vs Toman): API guide.
  • Keep your key safe: securing API keys.
  • Stack tutorials: Python/Django, Laravel, React.
  • Gold and coins: Iran gold price API.
Terminal showing the curl request and formatted JSON response
Your first live request

What to build next

With a working request you can choose a direction. For a website, add server-side caching and a small endpoint for your front end. For a spreadsheet, follow the Google Sheets or Excel guide. For a Telegram channel, the no-code poster may be all you need. Whatever you build, keep the key on the server, cache for the freshness window and show the update time next to every number — those three habits prevent most integration problems.

If something does not work, check the status code first: 401 and 403 are configuration issues, 422 means a parameter is wrong, 429 means you are calling too often. The error body always contains a machine-readable code and a human-readable message.

Security from day one

Even for a first experiment, treat the key like a password. Keep it in an environment variable, add your local .env file to .gitignore, and create separate keys for development and production so you can revoke one without affecting the other. When you move to production, restrict the key to your server IPs in the panel. If you ever paste a key into a chat, a ticket or a public repository, rotate it immediately.

These habits take two minutes to set up and save hours of cleanup later.

Related live rates: US dollar rate, 18K gold price, Emami coin price.

How do I get an EZRate API key?
Create an account, open the user panel, go to API keys and create a new key.
Is there a free plan?
Yes, a free plan with a limited quota is available; current plans and limits are listed on the API page.
Which header carries the key?
X-API-Key, or Authorization: Bearer <key>.
Are prices in Toman or Rial?
Toman by default; add quote=IRR for Rial.
Ersan Fazli
I work in software development and programming, with a strong interest in building practical and efficient solutions. My focus is on developing new features, improving system performance, and solving technical challenges using modern technologies. I strive to create reliable, scalable, and high-quality software through continuous learning and the application of modern development practices.
All posts by author →

Comments (0)

Comments are shown after review. Sign-in is needed to send.

Related

API & Developers
Iranian Rial Exchange Rate API: The Complete Guide to IRR and Toman Rates
Gold & coins
What Is the Gold Bubble in Iran? Real Value vs. Market Price
Gold & coins
What Is a Gold Coin Bubble and How Is It Calculated?