Open House API¶
Reference for the open house client and its convenience helpers.
Overview¶
OpenHouseClient wraps the OpenHouse resource and exposes helper methods for common workflows such as agent-specific schedules, date-range filters, and property expansion.
Common helpers¶
get_open_houses()get_open_house()get_upcoming_open_houses()get_open_houses_for_property()get_open_houses_by_agent()get_active_open_houses()get_open_houses_with_property()get_modified_open_houses()get_open_houses_by_date_range()get_weekend_open_houses()
Client Reference¶
wfrmls.openhouse.OpenHouseClient ¶
Bases: BaseClient
Client for open house schedule API endpoints.
The OpenHouse resource contains information about scheduled open house events, including dates, times, showing agents, and related property information. All timestamps are in UTC format.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
bearer_token | Optional[str] | Bearer token for authentication | None |
base_url | Optional[str] | Base URL for the API | None |
Source code in wfrmls/openhouse.py
Functions¶
get_active_open_houses ¶
Get open houses with Active status.
Convenience method to retrieve only active open houses. Filters out ended, cancelled, or expired open house events.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
**kwargs | Any | Additional OData parameters (top, select, orderby, etc.) | {} |
Returns:
| Type | Description |
|---|---|
Dict[str, Any] | Dictionary containing active open house listings |
Example
# Get all active open houses
active_opens = client.openhouse.get_active_open_houses(
orderby="OpenHouseStartTime asc",
top=100
)
# Get active open houses with property details
active_with_props = client.openhouse.get_active_open_houses(
expand="Property",
select=["OpenHouseKey", "ListingKey", "OpenHouseStartTime", "OpenHouseStatus"],
top=50
)
Source code in wfrmls/openhouse.py
get_modified_open_houses ¶
Get open houses modified since a specific date/time.
Used for incremental data synchronization to get only open house records that have been updated since the last sync. Essential for maintaining up-to-date scheduling information.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
since | Union[str, date, datetime] | ISO format datetime string, date object, or datetime object for cutoff time | required |
**kwargs | Any | Additional OData parameters | {} |
Returns:
| Type | Description |
|---|---|
Dict[str, Any] | Dictionary containing open houses modified since the specified time |
Example
from datetime import datetime, timedelta, timezone
# Get open houses modified in last 15 minutes (recommended sync interval)
cutoff_time = datetime.now(timezone.utc) - timedelta(minutes=15)
updates = client.openhouse.get_modified_open_houses(
since=cutoff_time
)
# Get open houses modified since yesterday
yesterday = datetime.now(timezone.utc) - timedelta(days=1)
updates = client.openhouse.get_modified_open_houses(
since=yesterday,
orderby="ModificationTimestamp desc"
)
Source code in wfrmls/openhouse.py
get_open_house ¶
Get open house by open house key.
Retrieves a single open house record by its unique open house key. This is the most efficient way to get detailed information about a specific open house event.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
open_house_key | str | Open house key to retrieve (unique identifier) | required |
Returns:
| Type | Description |
|---|---|
Dict[str, Any] | Dictionary containing open house data for the specified event |
Raises:
| Type | Description |
|---|---|
NotFoundError | If the open house with the given key is not found |
WFRMLSError | If the API request fails |
Example
# Get specific open house by key
open_house = client.openhouse.get_open_house("306227")
print(f"Open House: {open_house['OpenHouseStartTime']} - {open_house['OpenHouseEndTime']}")
print(f"Property: {open_house['ListingKey']}")
print(f"Agent: {open_house['ShowingAgentFirstName']} {open_house['ShowingAgentLastName']}")
Source code in wfrmls/openhouse.py
get_open_houses ¶
get_open_houses(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]
Get open houses with optional OData filtering.
This method retrieves open house schedule information with full OData v4.0 query support. All timestamps are returned in UTC format.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
top | Optional[int] | Number of results to return (OData $top, max 200 per API limit) | None |
skip | Optional[int] | Number of results to skip (OData $skip) - use with caution for large datasets | None |
filter_query | Optional[str] | OData filter query string for complex filtering | None |
select | Optional[Union[List[str], str]] | Fields to select (OData $select) - can be list or comma-separated string | None |
orderby | Optional[str] | Order by clause (OData $orderby) for result sorting | None |
expand | Optional[Union[List[str], str]] | Related resources to include (OData $expand) - can be list or comma-separated string | None |
count | Optional[bool] | Include total count in results (OData $count) | None |
Returns:
| Type | Description |
|---|---|
Dict[str, Any] |
Raises:
| Type | Description |
|---|---|
WFRMLSError | If the API request fails |
ValidationError | If OData query parameters are invalid |
RateLimitError | If the rate limit is exceeded |
Example
# Get upcoming open houses
open_houses = client.openhouse.get_open_houses(
filter_query="OpenHouseStartTime gt '2023-12-01T00:00:00Z'",
orderby="OpenHouseStartTime asc",
top=50
)
# Get open houses with property info
open_houses = client.openhouse.get_open_houses(
expand="Property",
top=25
)
# Get open houses with specific fields only
open_houses = client.openhouse.get_open_houses(
select=["OpenHouseKey", "ListingKey", "OpenHouseStartTime", "OpenHouseEndTime"],
top=100
)
Source code in wfrmls/openhouse.py
get_open_houses_by_agent ¶
Get open houses by showing agent.
Convenience method to filter open houses by the agent conducting them. Useful for finding all open houses managed by a specific agent.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
agent_key | str | Showing agent key to filter by | required |
**kwargs | Any | Additional OData parameters | {} |
Returns:
| Type | Description |
|---|---|
Dict[str, Any] | Dictionary containing open houses for the specified agent |
Example
Source code in wfrmls/openhouse.py
get_open_houses_by_date_range ¶
get_open_houses_by_date_range(start_date: Union[str, date, datetime], end_date: Union[str, date, datetime], **kwargs: Any) -> Dict[str, Any]
Get open houses within a specific date range.
Convenience method to retrieve open houses scheduled between two dates.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
start_date | Union[str, date, datetime] | Start date for the range (ISO format string, date, or datetime object) | required |
end_date | Union[str, date, datetime] | End date for the range (ISO format string, date, or datetime object) | required |
**kwargs | Any | Additional OData parameters | {} |
Returns:
| Type | Description |
|---|---|
Dict[str, Any] | Dictionary containing open houses within the specified date range |
Example
Source code in wfrmls/openhouse.py
get_open_houses_for_property ¶
Get open houses for a specific property.
Convenience method to filter open houses by property listing key. Useful for finding all scheduled showings for a particular property.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
listing_key | str | Property listing key to filter by | required |
**kwargs | Any | Additional OData parameters | {} |
Returns:
| Type | Description |
|---|---|
Dict[str, Any] | Dictionary containing open houses for the specified property |
Example
# Get all open houses for a property
property_opens = client.openhouse.get_open_houses_for_property(
listing_key="1625740",
orderby="OpenHouseStartTime asc"
)
# Get upcoming open houses for property
upcoming_opens = client.openhouse.get_open_houses_for_property(
listing_key="1625740",
filter_query="OpenHouseStartTime gt '2023-12-01T00:00:00Z'"
)
Source code in wfrmls/openhouse.py
get_open_houses_with_property ¶
Get open houses with their property information expanded.
This is a convenience method that automatically expands the Property relationship to include property details in the response. More efficient than making separate requests for open houses and their properties.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
**kwargs | Any | OData parameters (top, filter_query, select, etc.) | {} |
Returns:
| Type | Description |
|---|---|
Dict[str, Any] | Dictionary containing open house data with expanded Property relationships |
Example
# Get upcoming open houses with property info
opens_with_props = client.openhouse.get_open_houses_with_property(
filter_query="OpenHouseStartTime gt '2023-12-01T00:00:00Z'",
orderby="OpenHouseStartTime asc",
top=25
)
# Access property info for first open house
first_open = opens_with_props['value'][0]
if 'Property' in first_open:
property_info = first_open['Property']
print(f"Open house for: {property_info['UnparsedAddress']}")
Source code in wfrmls/openhouse.py
get_upcoming_open_houses ¶
Get upcoming open houses.
Convenience method to retrieve open houses scheduled for the near future.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
days_ahead | Optional[int] | Number of days ahead to search (default: 7) | 7 |
**kwargs | Any | Additional OData parameters (top, select, orderby, etc.) | {} |
Returns:
| Type | Description |
|---|---|
Dict[str, Any] | Dictionary containing upcoming open house listings |
Example
# Get open houses for next 3 days
upcoming = client.openhouse.get_upcoming_open_houses(
days_ahead=3,
orderby="OpenHouseStartTime asc",
top=50
)
# Get this week's open houses
weekend_opens = client.openhouse.get_upcoming_open_houses(
days_ahead=7,
expand="Property",
select=["OpenHouseKey", "ListingKey", "OpenHouseStartTime", "OpenHouseEndTime"]
)
Source code in wfrmls/openhouse.py
get_weekend_open_houses ¶
Get weekend open houses.
Convenience method to retrieve open houses scheduled for weekends.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
weeks_ahead | Optional[int] | Number of weeks ahead to search (default: 2) | 2 |
**kwargs | Any | Additional OData parameters | {} |
Returns:
| Type | Description |
|---|---|
Dict[str, Any] | Dictionary containing weekend open house listings |
Example
Source code in wfrmls/openhouse.py
Related Enums¶
wfrmls.openhouse.OpenHouseStatus ¶
Bases: Enum
OpenHouse status options.
wfrmls.openhouse.OpenHouseType ¶
Bases: Enum
OpenHouse type options.
wfrmls.openhouse.OpenHouseAttendedBy ¶
Bases: Enum
Who attends the open house.