The Search transaction is used to query and retrieve available offices, agents, and properties from the MLS® IDX API.
https://sample.MLSIDXAPI.com/Search.svc/Search
Request Arguments
Argument | Type | Description | Default | Required | Supported Values |
---|---|---|---|---|---|
Format | String | Specifies the data return format to be used for the query response. | Sandard-XML | Standard-XML Standard-XML-Encoded COMPACT COMPACT-Decoded | |
SearchType | String | Specifies the resource type to be returned in the query response. | RETS 1.7.2 | Office Agent Property | |
Class | String | Defines the class of data within the selected SearchType . | RETS 1.7.2 | Office Agent Property | |
QueryType | String | Specifies the language in which the query is submitted. | RETS 1.7.2 | DMQL2 | |
Query | String | Defines the query statement that will be executed by the server. | RETS 1.7.2 | (ID=*)or(ID=0+) (,ID=1*9Digit (,1*9Digit)) LastUpdated=RETSDateType) | |
Select | String | Specifies which fields should be returned in the query response. (Supported in COMPACT format only). | All elements | See list of elements in Appendix J – Property Details Payload (Compact) | |
Count | Integer | Determines whether the server response should include a count of matching records. | 1 | 0 – results only 1 – record count and results 2 – record count only | |
Limit | String | Specifies a maximum number of records to be returned in the search results. | “None” | “None” 1*9Digit (greater than 0, maximum of 100) | |
Offset | Integer | Specifies an offset value, instructing the server to begin returning results from a position other than the first record in the matching set. | 1 | “None” 1*9Digit (greater than 0, maximum of 100) | |
Culture | String | Defines how the results are localized, such as adapting data to a specific region or language setting. | en-CA | en-CA fr-CA |
Query Parameters Supported
Query Parameter | Type | Resource | Required | Description |
---|---|---|---|---|
LastUpdated | RETSDateTime | Office Agent Property | Limits response to only those resources that have been updated since the supplied date/time. Example: 2011-05-08T22:0:17Z | |
ID | 1*9Digit (,1*Digit) – or – String | Office Agent Property | MLS® IDX API | Single or comma separated list of IDs to include in the response. – or – Asterisk (*) or (0+), which signifies all available records will be returned |
Note
When specific records are requested using the ID parameter, the LastUpdated filter is ignored. Matching records will be returned regardless of their last update time.
Select Parameters Supported
This server implementation does not support customizing the response content using Select arguments.
Search Response Body Format
<?xml version"1.0" encoding="UTF-8"?>
<RETS ReplyText="Operation Successful" ReplyCode="0">
<RETS-RESPONSE>
(<Pagination>)
(Office Payload)
(OfficeDetails Payload)
(Agent Payload)
(AgentDetails Payload)
(Property Payload)
(PropertyDetails Payload)
</RETS-RESPONSE>
</RETS>
Pagination
When the server receives a request asking for record count to be provided, a Pagination element is returned as part of the response.
Attribute | Description |
---|---|
Total Records | Indicates the total number of records that match the search criteria. |
Limit | Specifies the number of records returned in a single page. This value equals the Limit parameter if provided; otherwise, it defaults to the system’s standard page size. |
Offset | Indicates the starting record position within a set of paged search results. |
TotalPages | Indicates the total number of pages available based on the search criteria and pagination settings. |
RecordsReturned | Specifies the number of records returned in the current result set. |
Difference Between Compact and Standard-XML
Compact format payloads contain tabular data wrapped in an XML structure, following the RETS 1.7.2 standard (see RESO specifications). A <COLUMNS>
element defines the table headers, and each record is represented as a single, flat <DATA>
element.
Because the Compact format is consistent across RETS servers, many commonly available RETS tools and libraries are designed to work directly with it. The MLS IDX API provides Compact data as described in the RESO Data Dictionary 1.0 (see RESO Data Dictionary). With the exception of some legacy analytics elements (retained for backward compatibility), all payload elements originate from this dictionary.
Compact support for Agent and Office searches will be introduced once the RESO Data Dictionary includes finalized standards for these resources.
Limitations:
The RESO Data Dictionary 1.0 has a few known limitations, such as:
- Support for a maximum of 2 agents per property
- Support for up to 20 rooms per property
- Several data elements that are available in Standard-XML format are not currently represented in the Data Dictionary
Standard-XML
Standard-XML is the default format for search transactions. Payloads contain fully structured XML that mirrors the data provided by boards and associations as closely as possible.
Unless you are specifically using RETS tools that support only Compact format, it is recommended to use Standard-XML whenever possible for maximum compatibility and accuracy.
Difference Between STANDARD-XML and STANDARD-XML-Encoded
The STANDARD-XML format returns field data in a fully expanded, human-readable form. In contrast, the STANDARD-XML-Encoded format returns data in coded form, with a matching lookup available in the metadata.
The corresponding LookupType table contains four values:
- MetadataEntryID
- Value
- LongValue
- ShortValue
Example:
- A property might have a
LandscapeFeatures
value of “Vegetable garden”. - If requested in STANDARD-XML, the response will return just the text value:
Vegetable garden
- If requested in STANDARD-XML-Encoded, the response will return the text value along with the associated code and the name of the lookup table that contains the
Value/LongValue
pairs.
Comparison:
- STANDARD-XML provides a lighter payload, making storage and display simpler.
- STANDARD-XML-Encoded allows for more normalized data storage, enabling more advanced and flexible search capabilities.
STANDARD-XML | <LandscapeFeatures>Landscaped, Vegetable Garden</LandscapeFeatures> |
STANDARD-XML-Encoded | <LandscapeFeatures ID=”1.3″ LookupName=”LandscapeFeatures”>Landscaped, Vegetable garden </LandscapeFeatures> |
Measurement Handling in STANDARD-XML vs. STANDARD-XML-Encoded
Another key difference between STANDARD-XML and STANDARD-XML-Encoded formats is how measurement values are returned:
- In STANDARD-XML, measurements are provided as a fully formatted string, ready for direct display (e.g., “1200 sq ft”).
- In STANDARD-XML-Encoded, measurements are separated into two parts: a numeric value and a unit type ID.
The Unit attribute returned in the encoded format can be cross-referenced with the values provided by the MeasureUnit lookup in the metadata.
STANDARD-XML | <SizeFrontage>125 sqft</SizeFrontage> |
STANDARD-XML-Encoded | <SizeFrontage Unit=”1″>125</SizeFrontage> |