Dataspryva

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.

FieldTypeRequiredDescription
modestringoptionalHow 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.
searchLocationstringoptionalUS city and state (`New York, NY`) or 5-digit ZIP (`10001`). Used only in search mode.
bedroomsstringoptionalMatch listings with at least one floor plan of this bedroom count.
bathroomsstringoptionalMatch listings with a floor plan at or above this bathroom count.
priceMinintegeroptionalLowest monthly rent to include. Leave unset for no minimum.
priceMaxintegeroptionalHighest monthly rent to include. Leave unset for no maximum.
sqftMinintegeroptionalSmallest floor plan to include. Leave unset for no minimum.
sqftMaxintegeroptionalLargest floor plan to include. Leave unset for no maximum.
propertyTypestringoptionalRestrict results to one property type.
petPolicystringoptionalRequire listings that allow dogs, cats, or both.
amenitiesarrayoptionalOnly return listings that publish every selected amenity.
rentSpecialsbooleanoptionalOnly return listings advertising a current move-in deal.
minRatingstringoptionalOnly return listings rated at or above this score (1–5).
moveInDatestringoptionalOnly return listings with a unit available on or before this date (YYYY-MM-DD).
specialtiesarrayoptionalReturn 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.
keywordsstringoptionalKeep listings whose name, description, amenities, neighborhood or floor-plan names contain this text. Requires scrapeDetails=true.
sortBystringoptionalHow to order returned listings.
startUrlsarrayoptionalApartments.com city-search or property URLs. Used only in `urls` mode. A listing key is also accepted.
listingKeysarrayoptionalApartments.com listing keys such as `d3pj6rk`. Used only in `listingKeys` mode.
maximizeCoveragebooleanoptionalWhen the public listing index cannot fill your request, automatically try the site's search page as a last resort. Off by default.
scrapeDetailsbooleanoptionalFetch floor plans, available units, fees, pets, parking, schools, office hours, manager, website and photos for each listing. Turn off for faster card-level results.
maxItemsintegeroptionalMaximum listings to return (1–5,000). Search mode also stops at the maxPages scan depth.
maxPagesintegeroptionalHow 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.