MDN’s new design is in Beta! A sneak peek:


This API is available on Firefox OS for internal applications only.


The getSamples method asynchronously queries network interface statistics. The query may be filtered by connection type and date.

A data usage chunk is a MozNetworkStatsData object representing the total number of bits received and sent during the amount of time defined by the sampleRate property.


var samples = getSamples(network, start, end, options);

samples.onsuccess = function() {
  // do something with samples.result


The origin of the data; it can be specified as wifi or mobile. If null, data measurement from both origins are merged. To know in advance which kind of origin is available, the MozNetworkStatsManager.getAvailableNetworks method returns an Array of interfaces.
A Date object representing the beginning of data measurement.
A Date object representing the end of data measurement.
options Optional
Filtering options.
NetworkStatsGetOptions is a dictionary object providing filtering options.


A DOMRequest object. If successful, the request result is a MozNetworkStats object describing the network statistics. If network stats are not available for some dates, then rxBytes and txBytes are undefined for those dates. If the filtering start date is greater than the end date, an exception is thrown.


The filtering start date is greater than the end date.
Both appManifestURL and serviceType are specified at the same time in the NetworkStatsGetOptions dictionary.
The network must be in the return of MozNetworkStatsManager.getAvailableNetworks.


Not part of any specification.

See also

Document Tags and Contributors

 Contributors to this page: kmag, chrisdavidmills, kscarfone, zeller
 Last updated by: kmag,