# Battery Status API

## Overview

Battery Status API provides information about the device's battery charge level and notifies you when the battery level or charging status change.

This can be used to adjust your app's resource usage to reduce battery drain when the battery is low, or to save changes before the battery runs out in order to prevent data loss.

## Demo

<https://nectar.website/demo/web-apis/battery-status/>

## Usage

You can refer to the code present in `/partials/web-apis/battery-status.html` file and use it accordingly.

## Reference

<https://developer.mozilla.org/en-US/docs/Web/API/Battery_Status_API>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://pmsgz.gitbook.io/nectar/advanced/web-apis/battery-status.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
