Select Page
View all Web API examples ▸

FBS Generic

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 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=ListingId eq '332017' Top

B3 | Filter by resource key

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

C4 | 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=(ListPrice gt 500000 and ListPrice lt 1150000) and (City eq 'Vancleave')&$top=10&$select=ListingId,ListPrice,StreetName,City,PropertySubType Top

C5 | 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=InternetAddressDisplayYN eq true and (ListPrice gt 500000 and ListPrice lt 1150000) and (City eq 'Vancleave')&$top=10&$select=ListingId,ListPrice,StreetName,City,PropertySubType,InternetAddressDisplayYN Top

C6 | 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/Property?$filter=(PropertySubType eq 'b__53696e676c652046616d696c79205265736964656e6365' and (StreetName eq 'Twisted Run' or StreetName eq 'cr 222'))&$top=25&$select=ListingId,ListPrice,StreetNumber,StreetName,City,PropertySubType,InternetAddressDisplayYN Top

C7 | 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,City,StreetName,StreetNumber,BedroomsTotal&$top=10 Top

C8 | Filter on same field

Use parenthesis and logical ‘and’ or ‘or’ to group filter expressions. https://sparkapi.com/Reso/OData/Property?$top=11&$select=ListingKey,BedroomsTotal,BathroomsTotalInteger ,ListingContractDate,ModificationTimestamp,StandardStatus,PropertySubType,Location,PublicRemarks&$filter=(BathroomsTotalInteger gt 2) and (BedroomsTotal le 5 and BedroomsTotal ge 2) and PropertySubType eq 'b__53696e676c652046616d696c79205265736964656e6365' Top

C9 | Filter using not equal

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

D10 | 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=10&$select=ListingKey,BedroomsTotal,Directions,ListingContractDate,ModificationTimestamp,StandardStatus,PropertyType,City,StreetName,StreetNumber Top

D11 | 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=MemberFirstName eq 'John' Top

D12 | 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

D13 | 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=(ListPrice gt 200000 and ListPrice lt 1150000) and (City eq 'Vancleave')&$top=25&$select=ListingId,ListPrice,StreetName,City,PropertySubType,ListingContractDate,ModificationTimestamp&$orderby=ListPrice desc Top

D14 | 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 'Vancleave') and (PropertySubType eq 'b__53696e676c652046616d696c79205265736964656e6365') and PhotosCount gt 1&$top=10&$select=ListingId,ListingKey,ListPrice,StreetNumber,StreetName,PropertySubType,PhotosCount&$expand=Media Top

E15 | 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=(City eq 'Vancleave') and (Levels has PropertyEnums.Levels'One' or Levels has PropertyEnums.Levels'Two')&$top=10&$select=ListingId,ListPrice,StreetNumber,StreetName,City,AssociationFeeIncludes Top

E16 | 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,City,StreetName,StreetNumber,PropertyType 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=year(ListingContractDate) eq 2018 and month(ListingContractDate) eq 5 and (City eq 'Vancleave')&$top=10&$select=ListingId,ListingKey,ListPrice,StreetNumber,StreetName,BathroomsTotalInteger,BedroomsTotal,PropertyType,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(ListingContractDate) lt 2018 and month(ListingContractDate) eq 5 and day(ListingContractDate) lt 31 and hour(ModificationTimestamp) gt 13 and minute(ModificationTimestamp) gt 3&$top=10&$select=ListingId,ListingKey,ListPrice,StreetNumber,StreetName,BathroomsTotalInteger,BedroomsTotal,PropertyType,ListingContractDate 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?$top=12&$select=ListingId,ListingKey,ListPrice,StreetNumber,StreetName,BathroomsTotalInteger,BedroomsTotal,PropertyType,ListingContractDate,ModificationTimestamp&$filter=year(ModificationTimestamp) eq 2016 and month(ModificationTimestamp) eq 9 and day(ModificationTimestamp) eq 14 and hour(ModificationTimestamp) gt 6 and minute(ModificationTimestamp) gt 3 and fractionalseconds(ModificationTimestamp) gt 3 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?$top=9&$select=PropertyType,ListingId,ListingKey,ListPrice,StreetNumber,StreetName,BathroomsTotalInteger,BedroomsTotal,PropertyType,ListingContractDate,ModificationTimestamp&$filter=ModificationTimestamp le now() Top

G21 | 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=(City eq 'Vancleave') and contains(StreetName, 'Highway')&$top=10&$select=ListingId,ListingKey,ListPrice,StreetNumber,StreetName,BathroomsTotalInteger,BedroomsTotal,PropertyType 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=(City eq 'Vancleave') and endswith(StreetName, 'Marina')&$top=10&$select=ListingId,ListingKey,ListPrice,StreetNumber,StreetName,BathroomsTotalInteger,BedroomsTotal,PropertyType,ListingContractDate Top

G23 | 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/Property?$filter=(City eq 'Vancleave') and startswith(StreetName, 'Highway')&$top=10&$select=ListingId,ListingKey,ListPrice,StreetNumber,StreetName,BathroomsTotalInteger,BedroomsTotal,PropertyType 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?$top=11&$select=ListingKey,BedroomsTotal,BathroomsTotalInteger ,ListingContractDate,ModificationTimestamp,StandardStatus,PropertyType,Location,PublicRemarks&$filter=(BathroomsTotalInteger gt 2) and (BedroomsTotal le 5 and BedroomsTotal ge 2) and PropertyType eq 'b__53696e676c652046616d696c79' and contains(toupper(PublicRemarks), 'POTS') 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?$top=10&$filter=geo.distance(Location, geography'POINT(-88.690586 30.535)') lt 10&$select=ListingKey,BedroomsTotal,Directions,ListingContractDate,ModificationTimestamp,StandardStatus,PropertyType,Location,StreetNumber,StreetName 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?$top=10&$filter=ListPrice gt 25000 and geo.intersects(Location, geography'POLYGON((-88.690586 30.535,-88.683199 30.535374,88.682834 30.532269,-88.690586 30.535 28.896669))')&$select=ListingKey,BedroomsTotal,Directions,ListingContractDate,ModificationTimestamp,StandardStatus,PropertyType,Location,StreetNumber,StreetName 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!