
Shekel Currency Converter
- 63 installs
- 29 repo stars
- Updated August 3, 2026
- skills-il/tax-and-finance
shekel-currency-converter is a finance skill that converts amounts to and from Israeli New Shekel (ILS) using exchange rates so builders can price or invoice in shekels accurately.
About
An agent skill that converts currency amounts involving the Israeli New Shekel (ILS) using exchange rates. A builder uses it for Israeli finance, invoicing, or pricing tasks that need shekel conversion. Content is name-only, so rate sources and direction are inferred.
- ILS/shekel conversion
- Exchange-rate lookup
- Finance utility
Shekel Currency Converter by the numbers
- 63 all-time installs (skills.sh)
- Ranked #565 of 1,106 Finance & Trading skills by installs in the Skillselion catalog
- Security screen: LOW risk (skills.sh audit)
- Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/skills-il/tax-and-finance --skill shekel-currency-converterAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 63 |
|---|---|
| repo stars | ★ 29 |
| Security audit | 3 / 3 scanners passed |
| Last updated | August 3, 2026 |
| Repository | skills-il/tax-and-finance ↗ |
What is this amount in Israeli shekels (ILS), or how do I convert from shekels to another currency at current rates?
Convert amounts to/from Israeli New Shekel (ILS) using current exchange rates.
Who is it for?
A developer or freelancer handling Israeli pricing, invoicing, or finance tasks involving ILS.
Skip if: Users with no ILS exposure or teams needing full treasury or accounting systems.
When should I use this skill?
When converting currency amounts involving Israeli New Shekel for pricing, invoicing, or finance calculations.
What you get
Converted currency amounts with ILS as the source or target using current exchange rates.
Files
Shekel Currency Converter
Instructions
Step 1: Identify Conversion Request
Parse the user's request for:
- Source currency and target currency (at least one should be NIS/ILS)
- Amount to convert
- Date (current or specific historical date, important for tax conversions)
- Purpose (general info vs. tax-relevant representative rate)
Common currency codes:
| Code | Currency | Hebrew |
|---|---|---|
| ILS | Israeli New Shekel | shekel chadash |
| USD | US Dollar | dolar |
| EUR | Euro | euro |
| GBP | British Pound | lira sterling |
| JPY | Japanese Yen | yen |
| CHF | Swiss Franc | frank shveitzi |
Step 2: Fetch Exchange Rate
Current rate (live JSON endpoint): The legacy XML feed at currency.xml is gone (it now redirects to the JSON API), so do NOT parse XML. Fetch the JSON endpoint and read the exchangeRates array.
Fetch: https://www.boi.org.il/PublicApi/GetExchangeRates
Parse JSON: response.exchangeRates is an array of objects.
Each object: key (currency code), currentExchangeRate (NIS per "unit"),
unit (1, 10, or 100), currentChange (percent move vs. previous
publication), lastUpdate (ISO timestamp).Example object: {"key":"USD","currentExchangeRate":2.872,"unit":1,"currentChange":1.66,"lastUpdate":"..."}. Here currentChange is a percentage daily move, not an absolute NIS delta, and it is NOT used in conversion math.
Historical / tax-date rate (SDMX series): The JSON endpoint's ?date= parameter is IGNORED, it always returns today's rate. For a specific past date (the rate that matters for tax), use the Bank of Israel SDMX EXR series instead:
Fetch: https://edge.boi.gov.il/FusionEdgeServer/sdmx/v2/data/dataflow/BOI.STATISTICS/EXR/1.0/RER_<CUR>_ILS?startPeriod=YYYY-MM-DD&endPeriod=YYYY-MM-DD&format=csv
Replace <CUR> with the currency code (e.g., RER_USD_ILS, RER_EUR_ILS).
Parse CSV: read OBS_VALUE keyed by TIME_PERIOD.The series omits non-publication days (Saturday, Sunday, holidays). If there is no row for the exact requested date, walk back to the most recent published date on or before it, and tell the user which date's rate you used.
Step 3: Calculate Conversion
If converting FROM NIS:
result = amount / rate * unit
If converting TO NIS:
result = amount * rate / unit
If converting between two foreign currencies:
nis_amount = amount * rate_source / unit_source
result = nis_amount / rate_target * unit_targetNote: Bank of Israel rates express how many NIS per unit(s) of foreign currency. Example (illustrative; fetch the live/dated rate): USD rate around 2.87, unit = 1 means 1 USD is about 2.87 NIS. Example (illustrative): JPY rate around 1.80, unit = 100 means 100 JPY is about 1.80 NIS.
Step 4: Present Results
Format the result with:
- Converted amount (2 decimal places for NIS, appropriate precision for other currencies)
- Exchange rate used and its date
- Source: "Bank of Israel representative rate (shaar yatzig)"
- Caveat: "Representative rate for reference. Actual bank rates may differ."
Which date's rate applies (tax)
- Foreign income: representative rate on the income accrual / receipt date.
- Foreign expenses: representative rate on the payment date.
- End-of-year revaluation: the December 31 representative rate for balance-sheet items.
- Import VAT (caveat): import VAT and customs are NOT computed at the bare BOI representative rate. Customs value uses the customs rate (shaar hamekhes), which the Israel Tax Authority sets weekly on the import declaration (rashimon) and is based on the BOI representative rate plus 0.5%. Do not quote the plain shaar yatzig as the import-VAT rate.
Examples
Example 1: Simple USD to NIS
User says: "Convert 1000 dollars to shekels" Result: "1,000 USD = X NIS (at the live Bank of Israel representative rate; fetch the dated rate before quoting a figure)."
Example 2: Historical Rate
User says: "What was the dollar rate on January 1, 2026?" Result: Fetch the SDMX RER_USD_ILS series. Jan 1, 2026 is a non-publication day, so report the most recent published date on or before it (the first 2026 observation is Jan 2, 2026) and say which date you used.
Example 3: Tax-Relevant Rate
User says: "I need the EUR rate for my VAT report for December 2025" Result: Provides the representative rate for the relevant transaction date from the SDMX series, noting it is the official rate for tax purposes. For import VAT specifically, point the user to the weekly customs rate.
Bundled Resources
Scripts
scripts/fetch_rates.py- Fetches official Bank of Israel representative exchange rates (shaar yatzig) and performs currency conversions to/from NIS. Uses the live JSON endpoint for current rates and the SDMX EXR series for historical date lookups (with publication-day walk-back). On a fetch failure it fails loud (prints an error, exits non-zero) and never substitutes sample rates for a real conversion; illustrative sample output is only available behind the explicit--demoflag. Run:python scripts/fetch_rates.py --help
References
references/boi-api-guide.md- Bank of Israel exchange rate API documentation: the live JSON endpoint and its fields, the SDMX EXR historical series, update schedule, and the import-VAT customs-rate caveat. Consult when troubleshooting API calls or understanding rate publication timing.references/currency-codes.md- Supported currency codes with Hebrew names, typical NIS rate ranges, and unit values (important for JPY and other multi-unit currencies). Consult when parsing user currency requests or handling unit-based conversions.
Reference Links
| Resource | URL |
|---|---|
| BOI exchange rates page | https://www.boi.org.il/en/economic-roles/financial-markets/exchange-rates/ |
| Live JSON rates endpoint | https://www.boi.org.il/PublicApi/GetExchangeRates |
| BOI SDMX EXR historical series | https://edge.boi.gov.il/FusionEdgeServer/sdmx/v2/data/dataflow/BOI.STATISTICS/EXR/1.0/RER_USD_ILS |
Recommended MCP Servers
For live exchange rate data, pair this skill with:
| MCP Server | What it provides | Install |
|---|---|---|
| boi-exchange | Official Bank of Israel daily representative rates (sha'ar yatzig) for the published currencies, historical rate series, rate change calculations, and direct currency conversion via BOI SDMX API. No API key required. | Install boi-exchange |
When the boi-exchange MCP is available, use its tools for real-time conversions instead of the static reference tables above. The MCP provides the official representative rate (shaar yatzig) which is the legally binding rate for tax purposes.
Gotchas
- The official NIS currency code is ILS (ISO 4217), but Israelis colloquially say "shekel" or "shekalim". Agents may not recognize "NIS" as a valid currency code or confuse it with the pre-1985 "Old Shekel" (IS).
- Bank of Israel publishes ONE representative rate per currency per day (no separate buy/sell rates), Monday to Thursday soon after 15:15 and Friday (and holiday eves) soon after 12:15. No rate is set on Saturday, Sunday, or Israeli holidays. Agents may fetch a rate before publication time and get the previous publication's rate without indicating it is stale.
- Only the official Bank of Israel published currencies have a representative rate (currently 14: USD, GBP, JPY, EUR, AUD, CAD, DKK, NOK, ZAR, SEK, CHF, JOD, LBP, EGP). The skill is not a general FX converter for every world currency.
- NIS formatting uses the shekel sign before the number, with comma for thousands and period for decimals (e.g., 1,234.56). Agents may use the European convention (1.234,56) or place the symbol after the number.
- When converting for tax purposes, Israeli law requires using the BOI representative rate (sha'ar yatzig) for the specific transaction date, not a live forex rate. For import VAT use the weekly customs rate, not the bare representative rate. Agents may use real-time rates that are not legally valid for tax reporting.
Troubleshooting
Error: "Rate not available for date"
Cause: Requested date is Saturday, Sunday, an Israeli holiday, or a future date. Solution: Use the most recent published date on or before the requested date from the SDMX series. Bank of Israel publishes rates Monday to Thursday (soon after 15:15) and Friday (soon after 12:15), not on Saturday, Sunday, or holidays.
Error: "Currency not supported"
Cause: Bank of Israel does not publish a representative rate for this currency (only the 14 listed currencies are covered). Solution: Suggest using USD or EUR as an intermediate currency for conversion.
{
"schemaVersion": "1.0",
"skill": "shekel-currency-converter",
"generated_at": "2026-06-03T21:43:29Z",
"claims": [
{
"claim": "The legacy XML endpoint https://www.boi.org.il/currency.xml no longer serves XML; it 301-redirects to the JSON endpoint https://www.boi.org.il/PublicApi/GetExchangeRates.",
"source_url": "https://www.boi.org.il/currency.xml",
"raw_snippet": "curl -L -o /dev/null -w 'code=%{http_code} final=%{url_effective}' https://boi.org.il/currency.xml => code=200 final=https://boi.org.il/PublicApi/GetExchangeRates (body is JSON, not XML)",
"verified_by": "curl 2026-06-03"
},
{
"claim": "The live JSON endpoint returns {\"exchangeRates\":[{...}]} with fields key, currentExchangeRate, currentChange, unit, lastUpdate.",
"source_url": "https://www.boi.org.il/PublicApi/GetExchangeRates",
"raw_snippet": "{\"exchangeRates\":[{\"key\":\"USD\",\"currentExchangeRate\":2.872,\"currentChange\":1.6637168141592920353982300900,\"unit\":1,\"lastUpdate\":\"2026-06-03T12:22:02.9555812Z\"}, ...]}",
"verified_by": "curl 2026-06-03"
},
{
"claim": "currentChange is a percentage daily move (e.g., ~1.66 for USD), not an absolute NIS delta.",
"source_url": "https://www.boi.org.il/PublicApi/GetExchangeRates",
"raw_snippet": "{\"key\":\"USD\",\"currentExchangeRate\":2.872,\"currentChange\":1.6637168141592920353982300900,\"unit\":1} -- a 1.66 absolute NIS move on a 2.872 rate is impossible; the value is a percent.",
"verified_by": "curl 2026-06-03"
},
{
"claim": "The Bank of Israel publishes a representative rate for exactly 14 currencies: USD, GBP, JPY, EUR, AUD, CAD, DKK, NOK, ZAR, SEK, CHF, JOD, LBP, EGP.",
"source_url": "https://www.boi.org.il/PublicApi/GetExchangeRates",
"raw_snippet": "keys returned by the live endpoint: USD, GBP, JPY, EUR, AUD, CAD, DKK, NOK, ZAR, SEK, CHF, JOD, LBP, EGP (14 objects total).",
"verified_by": "curl 2026-06-03"
},
{
"claim": "Units vary by currency: JPY unit=100, LBP unit=10, most others unit=1.",
"source_url": "https://www.boi.org.il/PublicApi/GetExchangeRates",
"raw_snippet": "{\"key\":\"JPY\",\"currentExchangeRate\":1.7968,\"unit\":100,...}, {\"key\":\"LBP\",\"currentExchangeRate\":0.0003,\"unit\":10,...}",
"verified_by": "curl 2026-06-03"
},
{
"claim": "The JSON endpoint's ?date= parameter is ignored: passing an old date still returns today's rate (lastUpdate unchanged).",
"source_url": "https://www.boi.org.il/PublicApi/GetExchangeRates?date=2025-06-03",
"raw_snippet": "GetExchangeRates?date=2026-01-01 and GetExchangeRates?date=2025-06-03 both return USD 2.872 with lastUpdate 2026-06-03T12:22:02Z (identical to the no-date response).",
"verified_by": "curl 2026-06-03"
},
{
"claim": "Historical rates are available from the BOI SDMX EXR series at edge.boi.gov.il using RER_<CUR>_ILS with startPeriod/endPeriod and format=csv; parse OBS_VALUE keyed by TIME_PERIOD.",
"source_url": "https://edge.boi.gov.il/FusionEdgeServer/sdmx/v2/data/dataflow/BOI.STATISTICS/EXR/1.0/RER_USD_ILS?startPeriod=2026-01-01&endPeriod=2026-01-15&format=csv",
"raw_snippet": "Endpoint forms: https://edge.boi.gov.il/FusionEdgeServer/sdmx/v2/data/dataflow/ is the base path; pattern https://edge.boi.gov.il/FusionEdgeServer/sdmx/v2/data/dataflow/BOI.STATISTICS/EXR/1.0/RER_<CUR>_ILS ; concrete https://edge.boi.gov.il/FusionEdgeServer/sdmx/v2/data/dataflow/BOI.STATISTICS/EXR/1.0/RER_USD_ILS . CSV header: SERIES_CODE,FREQ,...,TIME_PERIOD,OBS_VALUE,RELEASE_STATUS then RER_USD_ILS,D,USD,ILS,...,2026-01-02,3.181,YP ... 2026-01-15,3.156,YP",
"verified_by": "curl 2026-06-03"
},
{
"claim": "The SDMX series omits non-publication days, so a walk-back to the most recent published date <= requested date is needed; e.g., requesting 2026-01-01 yields the 2025-12-31 rate of 3.19.",
"source_url": "https://edge.boi.gov.il/FusionEdgeServer/sdmx/v2/data/dataflow/BOI.STATISTICS/EXR/1.0/RER_USD_ILS?startPeriod=2025-12-11&endPeriod=2026-01-01&format=csv",
"raw_snippet": "RER_USD_ILS,...,2025-12-31,3.19,YP (no row exists for 2026-01-01, which is a holiday/non-publication day; first 2026 observation is 2026-01-02)",
"verified_by": "curl 2026-06-03"
},
{
"claim": "Publication pattern: Sunday excluded, Mon-Fri published; weekend gap visible (no rows on Saturday or Sunday).",
"source_url": "https://edge.boi.gov.il/FusionEdgeServer/sdmx/v2/data/dataflow/BOI.STATISTICS/EXR/1.0/RER_EUR_ILS?startPeriod=2026-05-25&endPeriod=2026-06-01&format=csv",
"raw_snippet": "2026-05-26,3.3263 / 2026-05-27,3.3056 / 2026-05-28,3.2894 / 2026-05-29,3.2715 / (gap 05-30 Sat, 05-31 Sun) / 2026-06-01,3.2769",
"verified_by": "curl 2026-06-03"
},
{
"claim": "The representative rate is published soon after 15:15 on regular days and soon after 12:15 on Fridays, holiday eves and some Jewish holidays; there are no representative rates on Saturdays, Sundays and Israeli holidays.",
"source_url": "https://www.boi.org.il/en/economic-roles/financial-markets/explanatory-notes-to-the-representative-exchange-rates/",
"raw_snippet": "The representative exchange rate is currently published soon after 15:15 ... or soon after 12:15 on Fridays, holiday eves and some other Jewish holidays. ... There are no representative rates on Saturdays, Sundays, Israeli holidays ...",
"verified_by": "WebFetch 2026-06-03"
},
{
"claim": "The Bank of Israel sets a single representative (average) rate, not separate buy/sell rates.",
"source_url": "https://www.boi.org.il/en/economic-roles/financial-markets/explanatory-notes-to-the-representative-exchange-rates/",
"raw_snippet": "The average rate in NIS is calculated on the basis of a sampling of exchange rates published by the banks on the Reuters screens (one unified representative rate, not separate buying/selling rates).",
"verified_by": "WebFetch 2026-06-03"
},
{
"claim": "For imports priced in foreign currency, the customs value is converted at the Bank of Israel representative rate plus 0.5%; the customs rate is administered by the Israel Tax Authority on the import declaration (rashimon).",
"source_url": "https://www.gov.il/he/service/exchange-rate",
"raw_snippet": "%D7%91%D7%99%D7%91%D7%95%D7%90 %D7%9E%D7%95%D7%A6%D7%A8%D7%99%D7%9D %D7%9C%D7%99%D7%A9%D7%A8%D7%90%D7%9C ... %D7%94%D7%A9%D7%A2%D7%A8 %D7%94%D7%99%D7%A6%D7%99%D7%92 %D7%A9%D7%9C %D7%91%D7%A0%D7%A7 %D7%99%D7%A9%D7%A8%D7%90%D7%9C %D7%91%D7%AA%D7%95%D7%A1%D7%A4%D7%AA %D7%A9%D7%9C 0.5%. (BOI representative rate + 0.5% for customs valuation)",
"verified_by": "WebSearch 2026-06-03"
},
{
"claim": "For Israeli income tax, foreign-currency amounts are converted at the representative exchange rate on the relevant date (income accrual/receipt or payment date), per the Income Tax Rules (Conversion to New Shekels of amounts originating outside Israel), 5764-2003.",
"source_url": "https://www.nevo.co.il/law_html/law01/999_233.htm",
"raw_snippet": "%D7%9B%D7%9C%D7%9C%D7%99 %D7%9E%D7%A1 %D7%94%D7%9B%D7%A0%D7%A1%D7%94 (%D7%94%D7%9E%D7%A8%D7%94 %D7%9C%D7%A9%D7%A7%D7%9C%D7%99%D7%9D %D7%97%D7%93%D7%A9%D7%99%D7%9D %D7%A9%D7%9C %D7%A1%D7%9B%D7%95%D7%9E%D7%99%D7%9D %D7%A9%D7%9E%D7%A7%D7%95%D7%A8%D7%9D %D7%9E%D7%97%D7%95%D7%A5 %D7%9C%D7%99%D7%A9%D7%A8%D7%90%D7%9C), %D7%AA%D7%A9%D7%A1%22%D7%93-2003 -- conversion at the representative rate on the relevant date.",
"verified_by": "WebSearch 2026-06-03"
},
{
"claim": "Illustrative mid-2026 rates (snapshot, move daily): USD ~2.872, EUR ~3.3365, GBP ~3.8629, JPY ~1.7968 (per 100), CHF ~3.6409.",
"source_url": "https://www.boi.org.il/PublicApi/GetExchangeRates",
"raw_snippet": "{\"key\":\"USD\",\"currentExchangeRate\":2.872}, {\"key\":\"EUR\",\"currentExchangeRate\":3.3365}, {\"key\":\"GBP\",\"currentExchangeRate\":3.8629}, {\"key\":\"JPY\",\"currentExchangeRate\":1.7968,\"unit\":100}, {\"key\":\"CHF\",\"currentExchangeRate\":3.6409}. Rounded illustrative figures used in the skill body: 1 USD is about 2.87 NIS (2.87 ש\"ח); 100 JPY is about 1.80 NIS (1.80 ש\"ח).",
"verified_by": "curl 2026-06-03"
},
{
"claim": "NIS amounts are formatted with comma thousands separator and period decimal, e.g. 1,234.56 NIS.",
"source_url": "https://www.boi.org.il/en/economic-roles/financial-markets/exchange-rates/",
"raw_snippet": "Israeli NIS display convention: thousands separator comma, decimal period, e.g. 1,234.56 NIS (not the European 1.234,56). BOI exchange-rates page: https://www.boi.org.il/en/economic-roles/financial-markets/exchange-rates/",
"verified_by": "WebSearch 2026-06-03"
}
]
}
{
"author": "skills-il",
"version": "2.0.0",
"category": "tax-and-finance",
"tags": {
"he": [
"מטבע",
"שקל",
"ש״ח",
"שער-חליפין",
"בנק-ישראל"
],
"en": [
"currency",
"shekel",
"nis",
"exchange-rate",
"bank-of-israel"
]
},
"display_name": {
"he": "ממיר מטבע שקל",
"en": "Shekel Currency Converter"
},
"display_description": {
"he": "המרת מטבעות מול השער היציג של בנק ישראל, כולל שער לתאריך מס. תומך ב-14 המטבעות הרשמיים שבנק ישראל מפרסם, עם שער נוכחי ושער היסטורי לכל תאריך עסקה.",
"en": "Convert currencies to/from Israeli New Shekel (NIS/ILS) using Bank of Israel official representative rates (shaar yatzig). Use when user asks to convert shekels, NIS, ILS, asks about exchange rates, \"shaar yatzig\" (representative rate), or needs currency conversion for Israeli tax or business purposes. Covers the official Bank of Israel published currencies (14 currencies) with current and historical (tax-date) rates. Do NOT use for cryptocurrency or unofficial money exchange rates."
},
"supported_agents": [
"claude-code",
"cursor",
"github-copilot",
"windsurf",
"opencode",
"gemini-cli"
]
}
{
"skill": "shekel-currency-converter",
"cycles": [
{
"date": "2026-06-03",
"from_version": "1.2.1",
"to_version": "2.0.0",
"type": "major",
"summary": "Data-source migration. The XML feed (currency.xml) is dead and the XML parsing the skill taught was fabricated. Migrated current rates to the live JSON endpoint (PublicApi/GetExchangeRates) and historical/tax-date rates to the BOI SDMX EXR series (the JSON ?date= param is ignored). Corrected the currency count (14, not 30+), the publish schedule (Mon-Thu soon after 15:15 / Fri soon after 12:15, no Sat/Sun/holidays, not Sunday-Thursday), documented currentChange as a percent, added the import-VAT customs-rate caveat and the tax-date rule, added a Reference Links table, refreshed stale example rates to labeled illustrative values, and rewrote fetch_rates.py to actually fetch JSON + SDMX with publication-day walk-back. Created evidence.json (cited claims) and this log. Routing description updated (eval gate applies).",
"changes": [
"SKILL.md + SKILL_HE.md: Step 2 rewritten (JSON + SDMX), new tax-date section, Reference Links table, corrected gotchas/troubleshooting, illustrative example rates.",
"metadata.json: version 1.2.1 -> 2.0.0; display_description (both langs) rewritten.",
"references/boi-api-guide.md: XML block replaced with JSON shape + SDMX + customs caveat + 14-currency list.",
"references/currency-codes.md: 14-currency list, illustrative labeled rates, import-VAT customs caveat.",
"scripts/fetch_rates.py: JSON fetch + SDMX historical with walk-back; sample rates refreshed; --date now functional.",
"evidence.json + optimization-log.json created."
],
"deferrals": [
"Did not add a Tax Authority customs-rate live-lookup helper to fetch_rates.py (the gov.il exchange-rate query system has no documented public JSON API; the skill instead points users to the weekly customs rate in prose). Defer until a stable customs-rate endpoint is confirmed.",
"Did not enumerate per-currency typical-range tables for all 14 currencies in currency-codes.md (kept the 6 primary ones); low value, daily-moving figures."
]
},
{
"date": "2026-06-04",
"from_version": "2.0.0",
"to_version": "2.0.0",
"type": "patch-in-place",
"summary": "Post-judge safety + correctness refinements; no factual/evidence claim changed (judge PASS / eval ACCEPT still hold). MAJOR tax-safety fix: fetch_rates.py no longer silently substitutes hardcoded _sample_rates() on a fetch failure and stamps it as the official shaar yatzig. It now raises RateFetchError and FAILS LOUD (stderr + non-zero exit, no tax-stamped output). Sample data is reachable only via an explicit --demo/--offline flag and is clearly labeled 'ILLUSTRATIVE SAMPLE DATA, NOT the official rate, do not use for tax'. Minors: publication time corrected to soon-after-15:15 / soon-after-12:15 (matches BOI explanatory notes; evidence row already stated this) in SKILL.md, SKILL_HE.md, references; fixed the stale 14-day comment in fetch_historical_rate (code is 21 days); unit basis now read from the SDMX UNIT_MULT column (unit = 10**UNIT_MULT) instead of a hardcoded JPY/LBP map (verified live: USD UNIT_MULT=0 -> 1, JPY=2 -> 100, LBP=1 -> 10); a --date fetch failure now reports a fetch error and the 'unsupported currency' message only fires for an actually-unsupported currency (checked up front against the 14-currency set).",
"changes": [
"scripts/fetch_rates.py: RateFetchError fail-loud on current + historical fetch failure; --demo/--offline flag gates labeled sample output; UNIT_MULT-derived unit; 21-day comment fix; main() distinguishes unsupported-currency (exit 2) from no-data-for-date and fetch-failure.",
"SKILL.md + SKILL_HE.md: publication time 15:15/12:15; one-line note that the helper fails loud and never substitutes sample rates.",
"references/boi-api-guide.md: publication time 15:15/12:15."
],
"deferrals": []
}
]
}
Bank of Israel Exchange Rate API Guide
Current Rates (live JSON endpoint)
- URL:
https://www.boi.org.il/PublicApi/GetExchangeRates - Method: GET (no authentication required)
- Format: JSON
- Update time: Monday to Thursday soon after 15:15 Israel time; Friday and holiday eves soon after 12:15. No rate on Saturday, Sunday, or Israeli holidays.
The legacy XML feed at https://www.boi.org.il/currency.xml no longer serves XML. It now redirects to the JSON endpoint above, so do NOT try to parse XML.
JSON Response Structure
{
"exchangeRates": [
{
"key": "USD",
"currentExchangeRate": 2.872,
"currentChange": 1.66,
"unit": 1,
"lastUpdate": "2026-06-03T12:22:02Z"
}
]
}Fields:
key- currency code (e.g., USD, EUR, JPY).currentExchangeRate- NIS perunitof the foreign currency.unit- number of foreign-currency units the rate is quoted per (1 for most, 100 for JPY, 10 for LBP).currentChange- percentage move versus the previous publication (a percent, NOT an absolute NIS delta). Not used in conversion math.lastUpdate- ISO timestamp of when the rates were set.
Historical Rates (SDMX EXR series)
The JSON endpoint's ?date= parameter is ignored: it always returns the latest rate regardless of the date supplied. For a specific historical date (the rate that matters for tax), use the Bank of Israel SDMX EXR series.
- URL pattern:
https://edge.boi.gov.il/FusionEdgeServer/sdmx/v2/data/dataflow/BOI.STATISTICS/EXR/1.0/RER_<CUR>_ILS - Parameters:
startPeriod(YYYY-MM-DD)endPeriod(YYYY-MM-DD)format=csv- Example:
.../RER_USD_ILS?startPeriod=2026-01-01&endPeriod=2026-01-15&format=csv
Parse the CSV: read OBS_VALUE (the rate) keyed by TIME_PERIOD (the date). The series omits non-publication days. If the exact requested date has no row, walk back to the most recent published date on or before it.
Understanding Rates
- Rate = NIS per UNIT of foreign currency.
- UNIT varies by currency (usually 1, but 100 for JPY, 10 for LBP).
- Bank of Israel sets a single representative rate (shaar yatzig) per currency per day. There are no separate buy/sell rates.
- The representative rate is the official rate for:
- Income tax calculations (transaction-date rate)
- Legal/contractual obligations
- Financial reporting
Import VAT and the customs rate (caveat)
For import VAT and customs duty, the value of goods priced in foreign currency is NOT converted at the bare BOI representative rate. The Israel Tax Authority sets a weekly customs rate (shaar hamekhes) used on the import declaration (rashimon); it is based on the BOI representative rate plus 0.5%. Use the customs rate for import VAT, not the plain representative rate.
Published Currencies (14 total)
USD, GBP, JPY, EUR, AUD, CAD, DKK, NOK, ZAR, SEK, CHF, JOD, LBP, EGP.
This is the full set the Bank of Israel publishes a representative rate for. The skill is not a general FX converter for every world currency.
Rate Limitations
- Saturday, Sunday: no rate published.
- Israeli holidays: no rate published.
- Bank of Israel may delay publication due to market conditions.
- For missing dates, use the most recent published date on or before the requested date.
Currency Codes and NIS Conversion Notes
Published Currencies (14 total)
The Bank of Israel publishes a representative rate for exactly these 14 currencies: USD, GBP, JPY, EUR, AUD, CAD, DKK, NOK, ZAR, SEK, CHF, JOD, LBP, EGP.
Primary Currencies
| Code | Currency | Hebrew | Illustrative Rate (NIS) | Unit |
|---|---|---|---|---|
| ILS | Israeli New Shekel | shekel chadash | 1.0000 | 1 |
| USD | US Dollar | dolar | about 2.87 | 1 |
| EUR | Euro | euro | about 3.34 | 1 |
| GBP | British Pound | lira sterling | about 3.86 | 1 |
| JPY | Japanese Yen | yen | about 1.80 | 100 |
| CHF | Swiss Franc | frank shveitzi | about 3.64 | 1 |
NOTE: These figures are illustrative snapshots (mid-2026) and move daily. Always fetch the live or dated rate from the API; never quote these as the actual rate.
Tax-Relevant Uses
- Foreign income: Report at the representative rate on the income accrual / receipt date.
- Foreign expenses: Deduct at the representative rate on the payment date.
- End-of-year revaluation: Use the December 31 representative rate for balance sheet items.
- VAT and customs on imports: Do NOT use the bare BOI representative rate. Customs value uses the weekly customs rate (shaar hamekhes), set by the Israel Tax Authority on the import declaration (rashimon), based on the BOI representative rate plus 0.5%.
NIS Symbol and Formatting
- Currency code: ILS (ISO 4217)
- Symbol: shekel sign (Unicode U+20AA)
- Common display: NIS or ILS
- Format: 1,234.56 NIS (thousands separator: comma, decimal: period)
- Hebrew format: 1,234.56 (symbol before number)
Domain Checklist: Shekel Currency Converter
Scope: converting foreign-currency amounts to/from NIS at the Bank of Israel representative rate (sha'ar yatzig) for Israeli tax, VAT, and accounting use. Used to review the skill for correctness and completeness.
Must cover (a wrong answer here causes a wrong tax filing)
1. Correct live current-rate source. Use the live BOI JSON endpoint https://www.boi.org.il/PublicApi/GetExchangeRates. The legacy currency.xml no longer serves XML (it redirects to the JSON API). Source: live curl 2026-06-03 (HTTP 200, JSON body); evidence.json claim 1-2. 2. Correct historical / tax-date rate source. The JSON endpoint's ?date= is ignored (always returns today). A specific past date must come from the BOI SDMX EXR series RER_<CUR>_ILS (CSV, OBS_VALUE keyed by TIME_PERIOD). Source: live curl 2026-06-03; evidence.json claim 6-7. 3. Weekend/holiday walk-back. The SDMX series omits Saturdays, Sundays, and Israeli holidays. For a non-publication date, use the most recent published rate on or before it, and tell the user which date was used. Verified: 2026-01-01 (holiday) -> 2025-12-31 rate 3.19. Source: live curl; evidence.json claim 8. 4. Correct unit basis. Rate is NIS per unit foreign-currency units; unit is 1 for most, 100 for JPY, 10 for LBP, both in the JSON feed and in the SDMX series (UNIT_MULT exponent: USD=0, JPY=2, LBP=1). Conversion math must divide/multiply by unit. Source: live curl (JPY SDMX OBS_VALUE 1.7968 = per 100, matches JSON); evidence.json claim 5. 5. Tax-date rule. Israeli law converts foreign-currency amounts at the representative rate on the relevant date: income at accrual/receipt date, expenses at payment date, balance-sheet items at the Dec 31 rate. Income Tax Rules (Conversion to NIS of amounts originating outside Israel), 5764-2003. Source: nevo.co.il 999_233; evidence.json claim 13. 6. Import VAT uses the customs rate, NOT the bare representative rate. For goods priced in foreign currency, customs value is converted at the weekly customs rate (sha'ar ha-mekhes) set by the Israel Tax Authority on the rashimon = BOI representative rate + 0.5%. Do not quote the plain representative rate as the import-VAT rate. Source: gov.il/he/service/ exchange-rate; evidence.json claim 12. 7. Single representative rate per currency per day (no buy/sell split), published soon after 15:15 on regular days and soon after 12:15 on Fridays / holiday eves; none on Sat/Sun/Israeli holidays. Source: BOI explanatory notes; evidence.json claim 10-11.
Should cover
- Supported-currency set is exactly 14 (USD, GBP, JPY, EUR, AUD, CAD, DKK,
NOK, ZAR, SEK, CHF, JOD, LBP, EGP); not a general FX converter. Source: live JSON (14 keys); evidence.json claim 4.
- Stale-rate awareness: a rate fetched before the afternoon publication is
the previous day's; flag it as not-yet-updated. Source: BOI explanatory notes.
- NIS formatting: symbol before the number, comma thousands / period
decimal (1,234.56), not the European 1.234,56. evidence.json claim 15.
- Cross-currency via NIS for two foreign currencies (both must be published).
- Fail-loud on fetch failure so a stale/sample rate is never presented as an
authoritative "shaar yatzig" figure for a tax computation.
Out of scope
- Cryptocurrency and unofficial/grey-market exchange rates.
- Currencies BOI does not publish (outside the 14).
- Bank buy/sell spreads and card-network conversion fees (skill quotes the
representative reference rate only).
- Live machine-lookup of the weekly customs rate: the Tax Authority customs
query system (shaarolami-query.customs.mof.gov.il) is a session-based web app with no clean public JSON API, so the skill points to it in prose rather than computing the import-VAT rate. Reasonable deferral.
Authoritative sources
- BOI live JSON rates: https://www.boi.org.il/PublicApi/GetExchangeRates
- BOI SDMX EXR series: https://edge.boi.gov.il/FusionEdgeServer/sdmx/v2/data/dataflow/BOI.STATISTICS/EXR/1.0/RER_USD_ILS
- BOI representative-rate explanatory notes (schedule, single-rate): https://www.boi.org.il/en/economic-roles/financial-markets/explanatory-notes-to-the-representative-exchange-rates/
- Israel Tax Authority customs/exchange rate (+0.5%): https://www.gov.il/he/service/exchange-rate
- Income Tax Rules (Conversion to NIS), 5764-2003: https://www.nevo.co.il/law_html/law01/999_233.htm
The Tax Authority customs-rate query system (host shaarolami-query.customs.mof.gov.il) is a session-based web app with no clean public JSON API, so it is referenced in prose rather than linked or machine-queried.
#!/usr/bin/env python3
"""Fetch and convert currencies using Bank of Israel exchange rates.
Current rates come from the live Bank of Israel JSON endpoint. Historical
(tax-date) rates come from the Bank of Israel SDMX EXR series, because the
JSON endpoint's ?date= parameter is ignored and always returns today's rate.
Usage:
python scripts/fetch_rates.py --list
python scripts/fetch_rates.py --from USD --to ILS --amount 1000
python scripts/fetch_rates.py --from ILS --to EUR --amount 5000
python scripts/fetch_rates.py --from USD --to ILS --amount 100 --date 2026-01-15
"""
import sys
import argparse
import json
import csv
import io
from urllib.request import urlopen
from urllib.error import URLError
from datetime import date
from typing import Optional
# Live JSON endpoint for current representative rates.
BOI_CURRENT_URL = "https://www.boi.org.il/PublicApi/GetExchangeRates"
# SDMX EXR series for historical rates: insert the currency code and date range.
BOI_SDMX_URL = (
"https://edge.boi.gov.il/FusionEdgeServer/sdmx/v2/data/dataflow/"
"BOI.STATISTICS/EXR/1.0/RER_{cur}_ILS"
"?startPeriod={start}&endPeriod={end}&format=csv"
)
# The 14 currencies the Bank of Israel publishes a representative rate for,
# with their Hebrew transliterations.
COMMON_CURRENCIES = {
"USD": ("US Dollar", "dolar"),
"GBP": ("British Pound", "lira sterling"),
"JPY": ("Japanese Yen", "yen"),
"EUR": ("Euro", "euro"),
"AUD": ("Australian Dollar", "dolar australi"),
"CAD": ("Canadian Dollar", "dolar kanadi"),
"DKK": ("Danish Krone", "krone dani"),
"NOK": ("Norwegian Krone", "krone norvegi"),
"ZAR": ("South African Rand", "rand"),
"SEK": ("Swedish Krona", "krona shvedit"),
"CHF": ("Swiss Franc", "frank shveitzi"),
"JOD": ("Jordanian Dinar", "dinar yardeni"),
"LBP": ("Lebanese Pound", "lira levanonit"),
"EGP": ("Egyptian Pound", "lira mitzrit"),
}
class RateFetchError(Exception):
"""Raised when a real rate cannot be fetched. The caller must FAIL LOUD and
must never substitute sample data for a tax-stamped conversion."""
def fetch_current_rates() -> dict:
"""Fetch current representative rates from the Bank of Israel JSON endpoint.
Returns:
Dictionary mapping currency code to (rate, unit, change_pct) tuples.
change_pct is the percentage daily move, not an absolute NIS delta.
Raises:
RateFetchError: if the endpoint cannot be reached or returns no usable
rates. The caller must abort, NOT fall back to sample data.
"""
try:
with urlopen(BOI_CURRENT_URL, timeout=15) as response:
data = json.loads(response.read().decode("utf-8"))
except (URLError, ValueError) as e:
raise RateFetchError(
f"Could not fetch live rates from Bank of Israel: {e}"
) from e
rates = {}
for entry in data.get("exchangeRates", []):
code = entry.get("key")
rate = entry.get("currentExchangeRate")
unit = entry.get("unit", 1)
change = entry.get("currentChange", 0.0)
if code and rate:
rates[code] = (float(rate), int(unit), float(change))
if not rates:
raise RateFetchError(
"Bank of Israel endpoint returned no usable rates."
)
return rates
def fetch_historical_rate(currency: str, target_date: str) -> Optional[tuple]:
"""Fetch a historical representative rate from the SDMX EXR series.
The series omits non-publication days (Saturday, Sunday, holidays), so this
walks back to the most recent published date on or before target_date.
Args:
currency: Currency code (e.g., USD). ILS is not fetched (it is the base).
target_date: Requested date in YYYY-MM-DD format.
Returns:
Tuple of (rate, unit, used_date), or None if the series has no published
observation on or before target_date. The unit is derived from the
SDMX UNIT_MULT column (unit = 10 ** UNIT_MULT) so the script
self-corrects if BOI re-bases a series.
Raises:
RateFetchError: if the SDMX endpoint cannot be reached. The caller must
abort, NOT fall back to sample data.
"""
currency = currency.upper()
if currency == "ILS":
return (1.0, 1, target_date)
# Look back up to 21 days to cross weekends + multi-day holiday clusters.
from datetime import datetime, timedelta
end = datetime.strptime(target_date, "%Y-%m-%d").date()
start = end - timedelta(days=21)
url = BOI_SDMX_URL.format(
cur=currency, start=start.isoformat(), end=end.isoformat()
)
try:
with urlopen(url, timeout=20) as response:
text = response.read().decode("utf-8")
except URLError as e:
raise RateFetchError(
f"Could not fetch historical rate for {currency} from BOI SDMX: {e}"
) from e
reader = csv.DictReader(io.StringIO(text))
rows = [r for r in reader if r.get("OBS_VALUE")]
if not rows:
return None
# Keep only rows on or before the requested date, pick the latest.
eligible = [r for r in rows if r["TIME_PERIOD"] <= target_date]
if not eligible:
return None
chosen = max(eligible, key=lambda r: r["TIME_PERIOD"])
# Unit basis from the SDMX UNIT_MULT exponent (USD=0 -> 1, JPY=2 -> 100,
# LBP=1 -> 10). Falls back to 1 if the column is missing/unparseable.
try:
unit = 10 ** int(chosen.get("UNIT_MULT", "0"))
except (TypeError, ValueError):
unit = 1
return (float(chosen["OBS_VALUE"]), unit, chosen["TIME_PERIOD"])
def _sample_rates() -> dict:
"""ILLUSTRATIVE sample rates for offline demo ONLY (mid-2026 snapshot).
These are NOT live and NOT the official representative rate. They are only
reachable via the explicit --demo flag, and any output built from them is
labeled as illustrative sample data that must not be used for tax.
"""
return {
"USD": (2.872, 1, 1.66),
"EUR": (3.3365, 1, 1.41),
"GBP": (3.8629, 1, 1.52),
"JPY": (1.7968, 100, 1.59),
"CHF": (3.6409, 1, 1.22),
"CAD": (2.0732, 1, 1.66),
"AUD": (2.0584, 1, 1.45),
}
def convert(
amount: float,
from_currency: str,
to_currency: str,
rates: dict,
) -> Optional[tuple[float, float, str]]:
"""Convert between currencies using Bank of Israel rates.
Args:
amount: Amount to convert.
from_currency: Source currency code.
to_currency: Target currency code.
rates: Exchange rates dictionary mapping code to (rate, unit, change).
Returns:
Tuple of (result, rate_used, description) or None if conversion impossible.
"""
from_currency = from_currency.upper()
to_currency = to_currency.upper()
if from_currency == to_currency:
return (amount, 1.0, "Same currency")
if from_currency == "ILS" and to_currency in rates:
rate, unit, _ = rates[to_currency]
result = amount / rate * unit
return (result, rate / unit, f"1 {to_currency} = {rate/unit:.4f} ILS")
if to_currency == "ILS" and from_currency in rates:
rate, unit, _ = rates[from_currency]
result = amount * rate / unit
return (result, rate / unit, f"1 {from_currency} = {rate/unit:.4f} ILS")
# Cross-currency via ILS
if from_currency in rates and to_currency in rates:
from_rate, from_unit, _ = rates[from_currency]
to_rate, to_unit, _ = rates[to_currency]
nis_amount = amount * from_rate / from_unit
result = nis_amount / to_rate * to_unit
cross_rate = (from_rate / from_unit) / (to_rate / to_unit)
return (result, cross_rate, f"1 {from_currency} = {cross_rate:.4f} {to_currency} (via ILS)")
return None
def build_dated_rates(
from_currency: str, to_currency: str, target_date: str
) -> tuple[dict, str]:
"""Build a rates dict for a specific historical date using SDMX.
Returns the rates dict plus the actual publication date used (which may be
earlier than target_date if the requested day had no publication).
"""
rates = {"ILS": (1.0, 1, 0.0)}
used_date = target_date
for cur in {from_currency.upper(), to_currency.upper()}:
if cur == "ILS":
continue
hist = fetch_historical_rate(cur, target_date)
if hist is None:
continue
rate, unit, when = hist
rates[cur] = (rate, unit, 0.0)
used_date = when # last writer wins; both should resolve to same day
return rates, used_date
def format_result(
amount: float,
from_currency: str,
to_currency: str,
result: float,
description: str,
rate_date: Optional[str] = None,
is_sample: bool = False,
) -> str:
"""Format conversion result for display."""
date_str = rate_date or date.today().isoformat()
if is_sample:
lines = [
"=== Currency Conversion (DEMO) ===",
"",
f" {amount:,.2f} {from_currency.upper()} = {result:,.2f} {to_currency.upper()}",
"",
f" Rate: {description}",
" Source: ILLUSTRATIVE SAMPLE DATA, NOT the official rate.",
"",
" WARNING: Sample data only. Do NOT use for tax, VAT, or any filing.",
]
return "\n".join(lines)
lines = [
"=== Currency Conversion ===",
"",
f" {amount:,.2f} {from_currency.upper()} = {result:,.2f} {to_currency.upper()}",
"",
f" Rate: {description}",
f" Date: {date_str}",
" Source: Bank of Israel representative rate (shaar yatzig)",
"",
" NOTE: Representative rate for reference. Actual bank rates may differ.",
" NOTE: For import VAT, use the weekly customs rate, not this rate.",
]
return "\n".join(lines)
def main():
"""Main entry point."""
parser = argparse.ArgumentParser(
description="Convert currencies using Bank of Israel rates"
)
parser.add_argument("--from", dest="from_curr", help="Source currency (e.g., USD)")
parser.add_argument("--to", dest="to_curr", help="Target currency (e.g., ILS)")
parser.add_argument("--amount", type=float, help="Amount to convert")
parser.add_argument("--date", type=str, help="Historical date (YYYY-MM-DD)")
parser.add_argument("--list", action="store_true", help="List available currencies")
parser.add_argument(
"--demo", "--offline", dest="demo", action="store_true",
help="Use illustrative SAMPLE rates offline (NOT official, not for tax)",
)
args = parser.parse_args()
if args.list:
print("=== Bank of Israel Published Currencies (14) ===")
print(f" {'Code':<6} {'Currency':<25} {'Hebrew':<20}")
print(f" {'-' * 51}")
print(f" {'ILS':<6} {'Israeli New Shekel':<25} {'shekel chadash':<20}")
for code, (name, hebrew) in COMMON_CURRENCIES.items():
print(f" {code:<6} {name:<25} {hebrew:<20}")
return
if not all([args.from_curr, args.to_curr, args.amount]):
parser.print_help()
sys.exit(1)
supported = set(COMMON_CURRENCIES) | {"ILS"}
requested = {args.from_curr.upper(), args.to_curr.upper()}
unsupported = requested - supported
if unsupported:
print(
f"Error: Currency not published by the Bank of Israel: "
f"{', '.join(sorted(unsupported))}.",
file=sys.stderr,
)
print(
"Only these 14 currencies are supported: "
+ ", ".join(COMMON_CURRENCIES) + ".",
file=sys.stderr,
)
sys.exit(2)
is_sample = False
try:
if args.demo:
# Explicit offline mode: illustrative sample data only.
rates = _sample_rates()
rates["ILS"] = (1.0, 1, 0.0)
is_sample = True
used_date = None
elif args.date:
rates, used_date = build_dated_rates(
args.from_curr, args.to_curr, args.date
)
else:
rates = fetch_current_rates()
used_date = None
except RateFetchError as e:
# FAIL LOUD: never present sample data as an official tax rate.
print(f"Error: {e}", file=sys.stderr)
print(
"Aborting: no live rate available, and sample rates are never "
"substituted for a real conversion. Re-run later, or use --demo "
"for clearly-labeled illustrative output only.",
file=sys.stderr,
)
sys.exit(1)
result = convert(args.amount, args.from_curr, args.to_curr, rates)
if result is None:
# Both currencies are supported (checked above), so this means the
# SDMX series had no published observation on or before the date.
print(
f"Error: No published rate found on or before {args.date} for "
f"{args.from_curr.upper()}/{args.to_curr.upper()}.",
file=sys.stderr,
)
print(
"Try an earlier date; the series omits Saturdays, Sundays, and "
"Israeli holidays.",
file=sys.stderr,
)
sys.exit(1)
converted, _rate_used, description = result
print(format_result(
args.amount, args.from_curr, args.to_curr,
converted, description, used_date or args.date,
is_sample=is_sample,
))
if __name__ == "__main__":
main()
ממיר מטבע שקל
הוראות
שלב 1: זיהוי בקשת המרה
נתחו את בקשת המשתמש ואתרו:
- מטבע מקור ומטבע יעד (לפחות אחד מהם צריך להיות ש"ח/ILS)
- סכום להמרה
- תאריך (נוכחי או תאריך היסטורי ספציפי, חשוב להמרות לצורכי מס)
- מטרה (מידע כללי מול שער יציג רלוונטי למס)
קודי מטבע נפוצים:
| קוד | מטבע | עברית |
|---|---|---|
| ILS | שקל חדש | shekel chadash |
| USD | דולר אמריקאי | dolar |
| EUR | אירו | euro |
| GBP | לירה שטרלינג | lira sterling |
| JPY | ין יפני | yen |
| CHF | פרנק שוויצרי | frank shveitzi |
שלב 2: שליפת שער חליפין
שער נוכחי (נקודת קצה JSON חיה): פיד ה-XML הישן בכתובת currency.xml כבר לא קיים (הוא מפנה כעת ל-API של JSON), לכן אין לנתח XML. שלפו את נקודת הקצה של JSON וקראו את המערך exchangeRates.
Fetch: https://www.boi.org.il/PublicApi/GetExchangeRates
Parse JSON: response.exchangeRates is an array of objects.
Each object: key (currency code), currentExchangeRate (NIS per "unit"),
unit (1, 10, or 100), currentChange (percent move vs. previous
publication), lastUpdate (ISO timestamp).דוגמה לאובייקט: {"key":"USD","currentExchangeRate":2.872,"unit":1,"currentChange":1.66,"lastUpdate":"..."}. כאן השדה currentChange הוא שינוי יומי באחוזים, לא הפרש מוחלט בש"ח, והוא אינו משמש בחישוב ההמרה.
שער היסטורי / לתאריך מס (סדרת SDMX): הפרמטר ?date= בנקודת הקצה של JSON מתעלמים ממנו, הוא תמיד מחזיר את שער היום. עבור תאריך עבר ספציפי (השער שרלוונטי למס), השתמשו בסדרת SDMX EXR של בנק ישראל במקום זאת:
Fetch: https://edge.boi.gov.il/FusionEdgeServer/sdmx/v2/data/dataflow/BOI.STATISTICS/EXR/1.0/RER_<CUR>_ILS?startPeriod=YYYY-MM-DD&endPeriod=YYYY-MM-DD&format=csv
Replace <CUR> with the currency code (e.g., RER_USD_ILS, RER_EUR_ILS).
Parse CSV: read OBS_VALUE keyed by TIME_PERIOD.הסדרה מדלגת על ימים שאין בהם פרסום (שבת, ראשון, חגים). אם אין שורה לתאריך המבוקש בדיוק, חזרו אחורה לתאריך הפרסום האחרון שלפניו או בו, ועדכנו את המשתמש באיזה תאריך שער השתמשתם.
שלב 3: חישוב ההמרה
If converting FROM NIS:
result = amount / rate * unit
If converting TO NIS:
result = amount * rate / unit
If converting between two foreign currencies:
nis_amount = amount * rate_source / unit_source
result = nis_amount / rate_target * unit_targetהערה: שערי בנק ישראל מבטאים כמה שקלים ליחידה/יחידות של מטבע זר. דוגמה (להמחשה בלבד; שלפו את השער החי/לתאריך): שער USD בסביבות 2.87, יחידה = 1 פירושו ש-1 USD שווה בערך 2.87 ש"ח. דוגמה (להמחשה בלבד): שער JPY בסביבות 1.80, יחידה = 100 פירושו ש-100 JPY שווים בערך 1.80 ש"ח.
שלב 4: הצגת תוצאות
עצבו את התוצאה עם:
- סכום מומר (2 ספרות עשרוניות לש"ח, דיוק מתאים למטבעות אחרים)
- שער החליפין שנעשה בו שימוש ותאריכו
- מקור: "שער יציג של בנק ישראל (shaar yatzig)"
- הערה: "שער יציג לעיון בלבד. שערי הבנקים בפועל עשויים להיות שונים."
שער של איזה תאריך חל (מס)
- הכנסה במטבע חוץ: השער היציג ביום צבירת/קבלת ההכנסה.
- הוצאות במטבע חוץ: השער היציג ביום התשלום.
- תיאום מאזני סוף שנה: השער היציג של 31 בדצמבר לפריטים מאזניים.
- מע"מ ביבוא (הסתייגות): מע"מ ומכס ביבוא אינם מחושבים לפי השער היציג הרגיל של בנק ישראל. ערך הטובין למכס מחושב לפי שער המכס, אותו קובעת רשות המסים אחת לשבוע על רשימון היבוא, והוא מבוסס על השער היציג של בנק ישראל בתוספת 0.5%. אל תצטטו את השער היציג הרגיל כשער של מע"מ ביבוא.
דוגמאות
דוגמה 1: המרת דולר לשקל פשוטה
המשתמש אומר: "המר 1000 דולר לשקלים" תוצאה: "1,000 USD שווים X ש"ח (לפי השער היציג החי של בנק ישראל; שלפו את השער לתאריך לפני ציטוט מספר)."
דוגמה 2: שער היסטורי
המשתמש אומר: "מה היה שער הדולר ב-1 בינואר 2026?" תוצאה: שלפו את סדרת SDMX RER_USD_ILS. ה-1 בינואר 2026 הוא יום ללא פרסום, לכן דווחו את תאריך הפרסום האחרון שלפניו או בו (התצפית הראשונה ב-2026 היא 2 בינואר 2026) וציינו באיזה תאריך השתמשתם.
דוגמה 3: שער רלוונטי למס
המשתמש אומר: "אני צריך את שער האירו לדוח מע"מ לדצמבר 2025" תוצאה: מספק את השער היציג לתאריך העסקה הרלוונטי מתוך סדרת SDMX, עם ציון שזהו השער הרשמי לצרכי מס. עבור מע"מ ביבוא ספציפית, הפנו את המשתמש לשער המכס השבועי.
משאבים מצורפים
סקריפטים
scripts/fetch_rates.py- שולף שערי חליפין יציגים רשמיים של בנק ישראל ומבצע המרות מטבע מול ש"ח. משתמש בנקודת הקצה החיה של JSON לשערים נוכחיים ובסדרת SDMX EXR לחיפוש תאריכים היסטוריים (עם חזרה אחורה ליום פרסום). בכשל שליפה הוא נכשל בקול (מדפיס שגיאה, יוצא עם קוד שונה מאפס) ולעולם אינו מחליף שערים לדוגמה בהמרה אמיתית; פלט לדוגמה להמחשה זמין רק עם הדגל המפורש--demo. הרצה:python scripts/fetch_rates.py --help
חומרי עזר
references/boi-api-guide.md- תיעוד API של שערי חליפין של בנק ישראל: נקודת הקצה החיה של JSON ושדותיה, סדרת SDMX EXR ההיסטורית, לוח זמני עדכון, וההסתייגות של שער המכס למע"מ ביבוא. היעזרו בקובץ זה בעת פתרון בעיות בקריאות API או הבנת זמני פרסום שערים.references/currency-codes.md- קודי מטבע נתמכים עם שמות בעברית, טווחי שער אופייניים מול ש"ח, וערכי יחידה (חשוב ל-JPY ומטבעות מרובי יחידות אחרים). היעזרו בקובץ זה בעת פענוח בקשות מטבע של משתמשים או טיפול בהמרות מבוססות יחידות.
קישורי עזר
| משאב | כתובת |
|---|---|
| עמוד שערי החליפין של בנק ישראל | https://www.boi.org.il/en/economic-roles/financial-markets/exchange-rates/ |
| נקודת קצה חיה של שערים ב-JSON | https://www.boi.org.il/PublicApi/GetExchangeRates |
| סדרת SDMX EXR היסטורית של בנק ישראל | https://edge.boi.gov.il/FusionEdgeServer/sdmx/v2/data/dataflow/BOI.STATISTICS/EXR/1.0/RER_USD_ILS |
שרתי MCP מומלצים
לקבלת נתוני שער חליפין חיים, שלבו את הסקיל הזה עם:
| שרת MCP | מה הוא מספק | התקנה |
|---|---|---|
| boi-exchange | שערים יציגים יומיים רשמיים של בנק ישראל (shaar yatzig) למטבעות המתפרסמים, סדרות שער היסטוריות, חישובי שינוי שער, והמרת מטבע ישירה דרך BOI SDMX API. ללא צורך במפתח API. | התקינו את boi-exchange |
כאשר שרת ה-MCP בשם boi-exchange זמין, השתמשו בכליו להמרות בזמן אמת במקום בטבלאות העזר הסטטיות שלמעלה. ה-MCP מספק את השער היציג (shaar yatzig) שהוא השער המחייב חוקית לצרכי מס.
מלכודות נפוצות
- קוד המטבע הרשמי הוא ILS (לפי תקן ISO 4217), אבל ישראלים אומרים "שקל" או "שקלים". סוכנים עלולים לא לזהות "NIS" כקוד מטבע תקין או לבלבל עם ה"שקל ישן" (IS) שלפני 1985.
- בנק ישראל מפרסם שער יציג אחד למטבע ליום (ללא שערי קנייה/מכירה נפרדים), בימים שני עד חמישי זמן קצר לאחר 15:15 ובימי שישי (וערבי חג) זמן קצר לאחר 12:15. אין שער בשבת, בראשון או בחגים בישראל. סוכנים עלולים למשוך שער לפני שעת הפרסום ולקבל את שער הפרסום הקודם בלי לציין שהוא לא עדכני.
- רק המטבעות הרשמיים שבנק ישראל מפרסם להם שער יציג נתמכים (כיום 14: USD, GBP, JPY, EUR, AUD, CAD, DKK, NOK, ZAR, SEK, CHF, JOD, LBP, EGP). הסקיל אינו ממיר מט"ח כללי לכל מטבעות העולם.
- עיצוב סכומי ש"ח משתמש בסימן שקל לפני המספר, עם פסיק לאלפים ונקודה לעשרוניים (למשל 1,234.56). סוכנים עלולים להשתמש במוסכמה אירופית (1.234,56) או לשים את הסימן אחרי המספר.
- בהמרה למטרות מס, החוק הישראלי דורש שימוש בשער היציג של בנק ישראל לתאריך העסקה הספציפי, לא שער מט"ח בזמן אמת. עבור מע"מ ביבוא יש להשתמש בשער המכס השבועי, לא בשער היציג הרגיל. סוכנים עלולים להשתמש בשערים בזמן אמת שאינם תקפים חוקית לדיווח מס.
פתרון בעיות
שגיאה: "Rate not available for date"
סיבה: התאריך המבוקש הוא שבת, ראשון, חג בישראל, או תאריך עתידי. פתרון: השתמשו בתאריך הפרסום האחרון שלפני התאריך המבוקש או בו מתוך סדרת SDMX. בנק ישראל מפרסם שערים בימים שני עד חמישי (זמן קצר לאחר 15:15) ובימי שישי (זמן קצר לאחר 12:15), לא בשבת, בראשון או בחגים.
שגיאה: "Currency not supported"
סיבה: בנק ישראל אינו מפרסם שער יציג למטבע זה (רק 14 המטבעות המפורטים נתמכים). פתרון: הציעו שימוש בדולר או אירו כמטבע ביניים להמרה.
Related skills
FAQ
Which currency does it focus on?
Israeli New Shekel (ILS) conversions to and from other currencies.
When should I use it?
During Israeli finance, invoicing, or pricing tasks that need accurate shekel conversion.
Is Shekel Currency Converter safe to install?
skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.