Payment apps, neobanks, remittance services and B2B payment platforms all need a neutral benchmark: what is the currency pair worth right now, before anyone adds a margin? An exchange rate API for fintech gives your product that benchmark. fxapi delivers mid-market reference rates for 190+ currencies, refreshed every 60 seconds on paid Professional and Enterprise plans, so you can show indicative quotes, disclose your FX markup and reconcile what your providers actually charged.
Reference rates, not executable quotes. fxapi returns mid-market reference rates. It is not a trading or brokerage feed: there is no bid/ask spread and no order execution. Use fxapi to price, display, compare and reconcile; book the actual conversion with your bank, liquidity provider or payment processor.
Where fintech products need exchange rates
- Indicative quotes. “You send 1,000.00 EUR, they receive about 1,085.40 USD” before the user confirms.
- Markup on mid-market. Your customer rate is the mid-market rate minus a margin. Calculating it from a neutral reference keeps pricing consistent across corridors.
- FX fee transparency. Users increasingly compare the rate they get with the mid-market rate. Showing the markup explicitly builds trust, and some markets have disclosure rules – ask your compliance team which apply to you.
- Payouts. Marketplaces and payroll platforms estimate recipient amounts in local currency before batching payouts.
- Multi-currency wallets. Show the total value of EUR, GBP and USD balances in the user’s home currency.
- Reconciliation. Compare the rate your provider executed against the reference rate for the same timestamp to monitor spread and catch errors.
How fxapi fits a payments stack
| Need | Endpoint | Plan |
|---|---|---|
| Live reference rate for quotes and wallets | /v1/latest | All (60-second updates on Professional+) |
| Converted amount for one value, optionally on a past date | /v1/convert | Basic and up |
| End-of-day rate for a transaction date | /v1/historical | All |
| Intraday history (hourly, 15-minute, minute) for spread analysis | /v1/range | Professional and up |
| Period change and volatility alerts | /v1/fluctuation | All |
For a production payments product, Professional is the usual starting point: 600,000 requests per month, 60-second updates, /v1/range for intraday analysis, two API keys and sandbox keys that return dummy values with X-Cost: 0 for your test suites. Enterprise adds IP and URL whitelisting, five keys and an SLA. Details on the pricing page.
Architecture: indicative quote to reconciliation
- Rate cache. A backend worker calls
/v1/latestevery 60 seconds for your supported currencies and stores the values withmeta.last_updated_at. - Quote service. When a user enters an amount, compute the customer rate from the cached mid-market rate and your markup in basis points. Return both rates, the fee and an expiry time.
- Confirmation. Re-check that the quote has not expired, then send the conversion to your provider.
- Execution record. Store the provider’s executed rate, the reference rate and both timestamps on the transaction.
- Reconciliation. Nightly, compare executed rates with reference rates. For older transactions, fetch the end-of-day rate with
/v1/historical; on Professional, use/v1/rangewithaccuracy=hourorquarter_hourfor a closer intraday match. - Monitoring. Run
/v1/fluctuationdaily to flag corridors that moved more than a threshold, and widen margins or shorten quote expiry accordingly.
Code example: indicative quote with markup in Go
Plain net/http, API key in the apikey header. Amounts are handled in minor units; in production use a decimal library for the rate arithmetic.
package fx
import (
"encoding/json"
"fmt"
"math"
"net/http"
"os"
"time"
)
type latestResponse struct {
Meta struct {
LastUpdatedAt time.Time `json:"last_updated_at"`
} `json:"meta"`
Data map[string]struct {
Code string `json:"code"`
Value float64 `json:"value"`
} `json:"data"`
}
type Quote struct {
MidRate float64 `json:"mid_rate"`
CustomerRate float64 `json:"customer_rate"`
MarkupPct float64 `json:"markup_pct"`
SendMinor int64 `json:"send_minor"`
ReceiveMinor int64 `json:"receive_minor"`
RateTime time.Time `json:"rate_time"`
ExpiresAt time.Time `json:"expires_at"`
}
func IndicativeQuote(from, to string, sendMinor int64, markupBps int) (*Quote, error) {
url := fmt.Sprintf("https://api.fxapi.com/v1/latest?base_currency=%s¤cies=%s", from, to)
req, _ := http.NewRequest(http.MethodGet, url, nil)
req.Header.Set("apikey", os.Getenv("FXAPI_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
return nil, err
}
defer res.Body.Close()
if res.StatusCode != http.StatusOK {
return nil, fmt.Errorf("fxapi: HTTP %d", res.StatusCode)
}
var body latestResponse
if err := json.NewDecoder(res.Body).Decode(&body); err != nil {
return nil, err
}
mid := body.Data[to].Value
customer := mid * (1 - float64(markupBps)/10000)
return &Quote{
MidRate: mid,
CustomerRate: customer,
MarkupPct: float64(markupBps) / 100,
SendMinor: sendMinor,
ReceiveMinor: int64(math.Floor(float64(sendMinor) * customer)),
RateTime: body.Meta.LastUpdatedAt,
ExpiresAt: time.Now().Add(30 * time.Second),
}, nil
}
In production, read from your rate cache instead of calling the API on every quote request. This example assumes both currencies have two decimals; check decimal_digits from /v1/currencies for others. More in the Go guide.
Pitfalls and best practices
- Label quotes as indicative. Until your provider confirms, the amount is an estimate. Say so in the UI.
- Expire quotes. Tie expiry to your plan’s refresh interval and your risk appetite; never honor a quote built on a stale rate.
- Show the timestamp. Display
last_updated_atnext to the reference rate. - Don’t call the API per user request. Cache server-side and serve all users from the cache – see caching exchange rates. This also protects you from HTTP 429 during traffic spikes.
- Use sandbox keys in CI. On Professional and Enterprise, sandbox keys return dummy values without spending quota.
- Separate keys by environment. Paid plans support multiple keys, so a leaked staging key can be revoked without touching production.
- Round per currency. Use
decimal_digitsand integer minor units; see currency rounding and precision.
Build transparent FX into your product
Start on the Free plan to wire up quotes and reconciliation logic, then move to Professional for 60-second rates, intraday history and sandbox keys. Have higher volumes or specific requirements? Talk to us about a custom plan, or create a free API key and request your first reference rate now.
Everything on this page runs on the fxapi FX rates API: one key, 190+ currencies, data back to 1999.
Frequently asked questions
Can I execute currency trades with fxapi rates?
How do I show a transparent FX fee to users?
How fresh are the rates for payment quotes?
meta.last_updated_at to show users when the reference rate was taken and to expire quotes.Which endpoint should I use to reconcile past transactions?
/v1/historical for the end-of-day rate on the transaction date, or /v1/convert with a date to get converted amounts directly (Basic and up).