{"openapi":"3.0.3","info":{"title":"Howmch API","version":"1.0.0","description":"Convert any listed world currency into any other. Rates are daily mid-market figures from the open Currency API (fawazahmed0/exchange-api). The convertible mark stays on its euro peg (1 EUR = 1.95583 BAM). The dirham stays on its dollar peg when the feed needs it. These are not card or bank rates. Public routes send Access-Control-Allow-Origin: *. Device, scan, and support routes use the howmch_device cookie."},"servers":[{"url":"https://howmch.app"}],"tags":[{"name":"Currencies","description":"The world currency catalog."},{"name":"Rates","description":"Kursne liste and the stored euro table."},{"name":"Convert","description":"Turn an amount in one currency into another."},{"name":"Device","description":"Home and trip currencies for this browser."},{"name":"Scans","description":"Camera reads kept for this browser."},{"name":"Support","description":"Messages sent from the support form."},{"name":"Letter","description":"Newsletter signup and a keyed send through Resend."}],"paths":{"/api/currencies":{"get":{"tags":["Currencies"],"summary":"List world currencies","description":"Active ISO currencies Howmch can convert. Pass q to search by code, name, country, or symbol.","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string"},"example":"mark"}],"responses":{"200":{"description":"Matching currencies.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CurrencyList"},"example":{"count":1,"currencies":[{"code":"BAM","name":"Convertible mark","country":"Bosnia and Herzegovina","symbol":"KM","decimals":2}]}}}},"400":{"description":"The request was rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Pick both from the list."}}}}}}},"/api/rates":{"get":{"tags":["Rates"],"summary":"Euro rate table","description":"Units of each currency per 1 euro. This is the table the site stores. For a list quoted in another currency, use /api/rates/board.","responses":{"200":{"description":"The stored table.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateTable"},"example":{"date":"2026-11-21","source":"currency-api","base":"EUR","count":156,"rates":{"EUR":1,"USD":1.0968,"BAM":1.95583}}}}},"400":{"description":"The request was rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Pick both from the list."}}}}}}},"/api/rates/board":{"get":{"tags":["Rates"],"summary":"Kursna lista","description":"One unit of base, priced in every other currency. rate is how many units of that currency you get for 1 base. inverse is how many base you get for 1 unit of that currency.","parameters":[{"name":"base","in":"query","required":false,"description":"Currency the list is quoted from. Defaults to EUR.","schema":{"type":"string","default":"EUR"},"example":"USD"}],"responses":{"200":{"description":"The board for that base.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateBoard"},"example":{"base":"USD","baseName":"US Dollar","date":"2026-11-21","source":"currency-api","count":155,"quotes":[{"code":"BAM","name":"Convertible mark","country":"Bosnia and Herzegovina","rate":1.783,"inverse":0.5608}]}}}},"400":{"description":"The request was rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Pick both from the list."}}}}}}},"/api/rates/refresh":{"post":{"tags":["Rates"],"summary":"Fetch a newer table","description":"Downloads today's euro rates from the open Currency API and stores them. Tries the jsDelivr mirror, then the pages.dev mirror.","responses":{"200":{"description":"The table that was saved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateTable"},"example":{"date":"2026-11-21","source":"currency-api","base":"EUR","count":156,"rates":{"EUR":1,"USD":1.0968}}}}},"400":{"description":"The request was rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Pick both from the list."}}}}}}},"/api/convert":{"get":{"tags":["Convert"],"summary":"Convert with a query string","parameters":[{"name":"amount","in":"query","required":true,"schema":{"type":"number","minimum":0},"example":89.99},{"name":"from","in":"query","required":true,"schema":{"type":"string"},"example":"USD"},{"name":"to","in":"query","required":true,"schema":{"type":"string"},"example":"BAM"}],"responses":{"200":{"description":"The converted amount.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Conversion"},"example":{"amount":89.99,"from":"USD","to":"BAM","converted":160.45,"formatted":"KM 160.45","sourceFormatted":"$89.99","rate":1.783,"inverse":0.5608,"rateDate":"2026-11-21","source":"currency-api"}}}},"400":{"description":"The request was rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Pick both from the list."}}}}}},"post":{"tags":["Convert"],"summary":"Convert with a JSON body","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversionRequest"},"example":{"amount":89.99,"from":"USD","to":"BAM"}}}},"responses":{"200":{"description":"The converted amount.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Conversion"},"example":{"amount":89.99,"from":"USD","to":"BAM","converted":160.45,"formatted":"KM 160.45","sourceFormatted":"$89.99","rate":1.783,"inverse":0.5608,"rateDate":"2026-11-21","source":"currency-api"}}}},"400":{"description":"The request was rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Pick both from the list."}}}}}}},"/api/settings":{"get":{"tags":["Device"],"summary":"Read this browser's pair","responses":{"200":{"description":"Home and trip currencies.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pair"},"example":{"home":"BAM","trip":"USD"}}}}}},"put":{"tags":["Device"],"summary":"Save this browser's pair","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pair"},"example":{"home":"BAM","trip":"EUR"}}}},"responses":{"200":{"description":"The pair that was saved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pair"},"example":{"home":"BAM","trip":"EUR"}}}},"400":{"description":"The request was rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Pick both from the list."}}}}}}},"/api/device":{"delete":{"tags":["Device"],"summary":"Forget this browser","description":"Deletes the device row, its scans, and clears the cookie.","responses":{"200":{"description":"The browser was forgotten.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"},"example":{"ok":true}}}}}}},"/api/scans":{"get":{"tags":["Scans"],"summary":"List camera reads","responses":{"200":{"description":"Newest first, up to 100.","content":{"application/json":{"schema":{"type":"object","properties":{"scans":{"type":"array","items":{"$ref":"#/components/schemas/Scan"}}}},"example":{"scans":[]}}}}}},"post":{"tags":["Scans"],"summary":"Keep a camera read","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversionRequest"},"example":{"amount":89.99,"from":"USD","to":"BAM"}}}},"responses":{"201":{"description":"The saved scan.","content":{"application/json":{"schema":{"type":"object","properties":{"scan":{"$ref":"#/components/schemas/Scan"}}}}}},"400":{"description":"The request was rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Pick both from the list."}}}}}},"delete":{"tags":["Scans"],"summary":"Clear camera history","responses":{"200":{"description":"The list was cleared.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"},"example":{"ok":true}}}}}}},"/api/scans/{id}":{"patch":{"tags":["Scans"],"summary":"Correct a saved amount","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["amount"],"properties":{"amount":{"type":"number"}}},"example":{"amount":90}}}},"responses":{"200":{"description":"The updated scan."},"400":{"description":"The request was rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Pick both from the list."}}}}}},"delete":{"tags":["Scans"],"summary":"Delete one scan","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"The scan was deleted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"},"example":{"ok":true}}}},"400":{"description":"The request was rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Pick both from the list."}}}}}}},"/api/newsletter":{"post":{"tags":["Letter"],"summary":"Join the letter","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"type":"string","format":"email"}}},"example":{"email":"mina@example.com"}}}},"responses":{"201":{"description":"The address is on the list.","content":{"application/json":{"example":{"ok":true,"email":"mina@example.com"}}}},"400":{"description":"The request was rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Pick both from the list."}}}}}}},"/api/newsletter/send":{"post":{"tags":["Letter"],"summary":"Send the letter","description":"Sends the text through Resend to every address still subscribed. Requires the send key.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Letter"},"example":{"subject":"The board moved","body":"Today's table is in.","key":"send-key"}}}},"responses":{"200":{"description":"How many addresses received it.","content":{"application/json":{"example":{"ok":true,"sent":12}}}},"400":{"description":"The request was rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Pick both from the list."}}}}}}},"/api/newsletter/unsubscribe":{"get":{"tags":["Letter"],"summary":"Leave the letter","parameters":[{"name":"email","in":"query","required":true,"schema":{"type":"string","format":"email"}}],"responses":{"200":{"description":"A short page confirming the address is off the list."}}}},"/api/support":{"post":{"tags":["Support"],"summary":"Send a support message","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupportMessage"},"example":{"name":"Mina","email":"mina@example.com","topic":"Rates","message":"The board looks a day old."}}}},"responses":{"201":{"description":"The message was stored.","content":{"application/json":{"example":{"ok":true,"id":"6f1c","createdAt":"2026-11-22T11:00:00.000Z"}}}},"400":{"description":"The request was rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Pick both from the list."}}}}}}}},"components":{"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}},"Ok":{"type":"object","required":["ok"],"properties":{"ok":{"type":"boolean"}}},"Currency":{"type":"object","required":["code","name","country","symbol","decimals"],"properties":{"code":{"type":"string","example":"BAM"},"name":{"type":"string"},"country":{"type":"string"},"symbol":{"type":"string"},"decimals":{"type":"integer"}}},"CurrencyList":{"type":"object","properties":{"count":{"type":"integer"},"currencies":{"type":"array","items":{"$ref":"#/components/schemas/Currency"}}}},"RateTable":{"type":"object","properties":{"date":{"type":"string","format":"date"},"source":{"type":"string"},"base":{"type":"string","enum":["EUR"]},"count":{"type":"integer"},"rates":{"type":"object","additionalProperties":{"type":"number"},"description":"Units of that currency per 1 euro."}}},"RateQuote":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"},"country":{"type":"string"},"rate":{"type":"number"},"inverse":{"type":"number"}}},"RateBoard":{"type":"object","properties":{"base":{"type":"string"},"baseName":{"type":"string"},"date":{"type":"string","format":"date"},"source":{"type":"string"},"count":{"type":"integer"},"quotes":{"type":"array","items":{"$ref":"#/components/schemas/RateQuote"}}}},"ConversionRequest":{"type":"object","required":["amount","from","to"],"properties":{"amount":{"type":"number","minimum":0},"from":{"type":"string"},"to":{"type":"string"}}},"Conversion":{"type":"object","properties":{"amount":{"type":"number"},"from":{"type":"string"},"to":{"type":"string"},"converted":{"type":"number"},"formatted":{"type":"string"},"sourceFormatted":{"type":"string"},"rate":{"type":"number","description":"Units of `to` for 1 unit of `from`."},"inverse":{"type":"number"},"rateDate":{"type":"string","format":"date"},"source":{"type":"string"}}},"Pair":{"type":"object","required":["home","trip"],"properties":{"home":{"type":"string"},"trip":{"type":"string"}}},"Scan":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"amount":{"type":"number"},"fromCode":{"type":"string"},"toCode":{"type":"string"},"converted":{"type":"number"},"rate":{"type":"number"},"rateDate":{"type":"string"},"source":{"type":"string","enum":["camera"]},"createdAt":{"type":"string","format":"date-time"}}},"Letter":{"type":"object","required":["subject","body","key"],"properties":{"subject":{"type":"string"},"body":{"type":"string"},"key":{"type":"string"}}},"SupportMessage":{"type":"object","required":["name","email","topic","message"],"properties":{"name":{"type":"string","maxLength":80},"email":{"type":"string","format":"email"},"topic":{"type":"string","enum":["Scan","Rates","Currencies","History","Something else"]},"message":{"type":"string","minLength":10,"maxLength":4000}}}}}}