API Get MLS Field Values

This API provides a programming method for extracting the data values for a field in the MLS / IDX data set.

Values are returned as a JSON array.

The application of filters allow you to narrow down the set of values you require.

Note: This method requires advanced programming skills.

How to Use the API

The API is called at a unique URL as follows:

$url = "https://www.mbb2.com/client-api/lookup-field/auth_key/[YOUR_API-AUTHCODE]/?field=[FIELD_NAME]&filter=mls_id:[YOUR_BB_MLS_ID]";
$url = str_replace("+", "%2B", $url);
$json = file_get_contents( $url );
$data = json_decode( $json );

Explanation:

  • The first line uses a filter string that can be generated by the Widget Wizards
  • The next line does a string replace of "+" signs

Parameters

[FIELD_NAME] (required)

You can discover the field names for your MLS by creating a custom search link in the Widgets section of your Buying Buddy account and inspecting the filter string that is generated.

[YOUR_BB_MLS_ID] (required)

This is the Buying Buddy "mls_id" code for your MLS. Again this is displayed when you generate a filter using the Widget wizards in your Buying Buddy dashboard.

[YOUR_API-AUTHCODE] (required)

Your "API-Authcode" authenticates your use of the JavaScript code on your "authorized website(s)" for API calls.

This is the API-Authcode for your Buying Buddy account. To get the API-Authcode - login to your Buying Buddy account and go to Account > Account Settings, then go to the "Preferences" tab. Scroll down to see your account API-Authcode.

For example:
If your mls_id is "co85", and the field name for subdivision is "sub_area", then the following would extract a unique list of all the sub division names as an array (*make sure you use your own API-Authcode)

$url = "https://www.mbb2.com/client-api/lookup-field/auth_key/[YOUR_API-AUTHCODE]/?field=sub_area&filter=mls_id:co85";
$url = str_replace("+", "%2B", $url);
$json = file_get_contents( $url );
$data = json_decode( $json );

Other Filter Parameters for "discovered" or "precise" lists

Without any additional parameters, the API will return the full set of available values for that field according to one of two approaches

  1. If the field is a lookup field, then the values will be extracted from the lookup field in the IDX/ RETS data feed
  2. If the field is not a lookup field, then then the API will search ALL properties to find all the unique values currently in the database for that field
  3. Additionally, if you add add extra filter parameters to the API call this forces the discovery method to only return the unique list of values that are present on the sub-set of properties matching the filter.

These method allow you to create a precise lists of values from lookup fields such as city, property type etc

Or, where a field is not a lookup field, the API will discover all the values that are present in the subset of properties you define, e.g. zip code.

For example:
If you wish to return the list of all the zip codes from the Denver MLS, with properties in the Broomfield (city), then the API call would look like this (*make sure you use your own Auth Key):

$url = "https://www.mbb2.com/client-api/lookup-field/auth_key/[YOUR_API-AUTHCODE_HERE]/?field=zip_code&filter=mls_id:denver+city:broomfield";
$url = str_replace("+", "%2B", $url);
$json = file_get_contents( $url );
$data = json_decode( $json );


Updated on December 30, 2023

Was this article helpful?

Related Articles

Need Support?
Can't find the answer you're looking for?
Contact Support
Buying Buddy Support