8. Search Transaction

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

ArgumentTypeDescriptionDefaultRequiredSupported Values
FormatStringSpecifies the data return format to be used for the query response.Sandard-XMLStandard-XML
Standard-XML-Encoded
COMPACT
COMPACT-Decoded
SearchTypeStringSpecifies the resource type to be returned in the query response.RETS 1.7.2Office
Agent
Property
ClassStringDefines the class of data within the selected SearchType.RETS 1.7.2Office
Agent
Property
QueryTypeStringSpecifies the language in which the query is submitted. RETS 1.7.2DMQL2
QueryStringDefines 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)
SelectStringSpecifies which fields should be returned in the query response. (Supported in COMPACT format only).All elementsSee list of elements in Appendix J – Property Details Payload (Compact)
CountIntegerDetermines whether the server response should include a count of matching records.10 – results only
1 – record count and results
2 – record count only
LimitStringSpecifies a maximum number of records to be returned in the search results.“None”“None”
1*9Digit (greater than 0, maximum of 100)
OffsetIntegerSpecifies 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)
CultureStringDefines how the results are localized, such as adapting data to a specific region or language setting.en-CAen-CA
fr-CA

Query Parameters Supported

Query ParameterTypeResourceRequiredDescription
LastUpdatedRETSDateTimeOffice
Agent
Property
Limits response to only those resources that have been updated since the supplied date/time.
Example: 2011-05-08T22:0:17Z
ID1*9Digit
(,1*Digit)
– or –
String
Office
Agent
Property
MLS® IDX APISingle 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.

AttributeDescription
Total RecordsIndicates the total number of records that match the search criteria.
LimitSpecifies 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.
OffsetIndicates the starting record position within a set of paged search results.
TotalPagesIndicates the total number of pages available based on the search criteria and pagination settings.
RecordsReturnedSpecifies 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>

SHARE POST:

Facebook
Reddit
LinkedIn

AgentDetails Payload

Parent Cardinality Name Type Description Lookup AgentDetails 1 Name String The name of the Agent AgentDetails 1 ID Integer (Attribute) Unique ID assigned to the

Read More »

Agent Payload

Parent Cardinality Name Type Description Lookup Agent 1 ID Integer (Attribute) Unique ID assigned to the Agent Agent 1 LastUpdated DateTime (Attribute) The date agent

Read More »

OfficeDetails Payload

Parent Cardinality Name Type Description Lookup OfficeDetails 1 Name String The name of the Office OfficeDetails 1 ID Integer Unique ID assigned to the Office

Read More »

Office Payload

Parent Cardinality Name Type Description Lookup Office 1 ID Integer Unique ID assigned to the office Office 1 Last Updated DateTime The date the office

Read More »