> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.repliers.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Filtering Listings by Status

When working with listings in the system, you have three different ways to filter by status. Each method serves different purposes and provides varying levels of detail.

## Overview of Status Filtering Options

### 1. status (Binary Filter)

The **status** parameter provides a simple binary filter for listings:

* **A** = Available (On-Market)
* **U** = Unavailable (Off-Market)

This is the most basic status filter, giving you a high-level view of listing availability.

**When to use:** When you need a quick overview of which listings are available versus unavailable.

### 2. lastStatus (Detailed Sub-Status)

The **lastStatus** parameter acts as a sub-status that provides more granular information about a listing's current state. It's designed to work **in combination with the status parameter** to give you detailed breakdowns of listings that are either Available (A) or Unavailable (U).

**Important characteristics:**

* There is no predetermined sequence for lastStatus values
* Values can change in any order (e.g., New → Sc → Sld → Sc)
* Provides detailed insight into the listing's current condition
* Some lastStatus values are specific to certain status values (A or U)
* **Should be used together with the status parameter** for optimal filtering

For a complete list of lastStatus values and their definitions, see: [lastStatus Definitions](https://help.repliers.com/en/article/laststatus-definitions-8mokhu/)

**When to use:** When you need detailed information about the specific state or condition of listings within Available or Unavailable categories.

### Practical Implementations (Sold / Leased / De-listed)

Most apps:
- show **Sold** when `status=U` and `lastStatus=Sld`
- show **Leased** when `status=U` and `lastStatus=Lsd`
- show **De-listed** when `status=U` and `lastStatus` is one of the board's off-market reasons (commonly `Exp`, `Ter`, `Sus`, etc.)

Because `lastStatus` values vary by board, first fetch the valid values using aggregates:
```
GET /listings?aggregates=lastStatus&status=U&listings=false&boardId=...
```

For the complete list of lastStatus codes and their meanings, see: [lastStatus Definitions](https://help.repliers.com/en/article/laststatus-definitions-8mokhu/)

### 3. standardStatus (RESO-Compliant Standard)

The **standardStatus** parameter uses familiar status terminology

* **Active**
 The listing is currently on the market and available for sale or lease. The property is being actively marketed and showings can be arranged.
* **Active Under Contract**
 The listing has an accepted offer and is under contract, but remains active on the market. The seller is still accepting backup offers in case the primary contract falls through.
* **Canceled**
 The listing agreement was terminated by mutual agreement between the seller and listing agent before its expiration date.
* **Closed**
 The listing is no longer available. This is a general status indicating the listing process has concluded.
* **Coming Soon**
 The property will be listed in the near future but is not yet officially on the market. This pre-marketing status allows agents to generate interest before the official listing date.
* **Delete**
 The listing has been marked for removal from the system and should no longer appear in search results.
* **Expired**
 The listing agreement period has ended without the property being sold or leased. The agreement between the seller and agent has concluded.
* **Hold**
 The listing is temporarily off the market at the seller's request but has not been officially withdrawn or canceled.
* **Incomplete**
 The listing has been entered into the system but does not yet have all required information for publication.
* **Pending**
 The listing has an accepted offer and is under contract, progressing toward closing. The property is no longer being actively marketed and showings are typically not permitted.
* **Withdrawn**
 The seller has temporarily removed the property from the market, typically with the intent to re-list later.

**Note on 'de-listed':** People often use 'de-listed' to refer to listings that went off market (expired, terminated, withdrawn, sold). Those are typically still available as **Unavailable (U)** listings and can be filtered using `status=U` or `standardStatus`.

If a listing is marked as **Delete** by the MLS and removed from the feed entirely, it may no longer appear in search results or be retrievable.

**This is the RESO-compliant approach** and is more widely adopted across the industry, making it the recommended method for most use cases.

**Important note:** When using standardStatus as your filter, the status and lastStatus parameters become irrelevant and should not be used simultaneously.

**When to use:** For industry-standard filtering that's widely recognized and RESO-compliant. This is the preferred approach for new implementations.

## Choosing the Right Status Filter

| Filter Type | Best For | Level of Detail | Industry Standard |
| ---- |
| status + lastStatus | Legacy systems requiring detailed workflow tracking | Granular (specific states within A/U) | Legacy approach |
| standardStatus | Modern, industry-standard filtering | Moderate (standard business terms) | RESO-compliant ✓ |

## Common Examples

**Off-market listings (all unavailable):**
```
/listings?status=U
```

**Expired listings:**
```
/listings?status=U&lastStatus=Exp
```
Where `Exp` maps to **Expired** (see [lastStatus definitions](https://help.repliers.com/en/article/laststatus-definitions-8mokhu/)).

**RESO-compliant standard filtering (Recommended):**

```
?standardStatus=Active     // Shows active listings
?standardStatus=Pending    // Shows pending listings
?standardStatus=Closed     // Shows closed listings
```

**Legacy combined filtering:**

```
?status=A&lastStatus=New   // Shows active listings
?status=U&lastStatus=Sc    // Shows pending listings
?status=U&lastStatus=Sld   // Shows closed listings
```

## About "Distressed Properties"

MLS feeds do not provide a consistent, standardized field that reliably marks a listing as "distressed" across markets. In practice, "distressed" is usually inferred from listing remarks/description (e.g., "foreclosure", "court ordered", "power of sale").

If you need a distressed-style filter, the most practical approach is to use our keyword search:
- See: [How to Search Listings Using Keywords](https://help.repliers.com/en/article/how-to-search-listings-using-keywords-1osixqn/)

**Important:** keyword results depend on what the MLS/listing agent provides in the listing text.

## Best Practices

1. Choose the right approach for your needs:

* **Recommended**: Use `standardStatus` for RESO-compliant, industry-standard filtering
* **Legacy**: Use `status` and `lastStatus` together for detailed legacy workflow tracking

2. Don't mix approaches - Use either standardStatus OR the status/lastStatus combination, never both
3. When using legacy filtering:

* Always combine `status` with `lastStatus` for meaningful results
* Some lastStatus values are specific to certain status values (A or U)

4. **Refer to documentation** - For lastStatus values, always check the [definitions guide](https://help.repliers.com/en/article/laststatus-definitions-8mokhu/) to ensure you're using the correct values

# What questions does this article answer?

* What's the difference between `status`, `lastStatus`, and `standardStatus`?  
* When should I use RESO-compliant `standardStatus` vs. legacy `status + lastStatus`?  
* How do I filter for Active, Pending, or Closed listings using `standardStatus`?  
* How do I interpret and combine `status` and `lastStatus` correctly in older implementations?  
* Why shouldn't I mix `standardStatus` with `status`/`lastStatus` in a single query?
* How do I filter for off-market or expired listings?
* How do I label listings as Sold, Leased, or De-listed in my UI?
* Can I filter for distressed properties like foreclosures?
* What happens when a listing is deleted from the MLS?