Developer Documentation
Platform Overview
Authentication
API Services
Overview Accounts Accounts: Associations Accounts: Metadata Accounts: Profile Appstore: Users Broker Distributions Broker Tours Consumers Consumers: Linked Agents Contacts Contacts: Activity Contacts: Export Contacts: Tags Contacts: Portal Accounts Developers: Identities Developers: Keys Developers: Authorizations Developers: Billing Summary Developers: Change History Developers: Domains Developers: News Feed Webhooks Developers: Roles Developers: Syndications Developers: Templates Developers: Usage Detail Developers: Usage Summary Devices Flexmls: Email Links Flexmls: Listing Meta Origins Flexmls: Listing Meta Translations Flexmls: Listing Meta Field List Translations Flexmls: Listing Reports Flexmls: Listing Updates IDX IDX Links Listing Carts Listing Carts: Portal/VOW Carts Incomplete Listings Incomplete Listings: Documents Incomplete Listings: Documents Metadata Incomplete Listings: Document Uploads Incomplete Listings: FloPlans Incomplete Listings: Photos Incomplete Listings: Photos Metadata Incomplete Listings: Photo Uploads Incomplete Listings: Rooms Incomplete Listings: Tickets Incomplete Listings: Units Incomplete Listings: Videos Incomplete Listings: Videos Metadata Incomplete Listings: Virtual Tours Incomplete Listings: Virtual Tours Metadata Listings Listings: Clusters Listings: Documents Listings: Documents Metadata Listings: FloPlans Listings: Historical Listings: History Listings: Hot Sheet Parameters Listings: Notes Listings: Search Parameters Listings: Open Houses Listings: Photos Listings: Photos Metadata Listings: Photo Uploads Listings: Document Uploads Listings: Rental Calendar Listings: Rooms Listings: Rules Listings: Tour of Homes Listings: Tickets Listings: Units Listings: Validation Listings: Videos Listings: Videos Metadata Listings: Virtual Tours Listings: Virtual Tours Metadata Listing Meta: Custom Fields Listing Meta: Custom Field Groups Listing Meta: Field Order Listing Meta: Field Relations Listing Meta: Property Types Listing Meta: Rooms Listing Meta: Standard Fields Listing Meta: Units Registered Listings Market Statistics Messages News Feed News Feed: Curation News Feed: Events News Feed: Groups News Feed: Metadata News Feed: Restrictions News Feed: Schedule News Feed: Settings News Feed: Templates Notifications Open Houses Portals Portal Groups Portal Groups: Current Portal Groups: Tags Portals: Listing Categories Portals: Metadata Preferences Properties Properties: Clusters Properties Meta: Standard Fields Saved Searches Saved Searches: Provided Saved Searches: Restrictions Saved Searches: Tags Search Templates: Quick Searches Search Templates: Views Search Templates: Sorts Shared Links System Info System Info: Languages System Info: Search Templates
API Explorer
Supporting Documentation
Examples
RESO Web API
RETS
Terms of Use

Example: Making Fast API Requests

While we strive to make the API as fast as possible, many performance factors are dependant on the API client itself. Below are some tips for improving the overall performance of your application as it interacts with the API.

 
  1. Authentication
  2. Compress large responses
  3. Use the _select parameter
  4. _expand wisely
  5. Be scrutinous when choosing a JSON parser
 

Step 1: Authentication

This example expects that you have already obtained an OAuth 2 authorization token to access a user's data. Read more on our OpendID Connect Authentication and OAuth 2 Authorization.

 

Step 2: Compress large responses

Especially for responses with large payloads, requesting the response be gzipped will save a significant amount of transmission time. Remember that if your response is compressed, you will need to uncompress it prior to processing.

In the example below, we are requesting that the response be gzipped by the following header:

Accept-Encoding: gzip, deflate
 
$ curl "https://sparkapi.com/v1/standardfields" -H "X-SparkApi-User-Agent: SparkAPIExamples" -H "Authorization: OAuth MY_OAUTH2_ACCESS_TOKEN" -H "Accept-Encoding: gzip, deflate" 
---- THE RESPONSE WILL BE COMPRESSED ----
 
 

Step 3: Use the _select parameter

The Attribute Selection Parameter greatly reduces the size of data payloads by returning only the fields you plan to use. Typically a few unselected fields will also be present, such as the Id for each record and any relevant Compliance Rules.

 
$ curl "https://sparkapi.com/v1/listings?_select=ListingId,City,StateOrProvince,PostalCode" -H "X-SparkApi-User-Agent: SparkAPIExamples" -H "Authorization: OAuth MY_OAUTH2_ACCESS_TOKEN" {"X-Frame-Options"=>"SAMEORIGIN", "X-XSS-Protection"=>"1; mode=block", "X-Content-Type-Options"=>"nosniff"} 
{
    "D": {
        "Success": true,
        "Results": [
          {
            "Id":"20100000000000000000000000",
            "StandardFields": { 
              "ListingId":"1000000",
              "City":"Fargo",
              "PostalCode":"58102",
              "MlsId":"20090000000000000000000000",
              "StateOrProvince":"ND"
            },
            "DisplayCompliance": { 
              "View":"Detail",
              "IDXLogoSmall": {
                "LogoUri":"IDX",
                "Type":"Text"
              },
              "IDXLogo": {
                "LogoUri":null,
                "Type":"Text"
              }
            }
          }
        ]
    }
}
 
 

Step 4: _expand wisely

Expansions are not included in the default response for good reason: they tend to slow things down, either by requiring more work of the API or by significantly increasing the response size. Thus, only request an expansion when you need it, and look for alternatives to larger expansions when available (e.g. consider using the PrimaryPhoto expansion over the Photos expansion in the Listings service.

The response below is abridged for clarity.

 
$ curl "https://sparkapi.com/v1/listings/20100000000000000000000000?_expand=PrimaryPhoto" -H "X-SparkApi-User-Agent: SparkAPIExamples" -H "Authorization: OAuth MY_OAUTH2_ACCESS_TOKEN" {"X-Frame-Options"=>"SAMEORIGIN", "X-XSS-Protection"=>"1; mode=block", "X-Content-Type-Options"=>"nosniff"} 
{
    "D": {
        "Success": true,
        "Results": [
            {
                "ResourceUri": "/vX/listings/20100000000000000000000000",
                "Id": "20100000000000000000000000",
                "StandardFields": {
                    "ListingId": "1000000",
                    "PropertyType": "A",
                    "PropertySubType": "SF",
                    "Photos": [
                        {
                            "ResourceUri": "/vX/listings/20100000000000000000000000/photos/20080917142739989238000000",
                            "Id": "20080917142739989238000000",
                            "Name": "Listing Photo",
                            "Caption": "",
                            "UriThumb": "http://photos.sparkplatform.com/demomls/20080917142739989238000000-t.jpg",
                            "Uri300": "http://photos.sparkplatform.com/demomls/20080917142739989238000000.jpg",
                            "Uri640": "http://resize.sparkplatform.com/demomls/640x480/true/20080917142739989238000000-o.jpg",
                            "Uri800": "http://resize.sparkplatform.com/demomls/800x600/true/20080917142739989238000000-o.jpg",
                            "Uri1024": "http://resize.sparkplatform.com/demomls/1024x768/true/20080917142739989238000000-o.jpg",
                            "Uri1280": "http://resize.sparkplatform.com/demomls/1280x1024/true/20080917142739989238000000-o.jpg",
                            "UriLarge": "http://photos.sparkplatform.com/demomls/20080917142739989238000000-o.jpg",
                            "Primary": true
                        }
                    ]
                }
            }
        ]
    }
}
 
 

Step 5: Be scrutinous when choosing a JSON parser

JSON parsing takes time, and all parsers are not equal. Test out your parser of choice on a large set of JSON data even before you run into speed issues to be sure your parser selection is optimal.