# Several MLS boards in one search

Source: https://help.ruuster.com/idx/guide-multiple-boards

> Search every MLS board your brokerage is approved for with one key, show one result per home when boards overlap, narrow to one board, and print each board's own rules.

One key covers every board your brokerage is approved for. A search covers all of them at once, unless
you narrow it.

## Which boards your key covers

`GET /v1/meta` lists them in `data.mls`: each board's `id`, `name`, `searchName` (the name
`filterByMls` takes), the `states` it covers and its display type. `data.capabilities.sold` says, per
board, whether it shows sold listings and for how many days back.

cURL:

```bash
curl -s "https://idx.ruuster.com/v1/meta" \
  -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.meta();
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/meta",
    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

$ch = curl_init('https://idx.ruuster.com/v1/meta');
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']);
```

## One result per home

When two of your boards carry the same home on one page of results, that page shows it once, from the
board listed first for your account. Its listing, photos and attribution are the ones you get.
`data.total` is the number of listings that match. If you want a different board to come first,
email `helpme@ruuster.com`.

## Narrowing to some boards

`filterByMls` takes a comma list of board search names from `/v1/meta`. It can only narrow: every
name must be one of your key's boards.

cURL:

```bash
curl -s -G "https://idx.ruuster.com/v1/listings" \
  --data-urlencode state=GA \
  --data-urlencode filterByMls=GAMLS \
  --data-urlencode limit=24 \
  -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.search({
  state: "GA",
  filterByMls: ["GAMLS"],
  limit: 24,
});
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/listings",
    params={
        "state": "GA",
        "filterByMls": "GAMLS",
        "limit": "24",
    },
    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([
    'state' => 'GA',
    'filterByMls' => 'GAMLS',
    'limit' => '24',
], '', '&', PHP_QUERY_RFC3986);
$ch = curl_init('https://idx.ruuster.com/v1/listings' . '?' . $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']);
```

## Each board's rules travel with its listings

- Every answer carries `meta.mls`: one compliance block for each board in that answer, with the
  board's disclaimer, logo, attribution format and where each required element goes. Print the
  disclaimer of every board in the results, not only the first.
- Each listing carries its own `mls` and its own `attribution.line`, built from its board's format.
- A listing's detail answer also has a `compliance` object for that one listing.
- Hidden-address rules, sold windows and field suppressions are the listing's own board's rules. The
  API applies them; you print what it returns.

## Sold data across boards

Boards differ on sold data. A sold search (`status=closed`) covers only the boards that show sold
listings. When a search mixes sold with other statuses and the boards disagree, the API answers 422
`sold_not_permitted`: narrow it with `filterByMls` to the boards that show sold data, or drop
`closed`. [Sold listings and sold windows](https://help.ruuster.com/idx/guide-sold) has the details.

## Fields that differ by board

A board can hide a field that another shows, such as days on market. The listing then comes back with
that field missing or null, and a filter on it skips that board's listings.
[Fields by board](https://help.ruuster.com/idx/reference-fields) lists every field the API can return
and the boards that hide it.
