# Index checker

Is each page in Google? Track any URL - on your sites or any other - and read its history.

## Index checker: plan and usage

`GET /index-checker` · scope `index:read`

The plan, how many pages may be tracked, checks a month included and used, the checks your chosen frequencies plan for, and how many tracked pages are indexed.

### Example

```bash
curl -s "https://app.pbn.ltd/api/v1/index-checker" \
  -H "Authorization: Bearer $PBN_API_KEY"
```

```python
import os
import requests

headers = {"Authorization": "Bearer " + os.environ["PBN_API_KEY"]}
r = requests.get("https://app.pbn.ltd/api/v1/index-checker", headers=headers, timeout=120)
print(r.status_code, r.json())
```

```javascript
const res = await fetch("https://app.pbn.ltd/api/v1/index-checker", {
  method: "GET",
  headers: {Authorization: `Bearer ${process.env.PBN_API_KEY}`}
});
console.log(res.status, await res.json());
```

### Response

`200`

```json
{
  "data": {
    "active": true,
    "plan": "Starter",
    "paid_until": "2026-10-31",
    "urls": {
      "used": 38,
      "limit": 50
    },
    "checks_this_month": {
      "used": 120,
      "limit": 215,
      "planned": 190
    },
    "pages": {
      "indexed": 30,
      "not_indexed": 6,
      "pending": 2
    }
  }
}
```

Errors: `rate_limited`, `scope_missing`, `unauthorized`

## List tracked pages

`GET /index-checker/urls` · scope `index:read`

Every page you track, newest first, with its current status.

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `status` | query | string (one of: indexed, not_indexed, pending) | no | Only pages in this state. |
| `host` | query | string | no | Only pages on this domain (www. ignored). |
| `search` | query | string | no | Part of the address. |
| `limit` | query | integer | no | Items per page. Default: `50`. |
| `cursor` | query | string | no | next_cursor of the previous page. |

### Example

```bash
curl -s "https://app.pbn.ltd/api/v1/index-checker/urls" \
  -H "Authorization: Bearer $PBN_API_KEY"
```

```python
import os
import requests

headers = {"Authorization": "Bearer " + os.environ["PBN_API_KEY"]}
r = requests.get("https://app.pbn.ltd/api/v1/index-checker/urls", headers=headers, timeout=120)
print(r.status_code, r.json())
```

```javascript
const res = await fetch("https://app.pbn.ltd/api/v1/index-checker/urls", {
  method: "GET",
  headers: {Authorization: `Bearer ${process.env.PBN_API_KEY}`}
});
console.log(res.status, await res.json());
```

### Response

`200`

```json
{
  "data": [
    {
      "id": 901,
      "url": "https://example.com/blog/post/",
      "status": "indexed",
      "frequency": "weekly",
      "last_checked_at": "2026-09-21T10:00:00Z",
      "last_change_at": "2026-09-14T10:00:00Z",
      "first_indexed_at": "2026-09-14T10:00:00Z",
      "google_url": "https://example.com/blog/post/",
      "hosted_site_id": 12345,
      "checks": 3
    }
  ],
  "next_cursor": null,
  "has_more": false
}
```

Errors: `rate_limited`, `scope_missing`, `unauthorized`

## One tracked page and its history

`GET /index-checker/urls/{url_id}` · scope `index:read`

The page and up to 100 of its most recent checks.

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `url_id` | path | integer | yes | The tracked page id. |

### Example

```bash
curl -s "https://app.pbn.ltd/api/v1/index-checker/urls/url_id" \
  -H "Authorization: Bearer $PBN_API_KEY"
```

```python
import os
import requests

headers = {"Authorization": "Bearer " + os.environ["PBN_API_KEY"]}
r = requests.get("https://app.pbn.ltd/api/v1/index-checker/urls/url_id", headers=headers, timeout=120)
print(r.status_code, r.json())
```

```javascript
const res = await fetch("https://app.pbn.ltd/api/v1/index-checker/urls/url_id", {
  method: "GET",
  headers: {Authorization: `Bearer ${process.env.PBN_API_KEY}`}
});
console.log(res.status, await res.json());
```

### Response

`200`

```json
{
  "data": {
    "id": 901,
    "url": "https://example.com/blog/post/",
    "status": "indexed",
    "frequency": "weekly",
    "last_checked_at": "2026-09-21T10:00:00Z",
    "last_change_at": "2026-09-14T10:00:00Z",
    "first_indexed_at": "2026-09-14T10:00:00Z",
    "google_url": "https://example.com/blog/post/",
    "hosted_site_id": 12345,
    "checks": 3,
    "history": [
      {
        "checked_at": "2026-09-21T10:00:00Z",
        "indexed": true,
        "changed": false,
        "manual": false
      }
    ]
  }
}
```

Errors: `not_found`, `rate_limited`, `scope_missing`, `unauthorized`

## Track pages

`POST /index-checker/urls` · scope `index:write`

Adds pages with the panel's own rules: a page that would pass the plan's URL limit or its checks a month is not added (see not_added). The first check runs within a few minutes.

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `urls` | body | array | yes | Page addresses (up to 5,000). Any site, hosted with us or not. |
| `frequency` | body | string (one of: daily, weekly, monthly) | no | How often the page is checked. Daily uses ~30 checks a month, weekly ~4.3, monthly 1. Default: `weekly`. |

### Example

```bash
curl -s -X POST "https://app.pbn.ltd/api/v1/index-checker/urls" \
  -H "Authorization: Bearer $PBN_API_KEY"
```

```python
import os
import requests

headers = {"Authorization": "Bearer " + os.environ["PBN_API_KEY"]}
r = requests.post("https://app.pbn.ltd/api/v1/index-checker/urls", headers=headers, timeout=120)
print(r.status_code, r.json())
```

```javascript
const res = await fetch("https://app.pbn.ltd/api/v1/index-checker/urls", {
  method: "POST",
  headers: {Authorization: `Bearer ${process.env.PBN_API_KEY}`}
});
console.log(res.status, await res.json());
```

### Response

`201`

```json
{
  "data": {
    "added": [
      {
        "id": 901,
        "url": "https://example.com/blog/post/",
        "status": "indexed",
        "frequency": "weekly",
        "last_checked_at": "2026-09-21T10:00:00Z",
        "last_change_at": "2026-09-14T10:00:00Z",
        "first_indexed_at": "2026-09-14T10:00:00Z",
        "google_url": "https://example.com/blog/post/",
        "hosted_site_id": 12345,
        "checks": 3
      }
    ],
    "already_tracked": 0,
    "invalid": [
      {
        "url": "not a url",
        "reason": "..."
      }
    ],
    "not_added": {
      "count": 0,
      "reason": null
    }
  }
}
```

Errors: `payment_required`, `rate_limited`, `scope_missing`, `unauthorized`, `validation_failed`

## Change how often a page is checked

`PATCH /index-checker/urls/{url_id}` · scope `index:write`

Refused when the new frequency would pass the plan's checks a month.

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `url_id` | path | integer | yes | The tracked page id. |
| `frequency` | body | string (one of: daily, weekly, monthly) | no | How often the page is checked. Daily uses ~30 checks a month, weekly ~4.3, monthly 1. Default: `weekly`. |

### Example

```bash
curl -s -X PATCH "https://app.pbn.ltd/api/v1/index-checker/urls/url_id" \
  -H "Authorization: Bearer $PBN_API_KEY"
```

```python
import os
import requests

headers = {"Authorization": "Bearer " + os.environ["PBN_API_KEY"]}
r = requests.patch("https://app.pbn.ltd/api/v1/index-checker/urls/url_id", headers=headers, timeout=120)
print(r.status_code, r.json())
```

```javascript
const res = await fetch("https://app.pbn.ltd/api/v1/index-checker/urls/url_id", {
  method: "PATCH",
  headers: {Authorization: `Bearer ${process.env.PBN_API_KEY}`}
});
console.log(res.status, await res.json());
```

### Response

`200`

```json
{
  "data": {
    "id": 901,
    "url": "https://example.com/blog/post/",
    "status": "indexed",
    "frequency": "weekly",
    "last_checked_at": "2026-09-21T10:00:00Z",
    "last_change_at": "2026-09-14T10:00:00Z",
    "first_indexed_at": "2026-09-14T10:00:00Z",
    "google_url": "https://example.com/blog/post/",
    "hosted_site_id": 12345,
    "checks": 3
  }
}
```

Errors: `not_found`, `rate_limited`, `scope_missing`, `unauthorized`, `validation_failed`

## Stop tracking a page

`DELETE /index-checker/urls/{url_id}` · scope `index:write`

Stops tracking. Its history is kept and comes back if you add the page again.

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `url_id` | path | integer | yes | The tracked page id. |

### Example

```bash
curl -s -X DELETE "https://app.pbn.ltd/api/v1/index-checker/urls/url_id" \
  -H "Authorization: Bearer $PBN_API_KEY"
```

```python
import os
import requests

headers = {"Authorization": "Bearer " + os.environ["PBN_API_KEY"]}
r = requests.delete("https://app.pbn.ltd/api/v1/index-checker/urls/url_id", headers=headers, timeout=120)
print(r.status_code, r.json())
```

```javascript
const res = await fetch("https://app.pbn.ltd/api/v1/index-checker/urls/url_id", {
  method: "DELETE",
  headers: {Authorization: `Bearer ${process.env.PBN_API_KEY}`}
});
console.log(res.status, await res.json());
```

### Response

`200`

```json
{
  "data": {
    "deleted": true,
    "id": 901
  }
}
```

Errors: `not_found`, `rate_limited`, `scope_missing`, `unauthorized`

## Check a page now

`POST /index-checker/urls/{url_id}/check` · scope `index:write`

Checks the page immediately (usually 1-2 seconds). Uses one check of the monthly allowance; at most once an hour per page and a daily number per account.

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `url_id` | path | integer | yes | The tracked page id. |

### Example

```bash
curl -s -X POST "https://app.pbn.ltd/api/v1/index-checker/urls/url_id/check" \
  -H "Authorization: Bearer $PBN_API_KEY"
```

```python
import os
import requests

headers = {"Authorization": "Bearer " + os.environ["PBN_API_KEY"]}
r = requests.post("https://app.pbn.ltd/api/v1/index-checker/urls/url_id/check", headers=headers, timeout=120)
print(r.status_code, r.json())
```

```javascript
const res = await fetch("https://app.pbn.ltd/api/v1/index-checker/urls/url_id/check", {
  method: "POST",
  headers: {Authorization: `Bearer ${process.env.PBN_API_KEY}`}
});
console.log(res.status, await res.json());
```

### Response

`200`

```json
{
  "data": {
    "id": 901,
    "url": "https://example.com/blog/post/",
    "status": "indexed",
    "frequency": "weekly",
    "last_checked_at": "2026-09-21T10:00:00Z",
    "last_change_at": "2026-09-14T10:00:00Z",
    "first_indexed_at": "2026-09-14T10:00:00Z",
    "google_url": "https://example.com/blog/post/",
    "hosted_site_id": 12345,
    "checks": 3
  }
}
```

Errors: `not_found`, `rate_limited`, `scope_missing`, `unauthorized`
