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.

- 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.
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
- Go to the API page and sign up (email, Google or Telegram login).
- Open the user panel → API keys → New key.
- Name it after its use (e.g. “production-backend”) and, ideally, restrict it to your server IPs.
- Copy the key and store it as an environment variable. Never commit it.

export EZRATE_KEY="paste-your-key-here"Step 2: your first request
curl -s -H "X-API-Key: $EZRATE_KEY" \
"https://api.ezrate.me/v1/rates?symbols=usd,eur,g18&lang=en"{
"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
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+)
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
$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
| Field | What to do with it |
|---|---|
buy / sell | Show both; customers buying currency pay sell |
quote | The unit — IRT (Toman) by default; use quote=IRR for Rial |
updated_at | Show it next to the price |
sources / low_sources | Confidence; badge the price when low_sources is true |
meta.freshness_sec | Cache for at least this long |
Step 4: check your usage
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.
Common first-run errors
| Error | Fix |
|---|---|
401 invalid_api_key | Check the header name and that the key was copied fully |
403 forbidden | Your IP is not in the key’s allowed list |
422 validation_failed | Check parameter values; fields tells you which |
429 rate_limited | Slow 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.

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.

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


