> ## Documentation Index
> Fetch the complete documentation index at: https://docs.watt.ma/llms.txt
> Use this file to discover all available pages before exploring further.

# Access the watt.ma REST API

> Authenticate to the watt.ma REST API with a Bearer token, run a sample curl request to fetch readings, and understand rate limits for your plan.

The watt.ma REST API lets you pull energy readings, meter metadata, and alert history into your own applications. This guide shows you how to generate an API key, authenticate your requests, and make your first call to retrieve meter data.

<Steps>
  <Step title="Generate an API key">
    Go to **Settings** then **API Access** in your watt.ma account. Click **Generate New Key**, give it a descriptive name (for example, "BI Pipeline"), and copy the key immediately. You will not be able to view it again.
  </Step>

  <Step title="Authenticate your requests">
    Include the key in the `Authorization` header as a Bearer token on every request:

    ```text theme={null}
    Authorization: Bearer YOUR_API_KEY
    ```
  </Step>

  <Step title="Make your first request">
    Use curl or any HTTP client to fetch the latest readings. Replace `YOUR_API_KEY` with the key you copied:

    ```bash theme={null}
    curl -H "Authorization: Bearer YOUR_API_KEY" \
         https://api.wattsc.com/v1/readings
    ```

    A successful response returns a JSON array of recent readings with timestamps, meter IDs, and consumption values.
  </Step>
</Steps>

<Warning>
  Keep your API key secret. Do not commit it to source control or expose it in client-side code. If a key is compromised, revoke it immediately from **Settings > API Access** and generate a new one.
</Warning>

## Rate limits

Rate limits vary by plan:

| Plan    | Requests per minute |
| ------- | ------------------- |
| Starter | 60                  |
| Pro     | 300                 |

If you exceed the limit, the API returns `429 Too Many Requests`. Wait one minute before retrying, or implement exponential backoff in your client.

## Next steps

* Read the full endpoint reference at [https://api.wattsc.com/docs](https://api.wattsc.com/docs)
* Set up [webhook notifications](/monitoring/alerts) for real-time alerts without polling
