# Authentication

{% hint style="info" %}
This documentation shares the RESTful api endpoints provided by AirQo for retrieving measurements and device metadata from the AirQo monitoring network.
{% endhint %}

## The BASE URL

`https://api.airqo.net/api/{VERSION_NUMBER}`

### Authentication

**IMPORTANT:** All API endpoints use `token` as a **query parameter**.

1. **Get AirQo Account:** Visit <https://analytics.airqo.net/user/login>
2. **Register Client:** Log in → Account Settings → API tab → Register CLIENT app
3. **Create Token:** Generate access token using client credentials
4. **Use Token:** Include as QUERY parameter in all requests

#### Example Request

```
GET https://api.airqo.net/v2/measurements/grids/64b7f3257249f0029fed743/recent?token=YOUR_ACCESS_TOKEN
```

*✅ Correct: Query parameter | ❌ Wrong: Authorization header*

{% hint style="warning" %}
Please note that the V1 endpoint for device measurements were deprecated on 30th July 2023.&#x20;
{% endhint %}

## Key Categories of Endpoints

Here are the key categories of endpoints you can use to retrieve measurements:

### 1. Recent

{% content-ref url="/pages/7cjIe6qWTwPILbq8s0Fn" %}
[Recent Measurements](/airqo-rest-api-documentation/api-endpoints/recent-measurements.md)
{% endcontent-ref %}

### 2. Historical&#x20;

{% content-ref url="/pages/bbCH5EFlRCCcN8cVV3mY" %}
[Historical Measurements](/airqo-rest-api-documentation/api-endpoints/historical-measurements.md)
{% endcontent-ref %}

### 3. Forecasts

{% content-ref url="/pages/1N9ORqZfpEET9IPSn24t" %}
[Forecasts](/airqo-rest-api-documentation/api-endpoints/forecasts.md)
{% endcontent-ref %}

### 4. Metadata

{% content-ref url="/pages/ZEVkuEcuJfw1B9IxcCaU" %}
[Metadata](/airqo-rest-api-documentation/api-endpoints/metadata.md)
{% endcontent-ref %}

{% hint style="info" %}
For support, please reach out to <support@airqo.net> to report bugs. We will also appreciate any feedback you would like to share with us!
{% endhint %}


---

# 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://docs.airqo.net/airqo-rest-api-documentation/introduction/reference.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.
