Select Page
View all Web API examples ▸

Michigan Regional Info Ctr

MLS Provider: FBS

A1 | Get metadata

Retrieve metadata for a specific service in OData EDMX/xml format. https://sparkapi.com/Reso/OData/$metadata Top

B2 | Filter by resource key

You can search most resources by using that resource’s unique identifier. https://sparkapi.com/Reso/OData/Property('20140701184827018171000000') Top

B3 | Filter for specific Property

There are several ways to get a single property. By ID as in this example or including the unique key (i.e. Listing Key) in the Property attribute. i.e. Property(‘23442234’). Resultant fields are dictated by the $select... https://sparkapi.com/Reso/OData/Property?$filter=ListingKey eq '20140701184827018171000000'&$select=ListingKey,BedroomsTotal,Directions,ListingContractDate,ModificationTimestamp,StandardStatus,PropertyType,Location,PublicRemarks,StreetName,StreetNumber,City Top

C4 | Filter on Boolean field

Filter results by a boolean field (true or false). Note, do not treat the value true or false as a string. https://sparkapi.com/Reso/OData/Property?$filter=FireplaceYN eq true&$top=4&$select=ListingKey,BedroomsTotal,Directions,ListingContractDate,ModificationTimestamp,StandardStatus,PropertyType,Location,PublicRemarks,StreetName,StreetNumber,City,FireplaceYN Top

C5 | Filter on multiple field values

All names in the $filter option are case sensitive and must match the names of elements provided by the metadata resource. Values are also case sensitive. https://sparkapi.com/Reso/OData/Property?$filter=BedroomsTotal lt 5 and City eq 'Holland' and (PropertyType eq 'Residential')&$top=4&$select=ListingKey,BedroomsTotal,Directions,ListingContractDate,ModificationTimestamp,StandardStatus,PropertyType,Location,PublicRemarks,StreetName,StreetNumber,City,BedroomsTotal Top

C6 | Filter on same field

Use parenthesis and logical ‘and’ or ‘or’ to group filter expressions. https://sparkapi.com/Reso/OData/Property?$filter=BedroomsTotal lt 5 or (BedroomsTotal eq 4 and FireplaceYN eq true)&$top=4&$select=ListingKey,BedroomsTotal,Directions,ListingContractDate,ModificationTimestamp,StandardStatus,PropertyType,Location,PublicRemarks,StreetName,StreetNumber,City Top

C7 | Filter on string fields

Filter a query by matching strings. Note that string comparisons are case sensitive. There are also string functions to aid with string filters but will vary depending on MLS Provider (i.e. toupper(StreetName) eq... https://sparkapi.com/Reso/OData/Member?$filter=(MemberFirstName eq 'James' or toupper(MemberFirstName) eq 'Adam')&$top=20 Top

C8 | Filter using not equal

not equal (ne) is used as to counter equal (eq) https://sparkapi.com/Reso/OData/Property?$filter=BedroomsTotal ne 3&$top=4&$select=ListingKey,BedroomsTotal,Directions,ListingContractDate,ModificationTimestamp,StandardStatus,PropertyType,Location,PublicRemarks,StreetName,StreetNumber,City Top

C9 | Filter using ‘not’ in an expression

A boolean ‘Not’ must enclose its operands in a parenthesis with not as an operator i.e. not(City eq ‘Elkwood’). https://sparkapi.com/Reso/OData/Property?$filter=not(BedroomsTotal le 3) and (PropertyType eq 'Residential')&$select=ListingKey,BedroomsTotal,Directions,ListingContractDate,ModificationTimestamp,StandardStatus,PropertyType,Location,PublicRemarks,StreetName,StreetNumber,City,BedroomsTotal&$top=10 Top

D10 | Expand Resources in results

The $expand system query option specifies the related resources to be included in line with retrieved resources. Look for the NavigationProperty in the metadata to determine if a resource is linked for expansion. https://sparkapi.com/Reso/OData/Property?$filter=City eq 'Holland' and (PropertyType eq 'Residential') and PhotosCount gt 1&$top=4&$select=ListingKey,BedroomsTotal,Directions,ListingContractDate,ModificationTimestamp,StandardStatus,PropertyType,Location,PublicRemarks,StreetName,StreetNumber,City,PhotosCount&$expand=Media Top

D11 | Sort Results

The $orderby system query option allows clients to request resources in either ascending order using asc or descending order using desc. If asc or desc not specified, then the resources will be ordered in ascending (asc) order. A compliant client SHOULD use the... https://sparkapi.com/Reso/OData/Property?$filter=BedroomsTotal lt 5 and (PropertyType eq 'Residential')&$orderby=ListPrice desc&$top=10&$select=ListingKey,BedroomsTotal,Directions,ListingContractDate,ModificationTimestamp,StandardStatus,PropertyType,Location,PublicRemarks,StreetName,StreetNumber,City Top

D12 | Return only limited number of records

Get first 10 results from query/filter. All names in the $select option are case-sensitive to match the names of elements provided by the resource. The implementation of $top and $orderby is defined by the server and may restrict what values may be used in either... https://sparkapi.com/Reso/OData/Member?$top=10&$select=MemberLastName,MemberFirstName,MemberLoginId&$filter=toupper(MemberFirstName) eq 'JOHN' Top

D13 | Skip n records and get next m records

Skip by the first 10 results and return the 2nd 10 results from a filter. If more records exist in the query than returned then using the @odata.nextLink value from the result is another way to retrieve remaining... https://sparkapi.com/Reso/OData/Member?$skip=10&$top=10&$orderby=MemberLastName&$select=MemberLastName,MemberFirstName,MemberLoginId Top

D14 | Ouput a selected set of fields

The resultant output (usually JSON) can be dictated by using the OData ‘select’ statement. https://sparkapi.com/Reso/OData/Property?$filter=BedroomsTotal eq 3&$top=4&$select=ListingKey,BedroomsTotal,Directions,ListingContractDate,ModificationTimestamp,StandardStatus,PropertyType,Location,PublicRemarks,StreetName,StreetNumber,City Top

E15 | Filter on single value enumeration

A Single Valued Lookup is a field that can have one and only one selection from a list of values. The Web API Implements Single Valued Lookup fields using the OData data type of Edm.EnumType with an underlying type of... https://sparkapi.com/Reso/OData/Property?$filter=(PropertyType eq 'Residential') and PropertyType has PropertyEnums.PropertyType'Residential'&$top=10&$select=ListingKey,BedroomsTotal,Directions,ListingContractDate,ModificationTimestamp,StandardStatus,PropertyType,Location,PublicRemarks,StreetName,StreetNumber,City,PropertyType Top

E16 | Filter on multi-valued enumeration

A Multi-Valued Lookup is a field that can have one or more items selected from a list of values. https://sparkapi.com/Reso/OData/Property?$filter=(PropertyType eq 'Residential') and (ConstructionMaterials has PropertyEnums.ConstructionMaterials'Brick') or (ConstructionMaterials has PropertyEnums.ConstructionMaterials'Concrete')&$top=10&$select=ListingKey,BedroomsTotal,Directions,ListingContractDate,ModificationTimestamp,StandardStatus,PropertyType,Location,PublicRemarks,StreetName,StreetNumber,City,ConstructionMaterials Top

F17 | Filter on a Date

Filtering on a date requires date fields to be defined as dates (Type=”Edm.Date”) in the metadata https://sparkapi.com/Reso/OData/Property?$filter=ListingContractDate lt 2016-12-31 and (PropertyType eq 'Residential')&$top=4&$select=ListingKey,BedroomsTotal,Directions,ListingContractDate,ModificationTimestamp,StandardStatus,PropertyType,Location,PublicRemarks,StreetName,StreetNumber,City,ListingContractDate Top

F18 | Filter on time

Filtering on time can use of the hour, minute, second and fractional seconds functions. https://sparkapi.com/Reso/OData/Property?$filter=year(ModificationTimestamp) eq 2018 and month(ModificationTimestamp) gt 5 and day(ModificationTimestamp) lt 31 and hour(ModificationTimestamp) gt 1 and minute(ModificationTimestamp) gt 3 and (PropertyType eq 'Residential')&$top=4&$select=ListingKey,BedroomsTotal,Directions,ListingContractDate,ModificationTimestamp,StandardStatus,PropertyType,Location,PublicRemarks,StreetName,StreetNumber,City,ModificationTimestamp Top

F19 | Filter on a fractional second

filtering on fractions of a second requires the use of the function fractionalseconds() https://sparkapi.com/Reso/OData/Property?$filter=ListingContractDate lt 2016-12-31 and fractionalseconds(ModificationTimestamp) lt 0033 and (PropertyType eq 'Residential')&$top=4&$select=ListingKey,BedroomsTotal,Directions,ListingContractDate,ModificationTimestamp,StandardStatus,PropertyType,Location,PublicRemarks,StreetName,StreetNumber,City,ListingContractDate,ModificationTimestamp Top

F20 | Filter on a date value of now

The function now() will return the now time in UTC https://sparkapi.com/Reso/OData/Property?$filter=ModificationTimestamp le now() and (PropertyType eq 'Residential')&$select=ListingKey,BedroomsTotal,Directions,ListingContractDate,ModificationTimestamp,StandardStatus,PropertyType,Location,PublicRemarks,StreetName,StreetNumber,City,ModificationTimestamp&$top=4 Top

G21 | Filter on a string that starts with

Filter on a string field value that starts with a certain value. This is case sensitive https://sparkapi.com/Reso/OData/Member?$filter=startswith(MemberFirstName, 'Joh')&$select=MemberFirstName,MemberLastName,MemberStatus,ModificationTimestamp&$top=20 Top

G22 | Filter on a string that ends with

Filter on a string field value that ends with a certain value. This is case sensitive https://sparkapi.com/Reso/OData/Property?$filter=endswith(StreetName, 'M')&$select=ListingKey,BedroomsTotal,Directions,ListingContractDate,ModificationTimestamp,StandardStatus,PropertyType,Location,PublicRemarks,StreetName,StreetNumber,City,StreetName&$top=4 Top

G23 | Filter a string that contains

Filter on a string field value that contains a certain value. This is case sensitive https://sparkapi.com/Reso/OData/Property?$filter=contains(toupper(StreetName),'MAIN')&$top=4&$select=ListingKey,BedroomsTotal,Directions,ListingContractDate,ModificationTimestamp,StandardStatus,PropertyType,Location,PublicRemarks,StreetName,StreetNumber,City Top

G24 | Filter by comparing upper case

Convert a string to upper case (toupper). Lower case would use the function tolower(). https://sparkapi.com/Reso/OData/Property?$filter=City eq 'Holland' and (PropertyType eq 'Residential') and toupper(StreetName) eq 'MAIN'&$top=4&$select=ListingKey,BedroomsTotal,Directions,ListingContractDate,ModificationTimestamp,StandardStatus,PropertyType,Location,PublicRemarks,StreetName,StreetNumber,City,StreetName Top

H25 | Geospatial Filter within a radius

A geographic search from a point in the Data System. Note that the structure of a geospatial search can vary per MLS.Search. Pay attention to MLS Service metadata name for Type=”Edm.GeographyPoint”. https://sparkapi.com/Reso/OData/Property?$filter=geo.distance(Location, geography'POINT(-85.666028 42.920418)') le 4&$top=4 Top

H26 | Geospatial Filter within a polygon

Need a minimum of four points to search by a polygon. The first and last points must be the same and because you’re able to put ‘holes’ into your polygon, you’d need to wrap the coords in another set of parenthesis. Note that the structure of a... https://sparkapi.com/Reso/OData/Property?$filter=(PropertyType eq 'Residential') and geo.intersects(Location,geography'POLYGON((-85.666028 42.920418,-85.672022 42.941522,-85.625124 42.940888,-85.623763 42.920824,-85.666028 42.920418))')&$top=4&$select=ListingKey,BedroomsTotal,Directions,ListingContractDate,ModificationTimestamp,StandardStatus,PropertyType,Location,PublicRemarks,StreetName,StreetNumber,City Top
Subscribe To Our Blog!

Subscribe To Our Blog!

Join our mailing list to receive the latest news and updates from our team.

You have Successfully Subscribed!