DocsGuidesView as Markdown

Converting to American odds

Which products return American odds, and a function to convert the rest.

Decimal only on standard and dutching

standard and dutching serve decimal odds only: oddsFormat=american is a 400 there. 2up, each-way, extra-place, bog, raw, the single-event route and the historical board and event calls take oddsFormat=american and convert for you. On standard and dutching, convert yourself.

This matches the API's own conversion: a price at or below 1.0 has no American form (null), and halves round to even.

JavaScript

const roundHalfEven = (x) => { const f = Math.floor(x); return x - f === 0.5 ? (f % 2 === 0 ? f : f + 1) : Math.round(x); };
const american = (d) => (d <= 1 ? null : d >= 2 ? roundHalfEven((d - 1) * 100) : roundHalfEven(-100 / (d - 1)));
const decimal = (a) => (a > 0 ? 1 + a / 100 : 1 + 100 / -a);

From the blog

Every parameter: API reference.