# IQ Xchange — full reference for machine readers Live USD/IQD and cross-currency rates for Iraq. This file is the long form of https://iqdrates.com/llms.txt: every endpoint, every field, every limit. It is written for an assistant or an agent that has to answer correctly without a human reading the page first. Last reviewed: 2026-11-30. ## 1. What the numbers are - **Desk tier (`desk`, `LOCAL`)** — the market price read from a monitored Iraqi trading channel, per governorate, parsed and stored with the line it came from. A desk quote carries its own timestamp. When it is older than the freshness window (90 minutes) it is still served, but labelled *last known* — it is never silently relabelled as reference data. - **Reference tier (`reference`)** — the European Central Bank rate served by Frankfurter, converted through the USD pivot. This is the international number, not the bazaar. It is available for every day back to 2004-12-31. - **Unit convention.** Machine endpoints answer per **1 unit of the base** (`USD/IQD = 1513.44`). The public board shows the same value per **100 units** (151,344) because the Iraqi market quotes per $100. Multiply or divide by 100 deliberately, never by accident. - **Mid price.** The single number is a mid. Desk quotes can also carry `bid` and `ask`; where only one side exists the other is absent rather than invented. - All timestamps are UTC. Days are Baghdad calendar days (`Asia/Baghdad`). - **Every number in this file is a sample of the shape, stamped with the day it was taken.** It is not the current quote; read the endpoint before quoting one. ## 2. Hosts | Host | Purpose | | --- | --- | | `https://iqdrates.com` | front page, archive endpoints, account API, A2A and the OpenAPI document | | `https://tv.iqdrates.com` | the live board (broadcast layout) | | `https://fx.iqdrates.com` | keyed JSON API and gRPC-Web | | `https://api.iqdrates.com` | same as `fx` | Legacy `iq.wipuu.app` and `exc.wipuu.app` answer 301/302 to the names above. ## 3. Current rates — keyed ``` GET https://fx.iqdrates.com/v2/rate/{base}/{quote}[?scope=ADM2:IQG08&expand=providers] GET https://fx.iqdrates.com/v2/rates?base=USD"es=EUR,GBP,TRY,SAR,AED[&scope=…] GET https://fx.iqdrates.com/v1/latest?from=USD&to=IQD&amount=100 GET https://fx.iqdrates.com/v1/latest?base=USD&symbols=IQD,EUR GET https://fx.iqdrates.com/v2/currencies GET https://fx.iqdrates.com/v2/providers ``` `/v2/rate/{base}/{quote}` answers: ```json { "date": "2026-11-30", "base": "USD", "quote": "IQD", "rate": 1513.44 } ``` The number above documents the shape only — the live value moves every few minutes. `expand=providers` adds a `providers` array: the legs behind the number, each with its own date, rate and — for desk data — bid/ask. `/v2/rates` answers one object per quote that the desk can price, and silently drops symbols it cannot (`{"message": "…"}` only when nothing is left). Published symbols: `IQD USD EUR GBP TRY SAR AED JPY CNY KWD`. `/v2/currencies` and `/v2/providers` are metadata and free of quota. ### Scope Every rate endpoint accepts `?scope=` (alias `?geo=`). Levels are `ADM0:IQ`, `ADM1:IQ-KRI`, `ADM2:IQG08`. Governorate p-codes: | Scope | Governorate | | --- | --- | | `ADM2:IQG08` | Baghdad (node default) | | `ADM2:IQG11` | Erbil | | `ADM2:IQG06` | Sulaymaniyah | | `ADM2:IQG09` | Duhok | | `ADM2:IQG02` | Basra | | `ADM2:IQG04` | Najaf | A missing governorate is a real answer ("we hold nothing for Maysan yet"), not an error. ## 4. Archive — free on the board host ``` GET https://iqdrates.com/archive/meta GET https://iqdrates.com/archive/days?from=2026-11-01&to=2026-11-30&code=IQG08&tier=desk&limit=200 GET https://iqdrates.com/archive/day?day=2026-11-27&code=IQG08 ``` `/archive/meta` answers coverage and the governorate list: ```json { "pair": { "base": "USD", "quote": "IQD" }, "today": "2026-11-30", "bounds": { "first_day": "2004-12-31", "last_day": "2026-11-30", "days": 6639, "desk_days": 2, "reference_days": 6639 }, "tiers": [ { "tier": "desk", "days": 2, "first_day": "…", "last_day": "…" } ], "provinces": [ { "code": "IQG08", "name": "Baghdad", "name_local": "بغداد", "level": 2, "days": 2, "samples": 3, "first_day": "2026-11-29", "last_day": "2026-11-30" } ], "years": [2004, 2005, "…"] } ``` `/archive/days` returns one row per stored day (`day`, `open`, `high`, `low`, `close`, `samples`, `code`, `tier`, `level`), ascending by day, `limit` 1–5000. `/archive/day` returns the day itself: `reference` (close, previous close, change, change_pct), `provinces` (per-governorate rows) and `intraday` (the desk ticks with their timestamps). These three are the endpoints the public page itself calls, so they carry no key and no quota. They are cached for five minutes at the edge. ## 5. A2A — the agent surface ``` GET https://iqdrates.com/a2a/ask?q=USD+to+IQD+in+Erbil (the flat call a tool makes) GET https://iqdrates.com/openapi.json (also /.well-known/openapi.json) GET https://iqdrates.com/.well-known/agent-card.json (also /.well-known/agent.json) GET https://iqdrates.com/a2a (same card) POST https://iqdrates.com/a2a (JSON-RPC 2.0) GET https://iqdrates.com/ai/chatgpt.txt (paste-ready ChatGPT setup) GET https://iqdrates.com/ai/gemini.txt (paste-ready Gemini setup) ``` ### The flat call — `GET /a2a/ask` Parameters: `q` (a sentence in Arabic, Kurdish, English or Turkish), or `base` and `quote`; optional `scope` (a governorate p-code, see §3) which overrides a province named in `q`. Everything else — the pair, the governorate, the word "archive" — is read out of the sentence. ```json { "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. Board: https://tv.iqdrates.com/ · keyed API and packages: https://iqdrates.com/docs", "data": { "pair": { "base": "USD", "quote": "IQD" }, "scope": "ADM2:IQG11", "rate": { "date": "2026-11-30", "base": "USD", "quote": "IQD", "rate": 1677 }, "archive": null, "board": "https://tv.iqdrates.com/", "source": "https://iqdrates.com/" }, "metadata": { "asOf": "2026-11-30T18:52:00Z", "units": "rate is per 1 unit of the base currency", "plan": "open", "quota": "none" } } ``` `data.rate` is byte-identical to what `GET /v2/rate/{base}/{quote}` would answer for the same pair and scope: the agent prices through the same dispatcher, so a reply cannot disagree with the keyed API. When no rate is available the sentence says so and `data.rate` carries the message instead of a number. ### No allowance, no key - The agent is **not metered**. There is no anonymous allowance, no key budget and no `429`: ask it as often as a conversation needs. Answers say `metadata.plan: "open"` and `metadata.quota: "none"` and carry no `x-ratelimit-*` header. - A key sent along (`Authorization: Bearer iqx_…`, `?token=`, `?api_key=`) is accepted and **ignored** — it is never charged. The metered product is `fx.iqdrates.com/v2/*`, where the package's daily counter applies. - The only throttle is the edge's burst limit, so do not poll faster than once a minute. Callers inside the VPC are served the same way. - A method that is not `message/send`, a body that is not JSON, or an unknown path is refused with a JSON-RPC error (`-32601`, `-32700`) and costs nothing. ### JSON-RPC — `POST /a2a` Skills advertised on the card: `live-rate` (one pair, optional governorate) and `rate-archive` (coverage). The endpoint is stateless: `message/send` answers with a Message, never a Task, so `tasks/*` and `message/stream` return JSON-RPC `-32601` with a reason. Request: ```json { "jsonrpc": "2.0", "id": 1, "method": "message/send", "params": { "message": { "role": "user", "parts": [ { "kind": "text", "text": "USD to IQD rate in Erbil" } ] } } } ``` Response (abridged): ```json { "jsonrpc": "2.0", "id": 1, "result": { "kind": "message", "role": "agent", "messageId": "iqx-…", "parts": [ { "kind": "text", "text": "USD → IQD: 1 USD = 1,677 IQD (2026-11-30, Erbil). …" }, { "kind": "data", "data": { "pair": { "base": "USD", "quote": "IQD" }, "scope": "ADM2:IQG11", "rate": { "date": "2026-11-30", "base": "USD", "quote": "IQD", "rate": 1677 }, "archive": null, "board": "https://tv.iqdrates.com/", "source": "https://iqdrates.com/" } } ], "metadata": { "asOf": "2026-11-30T18:52:00Z", "units": "rate is per 1 unit of the base currency", "plan": "open", "quota": "none" } } } ``` Anything unnamed defaults to USD/IQD in Baghdad. An unsupported method or a body that is not JSON answers a JSON-RPC error (`-32601`, `-32700`) and costs nothing. ### Action schemas `GET /openapi.json` is an OpenAPI 3.1 document generated by the running binary, so it cannot drift from the answers. Operations: `askRates` (`GET /a2a/ask`), `sendA2AMessage` (`POST /a2a`), `archiveCoverage` (`GET /archive/meta`) and `getRate` (`GET /v2/rate/{base}/{quote}`, bearer key). Import it as a custom GPT action with authentication **None** for `askRates`, or lift the function declaration out of `/ai/gemini.txt` for a Gemini tool call. ## 6. Keys, quotas, errors - Mint a key at `https://iqdrates.com/account` (or `POST https://iqdrates.com/api/auth/signup` with `{"email","password"}`). Keys look like `iqx_…` and are stored hashed. - Send it as `Authorization: Bearer iqx_…`, `?token=iqx_…` or `?api_key=iqx_…`. - Plans: free `$0` / 10 reads a day, Starter `$9` / 1,000, Pro `$39` / 20,000. `GET https://iqdrates.com/api/plans` is the live price list; each plan's `agents` object names the agent endpoint and marks it `unlimited`. A paid key stays `pending` (403) until an operator activates it. - Agent access is part of every package and is not metered: `/a2a`, `/a2a/ask` and the ChatGPT/Gemini action never spend the key's daily counter, so asking never costs a package read. - Every keyed answer carries `x-plan`, `x-ratelimit-limit`, `x-ratelimit-used`, `x-ratelimit-remaining`, `x-ratelimit-reset` (unix seconds). - Errors are JSON: `{"message": "…"}` plus `docs`/`account` links when the problem is authentication. Status codes: `401` no/invalid key, `403` pending plan, `429` daily quota exhausted, `404` unknown symbol. - Callers inside the VPC reach the listener at `172.26.1.225:8081` without a key; the public hostnames always require one for `/v2/*`. ## 7. gRPC and gRPC-Web Service `exchange.v1.ExchangeRateService` on `fx.iqdrates.com:443`: - gRPC-Web: `POST https://fx.iqdrates.com/rpc/exchange.v1.ExchangeRateService/` with the standard 5-byte frame prefix; the board uses this. - Native gRPC needs `52.28.245.40:50051` (Cloudflare rejects `application/grpc` on the proxied host) or the zone's gRPC toggle. - Reflection is on, so `grpcurl fx.iqdrates.com:443 list` works without the `.proto`. ## 8. Polling and caching - Rates: 30 seconds of edge cache. The board itself polls every 5 seconds; an assistant should not poll faster than that, and one read per answer is enough. - Archive: 300 seconds. - `ETag`/`Last-Modified` are not offered; the JSON is small (a few hundred bytes). - The board never reloads the page: it patches changed numbers only. ## 9. Attribution and limits of the data - Attribute numbers to "IQ Xchange (iqdrates.com)". The provider object returned by `/v2/providers` names the desk and the reference tier. - Desk readings cover the governorates that publish; a province without a quote has no market price, and this service will not invent one. - The archive mixes tiers: a day is `desk` when a market quote exists for it and `reference` otherwise. `/archive/days?tier=desk` filters to market days only. - Rates are informational, not an offer to trade, and not financial advice. ## 10. Where to look next - Integration guide: https://iqdrates.com/docs - OpenAPI 3.1 (action import): https://iqdrates.com/openapi.json - ChatGPT setup: https://iqdrates.com/ai/chatgpt.txt · Gemini: https://iqdrates.com/ai/gemini.txt - Packages and prices: https://iqdrates.com/api/plans - Console: https://iqdrates.com/account - Live board: https://tv.iqdrates.com/ - What the reader last parsed: https://iqdrates.com/source