Anti-Bot

What Is Battery Status API Fingerprinting?

What Is Battery Status API Fingerprinting? — conceptual illustration
On this page

Battery Status API fingerprinting used the precise charge level and charging/discharging times exposed by navigator.getBattery() as a short-lived device identifier. Because the readout (level to two decimals, plus seconds-to-full/empty) was nearly identical across two pages loaded within moments, two sites could correlate the same visitor. It is the textbook case of a helpful API that turned into a tracking and bot-detection vector, and most browsers have since restricted or removed it.

Quick facts

APInavigator.getBattery() (Battery Status API)
Leakedlevel, charging, chargingTime, dischargingTime
Disclosed2015 "battery privacy leak" research
StatusRemoved in Firefox; restricted/secure-context in Chrome
Bot tellAlways-100%/charging, or API missing where expected

How a battery became an identifier

The 2015 research showed the readout combined level (e.g. 0.57) with chargingTime/dischargingTime in seconds, giving roughly 14 million combinations at any instant. Two sites reading the API within a few seconds saw the same tuple, letting them re-identify and link a user even across cookie clears for that short window. Firefox removed the API; Chrome restricted it to secure contexts and coarsened values. The episode is now a standard teaching example of unintended fingerprinting surface.

The bot-detection angle

For anti-bot systems the battery readout is a coherence check. A server-hosted headless browser has no battery, so the API is absent or reports a permanently full, charging state. A laptop UA that reports no battery, or a battery stuck at exactly 1.0/charging forever, is mildly suspicious and feeds a lie-detection score alongside stronger signals. It is rarely decisive alone, but it is cheap to read and contributes to the overall picture.

Current status and how to handle it

The Battery Status API has been walked back since its 2012 debut: Firefox removed it outright, and Chrome restricts it (notably gating it behind secure contexts and reducing its precision). That history matters for scraping because the API's presence or absence is now itself a fingerprint surface — a browser claiming to be current Firefox while still exposing navigator.getBattery() is contradicting itself, and a Chrome profile returning suspiciously round values (exactly 100%, charging, infinite time) looks synthetic.

The right move is not to invent battery values but to match the API surface to the browser you claim to be: expose it only where that browser version really does, and let the values reflect a plausible device. Patched browsers such as Camoufox keep these capability surfaces aligned with the reported identity, which is more robust than overriding getBattery() on top of a stock headless build.

Related terms

Concept map

How Battery Status API Fingerprinting connects

The terms most directly tied to this one. Hover a node to see its neighbours, click to preview, drag to rearrange.

0 terms · 0 connections
You are here · Anti-Bot
Building map…

Frequently asked questions

Is the Battery Status API still usable?

Firefox removed it entirely; Chromium keeps a restricted version behind a secure context with coarser values. You should not rely on it, and its absence is itself a signal.

Was the battery a strong identifier?

Only briefly — it correlated visitors across a window of seconds, not permanently. Its lasting importance is as a cautionary tale about convenience APIs leaking entropy.

Does it matter for scraping today?

Marginally. It is a coherence/lie-detection input: a laptop UA with no battery or a frozen full-charge value adds a small amount to a bot score.

Last updated: 2026-05-28