Property queries and listing lookups¶
client.property provides PropertyClient. Collection methods return the server's JSON dictionary; get_property() returns a single listing dictionary.
Query a collection¶
get_properties(top=None, skip=None, filter_query=None, select=None, orderby=None, expand=None, count=None) sends a GET to Property. search_properties() has the same parameters and delegates to it.
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
top | int \| None | No | $top; values above 200 are clamped to 200 | None |
skip | int \| None | No | $skip offset | None |
filter_query | str \| None | No | $filter expression passed to the server | None |
select | list[str] \| str \| None | No | $select; lists become comma-separated strings | None |
orderby | str \| None | No | $orderby expression | None |
expand | list[str] \| str \| None | No | $expand; lists become comma-separated strings | None |
count | bool \| None | No | $count becomes true or false | None |
Omitted parameters are not sent. The wrapper does not validate field names, enum values, filter syntax, or positive pagination values. Check your metadata for supported fields and relationships.
With WFRMLS_BEARER_TOKEN configured:
from wfrmls import WFRMLSClient
client = WFRMLSClient()
response = client.property.get_properties(
top=25,
filter_query="StandardStatus eq 'Active' and City eq 'Salt Lake City'",
select=["ListingId", "ListPrice", "City"],
orderby="ListPrice desc",
count=True,
)
print("Returned records:", len(response.get("value", [])))
print("Server count:", response.get("@odata.count"))
@odata.count, when supplied by the server, is separate from the number of returned records. Collection methods make one request and do not follow @odata.nextLink automatically.
Retrieve one property by numeric key¶
get_property(listing_id) converts the supplied string to an integer and requests Property(<number>). It cannot look up arbitrary alphanumeric ListingKey values.
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
listing_id | str | Yes | Numeric key accepted by int() | — |
from wfrmls import WFRMLSClient
client = WFRMLSClient()
listing = client.property.get_property("12345")
print(listing.get("ListingId"), listing.get("ListPrice"))
A direct object response is returned unchanged. If the response contains a value array, the first object is returned. An empty array raises NotFoundError; a non-list value or non-object first item raises WFRMLSError. A nonnumeric string raises ValidationError before a request.
Use the supported search helpers¶
All collection helpers below return a JSON dictionary. Their **kwargs must be accepted by get_properties(); arbitrary OData keywords are not forwarded.
| Helper | Filter or behavior | Default |
|---|---|---|
get_active_properties(**kwargs) | StandardStatus eq 'Active' | No pagination default |
get_properties_by_price_range(min_price=None, max_price=None, **kwargs) | Inclusive ListPrice ge/le comparisons | No price restriction |
get_properties_by_city(city, **kwargs) | City eq '<city>'; combines filter_query with and | City required |
get_properties_with_media(**kwargs) | Sets $expand=Media | No extra filter |
get_modified_properties(since, **kwargs) | ModificationTimestamp gt <cutoff> | Cutoff required |
get_luxury_properties(min_price=1000000, **kwargs) | Minimum price and Active status; combines filters | 1,000,000 |
get_new_listings(days_back=7, **kwargs) | OnMarketDate gt <UTC date>; combines filters | 7 days |
The active, price-range, and modified-property helpers supply their own filter_query. Do not pass another filter_query to those helpers when they build a filter: Python raises a duplicate-keyword TypeError. Use get_properties() for combined filters instead. Likewise, do not pass expand to get_properties_with_media().
Use PropertyStatus.ACTIVE.value or a string when building filters. The enums contain constants; collection methods do not convert enum objects.
from datetime import datetime, timedelta, timezone
from wfrmls import WFRMLSClient
client = WFRMLSClient()
city_page = client.property.get_properties_by_city(
"Salt Lake City", filter_query="ListPrice le 600000", top=25
)
cutoff = (datetime.now(timezone.utc) - timedelta(hours=1)).isoformat()
updates = client.property.get_modified_properties(since=cutoff, top=100)
print(len(city_page.get("value", [])), len(updates.get("value", [])))
Prefer an explicit UTC datetime string for modification cutoffs. The helper removes +00:00 and trailing Z, then appends Z; other offsets are not converted to UTC. date objects are accepted but become date-only text with Z. Numeric zero values are not validated or normalized elsewhere.
Combine criteria in a dictionary¶
search_properties_by_multiple_criteria(criteria, **kwargs) builds filters for these exact keys:
| Criteria keys | Property fields |
|---|---|
status, property_type | StandardStatus, PropertyType |
min_price, max_price | ListPrice |
city, zip_code, school_district | City, PostalCode, SchoolDistrict |
min_bedrooms, max_bedrooms | BedroomsTotal |
min_bathrooms, max_bathrooms | BathroomsTotalInteger |
min_sqft, max_sqft | LivingArea |
Unknown keys and falsey values, including numeric zero, are ignored. Existing filter_query is joined with and without added parentheses. Text values are inserted into expressions without escaping; build properly escaped OData literals yourself for text containing apostrophes.
Pagination and partial results¶
get_all_properties_paginated(page_size=200, max_pages=None, **kwargs) sends repeated $top/$skip queries. It replaces any supplied top and skip, clamps page_size above 200, and accumulates records in memory.
The return dictionary contains value, @odata.context, and pagination_info with pages_fetched, total_records, page_size, and last_skip. @odata.count is copied only if it appears in the last response.
This helper catches request exceptions and returns accumulated results without an error marker. An empty result can therefore mean an empty dataset or failure on the first request. A successful-looking dictionary does not prove a complete sync. Use explicit page requests with your own error handling when completeness matters.
Use a positive page_size and a positive max_pages when limiting work. max_pages=None or 0 adds no page limit. The helper stops after an empty/short page or the requested page limit; it does not follow next links.
Location helper limitations¶
search_properties_by_radius(...)andsearch_properties_by_polygon(...)always raiseValidationErrorbefore an HTTP request.search_properties_near_address(address, radius_miles=5.0, **kwargs)only splits a comma-delimited address and filters on its second-to-last component as a city. It does not geocode, calculate distance, or useradius_miles.- An address without a comma returns
{"value": [], "@odata.context": "", "error": "..."}locally.
Use a city or other verified field filter for server-side location queries. The compatibility notes explain the boundary between implemented request behavior and current provider availability.
Generated method and enum reference¶
Property client for WFRMLS API.
Classes¶
PropertyClient ¶
PropertyClient(
bearer_token: Optional[str] = None, base_url: Optional[str] = None
)
Bases: BaseClient
Build Property collection queries and numeric-key lookups.
Collection queries return provider JSON without pagination or schema validation. Single-property lookups normalize a wrapped value array to its first object. Radius/polygon methods are disabled; address search only extracts a city.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
bearer_token | Optional[str] | Explicit token, or None to use WFRMLS_BEARER_TOKEN. | None |
base_url | Optional[str] | OData service root, or None for the package default. | None |
Raises:
| Type | Description |
|---|---|
AuthenticationError | If neither an explicit nor environment token exists. |
Methods:¶
get_active_properties ¶
get_active_properties(**kwargs: Any) -> Dict[str, Any]
Request a Property page filtered by StandardStatus eq 'Active'.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
**kwargs | Any | get_properties parameters, excluding filter_query. | {} |
Returns:
| Type | Description |
|---|---|
Dict[str, Any] | Provider collection JSON. Use get_properties for a combined custom filter. |
get_all_properties_paginated ¶
get_all_properties_paginated(
page_size: int = 200, max_pages: Optional[int] = None, **kwargs: Any
) -> Dict[str, Any]
Accumulate Property pages with repeated $top and $skip requests.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
page_size | int | Positive page size; values above 200 are clamped to 200. | 200 |
max_pages | Optional[int] | Positive page limit, or None/0 for no limit. | None |
**kwargs | Any | get_properties parameters; supplied top and skip are replaced. | {} |
Returns:
| Type | Description |
|---|---|
Dict[str, Any] | Dictionary with combined value, @odata.context, and pagination_info containing |
Dict[str, Any] | pages_fetched, total_records, page_size, and last_skip. A count is copied |
Dict[str, Any] | only when present in the last response. |
Note
Any request exception stops pagination and returns accumulated records without an error marker. Empty or partial results do not prove a complete sync. The helper uses offsets, does not follow next links, and keeps all records in memory. Use explicit error-checked pages when completeness matters.
get_luxury_properties ¶
get_luxury_properties(
min_price: float = 1000000, **kwargs: Any
) -> Dict[str, Any]
Filter active properties with ListPrice at or above min_price.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
min_price | float | Inclusive price threshold, default 1000000. | 1000000 |
**kwargs | Any | get_properties parameters, including optional filter_query. | {} |
Returns:
| Type | Description |
|---|---|
Dict[str, Any] | Provider collection JSON from one page; additional filters are joined with and. |
get_modified_properties ¶
get_modified_properties(
since: Union[str, date], **kwargs: Any
) -> Dict[str, Any]
Filter ModificationTimestamp with a strict greater-than cutoff.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
since | Union[str, date] | UTC datetime string or date. Strings strip +00:00/trailing Z and append Z. | required |
**kwargs | Any | get_properties parameters, excluding filter_query. | {} |
Returns:
| Type | Description |
|---|---|
Dict[str, Any] | Provider collection JSON from one page. |
Note
A date becomes date-only text followed by Z. Other timezone offsets are not converted to UTC; prefer an explicit normalized UTC datetime string.
get_new_listings ¶
get_new_listings(days_back: int = 7, **kwargs: Any) -> Dict[str, Any]
Filter OnMarketDate after a UTC date computed from days_back.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
days_back | int | Number of days subtracted from the current UTC datetime, default 7. | 7 |
**kwargs | Any | get_properties parameters, including optional filter_query. | {} |
Returns:
| Type | Description |
|---|---|
Dict[str, Any] | Provider collection JSON from one page. The cutoff is date-only text. |
get_properties ¶
get_properties(
top: Optional[int] = None,
skip: Optional[int] = None,
filter_query: Optional[str] = None,
select: Optional[Union[List[str], str]] = None,
orderby: Optional[str] = None,
expand: Optional[Union[List[str], str]] = None,
count: Optional[bool] = None,
) -> Dict[str, Any]
Request one Property collection page with named OData parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
top | Optional[int] | Optional $top; values above 200 are clamped to 200. | None |
skip | Optional[int] | Optional $skip offset, passed unchanged. | None |
filter_query | Optional[str] | Optional raw $filter expression. | None |
select | Optional[Union[List[str], str]] | Optional field list or comma-separated $select string. | None |
orderby | Optional[str] | Optional raw $orderby expression. | None |
expand | Optional[Union[List[str], str]] | Optional relationship list or comma-separated $expand string. | None |
count | Optional[bool] | Optional $count, converted to lowercase true or false. | None |
Returns:
| Type | Description |
|---|---|
Dict[str, Any] | Parsed JSON dictionary from one request, commonly containing value. |
Dict[str, Any] | Counts, next links, and individual fields are server-provided and optional. |
Raises:
| Type | Description |
|---|---|
WFRMLSError | For shared HTTP or transport failures. |
get_properties_by_city ¶
get_properties_by_city(city: str, **kwargs: Any) -> Dict[str, Any]
Filter by City and combine an optional filter_query with and.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
city | str | City text inserted without escaping into a quoted OData literal. | required |
**kwargs | Any | get_properties parameters, including optional filter_query. | {} |
Returns:
| Type | Description |
|---|---|
Dict[str, Any] | Provider collection JSON. The combined filter adds no grouping parentheses. |
Example
from wfrmls import WFRMLSClient
client = WFRMLSClient()
response = client.property.get_properties_by_city(
"Salt Lake City", filter_query="StandardStatus eq 'Active'", top=25
)
print(len(response.get("value", [])))
get_properties_by_price_range ¶
get_properties_by_price_range(
min_price: Optional[float] = None,
max_price: Optional[float] = None,
**kwargs: Any
) -> Dict[str, Any]
Filter ListPrice by optional inclusive lower and upper bounds.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
min_price | Optional[float] | Inclusive minimum, or None to omit it. | None |
max_price | Optional[float] | Inclusive maximum, or None to omit it. | None |
**kwargs | Any | get_properties parameters. Do not supply filter_query when a bound is set. | {} |
Returns:
| Type | Description |
|---|---|
Dict[str, Any] | Provider JSON from one page. With no bounds, forwards kwargs unchanged. |
get_properties_with_media ¶
get_properties_with_media(**kwargs: Any) -> Dict[str, Any]
Request a Property collection page with $expand=Media.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
**kwargs | Any | get_properties parameters, excluding expand. | {} |
Returns:
| Type | Description |
|---|---|
Dict[str, Any] | Provider JSON from one page; acceptance of Media expansion is server-specific. |
get_property ¶
get_property(listing_id: str) -> Dict[str, Any]
Retrieve one Property record using a numeric key URL.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
listing_id | str | Numeric string converted with int() for Property( | required |
Returns:
| Type | Description |
|---|---|
Dict[str, Any] | Direct object response, or the first object in a wrapped value array. |
Raises:
| Type | Description |
|---|---|
ValidationError | If listing_id is a nonnumeric string. |
NotFoundError | If the provider returns 404 or a wrapped empty array. |
WFRMLSError | For HTTP failures or malformed wrapped response shapes. |
search_properties ¶
search_properties(
top: Optional[int] = None,
skip: Optional[int] = None,
filter_query: Optional[str] = None,
select: Optional[Union[List[str], str]] = None,
orderby: Optional[str] = None,
expand: Optional[Union[List[str], str]] = None,
count: Optional[bool] = None,
) -> Dict[str, Any]
Alias of get_properties with the same explicit OData parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
top | Optional[int] | Optional $top; values above 200 are clamped to 200. | None |
skip | Optional[int] | Optional $skip offset, passed unchanged. | None |
filter_query | Optional[str] | Optional raw $filter expression. | None |
select | Optional[Union[List[str], str]] | Optional field list or comma-separated $select string. | None |
orderby | Optional[str] | Optional raw $orderby expression. | None |
expand | Optional[Union[List[str], str]] | Optional relationship list or comma-separated $expand string. | None |
count | Optional[bool] | Optional $count, converted to lowercase true or false. | None |
Returns:
| Type | Description |
|---|---|
Dict[str, Any] | Parsed JSON dictionary from one request, commonly containing value. |
Dict[str, Any] | Counts, next links, and individual fields are server-provided and optional. |
Raises:
| Type | Description |
|---|---|
WFRMLSError | For shared HTTP or transport failures. |
search_properties_by_multiple_criteria ¶
search_properties_by_multiple_criteria(
criteria: Dict[str, Any], **kwargs: Any
) -> Dict[str, Any]
Build a filter from the supported criteria dictionary keys.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
criteria | Dict[str, Any] | status, min/max_price, city, zip_code, school_district, property_type, min/max_bedrooms, min/max_bathrooms, and min/max_sqft. | required |
**kwargs | Any | get_properties parameters, including optional filter_query. | {} |
Returns:
| Type | Description |
|---|---|
Dict[str, Any] | Provider JSON from one filtered Property page. |
Note
Unknown keys and falsey values, including zero, are ignored. Text values are not escaped; filters are joined with and without extra parentheses.
search_properties_by_polygon ¶
search_properties_by_polygon(
polygon_coordinates: List[Dict[str, float]],
additional_filters: Optional[str] = None,
**kwargs: Any
) -> Dict[str, Any]
Reject unsupported geospatial polygon searches locally.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
polygon_coordinates | List[Dict[str, float]] | Compatibility polygon coordinate argument. | required |
additional_filters | Optional[str] | Compatibility argument; no filter is sent. | None |
**kwargs | Any | Compatibility arguments; no request is made. | {} |
Raises:
| Type | Description |
|---|---|
ValidationError | Always, before an HTTP request. |
Note
Use get_properties_by_city(city, filter_query=...) for supported server-side field filtering. This method does not verify current provider coordinate fields or calculate geographic matches.
search_properties_by_radius ¶
search_properties_by_radius(
latitude: float,
longitude: float,
radius_miles: float,
additional_filters: Optional[str] = None,
**kwargs: Any
) -> Dict[str, Any]
Reject unsupported geospatial radius searches locally.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
latitude | float | Compatibility latitude argument. | required |
longitude | float | Compatibility longitude argument. | required |
radius_miles | float | Compatibility distance argument. | required |
additional_filters | Optional[str] | Compatibility argument; no filter is sent. | None |
**kwargs | Any | Compatibility arguments; no request is made. | {} |
Raises:
| Type | Description |
|---|---|
ValidationError | Always, before an HTTP request. |
Note
Use get_properties_by_city(city, filter_query=...) for supported server-side field filtering. This method does not verify current provider coordinate fields or calculate geographic matches.
search_properties_near_address ¶
search_properties_near_address(
address: str, radius_miles: float = 5.0, **kwargs: Any
) -> Dict[str, Any]
Extract a city from a comma-delimited address and query that city.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
address | str | Text whose second-to-last comma component is treated as the city. | required |
radius_miles | float | Compatibility parameter; no distance calculation is performed. | 5.0 |
**kwargs | Any | get_properties parameters, including optional filter_query. | {} |
Returns:
| Type | Description |
|---|---|
Dict[str, Any] | Provider collection JSON for the city fallback, or an empty value list |
Dict[str, Any] | with an error string if the address has no comma. |
Note
This helper does not geocode or perform a radius search. Use get_properties_by_city(city, filter_query=...) for an explicit city query.
PropertyStatus ¶
Bases: Enum
Property status options.
PropertyType ¶
Bases: Enum
Property type options.