DEV Community

Donny Nguyen
Donny Nguyen

Posted on

Apartments.com Search API — Free to Use

Search Apartment Listings with the Apartments.com API

Finding apartments can be tedious. The Apartments.com Search API cuts through the noise by letting you programmatically query real apartment listings filtered by location, bedrooms, and price.

What It Does

This API taps into Apartments.com data to return apartment listings based on your search criteria. You get structured JSON responses with essential info: address, rent price, bedroom count, and more. Perfect for building apartment search tools, comparison apps, or real estate dashboards.

Key features:

  • Search by location (city, zip code, address)
  • Filter by number of bedrooms
  • Filter by price range
  • Get real apartment data instantly

Getting Started

The main endpoint is straightforward:

GET https://apartments-com-search-api-production.up.railway.app/api/search
Enter fullscreen mode Exit fullscreen mode

Query parameters include location, bedrooms, and price. Here's how to use it:

Code Example

async function searchApartments(location, bedrooms, maxPrice) {
  const baseUrl = 'https://apartments-com-search-api-production.up.railway.app/api/search';

  const params = new URLSearchParams({
    location: location,
    bedrooms: bedrooms,
    price: maxPrice
  });

  try {
    const response = await fetch(`${baseUrl}?${params}`, {
      method: 'GET',
      headers: {
        'x-rapidapi-key': 'YOUR_API_KEY',
        'x-rapidapi-host': 'apartments-com-search-api-production.up.railway.app'
      }
    });

    if (!response.ok) {
      throw new Error(`API error: ${response.status}`);
    }

    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Search failed:', error);
  }
}

// Usage
searchApartments('San Francisco, CA', 2, 3000).then(results => {
  console.log(`Found ${results.length} apartments`);
  results.forEach(apt => {
    console.log(`${apt.address} - $${apt.rent}/month (${apt.bedrooms}bd)`);
  });
});
Enter fullscreen mode Exit fullscreen mode

Response Example

[
  {
    "id": "123456",
    "address": "123 Main St, San Francisco, CA 94102",
    "rent": 2850,
    "bedrooms": 2,
    "bathrooms": 1.5,
    "sqft": 950,
    "url": "https://apartments.com/..."
  }
]
Enter fullscreen mode Exit fullscreen mode

Why Use It?

Instead of scraping or manually checking Apartments.com, integrate real listings directly into your app. Build a custom apartment finder for your users, add price alerts, or create comparison tools—all backed by live data.

Next Steps

The API is available on RapidAPI with a generous free tier. Check it out here and start building your apartment search tool today.

Top comments (0)