IQ XCHANGE

Developer API · v1

Integration guide

The Iraqi dinar market rate this desk trades, over plain JSON. Sign up, mint a key, call the endpoint. Ten reads a day are free; inside the VPC nothing is metered and no key is needed.

Overview

Two hostnames, one service. The public host is the product: key-gated, metered, cached at the edge. The private one is for machines that already sit in our network.

Where you call fromBase URLKeyMetered
Internet / mobile apps https://fx.iqdrates.com required yes — per package
Same AWS VPC http://172.26.1.225:8081 none no
Public board (our pages) https://iqdrates.com/archive/… none no — board only

The board's own paths are free so the archive section and the feed monitor keep working without a key; nothing else on iqdrates.com is a data endpoint.

One request, start to finish

curl -s https://fx.iqdrates.com/v2/rate/USD/IQD \
  -H "Authorization: Bearer iqx_YOUR_KEY"
# {"date":"2026-11-30","base":"USD","quote":"IQD","rate":1672}

Decimals are JSON numbers already rounded to the precision this desk deals at, so a client should store them as decimal, not float: a dinar price is an integer by construction and currency maths in binary floats drifts.

Authentication

Create an account at /signup. A free key is minted immediately and shown once; the service stores only its SHA-256, so a lost key is replaced, never recovered.

Send it as a bearer token on every metered request:

Authorization: Bearer iqx_9f1c0b7e2a5d4c33a1b0e5d7c9f2a1b3

For a quick probe in a browser you can pass the key as a query parameter — ?token=… or ?api_key=… — but URLs end up in logs, proxies and screenshots: never ship that form in an application.

What is free even on the public host

  • /healthz — liveness, plain text ok.
  • /v2/currencies, /v1/currencies, /currencies — the symbol catalogue.
  • /v2/providers — who publishes these numbers.
  • /api/* — account, keys and plans.

Everything that returns a rate or a price — /v1/*, /v2/rate/*, /v2/rates, /archive/*, /latest — needs a key on the public host.

Sessions (the console)

The console uses an iqx_session cookie: HttpOnly, SameSite=Lax, 30 days. Browsers cannot read it from JavaScript, and a POST from another origin is refused, which is what closes CSRF without a token field.

Packages & quotas

A key belongs to exactly one package, and one package can have one live key per account. The quota is counted per key, on the Baghdad calendar day (UTC+3), and resets at midnight — not 24 hours after the first call.

PackageReads / dayPriceFor
Free
free
10freeSmoke-testing an integration.
Starter
starter
1,000$9/moOne shop, POS or dashboard.
Pro
pro
20,000$39/moChains and resellers.
Unlimited
unlimited
—contractOperator keys; granted by us, not self-service.

Paid packages are activated by an operator. Mint one in the console and it is created pending: it answers 403 with a clear message until we switch it on after payment. Nothing is charged automatically — that is the honest state of the product today, and it will not silently bill you.

Do not poll: read the budget

Every metered response carries the counters:

HeaderMeaning
x-planPackage the key belongs to.
x-ratelimit-limitReads allowed today (absent on unlimited).
x-ratelimit-usedReads this key has spent today, including this one.
x-ratelimit-remainingReads left today.
x-ratelimit-resetUnix second when the quota returns.

Rates move a few times an hour, not a few times a second, and every response is already cacheable (Cache-Control: public, max-age=15 on rates, 300 on catalogues). A client that polls once a minute and honours max-age fits inside the free package. Polling in a tight loop will spend a package in hours and answer the same number.

Endpoints

GET /v2/rate/{base}/{quote}

The desk rate for one pair, in the Frankfurter v2 shape.

ParameterValuesDefault
expandproviders — add attribution, bid and askabsent
scopeany geo scope, e.g. ADM2:IQG11Baghdad
curl -s 'https://fx.iqdrates.com/v2/rate/USD/IQD?scope=ADM2:IQG11&expand=providers' \
  -H "Authorization: Bearer iqx_YOUR_KEY"
# {"date":"2026-11-30","base":"USD","quote":"IQD","rate":1672,
#  "providers":[{"key":"XCHANGE","date":"2026-11-30","rate":1672,"bid":1668,"ask":1672}]}

GET /v2/rates?base=USD&quotes=IQD,EUR,TRY

Several quotes per base, one round trip and one read from the quota. The answer is an array, one rate object per quote that resolved.

# [{"date":"2026-11-30","base":"USD","quote":"IQD","rate":1672},
#  {"date":"2026-11-30","base":"USD","quote":"EUR","rate":0.8678}]

GET /v1/latest?from=USD&to=IQD

Deprecated Frankfurter v1 shape, kept because old clients still ask for it.

ParameterMeaning
from / baseBase currency, default USD.
to / symbolsComma-separated quotes; all catalogue pairs when omitted.
amountMultiply the rates, e.g. 100 for a $100 note.
# {"amount":1,"base":"USD","date":"2026-11-30","rates":{"IQD":1672}}

Historical dates (/v1/2026-11-28) answer 501: this service keeps observations, not a market calendar. Use /archive/day for the daily series.

GET /v2/currencies · /v2/providers

The ten symbols this board quotes — IQD USD EUR GBP TRY SAR AED JPY CNY KWD, each with its name and symbol — and the provider record (XCHANGE, pivot IQD, intraday cadence). Both are free and cached for five minutes.

GET /archive/meta

Coverage of the daily series: bounds, per-tier day counts, every province with its day and sample count, and the years that hold data. Start here before walking the archive.

GET /archive/days?from=…&to=…&code=IQG08&tier=desk&limit=

Daily rows — open, high, low, close, samples, prev_close, change, change_pct — for one scope or all of them. code accepts an ADM0–ADM3 p-code; tier is desk (default) or reference.

curl -s 'https://fx.iqdrates.com/archive/days?from=2026-11-01&code=IQG11' \
  -H "Authorization: Bearer iqx_YOUR_KEY"

GET /archive/day?day=YYYY-MM-DD

One day across every province, plus the national reference close and — when code= is given — that province's intraday ticks.

GET /source/readings

The operator's view of the feed: each stored reading with the line it was parsed from. Metered like any other read; /source on the board is the same data rendered.

POST /api/auth/signup · /api/auth/signin

The same calls the website makes, for teams that provision accounts from a script. signup takes {email, password, display_name} and answers 201 with the user and a free key.

curl -s -X POST https://iqdrates.com/api/auth/signup \
  -H 'content-type: application/json' \
  -d '{"email":"ops@example.com","password":"a-long-password","display_name":"Ops"}'

From a terminal the CLI does this for you: iqx signup prompts for the email and password, then prints the key once. /api/me, /api/plans, /api/tokens and the admin routes complete the set; they are session-cookie calls, not key calls.

Scopes & provinces

Iraq does not have one dollar price. Every rate endpoint accepts ?scope= and defaults to the configured desk scope, Baghdad (ADM2:IQG08).

LevelExampleMeaning
ADM0IQCountry — the national reference.
ADM1KRIRegion — the Kurdistan Region.
ADM2IQG08 Baghdad, IQG11 Erbil, IQG02 Basra, IQG04 Najaf, IQG06 Sulaymaniyah, IQG09 DuhokGovernorate — the usual unit.
ADM3IQG11Q01District inside a governorate.

A miss is not an error: ask for a district with no quote and the service walks down — ADM3 → ADM2 → ADM1 → ADM0 — so an Erbil shop still gets a price when its district has not reported. The gRPC contract says which rung answered (matched_code); over JSON the answer is the price you can deal at.

/archive/meta lists every province p-code with its name, ready to build a selector.

Desk vs reference

Two tiers feed the numbers, and they are never mixed:

  • Desk — what the market channel in that governorate quotes, ingested intraday. This is the price a shop would trade at.
  • Reference — the international mid from the Frankfurter feed (ECB), used for pairs the desk does not quote and for the national series.

Over JSON the response is simply the effective rate. If you need to know whether the desk or the reference produced it — and whether the reading is stale — use the gRPC contract, where tier, source_key, matched_code and stale are fields, or ask for ?expand=providers, which carries the bid and ask when the desk is the source.

A 200 is not a promise to trade. These are indicative market prices; the board disclaimer applies to the API too.

Errors

Every error is JSON: {"message":"…"}.

StatusWhenWhat to do
400Unknown parameter, bad scope, from after to.Fix the request; the message names the field.
401No key, unknown key or a revoked one. Carries www-authenticate.Send Authorization: Bearer …. Mint a new key if it was revoked.
403Key is pending; account blocked; cross-origin POST.Paid package not activated yet — ask the operator.
404Unknown symbol or path.Check the catalogue at /v2/currencies.
429Daily quota spent.Wait for x-ratelimit-reset, cache harder, or upgrade.
501Historical date asked of the Frankfurter contract.Use /archive/day.
503Upstream reference unavailable and no desk quote.Retry with backoff; /healthz still answers.

Client code

JavaScript / TypeScript

const KEY = process.env.IQX_KEY;
const res = await fetch('https://fx.iqdrates.com/v2/rates?base=USD&quotes=IQD,EUR', {
  headers: { authorization: `Bearer ${KEY}` },
});
if (res.status === 429) throw new Error('daily quota spent');
const { date, rates } = await res.json();
console.log(date, rates.IQD);

Python

import os, requests

r = requests.get(
    "https://fx.iqdrates.com/v2/rate/USD/IQD",
    headers={"Authorization": f"Bearer {os.environ['IQX_KEY']}"},
    timeout=10,
)
r.raise_for_status()
price = r.json()["rate"]          # int, dinars per USD

PHP

$ch = curl_init('https://fx.iqdrates.com/v2/rate/USD/IQD?scope=ADM2:IQG08');
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('IQX_KEY')],
]);
$body = json_decode(curl_exec($ch), true);
echo $body['rate'];

Go

req, _ := http.NewRequest("GET", "https://fx.iqdrates.com/v2/rate/USD/IQD", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("IQX_KEY"))
res, err := http.DefaultClient.Do(req)
// decode into: struct{ Date, Base, Quote string; Rate json.Number }

Decode rate into a decimal ( json.Number, Decimal, decimal.Decimal) — never a float — and cache the body for its max-age.

CLI

Query a rate from a terminal without writing a client — and open the account from the same binary. The key lives in ~/.config/iqx/auth.json; --key, IQX_KEY and IQX_HOST still win when set, and the host (default https://fx.iqdrates.com) picks which stored session applies.

Node (one command)

iqx signup takes the email, asks for a password without echoing it, prints the key once and stores it (file mode 0600) — no browser round trip. Every interactive run opens with the retro IQX logo from banner.txt and the package version beneath it; --no-banner skips it, and --json/--quiet never print it.

curl -fsSL https://iqdrates.com/install | sh    # puts `iqx` and `iqx-rates` on PATH

iqx signup                            # asks for the email, then the password
iqx rate USD IQD
iqx latest --base USD --to IQD,EUR,TRY
iqx archive day --day 2026-11-30 --code IQG11
iqx usage                              # remaining reads today, from the headers

iqx whoami                             # account, keys, usage today
iqx token new --label pos-1            # another key (--replace rotates it)
iqx token revoke <id|prefix|label>
iqx signin / iqx signout               # session on this machine

Runs on Node 18+ with no dependencies. The installer reads /download/latest.json, verifies the tarball's sha256 and installs it; without the script the same release is one command: npm install -g https://iqdrates.com/download/iqx.tgz. npx @volls/iqx-rates takes over once the package is published to the registry.

Go

cd packages/go-iqx && go install ./cmd/iqx    # puts `iqx` on $GOBIN / ~/go/bin
iqx rate USD IQD --scope ADM2:IQG11

The Go module also exposes the client as a library: iqx.New(iqx.Options{Key: os.Getenv("IQX_KEY")}).

No install at all

curl -s https://fx.iqdrates.com/v1/latest?from=USD&to=IQD \
  -H "Authorization: Bearer $IQX_KEY" | jq .rates

Inside the VPC

A machine in the same private network as the service reads http://172.26.1.225:8081 — the same routes, no key, no quota. That is the intended path for internal jobs: nothing to rotate, nothing to leak.

curl -s 'http://172.26.1.225:8081/v2/rate/USD/IQD?scope=ADM2:IQG11'
curl -s 'http://172.26.1.225:8081/archive/days?from=2026-11-01&level=adm2'
curl -s 'http://172.26.1.225:8081/healthz'

The listener refuses callers outside loopback and RFC1918 by configuration, so a mis-opened firewall publishes nothing. Port 8081 is reachable inside the VPC only.

gRPC

The contract is exchange.v1.ExchangeRateService on 52.28.245.40:50051 (h2c, private) and over gRPC-Web at https://fx.iqdrates.com/rpc/…. It is the richer interface: batch calls, explicit tier, staleness, snapshot writes and the geo catalogue.

grpcurl -d '{"baseCurrency":"USD","quoteCurrency":"IQD","geo":{"adm0":"IQ","adm2":"IQ-EB"}}' \
  52.28.245.40:50051 exchange.v1.ExchangeRateService/GetEffectiveRate

Write RPCs (UpsertLocalRate, IngestLocalRate, UpsertGeoRule, CreateRateSnapshot) are restricted to loopback and private ranges and are not part of the public product.

AI agents (A2A)

An assistant answering “what is the dollar in Baghdad today?” usually has no key and no account. The desk therefore publishes the same answer in the shapes an AI client already knows how to read: a text map for retrieval, one flat endpoint for a tool call, and an A2A endpoint that takes a sentence and returns the rate with its tier and timestamp.

curl -s 'https://iqdrates.com/a2a/ask?q=USD+to+IQD+in+Erbil'
{"text":"USD → IQD: 1 USD = 1,677 IQD (2026-11-30, Erbil). The public board quotes
         the same pair per 100 units, so 1,677 reads as 167,700 there. …",
 "data":{"pair":{"base":"USD","quote":"IQD"},"scope":"ADM2:IQG11",
         "rate":{"date":"2026-11-30","base":"USD","quote":"IQD","rate":1677}},
 "metadata":{"plan":"open","quota":"none",
             "units":"rate is per 1 unit of the base currency"}}

The answer never disagrees with the keyed API: it is priced through the same dispatcher /v2/rate uses, so data is literally that object. The agent is stateless — one message in, one message out, no task to poll — and reads the pair, the governorate and the word “archive” straight out of the sentence.

No allowance, no key

The agent is not metered: no key, no daily allowance, no 429. Ask as often as a conversation needs — the only throttle is a burst limit at the edge, so do not poll faster than once a minute. A key sent along is accepted and ignored. The metered product is the keyed API on fx.iqdrates.com/v2/*, where the package sets the daily budget and the x-ratelimit-* headers appear. Every agent answer therefore says metadata.plan: "open" and metadata.quota: "none", and carries no quota header at all — an assistant that gets a 402 for asking would only fall back on stale memory.

ChatGPT and Gemini

The paste-ready setup is at /ai/chatgpt.txt and /ai/gemini.txt. For a custom GPT, import https://iqdrates.com/openapi.json as the action (operation askRates) with authentication None, then paste the instruction block. For Gemini, register get_iqd_rate as a function declaration and call the same URL. A Gem with no function attached can only link, so it should say so rather than invent a rate.

Units: the agent and the API answer per 1 unit of the base currency; the public board prints the same number per 100, because the bazaar quotes per $100.

AI integration prompt

Paste this into a coding assistant to wire the API into an application. It carries the parts a model gets wrong on its own: decimal handling, the quota header, the scope default and the 429 path.

You are integrating the IQ Xchange rate API into this project.

Base URL: https://fx.iqdrates.com (public, key required)
Auth: header  Authorization: Bearer $IQX_KEY      (key starts with "iqx_")
Free endpoints: /healthz, /v2/currencies, /v2/providers
Metered endpoints: /v2/rate/{BASE}/{QUOTE}, /v2/rates?base=&quotes=,
                   /v1/latest?from=&to=&amount=, /archive/meta|days|day

Rate format: {"date":"YYYY-MM-DD","base":"USD","quote":"IQD","rate":1672}
  - rate is dinars per 1 unit of base, already rounded to dealing precision
  - parse it as a DECIMAL (never float); IQD prices are whole dinars
  - use ?scope=ADM2:IQG11 for Erbil, ADM2:IQG08 Baghdad; default is Baghdad
  - ?expand=providers adds bid/ask attribution

Quota: headers x-ratelimit-limit / -used / -remaining / -reset (unix seconds).
  Resets at Baghdad midnight (UTC+3), not 24h after first call.
  On 429: back off until x-ratelimit-reset and reuse the cached body.
  Rates are cacheable (max-age=15); do not poll faster than once a minute.

Errors: {"message":"..."} with 400 bad request, 401 missing/unknown key,
  403 pending package or blocked account, 404 unknown symbol, 429 quota,
  501 historical date asked of /v1 (use /archive/day), 503 upstream down.

Requirements:
1. Read the key from the IQX_KEY environment variable; never hard-code it.
2. One function to fetch a rate with a timeout and a single retry on 5xx.
3. Surface remaining quota from the response headers in the app's logs.
4. Handle 429 explicitly instead of throwing a generic error.
5. Add a unit test with a recorded response body, and one test for the 429 path.

Usage policy

  • Keys are per application. Do not share one key between unrelated products — a single blocked key should not take several services down.
  • Do not resell the raw feed as your own exchange. Building a product on these rates, with attribution to IQ Xchange, is exactly the point.
  • Respect Cache-Control and the quota headers. Sustained abuse is a blocked key, not a surprise invoice.
  • Rates are indicative and published for information; they are not a binding offer to buy or sell currency.

Attribution, when convenient: Rates by IQ Xchange (iqdrates.com).

Ownership and contact

IQ Xchange is a product of Volls Technology AB, Sweden. All intellectual property rights in the project — the code, the API contract, the data model, this documentation and the IQ Xchange marks — belong to Volls Global Inc., USA. Copyright © 2026 both entities, all rights reserved.

Keys, billing, licensing and press: info@vollstech.com · +1 276 600 2052 (USA) · vollstech.com.