Use Apartments.com Rental Listing & Floor Plan Scraper with Python
Search Apartments.com rentals by city, bedroom count, price, property type, pet policy, and amenities, or scrape specific listing URLs directly. Returns rent ranges, per-unit floor plans, walkability scores, amenities, and leasing contact details.
1. Choose the data you need
Review the published README for supported collection modes, examples, and limits. The recipe below uses the current published input definition.
2. Prepare a source-based input
This JSON contains published prefills and required-field defaults. Review every value for your task before running it; it is not a promise of successful collection.
{
"amenities": [],
"bathrooms": "any",
"bedrooms": "any",
"maxItems": 1,
"maxPages": 1,
"maximizeCoverage": false,
"minRating": "any",
"mode": "search",
"petPolicy": "any",
"propertyType": "any",
"rentSpecials": false,
"scrapeDetails": true,
"searchLocation": "New York, NY",
"sortBy": "relevance",
"specialties": []
}
Download input.example.json and save your reviewed copy as input.json.
| Field | Type | Required | Description |
|---|---|---|---|
mode | string | optional | How to find listings: `search` uses a city or ZIP plus filters; `urls` uses the Apartments.com URLs you paste; `listingKeys` looks up the listing keys you paste. |
searchLocation | string | optional | US city and state (`New York, NY`) or 5-digit ZIP (`10001`). Used only in search mode. |
bedrooms | string | optional | Match listings with at least one floor plan of this bedroom count. |
bathrooms | string | optional | Match listings with a floor plan at or above this bathroom count. |
priceMin | integer | optional | Lowest monthly rent to include. Leave unset for no minimum. |
priceMax | integer | optional | Highest monthly rent to include. Leave unset for no maximum. |
sqftMin | integer | optional | Smallest floor plan to include. Leave unset for no minimum. |
sqftMax | integer | optional | Largest floor plan to include. Leave unset for no maximum. |
propertyType | string | optional | Restrict results to one property type. |
petPolicy | string | optional | Require listings that allow dogs, cats, or both. |
amenities | array | optional | Only return listings that publish every selected amenity. |
rentSpecials | boolean | optional | Only return listings advertising a current move-in deal. |
minRating | string | optional | Only return listings rated at or above this score (1–5). |
moveInDate | string | optional | Only return listings with a unit available on or before this date (YYYY-MM-DD). |
specialties | array | optional | Return listings matching at least one selected lifestyle or housing program. Student and senior housing are the most consistently published; other values are applied when the source exposes them. |
keywords | string | optional | Keep listings whose name, description, amenities, neighborhood or floor-plan names contain this text. Requires scrapeDetails=true. |
sortBy | string | optional | How to order returned listings. |
startUrls | array | optional | Apartments.com city-search or property URLs. Used only in `urls` mode. A listing key is also accepted. |
listingKeys | array | optional | Apartments.com listing keys such as `d3pj6rk`. Used only in `listingKeys` mode. |
maximizeCoverage | boolean | optional | When the public listing index cannot fill your request, automatically try the site's search page as a last resort. Off by default. |
scrapeDetails | boolean | optional | Fetch floor plans, available units, fees, pets, parking, schools, office hours, manager, website and photos for each listing. Turn off for faster card-level results. |
maxItems | integer | optional | Maximum listings to return (1–5,000). Search mode also stops at the maxPages scan depth. |
maxPages | integer | optional | How many 40-listing discovery pages to scan in search mode (1–20). Raise it when filters are narrow. |
3. Start an Actor run
Set APIFY_TOKEN in your environment. Python 3.10 or newer is sufficient; this recipe uses no third-party packages.
Execution may incur charges. Review current pricing on Apify. The request asks for a 120-second timeout and a charge limit; these settings are subject to Apify’s pricing and do not guarantee an all-inclusive spending cap.
import json
import os
import urllib.request
# Save the schema-derived example as input.json; review and edit it first.
with open("input.json", encoding="utf-8") as stream:
actor_input = json.load(stream)
token = os.environ["APIFY_TOKEN"]
request = urllib.request.Request(
"https://api.apify.com/v2/acts/uECeNxejUQFA2OJXF/runs?timeout=120&maxTotalChargeUsd=0.50",
data=json.dumps(actor_input).encode("utf-8"),
headers={"Authorization": "Bearer " + token, "Content-Type": "application/json"},
method="POST",
)
# This starts a potentially billable run. Do not automatically retry this POST.
with urllib.request.urlopen(request, timeout=40) as response:
run = json.load(response)["data"]
print("Run ID:", run["id"])
print("Status:", run["status"])
# Inspect and download results in Apify Console once the run succeeds.
4. Inspect the actual results
Open the run in Apify Console and wait for a successful completion. Use the published output schema to locate results and the dataset schema to understand declared views. Missing or optional record fields must not be treated as guaranteed values.
One record per Apartments.com property, with rent by bedroom, floor plans, available units, fees, pets, parking, amenities, schools, office hours, manager, website and photos.
Questions before you run
Which inputs are required?
No top-level fields are marked required in the published schema. Conditional requirements can still apply; check the README.
What does this guide verify?
The fields, prefills, and schema links are rendered from the published build. This is a usage recipe, not a paid live extraction test. Source availability and collection results can vary.
What if the run request times out?
Check Apify Console before retrying. The first request may already have created a run. Do not automatically repeat a run-creation POST.
Generated from source build p6YkqUxP9rFhfClUk and its README and schemas. Source changes regenerate this guide; no third-party editorial claims are inferred.