Numbers

Discussion

The Stack Exchange API typically works in integers, in all but a few cases returning integers and in all cases accepting only integers as parameters. The motivation for this is to prevent any unpleasant floating point confusion, especially across technologies that offering different floating point precision).

The few exceptions where a field on an object is a floating point value are indicated in the relevant type documentation pages. For example, the info object has three (questions_per_minute, answers_per_minute, and badges_per_minute) decimal fields.

Each method documentation page indicates the parameters that expect numeric values with a . All methods expect whole numbers, no method accepts decimal numbers.

The Stack Exchange API guarantees that all numbers returned will fit in a signed 32-bit integer. Dates are returned as numbers as well, but are instead guaranteed to fit in a signed 64-bit integer.