
In the world of real estate data, the quality of your insights is determined by the quality of your queries. Anyone can search for 2-bedroom properties in a city. But can you find all 3+ bedroom, non-owner-occupied, waterfront properties with a hot tub and a TTM revenue over $100k, sorted by highest occupancy first? With AirROI's API, you can.
This guide provides a deep dive into the advanced filtering and sorting capabilities of our API, empowering you to build highly specific, granular queries that uncover the niche investment opportunities others miss.
The AirROI API allows you to combine multiple filter conditions in a single query, using a simple and intuitive JSON object. All filters are ANDed together, allowing you to progressively narrow your search to the most relevant properties.
Let's construct a query to find properties that meet a very specific investment thesis: luxury homes suitable for families, with proven high performance.
// This query hones in on a very specific, high-value market segment
const advancedQuery = {
market: {
country: "US",
region: "Florida",
locality: "Orlando",
},
filter: {
// Property Type & Size
room_type: { eq: "entire_home" },
bedrooms: { gte: 4 },
guests: { gte: 10 },
// Luxury & Family-Friendly Amenities
amenities: { all: ["pool", "kitchen", "wifi"] },
amenities: { any: ["game_console", "pool_table", "crib"] },
// Proven Performance
ttm_revenue: { gte: 120000 },
ttm_occupancy: { gte: 0.75 },
rating_overall: { gte: 4.9 },
num_reviews: { gte: 50 },
// Host Quality
superhost: { eq: true },
},
sort: {
ttm_revenue: "desc",
rating_overall: "desc",
},
pagination: {
page_size: 25,
},
};
async function runAdvancedSearch(apiKey, query) {
const response = await fetch(
"https://api.airroi.com/listings/search/market",
{
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-KEY": apiKey,
},
body: JSON.stringify(query),
},
);
const data = await response.json();
console.log(
`Found ${data.pagination.total_count} properties matching your niche criteria.`,
);
return data.data;
}
This single API call replaces hours of manual searching and spreadsheet filtering, allowing you to instantly identify properties that fit even the most specific investment profiles.
Finding the right properties is only half the battle. You also need to rank them effectively. The AirROI API allows you to sort by up to five different fields, each with its own direction (asc or desc). This enables you to create a nuanced ranking system that reflects your unique priorities.
Imagine you want to find properties that are high-earning and well-regarded, but you also want to favor those with a lower cleaning fee, which might indicate a better value for guests and potentially higher occupancy.
# This query finds top properties, with a tie-breaker for lower cleaning fees
multi_level_sort_query = {
"market": {
"country": "US",
"region": "California",
"locality": "Lake Tahoe"
},
"filter": {
"bedrooms": {"gte": 3},
"amenities": {"any": ["hot_tub", "fireplace", "ski_in_ski_out"]}
},
"sort": {
"ttm_revenue": "desc", # Primary sort: Highest revenue
"rating_overall": "desc", # Secondary sort: Best reviews
"ttm_occupancy": "desc", # Tertiary sort: Highest occupancy
"cleaning_fee": "asc" # Tie-breaker: Lowest cleaning fee
}
}
# You would then send this query to the /listings/search/market endpoint
# The results will be perfectly ordered according to your priorities.
The depth and flexibility of the AirROI API's filtering and sorting capabilities are designed for one purpose: to allow you to ask better, more specific questions of the data. The more granular your queries, the more unique and valuable your insights will be.
Stop skimming the surface with generic searches. Dive deep, get specific, and start uncovering the hidden opportunities that others are missing. The power to build a truly intelligent property search engine is in your hands.
Stay ahead of the curve
Join our newsletter for exclusive insights and updates. No spam ever.