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

# Quickstart - Monitoring API

The **Monitoring API** watches resources of other HasData APIs on a schedule and tells you what changed. A **monitor** is one API endpoint, one or more **resources** (requests to it, such as an Amazon ASIN or a Zillow search), the **fields** of the response to compare, a **schedule**, and where to deliver changes.

Every check calls the API for each resource, keeps a snapshot of the tracked fields and diffs it against the previous one. Changes land in a feed you can poll, in a webhook, or in your inbox.

Monitors can watch most HasData APIs: search results, Maps, Amazon, Walmart, Zillow, social profiles, job boards, Web Scraping and more. `GET /monitors/endpoints` lists them with their ids, the params each accepts and the fields worth tracking. An endpoint id is the API's name with underscores, such as `amazon_product`, `google_serp` or `zillow_listing`. Chat APIs are left out: their answers differ on every call.

In the dashboard, open an API in the [Playground](https://app.hasdata.com/apis), set up a request and choose **Monitor this request**.

## Create a Monitor

The first check runs as soon as the monitor is created and becomes the starting point for comparisons.

```bash cURL theme={null}
curl --request POST \
  --url 'https://api.hasdata.com/monitors' \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <your-api-key>' \
  --data '{"name":"AirPods price","endpoint":"amazon_product","resources":[{"params":{"asin":"B0D1XD1ZV3"}},{"params":{"asin":"B0CHX3QBCH"}}],"fields":[{"path":"product.price.currentPrice"},{"path":"product.isAvailable"}],"schedule":{"preset":"6h"},"delivery":{"webhook":{"url":"https://yourdomain.com/webhook","secret":"replace-with-a-secret"}}}'
```

```javascript Node.js theme={null}
const axios = require('axios').default;

const options = {
  method: 'POST',
  url: 'https://api.hasdata.com/monitors',
  headers: {'Content-Type': 'application/json', 'x-api-key': '<your-api-key>'},
  data: {
    name: 'AirPods price',
    endpoint: 'amazon_product',
    resources: [{params: {asin: 'B0D1XD1ZV3'}}, {params: {asin: 'B0CHX3QBCH'}}],
    fields: [{path: 'product.price.currentPrice'}, {path: 'product.isAvailable'}],
    schedule: {preset: '6h'},
    delivery: {webhook: {url: 'https://yourdomain.com/webhook', secret: 'replace-with-a-secret'}}
  }
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```python Python theme={null}
import requests

url = "https://api.hasdata.com/monitors"

payload = {
    "name": "AirPods price",
    "endpoint": "amazon_product",
    "resources": [{"params": {"asin": "B0D1XD1ZV3"}}, {"params": {"asin": "B0CHX3QBCH"}}],
    "fields": [{"path": "product.price.currentPrice"}, {"path": "product.isAvailable"}],
    "schedule": {"preset": "6h"},
    "delivery": {"webhook": {"url": "https://yourdomain.com/webhook", "secret": "replace-with-a-secret"}},
}
headers = {
    "Content-Type": "application/json",
    "x-api-key": "<your-api-key>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

The answer is the monitor with its `id`, its resources (each with an `id` of its own) and the next run:

```json theme={null}
{
  "data": {
    "id": "fe452d1e-e0cc-4c02-b32c-4b33507af3ac",
    "name": "AirPods price",
    "endpoint": "amazon_product",
    "fields": [{ "path": "product.price.currentPrice" }, { "path": "product.isAvailable" }],
    "resources": [
      { "id": "3f1c…", "params": { "asin": "B0D1XD1ZV3" }, "position": 0, "lastResponseAt": null },
      { "id": "9a7e…", "params": { "asin": "B0CHX3QBCH" }, "position": 1, "lastResponseAt": null }
    ],
    "schedule": { "preset": "6h", "cron": "17 0-23/6 * * *", "timezone": "UTC", "nextRunAt": "2026-11-12T18:17:00.000Z" },
    "status": "active",
    "pauseReason": null,
    "delivery": { "webhook": { "url": "https://yourdomain.com/webhook", "hasSecret": true }, "email": null },
    "activity": { "lastCheckAt": null, "lastChangeAt": null, "creditsSpent": 0 }
  }
}
```

## Request Fields

| Field | Required | Description |
| - | - | - |
| `endpoint` | yes | An id from `GET /monitors/endpoints`, such as `amazon_product`, `google_serp` or `web_scraping`. |
| `resources` | yes | One request per resource: `{ "params": { … } }`, the same params the API itself takes. Up to your plan's concurrency limit. |
| `fields` | no | What to compare. Omitted, the whole response is compared; see [Fields to Track](https://docs.hasdata.com/apis/monitoring/fields-to-track.md). |
| `sharedParams` | no | Params set once for every resource. For Web Scraping, `aiExtractRules`. |
| `schedule` | no | `{ "preset": "5m" \| "15m" \| "1h" \| "6h" \| "24h" \| "7d" }` or `{ "cron": "0 9 * * *", "timezone": "Europe/Berlin" }`. `24h` by default; 5 minutes is the minimum. |
| `delivery` | no | `webhook: { url, secret? }` and `email: { to: [ … ] }`; see [Notifications](https://docs.hasdata.com/apis/monitoring/notifications.md). |
| `goal` | no | What matters, in plain words. With it, every change is judged by AI; see [Notifications](https://docs.hasdata.com/apis/monitoring/notifications.md#the-ai-judge). |
| `name` | no | Without it the first resource names the monitor. |

## Request Cost and API Credits

A check costs what the underlying API costs: every resource is one request to it, charged only when it succeeds. A monitor of two Amazon products checked every 6 hours spends 2 × 10 credits per check, 80 credits a day. The AI judge, when a `goal` is set, adds 2 credits per change it looks at.

> [!TIP]
>
> Run one request through the API first to see its exact cost; `GET /monitors/endpoints` gives the typical credits per request for each endpoint.

When the balance runs out, the monitor pauses itself (`pauseReason: "no_credits"`) and resumes when you call `POST /monitors/{id}/resume`.

## Next Steps

* [Fields to Track](https://docs.hasdata.com/apis/monitoring/fields-to-track.md): what a check compares, and how lists are read.
* [Checks and Changes](https://docs.hasdata.com/apis/monitoring/checks-and-changes.md): running a check now, polling it, reading the changes feed.
* [Notifications](https://docs.hasdata.com/apis/monitoring/notifications.md): webhooks, email and the AI judge.
* [API Reference](https://docs.hasdata.com/apis/monitoring/api-reference.md): every endpoint.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.