# Page sightings

Source: https://help.ruuster.com/idx/beacon

> Record that a page on your site shows listings, so your usage reports show which pages display your boards' listings.

```http
GET https://idx.ruuster.com/v1/beacon
```

publishable or secret key · free · never cached

A small ping a page sends from the browser once per visit to tell Ruuster it shows listings: the
page's host, the first part of its path, your bundle version and which kind of page it is. It feeds the
pages list in your usage reports, which also helps your boards' audits.

## What to know

- It costs no units and is never cached.
- From a browser, use the publishable key. `host` must be the page's own host.
- Only the first part of the path is kept, never the rest or the query string.
- It is optional. Pages built with the recipes work the same without it.

## Query parameters

| Name | Type | Description |
|---|---|---|
| `host` | string | The page's hostname (must match the Origin for a publishable key). At most 253 characters. Required. |
| `path` | string | The page path, e.g. window.location.pathname (only its first segment, at most 64 characters, is stored). At most 2048 characters. |
| `v` | string | The widget version. |
| `embed` | string | The saved configuration the page embeds, if any. |
| `surface` | enum | Which widget surface the page shows. Values: `search`, `results`, `detail`, `map`. |

## Response

The answer is `{ ok: true, data, meta }`. These are the fields of `data`; `meta` carries `brokerageId`, `freshness.asOf`, `mls` (each board's display rules) and `canonical`.

| Field | Type | Description |
|---|---|---|
| `recorded` | boolean | false when the sighting could not be stored (the call still succeeds). |

## Errors

These are the error codes this endpoint can answer. Every error has the same body; [Errors](https://help.ruuster.com/idx/reference-errors) explains each code and what to show.

`invalid_parameter`, `secret_key_in_url`, `invalid_credentials`, `missing_credentials`, `payment_required`, `access_revoked`, `brokerage_not_enabled`, `origin_not_allowed`, `origin_required`, `secret_key_in_browser`, `internal_error`, `api_paused`, `source_unavailable`

## Example request

cURL:

```bash
curl -s -G "https://idx.ruuster.com/v1/beacon" \
  --data-urlencode host=www.example.com \
  --data-urlencode path=/neighborhoods/midtown \
  --data-urlencode v=1.0.0 \
  --data-urlencode surface=results \
  -H "Authorization: Bearer $IDX_SECRET_KEY"
```

TypeScript:

```typescript
import { createClient } from "@ruuster/idx";

const idx = createClient({ secretKey: process.env.IDX_SECRET_KEY });

const r = await idx.request("/beacon", {
  host: "www.example.com",
  path: "/neighborhoods/midtown",
  v: "1.0.0",
  surface: "results",
});
if (!r.ok) throw new Error(`${r.error.code}: ${r.error.message}`);
console.log(r.data);
```

Python:

```python
import os

import requests

res = requests.get(
    "https://idx.ruuster.com/v1/beacon",
    params={
        "host": "www.example.com",
        "path": "/neighborhoods/midtown",
        "v": "1.0.0",
        "surface": "results",
    },
    headers={"Authorization": "Bearer " + os.environ["IDX_SECRET_KEY"]},
    timeout=30,
)
body = res.json()
if not body["ok"]:
    raise RuntimeError(body["error"]["code"] + ": " + body["error"]["message"])
print(body["data"])
```

PHP:

```php
<?php

$query = http_build_query([
    'host' => 'www.example.com',
    'path' => '/neighborhoods/midtown',
    'v' => '1.0.0',
    'surface' => 'results',
], '', '&', PHP_QUERY_RFC3986);
$ch = curl_init('https://idx.ruuster.com/v1/beacon' . '?' . $query);
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('IDX_SECRET_KEY')],
    CURLOPT_TIMEOUT => 30,
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);
if (!$body['ok']) {
    throw new RuntimeException($body['error']['code'] . ': ' . $body['error']['message']);
}
print_r($body['data']);
```

## Example response

```json
{
  "ok": true,
  "data": {
    "recorded": true
  },
  "meta": {
    "brokerageId": "bbbbbbbb-0000-4000-8000-000000000001",
    "freshness": {
      "asOf": "2026-10-22T15:00:00.000Z"
    },
    "mls": [],
    "canonical": null,
    "audience": "display"
  }
}
```
