# Market snapshot

Source: https://help.ruuster.com/idx/market-snapshot

> Get every market number for one area over a rolling window ending now, such as active listings, contracts, closings and both months of inventory, with the prior window beside each.

```http
GET https://idx.ruuster.com/v1/market/snapshot
```

publishable or secret key · 2 units · cached 3600 s

Every market metric for one area over a rolling window ending now (7, 30, 60, 90, 180 or 365 days,
30 when you leave it out), with the window before it beside each one where the listing index still
holds it. It answers listing appointment questions such as "how many months of inventory are there
for waterfront condos in this ZIP".

## What to know

- **Exactly one location**, as on `/v1/market`: a `where` object, `boundariesId`, `zip` with `city`
  and `state`, `bbox`, `polygon`, `near` with `radiusMiles`, or `shape`.
- **Filters:** `subdivision` (exact, repeatable), `mlsArea`, `mls` (some of your boards), `priceMin`
  and `priceMax`, beds, baths, square feet, `lotAcresMin` and `lotAcresMax`, `yearMin` and `yearMax`,
  `waterfront`, `newConstruction`, `type` and `subtype`. Sales only unless you send
  `listingType=lease`.
- **`metrics`** narrows the answer to the names you list. [Market metric catalog](https://help.ruuster.com/idx/market-metrics)
  defines each one.
- **Two months of inventory.** `monthsOfInventory` is real-time: active listings now divided by the
  listings that went under contract in the last 30 days. `monthsOfInventoryMls` is the number most
  MLS reports print: active listings now divided by a twelfth of the last 12 months of closings.
  `data.definitions` names both formulas in every answer.
- Each value carries the listings behind it (`count`), the boards that fed it, and `partial` with the
  reason when a board was left out or read only in part. Any median, average, sum or ratio over
  fewer than 3 listings is null.
- `yearAgo` is null for now: the index keeps about 12 months of history.
- Show every line of `data.attribution` with the numbers.
  [Market stats by area](https://help.ruuster.com/idx/guide-market-stats).

## Query parameters

| Name | Type | Description |
|---|---|---|
| `where` | json | The location, as one JSON object exactly as /v1/suggest returned it in `where`: a city, ZIP, neighborhood, county, school, place or county-or-parish row. Send exactly one location: where, boundariesId, zip / city / state, bbox, polygon, near or shape. |
| `boundariesId` | uuid | The location as a platform boundary id (neighborhood, county, ZIP, school) from /v1/suggest. Send exactly one location. |
| `zip` | string | The location as a five-digit ZIP code, or a Canadian postal code (T3J 2S7, or its first three characters for the whole area: T3J). zip, city and state together are one location; zip wins over city. |
| `city` | string | The location as a city name, with or without state. zip, city and state together are one location. At most 80 characters. |
| `state` | string | The location as a two-letter state code (the whole state), or the city's state. zip, city and state together are one location. |
| `bbox` | string | The location as a map box: south,west,north,east in decimal degrees, at most 20° on a side. Send exactly one location. |
| `polygon` | string, repeat | The location as a drawn area: lat,lng,lat,lng,… (repeat for several rings of the same area; at most 200 vertices in all). Send exactly one location. |
| `near` | string | The location as a point: latitude,longitude in decimal degrees, with radiusMiles (default 1, up to 25). A circle is one location on its own. |
| `radiusMiles` | number 0 to 25, default 1 | The circle's radius around near, in miles (default 1, up to 25). |
| `shape` | string | The location as one of the account's saved shapes (shp_…, from /v1/shapes). Send exactly one location. |
| `type` | enum, repeat | Only this property type (repeat for several); default every type the account shows. Values: `all`, `ResidentialIncome`, `ManufacturedInPark`, `Land`, `Farm`, `CommercialSale`, `CommercialLease`, `ResidentialLease`. |
| `subtype` | enum, repeat | Residential subtype (repeat for several). Values: `house`, `condo`, `townhome`, `co-op`, `other`. |
| `subdivision` | string, repeat | Only listings in this subdivision or building, matched exactly as the MLS spells it (repeat for several: any of them). At most 20 values. At most 120 characters. |
| `mlsArea` | string, repeat | Only listings in this MLS area (the board's own area code; repeat for several: any of them). At most 20 values. At most 120 characters. |
| `mls` | uuid, repeat | Only these of your MLS boards (their MLS ids; repeat for several). Default: every board of your account. A board that isn't yours is 400 invalid_parameter. /v1/market/metrics lists your boards. At most 20 values. |
| `priceMin` | integer from 0 | Lowest price, in dollars: the asking price of a listing for sale, the sold price of a closed one. |
| `priceMax` | integer from 0 | Highest price, in dollars: the asking price of a listing for sale, the sold price of a closed one. |
| `bedsMin` | integer 0 to 50 | At least this many bedrooms. |
| `bedsMax` | integer 0 to 50 | At most this many bedrooms. |
| `bathsMin` | number 0 to 50 | At least this many bathrooms. |
| `bathsMax` | number 0 to 50 | At most this many bathrooms. |
| `sqftMin` | integer from 0 | Smallest living area, in square feet. |
| `sqftMax` | integer from 0 | Largest living area, in square feet. |
| `lotAcresMin` | number 0 to 100000 | Smallest lot, in acres. |
| `lotAcresMax` | number 0 to 100000 | Largest lot, in acres. |
| `yearMin` | integer 1600 to 2100 | Built in or after this year. |
| `yearMax` | integer 1600 to 2100 | Built in or before this year. |
| `waterfront` | boolean (1 or 0) | true = waterfront listings only; false = leave them out. |
| `newConstruction` | boolean (1 or 0) | true = new construction only; false = leave it out. |
| `listingType` | enum, default sale | sale (the default) or lease listings. Sales and leases never share a statistic. lease needs rentals on the account. Values: `sale`, `lease`. |
| `window` | integer 7 to 365, default 30 | The rolling window ending now, in days: 7, 30, 60, 90, 180, 365. Each windowed metric also comes with the window before it where the listing index still holds it. |
| `metrics` | enum, comma list | Only these metrics (a comma list of names; default every metric). /v1/market/metrics defines each one. At most 32 values. Values: `activeListings`, `comingSoon`, `underContractNow`, `newListings`, `backOnMarket`, `priceReductions`, `wentUnderContract`, `daysToContract`, `closings`, `closings12m`, `monthsOfInventory`, `monthsOfInventoryMls`, `absorptionRate`, `pendingRatio`, `marketType`, `listPriceActive`, `listPriceNew`, `soldPrice`, `pricePerSqftSold`, `pricePerSqftActive`, `salesVolume`, `priceBands`, `daysOnMarketSold`, `daysOnMarketActive`, `cumulativeDaysOnMarket`, `saleToList`, `saleToOriginalList`, `overAtUnderList`, `concessions`, `cashShare`, `mixByType`, `mixByBeds`. |
| `groupBy` | enum | Split every metric by one dimension: zip, city, subdivision, type, beds or priceBand (at most 50 groups, largest first). Any median, average, sum or ratio over fewer than 3 listings in a group is null. For a breakdown by month use /v1/market. Values: `zip`, `city`, `subdivision`, `type`, `beds`, `priceBand`. |

## 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 |
|---|---|---|
| `location` | object | The one location the statistics describe. |
| `location.kind` | string (enum) | The kind of location: crm (a city, ZIP or state), countyOrParish, boundary (a neighborhood, county or school boundary), library (a place from /v1/suggest), shape (your saved shape), bbox or polygon (your drawn area), circle (near with radiusMiles). One of `crm`, `countyOrParish`, `boundary`, `library`, `shape`, `bbox`, `polygon`, `circle`. |
| `location.label` | string | The location's name, as /v1/suggest labels it (or the outline's own name). |
| `location.viewport` | object or null | The area's box (feed it back as bbox to frame the map); null when none is known. |
| `location.viewport.south` | number | South latitude. |
| `location.viewport.west` | number | West longitude. |
| `location.viewport.north` | number | North latitude. |
| `location.viewport.east` | number | East longitude. |
| `location.boundary` | object or null | The outline a page can draw: boundary, place and saved-shape locations; null otherwise. |
| `location.boundary.id` | string | The boundary, place or saved shape id. |
| `location.boundary.href` | string | GET this URL (same key) for the outline: GeoJSON geometry and its box. |
| `window` | object | The rolling window ending now, the one before it, and the same window a year ago. |
| `window.days` | integer | The window in days. One of `7`, `30`, `60`, `90`, `180`, `365`. |
| `window.current` | object | A window. |
| `window.current.from` | string | Start (ISO 8601). |
| `window.current.through` | string | End (ISO 8601). |
| `window.prior` | object | A window. |
| `window.prior.from` | string | Start (ISO 8601). |
| `window.prior.through` | string | End (ISO 8601). |
| `window.yearAgo` | object | A window. |
| `window.yearAgo.from` | string | Start (ISO 8601). |
| `window.yearAgo.through` | string | End (ISO 8601). |
| `listingType` | string (enum) | sale (the default) or lease listings: sales and leases never share a statistic. One of `sale`, `lease`. |
| `currency` | string (enum) or null | The currency of every price in this answer: USD, or CAD on Canadian boards. The price units keep their names (usd = whole dollars of this currency). null when the boards in the answer span the US and Canada and the location names no state or province. One of `USD`, `CAD`. |
| `metrics` | array of object | The metrics asked for (default all), in catalog order. |
| `metrics[].name` | string (enum) | The metric (GET /v1/market/metrics defines each one). |
| `metrics[].label` | string | Its plain label. |
| `metrics[].unit` | string (enum) | usd: whole dollars of the answer's currency; usd_per_sqft; days; ratio (0.987 = 98.7%); count; months; percent (0 to 100); category (marketType). One of `usd`, `usd_per_sqft`, `days`, `ratio`, `count`, `months`, `percent`, `category`. |
| `metrics[].current` | object | One window's value of one metric. |
| `metrics[].current.value` | number or null | The headline value: the median for price and time metrics, the count, the ratio, the months, or the percent. null when fewer than 3 listings stand behind a median, average, sum or ratio, or there's nothing to divide by. |
| `metrics[].current.average` | number or null | The mean, for price and time metrics; null otherwise (or under 3 listings). |
| `metrics[].current.share` | number or null | A percent (0 to 100) for the metrics that have one: price reductions of actives, closings with concessions, cash closings. |
| `metrics[].current.category` | string (enum) or null | marketType only: seller, balanced or buyer. One of `seller`, `balanced`, `buyer`. |
| `metrics[].current.count` | integer | The listings behind the value. |
| `metrics[].current.breakdown` | array of object or null | The rows of a breakdown metric (price bands, mix by type or beds, over / at / under list), and on the two sale-to-list ratios the closings that sold over, at and under the asking price; null otherwise. |
| `metrics[].current.breakdown[].key` | string | The row's key (a price band, a property type, a bedroom count, over / at / under). |
| `metrics[].current.breakdown[].label` | string | The row's plain label. |
| `metrics[].current.breakdown[].active` | integer or null | Active listings now in the row; null when the metric doesn't split actives. |
| `metrics[].current.breakdown[].activeShare` | number or null | Their percent of all actives in the metric (0 to 100). |
| `metrics[].current.breakdown[].contracts` | integer or null | Listings that went under contract in the window, in the row; null when the metric doesn't split contracts. |
| `metrics[].current.breakdown[].contractsShare` | number or null | Their percent of all contracts in the metric. |
| `metrics[].current.breakdown[].closings` | integer or null | Closings in the window, in the row; null when the metric doesn't split closings. |
| `metrics[].current.breakdown[].closingsShare` | number or null | Their percent of all closings in the metric. |
| `metrics[].prior` | object or null | The same metric over the window before; null with priorReason when the index can't answer it. |
| `metrics[].prior.value` | number or null | The headline value: the median for price and time metrics, the count, the ratio, the months, or the percent. null when fewer than 3 listings stand behind a median, average, sum or ratio, or there's nothing to divide by. |
| `metrics[].prior.average` | number or null | The mean, for price and time metrics; null otherwise (or under 3 listings). |
| `metrics[].prior.share` | number or null | A percent (0 to 100) for the metrics that have one: price reductions of actives, closings with concessions, cash closings. |
| `metrics[].prior.category` | string (enum) or null | marketType only: seller, balanced or buyer. One of `seller`, `balanced`, `buyer`. |
| `metrics[].prior.count` | integer | The listings behind the value. |
| `metrics[].prior.breakdown` | array of object or null | The rows of a breakdown metric (price bands, mix by type or beds, over / at / under list), and on the two sale-to-list ratios the closings that sold over, at and under the asking price; null otherwise. |
| `metrics[].prior.breakdown[].key` | string | The row's key (a price band, a property type, a bedroom count, over / at / under). |
| `metrics[].prior.breakdown[].label` | string | The row's plain label. |
| `metrics[].prior.breakdown[].active` | integer or null | Active listings now in the row; null when the metric doesn't split actives. |
| `metrics[].prior.breakdown[].activeShare` | number or null | Their percent of all actives in the metric (0 to 100). |
| `metrics[].prior.breakdown[].contracts` | integer or null | Listings that went under contract in the window, in the row; null when the metric doesn't split contracts. |
| `metrics[].prior.breakdown[].contractsShare` | number or null | Their percent of all contracts in the metric. |
| `metrics[].prior.breakdown[].closings` | integer or null | Closings in the window, in the row; null when the metric doesn't split closings. |
| `metrics[].prior.breakdown[].closingsShare` | number or null | Their percent of all closings in the metric. |
| `metrics[].priorReason` | string or null | Why prior is null; null when it isn't. |
| `metrics[].yearAgo` | object or null | The same window a year ago; null with yearAgoReason while the index keeps about 12 months of history. |
| `metrics[].yearAgo.value` | number or null | The headline value: the median for price and time metrics, the count, the ratio, the months, or the percent. null when fewer than 3 listings stand behind a median, average, sum or ratio, or there's nothing to divide by. |
| `metrics[].yearAgo.average` | number or null | The mean, for price and time metrics; null otherwise (or under 3 listings). |
| `metrics[].yearAgo.share` | number or null | A percent (0 to 100) for the metrics that have one: price reductions of actives, closings with concessions, cash closings. |
| `metrics[].yearAgo.category` | string (enum) or null | marketType only: seller, balanced or buyer. One of `seller`, `balanced`, `buyer`. |
| `metrics[].yearAgo.count` | integer | The listings behind the value. |
| `metrics[].yearAgo.breakdown` | array of object or null | The rows of a breakdown metric (price bands, mix by type or beds, over / at / under list), and on the two sale-to-list ratios the closings that sold over, at and under the asking price; null otherwise. |
| `metrics[].yearAgo.breakdown[].key` | string | The row's key (a price band, a property type, a bedroom count, over / at / under). |
| `metrics[].yearAgo.breakdown[].label` | string | The row's plain label. |
| `metrics[].yearAgo.breakdown[].active` | integer or null | Active listings now in the row; null when the metric doesn't split actives. |
| `metrics[].yearAgo.breakdown[].activeShare` | number or null | Their percent of all actives in the metric (0 to 100). |
| `metrics[].yearAgo.breakdown[].contracts` | integer or null | Listings that went under contract in the window, in the row; null when the metric doesn't split contracts. |
| `metrics[].yearAgo.breakdown[].contractsShare` | number or null | Their percent of all contracts in the metric. |
| `metrics[].yearAgo.breakdown[].closings` | integer or null | Closings in the window, in the row; null when the metric doesn't split closings. |
| `metrics[].yearAgo.breakdown[].closingsShare` | number or null | Their percent of all closings in the metric. |
| `metrics[].yearAgoReason` | string or null | Why yearAgo is null; null when it isn't. |
| `metrics[].boards` | integer | How many of your MLSs fed the current value. |
| `metrics[].partial` | boolean | true when fewer than all of the answer's MLSs fed it, or one fed it only in part. |
| `metrics[].partialReason` | string or null | Each MLS left out (or read in part) and why; null when not partial. |
| `metrics[].basis` | string (enum) or null | marketType only: the months-of-inventory formula it used. One of `monthsOfInventory`, `monthsOfInventoryMls`. |
| `groups` | object or null | Every metric per group (groupBy). |
| `groups.by` | string (enum) | The breakdown dimension. One of `zip`, `city`, `subdivision`, `type`, `beds`, `priceBand`. |
| `groups.truncated` | boolean | true when there were more than 50 groups (the largest 50 are returned). |
| `groups.rows` | array of object | The groups, largest first (price bands in band order). |
| `groups.rows[].key` | string | The group's key. |
| `groups.rows[].label` | string | The group's plain label. |
| `groups.rows[].listings` | integer | The listings the group's statistics matched. |
| `groups.rows[].metrics` | array of object | The metrics for this group; a value over fewer than 3 listings is null. |
| `groups.rows[].metrics[].name` | string (enum) | The metric (GET /v1/market/metrics defines each one). |
| `groups.rows[].metrics[].label` | string | Its plain label. |
| `groups.rows[].metrics[].unit` | string (enum) | usd: whole dollars of the answer's currency; usd_per_sqft; days; ratio (0.987 = 98.7%); count; months; percent (0 to 100); category (marketType). One of `usd`, `usd_per_sqft`, `days`, `ratio`, `count`, `months`, `percent`, `category`. |
| `groups.rows[].metrics[].current` | object | One window's value of one metric. |
| `groups.rows[].metrics[].current.value` | number or null | The headline value: the median for price and time metrics, the count, the ratio, the months, or the percent. null when fewer than 3 listings stand behind a median, average, sum or ratio, or there's nothing to divide by. |
| `groups.rows[].metrics[].current.average` | number or null | The mean, for price and time metrics; null otherwise (or under 3 listings). |
| `groups.rows[].metrics[].current.share` | number or null | A percent (0 to 100) for the metrics that have one: price reductions of actives, closings with concessions, cash closings. |
| `groups.rows[].metrics[].current.category` | string (enum) or null | marketType only: seller, balanced or buyer. One of `seller`, `balanced`, `buyer`. |
| `groups.rows[].metrics[].current.count` | integer | The listings behind the value. |
| `groups.rows[].metrics[].current.breakdown` | array of object or null | The rows of a breakdown metric (price bands, mix by type or beds, over / at / under list), and on the two sale-to-list ratios the closings that sold over, at and under the asking price; null otherwise. |
| `groups.rows[].metrics[].current.breakdown[].key` | string | The row's key (a price band, a property type, a bedroom count, over / at / under). |
| `groups.rows[].metrics[].current.breakdown[].label` | string | The row's plain label. |
| `groups.rows[].metrics[].current.breakdown[].active` | integer or null | Active listings now in the row; null when the metric doesn't split actives. |
| `groups.rows[].metrics[].current.breakdown[].activeShare` | number or null | Their percent of all actives in the metric (0 to 100). |
| `groups.rows[].metrics[].current.breakdown[].contracts` | integer or null | Listings that went under contract in the window, in the row; null when the metric doesn't split contracts. |
| `groups.rows[].metrics[].current.breakdown[].contractsShare` | number or null | Their percent of all contracts in the metric. |
| `groups.rows[].metrics[].current.breakdown[].closings` | integer or null | Closings in the window, in the row; null when the metric doesn't split closings. |
| `groups.rows[].metrics[].current.breakdown[].closingsShare` | number or null | Their percent of all closings in the metric. |
| `groups.rows[].metrics[].prior` | object or null | The same metric over the window before; null with priorReason when the index can't answer it. |
| `groups.rows[].metrics[].prior.value` | number or null | The headline value: the median for price and time metrics, the count, the ratio, the months, or the percent. null when fewer than 3 listings stand behind a median, average, sum or ratio, or there's nothing to divide by. |
| `groups.rows[].metrics[].prior.average` | number or null | The mean, for price and time metrics; null otherwise (or under 3 listings). |
| `groups.rows[].metrics[].prior.share` | number or null | A percent (0 to 100) for the metrics that have one: price reductions of actives, closings with concessions, cash closings. |
| `groups.rows[].metrics[].prior.category` | string (enum) or null | marketType only: seller, balanced or buyer. One of `seller`, `balanced`, `buyer`. |
| `groups.rows[].metrics[].prior.count` | integer | The listings behind the value. |
| `groups.rows[].metrics[].prior.breakdown` | array of object or null | The rows of a breakdown metric (price bands, mix by type or beds, over / at / under list), and on the two sale-to-list ratios the closings that sold over, at and under the asking price; null otherwise. |
| `groups.rows[].metrics[].prior.breakdown[].key` | string | The row's key (a price band, a property type, a bedroom count, over / at / under). |
| `groups.rows[].metrics[].prior.breakdown[].label` | string | The row's plain label. |
| `groups.rows[].metrics[].prior.breakdown[].active` | integer or null | Active listings now in the row; null when the metric doesn't split actives. |
| `groups.rows[].metrics[].prior.breakdown[].activeShare` | number or null | Their percent of all actives in the metric (0 to 100). |
| `groups.rows[].metrics[].prior.breakdown[].contracts` | integer or null | Listings that went under contract in the window, in the row; null when the metric doesn't split contracts. |
| `groups.rows[].metrics[].prior.breakdown[].contractsShare` | number or null | Their percent of all contracts in the metric. |
| `groups.rows[].metrics[].prior.breakdown[].closings` | integer or null | Closings in the window, in the row; null when the metric doesn't split closings. |
| `groups.rows[].metrics[].prior.breakdown[].closingsShare` | number or null | Their percent of all closings in the metric. |
| `groups.rows[].metrics[].priorReason` | string or null | Why prior is null; null when it isn't. |
| `groups.rows[].metrics[].yearAgo` | object or null | The same window a year ago; null with yearAgoReason while the index keeps about 12 months of history. |
| `groups.rows[].metrics[].yearAgo.value` | number or null | The headline value: the median for price and time metrics, the count, the ratio, the months, or the percent. null when fewer than 3 listings stand behind a median, average, sum or ratio, or there's nothing to divide by. |
| `groups.rows[].metrics[].yearAgo.average` | number or null | The mean, for price and time metrics; null otherwise (or under 3 listings). |
| `groups.rows[].metrics[].yearAgo.share` | number or null | A percent (0 to 100) for the metrics that have one: price reductions of actives, closings with concessions, cash closings. |
| `groups.rows[].metrics[].yearAgo.category` | string (enum) or null | marketType only: seller, balanced or buyer. One of `seller`, `balanced`, `buyer`. |
| `groups.rows[].metrics[].yearAgo.count` | integer | The listings behind the value. |
| `groups.rows[].metrics[].yearAgo.breakdown` | array of object or null | The rows of a breakdown metric (price bands, mix by type or beds, over / at / under list), and on the two sale-to-list ratios the closings that sold over, at and under the asking price; null otherwise. |
| `groups.rows[].metrics[].yearAgo.breakdown[].key` | string | The row's key (a price band, a property type, a bedroom count, over / at / under). |
| `groups.rows[].metrics[].yearAgo.breakdown[].label` | string | The row's plain label. |
| `groups.rows[].metrics[].yearAgo.breakdown[].active` | integer or null | Active listings now in the row; null when the metric doesn't split actives. |
| `groups.rows[].metrics[].yearAgo.breakdown[].activeShare` | number or null | Their percent of all actives in the metric (0 to 100). |
| `groups.rows[].metrics[].yearAgo.breakdown[].contracts` | integer or null | Listings that went under contract in the window, in the row; null when the metric doesn't split contracts. |
| `groups.rows[].metrics[].yearAgo.breakdown[].contractsShare` | number or null | Their percent of all contracts in the metric. |
| `groups.rows[].metrics[].yearAgo.breakdown[].closings` | integer or null | Closings in the window, in the row; null when the metric doesn't split closings. |
| `groups.rows[].metrics[].yearAgo.breakdown[].closingsShare` | number or null | Their percent of all closings in the metric. |
| `groups.rows[].metrics[].yearAgoReason` | string or null | Why yearAgo is null; null when it isn't. |
| `groups.rows[].metrics[].boards` | integer | How many of your MLSs fed the current value. |
| `groups.rows[].metrics[].partial` | boolean | true when fewer than all of the answer's MLSs fed it, or one fed it only in part. |
| `groups.rows[].metrics[].partialReason` | string or null | Each MLS left out (or read in part) and why; null when not partial. |
| `groups.rows[].metrics[].basis` | string (enum) or null | marketType only: the months-of-inventory formula it used. One of `monthsOfInventory`, `monthsOfInventoryMls`. |
| `boards` | object | MLS counts. |
| `boards.total` | integer | Your MLSs in the answer. |
| `boards.sold` | integer | Of those, the MLSs with sold data (sold metrics read these only). |
| `boards.contractDate` | integer | Of those, the MLSs whose contract dates are filled well enough to count contracts. |
| `definitions` | array of object | The formula of every metric in the answer. The three months-of-inventory formulas (monthsOfInventory, monthsOfInventoryMls, monthsOfSupply) are always among them. |
| `definitions[].name` | string | The metric or measure name. |
| `definitions[].label` | string | Its plain label. |
| `definitions[].definition` | string | What it means. |
| `definitions[].formula` | string | How it is computed. |
| `attribution` | array of object | One attribution line per MLS in the answer (NAR advertising policy): show them wherever these statistics are shown. |
| `attribution[].mls` | string | The MLS id. |
| `attribution[].mlsName` | string | The MLS's name. |
| `attribution[].from` | string | The first day the answer's values read (America/Chicago), YYYY-MM-DD. |
| `attribution[].through` | string | The last day (today), YYYY-MM-DD. |
| `attribution[].line` | string | The line to show with the statistics: "Based on information from {MLS} for the period {from} through {to}". |
| `asOf` | string | When these statistics were computed (ISO 8601). |

## 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.

`area_too_large`, `invalid_parameter`, `location_required`, `secret_key_in_url`, `invalid_credentials`, `missing_credentials`, `payment_required`, `access_revoked`, `brokerage_not_enabled`, `origin_not_allowed`, `origin_required`, `secret_key_in_browser`, `boundary_not_found`, `shape_not_found`, `location_not_supported`, `daily_quota_exceeded`, `rate_limited`, `internal_error`, `api_paused`, `source_unavailable`

## Example request

cURL:

```bash
curl -s -G "https://idx.ruuster.com/v1/market/snapshot" \
  --data-urlencode zip=30308 \
  --data-urlencode window=30 \
  --data-urlencode metrics=activeListings,wentUnderContract,closings12m,monthsOfInventory,monthsOfInventoryMls \
  -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.market.snapshot({
  zip: "30308",
  window: 30,
  metrics: ["activeListings", "wentUnderContract", "closings12m", "monthsOfInventory", "monthsOfInventoryMls"],
});
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/market/snapshot",
    params={
        "zip": "30308",
        "window": "30",
        "metrics": "activeListings,wentUnderContract,closings12m,monthsOfInventory,monthsOfInventoryMls",
    },
    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([
    'zip' => '30308',
    'window' => '30',
    'metrics' => 'activeListings,wentUnderContract,closings12m,monthsOfInventory,monthsOfInventoryMls',
], '', '&', PHP_QUERY_RFC3986);
$ch = curl_init('https://idx.ruuster.com/v1/market/snapshot' . '?' . $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": {
    "location": {
      "kind": "crm",
      "label": "ZIP 30308",
      "viewport": {
        "south": 33.76,
        "west": -84.41,
        "north": 33.8,
        "east": -84.35
      },
      "boundary": null
    },
    "window": {
      "days": 30,
      "current": {
        "from": "2026-09-22T15:00:00.000Z",
        "through": "2026-10-22T15:00:00.000Z"
      },
      "prior": {
        "from": "2026-08-23T15:00:00.000Z",
        "through": "2026-09-22T15:00:00.000Z"
      },
      "yearAgo": {
        "from": "2025-09-22T15:00:00.000Z",
        "through": "2025-10-22T15:00:00.000Z"
      }
    },
    "listingType": "sale",
    "currency": "USD",
    "metrics": [
      {
        "name": "activeListings",
        "label": "Active listings",
        "unit": "count",
        "current": {
          "value": 3,
          "average": null,
          "share": null,
          "category": null,
          "breakdown": null,
          "count": 3
        },
        "prior": null,
        "priorReason": "The listing index keeps each listing's current status only, so it can't say what this was in an earlier window.",
        "yearAgo": null,
        "yearAgoReason": "The listing index keeps each listing's current status only, so it can't say what this was in an earlier window.",
        "boards": 5,
        "partial": false,
        "partialReason": null,
        "basis": null
      },
      {
        "name": "wentUnderContract",
        "label": "Went under contract",
        "unit": "count",
        "current": {
          "value": 0,
          "average": null,
          "share": null,
          "category": null,
          "breakdown": null,
          "count": 0
        },
        "prior": {
          "value": 0,
          "average": null,
          "share": null,
          "category": null,
          "breakdown": null,
          "count": 0
        },
        "priorReason": null,
        "yearAgo": null,
        "yearAgoReason": "The listing index keeps about 12 months of history (less where a board's sold window is shorter), and the same window a year ago starts before it.",
        "boards": 5,
        "partial": true,
        "partialReason": "NWMLS (partly): its closed listings aren't shown under its rules, so contracts that already closed are missing",
        "basis": null
      },
      {
        "name": "closings12m",
        "label": "Closings, last 12 months",
        "unit": "count",
        "current": {
          "value": 7,
          "average": null,
          "share": null,
          "category": null,
          "breakdown": null,
          "count": 7
        },
        "prior": null,
        "priorReason": "It always reads the last 12 months, and the listing index keeps about 12 months of history.",
        "yearAgo": null,
        "yearAgoReason": "It always reads the last 12 months, and the listing index keeps about 12 months of history.",
        "boards": 4,
        "partial": true,
        "partialReason": "NWMLS (left out): no sold data under its rules",
        "basis": null
      },
      {
        "name": "monthsOfInventory",
        "label": "Months of inventory, current pace (contracts in the last 30 days)",
        "unit": "months",
        "current": {
          "value": null,
          "average": null,
          "share": null,
          "category": null,
          "breakdown": null,
          "count": 3
        },
        "prior": null,
        "priorReason": "The listing index keeps each listing's current status only, so it can't say what this was in an earlier window.",
        "yearAgo": null,
        "yearAgoReason": "The listing index keeps each listing's current status only, so it can't say what this was in an earlier window.",
        "boards": 5,
        "partial": true,
        "partialReason": "NWMLS (partly): its closed listings aren't shown under its rules, so contracts that already closed are missing",
        "basis": null
      },
      {
        "name": "monthsOfInventoryMls",
        "label": "Months of inventory, 12-month pace (closed sales in the last 12 months)",
        "unit": "months",
        "current": {
          "value": 5.1,
          "average": null,
          "share": null,
          "category": null,
          "breakdown": null,
          "count": 3
        },
        "prior": null,
        "priorReason": "It always reads the last 12 months, and the listing index keeps about 12 months of history.",
        "yearAgo": null,
        "yearAgoReason": "It always reads the last 12 months, and the listing index keeps about 12 months of history.",
        "boards": 4,
        "partial": true,
        "partialReason": "NWMLS (left out): no sold data under its rules",
        "basis": null
      }
    ],
    "groups": null,
    "boards": {
      "total": 5,
      "sold": 4,
      "contractDate": 5
    },
    "definitions": [
      {
        "name": "activeListings",
        "label": "Active listings",
        "definition": "Listings for sale (or for lease with listingType=lease) with status Active now.",
        "formula": "count of Active listings now"
      },
      {
        "name": "wentUnderContract",
        "label": "Went under contract",
        "definition": "Listings that went under contract in the window, whatever their status today (still pending, or already closed). The contract date is the purchase contract date when the MLS sends one, otherwise the date the listing turned pending, otherwise the date its contract status last changed. An MLS that leaves the contract date blank on most listings of a status is left out for that status, and the answer names it.",
        "formula": "count of Pending, Active Under Contract and Closed listings with a contract date in the window"
      },
      {
        "name": "closings12m",
        "label": "Closings, last 12 months",
        "definition": "Listings that closed (sold) in the last 365 days. This count ignores the window you asked for.",
        "formula": "count of Closed listings with closeDate in the last 365 days"
      },
      {
        "name": "monthsOfInventory",
        "label": "Months of inventory, current pace (contracts in the last 30 days)",
        "definition": "How many months it would take to sell the homes for sale today if buyers kept signing contracts at the pace of the last 30 days. It reacts fast, because it counts contracts as they are signed. This is the real-time figure.",
        "formula": "active listings now / listings that went under contract in the last 30 days"
      },
      {
        "name": "monthsOfInventoryMls",
        "label": "Months of inventory, 12-month pace (closed sales in the last 12 months)",
        "definition": "How many months it would take to sell the homes for sale today at the average monthly pace of closed sales over the last 12 months. This is the figure most MLS market reports print (MLS-style). It reacts slowly, because a closing comes a month or two after its contract and the average covers a full year.",
        "formula": "active listings now / (closings in the last 12 months / 12)"
      },
      {
        "name": "monthsOfSupply",
        "label": "Months of supply, 3-month pace (closed sales in the last 3 full months)",
        "definition": "How many months it would take to sell the homes for sale today at the average monthly pace of closed sales over the last three full calendar months. The monthly report's own figure. It reacts faster than the 12-month pace and slower than the current pace.",
        "formula": "active listings now (MLSs with sold data) / average monthly closings of the last 3 full calendar months"
      }
    ],
    "attribution": [
      {
        "mls": "11111111-1111-4111-8111-111111111111",
        "mlsName": "Fixture MLS",
        "from": "2025-10-22",
        "through": "2026-10-22",
        "line": "Based on information from Fixture MLS for the period October 22, 2025 through October 22, 2026"
      },
      {
        "mls": "43c8a0ee-4ac7-48e3-b684-72f1770ccb58",
        "mlsName": "NWMLS",
        "from": "2025-10-22",
        "through": "2026-10-22",
        "line": "Based on information from NWMLS for the period October 22, 2025 through October 22, 2026"
      },
      {
        "mls": "33333333-3333-4333-8333-333333333333",
        "mlsName": "No-Map MLS",
        "from": "2025-10-22",
        "through": "2026-10-22",
        "line": "Based on information from No-Map MLS for the period October 22, 2025 through October 22, 2026"
      },
      {
        "mls": "44444444-4444-4444-8444-444444444444",
        "mlsName": "Contact MLS",
        "from": "2025-10-22",
        "through": "2026-10-22",
        "line": "Based on information from Contact MLS for the period October 22, 2025 through October 22, 2026"
      },
      {
        "mls": "802219ea-d7ac-46cf-b3e2-83e78ef13f68",
        "mlsName": "Maine Listings",
        "from": "2025-10-22",
        "through": "2026-10-22",
        "line": "Based on information from Maine Listings for the period October 22, 2025 through October 22, 2026"
      }
    ],
    "asOf": "2026-10-22T15:00:00.000Z"
  },
  "meta": {
    "brokerageId": "bbbbbbbb-0000-4000-8000-000000000001",
    "freshness": {
      "asOf": "2026-10-22T15:00:00.000Z"
    },
    "mls": [
      {
        "mlsId": "11111111-1111-4111-8111-111111111111",
        "mlsName": "Fixture MLS",
        "displayType": "IDX",
        "disclaimer": {
          "text": "Fixture MLS data is deemed reliable but not guaranteed. CLIENTOK-disclaimer",
          "html": null
        },
        "logo": {
          "url": "https://ruuster-public.s3.amazonaws.com/mls-logo/fixture.png",
          "width": 80,
          "height": 40,
          "alt": "Fixture MLS logo"
        },
        "attributionTemplate": null,
        "required": [
          {
            "element": "listing_office",
            "placement": "card"
          },
          {
            "element": "disclaimer",
            "placement": "page"
          }
        ],
        "notices": [
          {
            "kind": "dmca",
            "text": "To report content that you believe infringes your copyright, write to the MLS's designated copyright agent.",
            "html": null
          }
        ],
        "draft": true
      },
      {
        "mlsId": "43c8a0ee-4ac7-48e3-b684-72f1770ccb58",
        "mlsName": "NWMLS",
        "displayType": "IDX",
        "disclaimer": {
          "text": "NWMLS data is deemed reliable but not guaranteed. CLIENTOK-disclaimer",
          "html": null
        },
        "logo": {
          "url": "https://ruuster-public.s3.amazonaws.com/mls-logo/fixture.png",
          "width": 80,
          "height": 40,
          "alt": "NWMLS logo"
        },
        "attributionTemplate": null,
        "required": [
          {
            "element": "listing_office",
            "placement": "card"
          },
          {
            "element": "disclaimer",
            "placement": "page"
          }
        ],
        "notices": [],
        "draft": true
      },
      {
        "mlsId": "33333333-3333-4333-8333-333333333333",
        "mlsName": "No-Map MLS",
        "displayType": "IDX",
        "disclaimer": {
          "text": "No-Map MLS data is deemed reliable but not guaranteed. CLIENTOK-disclaimer",
          "html": null
        },
        "logo": {
          "url": "https://ruuster-public.s3.amazonaws.com/mls-logo/fixture.png",
          "width": 80,
          "height": 40,
          "alt": "No-Map MLS logo"
        },
        "attributionTemplate": null,
        "required": [
          {
            "element": "listing_office",
            "placement": "card"
          },
          {
            "element": "disclaimer",
            "placement": "page"
          }
        ],
        "notices": [],
        "draft": true
      },
      {
        "mlsId": "44444444-4444-4444-8444-444444444444",
        "mlsName": "Contact MLS",
        "displayType": "IDX",
        "disclaimer": {
          "text": "Contact MLS data is deemed reliable but not guaranteed. CLIENTOK-disclaimer",
          "html": null
        },
        "logo": {
          "url": "https://ruuster-public.s3.amazonaws.com/mls-logo/fixture.png",
          "width": 80,
          "height": 40,
          "alt": "Contact MLS logo"
        },
        "attributionTemplate": "Listed by {listAgentName}, {agentPhone}, {agentEmail}, {listOfficeName}",
        "required": [
          {
            "element": "listing_agent",
            "placement": "detail"
          },
          {
            "element": "agent_contact",
            "placement": "detail"
          },
          {
            "element": "courtesy_line",
            "placement": "card"
          }
        ],
        "notices": [],
        "draft": true
      },
      {
        "mlsId": "802219ea-d7ac-46cf-b3e2-83e78ef13f68",
        "mlsName": "Maine Listings",
        "displayType": "IDX",
        "disclaimer": {
          "text": "Maine Listings data is deemed reliable but not guaranteed. CLIENTOK-disclaimer",
          "html": null
        },
        "logo": {
          "url": "https://ruuster-public.s3.amazonaws.com/mls-logo/fixture.png",
          "width": 80,
          "height": 40,
          "alt": "Maine Listings logo"
        },
        "attributionTemplate": null,
        "required": [
          {
            "element": "listing_office",
            "placement": "card"
          },
          {
            "element": "disclaimer",
            "placement": "page"
          }
        ],
        "notices": [],
        "draft": true
      }
    ],
    "canonical": null,
    "audience": "display"
  }
}
```
