Place lookup
Turns a typed city, ZIP code, neighbourhood, county or address into location ids, coordinates and a map box that apartments-search accepts.
Loading / 加载中…
Apartments.com API: search, property detail and locations · Real estate data
The Apartments.com API turns a typed city, ZIP code, neighbourhood or address into coordinates and a map box, searches rental buildings by that area or by a bounding box or coordinates with filters for rent, bedrooms, pets, amenities and media, and looks up one building's rating, rent range and photo by its listing id or URL.
JSON in, a structured response out. Every public gateway endpoint uses POST.
Turns a typed city, ZIP code, neighbourhood, county or address into location ids, coordinates and a map box that apartments-search accepts.
Looks up one rental building by its listing key or apartments.com URL, returning its address, coordinates, rating, rent range and bed range.
Searches rental buildings by place, map box or coordinates, with filters for rent, bedrooms, pets, amenities and media, sorted and paged.
apartments-locations resolves a typed place, given in body.query, into a short list of matching candidates, each one self-describing rather than needing a second lookup to interpret. A row's type says which of five kinds of place it is, and that kind decides what its other location fields mean: a city or county row's own city, state and county describe that place itself, while a street-address row's same three fields describe the street's own city, state and county instead. market is the metro market apartments.com groups that place under, a broader grouping than the city or state already on the row, and display is the place's own label text, kept separate from the coordinates.
available_unit_count is scoped to that one specific place rather than to the wider market around it. A row's latitude, longitude and bounding_box describe it on a map in the same shape apartments-search's own area fields expect, so a candidate can move into a search without reshaping any value.
apartments-property-detail reads one building by body.property_id and returns it as a single property object rather than a row inside a list. rating is the building's own renter rating, a field no search row carries at all, and neighborhood is a label for its area, kept distinct from the city and street fields that give its postal address. rent_display and beds_display are formatted text built from the rent_min, rent_max, beds_min and beds_max fields the same reply carries, so a caller comparing figures across several buildings should read that pair of fields rather than parsing the formatted text.
image is a single main photo rather than a fuller set. The floor-plan table, fee schedule and pet policy a building publishes sit outside every field this reply names; apartments-search's own floor_plans, pet_policy_summary and amenities fields come closest to either one, and only on that other operation.
Whichever of the three ways a call uses to set its area — a typed place, an explicit box, or coordinates with a radius — apartments-search's reply echoes back what the search actually ran against: a location object holding the resolved area and a bounding_box matching it. Reading that pair back tells a caller which actual area a reply covers, which matters when a typed place such as a neighbourhood name resolves to a box the caller did not compute itself. page and limit in the same reply mirror the values that call actually applied, rather than values a caller has to remember from its own request, so a workflow reading only the reply can tell exactly what produced it without keeping a separate record of what it sent.
body.min_rent and body.max_rent compare against a building's own rent_min and rent_max reply fields; body.min_beds and body.max_beds compare the same way against beds_min and beds_max. body.pets reads a building's own amenities list rather than a separate pet-policy field, since neither operation's reply carries a dedicated pet-policy field beyond the short pet_policy_summary text. body.specials_only, body.has_3d_tour and body.has_video each check a building's own specials, has_3d_tour and has_video fields, so a filtered reply's rows already carry, on each row, the exact field the filter checked.
Each apartments-search row describes one building: its address, street, city, state and postal_code; any current specials and a phone field for leasing contact; and a main image with an image_count, has_video and has_3d_tour showing whether that building carries either media type. A building offering more than one unit size keeps its entries together inside its own floor_plans array, instead of one flattened row per size; rent_display turns the rent_from/rent_to pair on each entry into formatted text, and price_is_from marks that figure as a starting one rather than a fixed one.
The row's own rent_min, rent_max, beds_min and beds_max fields hold the outer bounds of that whole array rather than any single entry's own figures. Running several calls with different body.sort values changes the order those same rows come back in, without changing which buildings are in the result set at all, since sorting and the filters above act independently of each other.
Apartments.com is a United States online rental-listing marketplace owned by CoStar Group, which acquired it for $585 million. A listing's floor plan is a bird's-eye diagram of a unit's layout, marking walls, doors, windows and any built-in fixtures, and a studio apartment has no separate bedroom, so its listing counts as zero bedrooms. A move-in special is a temporary lease incentive, such as free rent or a waived fee, meant to help fill a vacant unit sooner.
{
"body": {
"location": "Austin, TX",
"min_beds": 2,
"max_rent": 2500
}
}POST /api/v1/apartments/<action> with x-api-key, Content-Type: application/json and a required Idempotency-Key.ok: true: data is the result of the operation, meta.requestId identifies the recorded request and meta.chargedCreditUnits is the amount charged. Otherwise ok is false and error.code names the reason; read ok and error.code rather than relying on the HTTP status alone. Every gateway reply carries a request id for support: meta.requestId, or a top-level requestId in a reply without meta (such as a refusal before admission).apartments-search needs.apartments-locations returns at most 15 suggestions per call, from 1 to 15, defaulting to 15 when body.limit is left out.apartments-search returns between 1 and 200 buildings per call, defaulting to 40, with pages running from 1 to 100.apartments-search results whenever body.min_rent or body.max_rent is set.body.radius_miles on apartments-search only takes effect together with body.latitude and body.longitude, and runs from 0.25 to 50 miles, defaulting to 5.apartments-property-detail and apartments-locations each require their one input field; a call missing it is rejected rather than answered with an empty record.apartments-search's bedroom filter spans a 0–6 range, where 0 selects studios.Call apartments-locations with the typed text in body.query — a city, ZIP code, neighbourhood or street address all work, and the same field accepts q or term as alternative names. Each returned place carries its own latitude, longitude and bounding_box, either of which can be passed straight into apartments-search as the search area instead of typing coordinates by hand. body.limit controls how many suggested places come back, from 1 to 15, defaulting to 15.
Pass a typed place in body.location, also accepted under query, q, city, postcode or zip; an explicit box in body.bounding_box, also accepted as bbox; or give body.latitude and body.longitude as a centre point, adding body.radius_miles to size the area around it. A bounding box skips resolving a typed place entirely, and the radius field has no effect unless both coordinate fields are sent alongside it.
Each row is one building, but a building offering several unit sizes carries one entry per bed count inside its own floor_plans array, with beds, beds_label, rent_from, rent_to, rent_display and price_is_from on each entry. The building-level rent_min, rent_max, beds_min and beds_max summarise the range across every floor plan the building lists, so a caller does not have to scan the array just to read the overall range.
Set body.min_rent and body.max_rent, in US dollars, to keep buildings whose rent range reaches into that band, and body.min_beds and body.max_beds, counting a studio as 0 bedrooms up to 6, to keep buildings offering that many. Both pairs filter the rows this operation already found rather than changing the search area, and a building with no published rent drops out whenever either rent bound is set.
Set body.pets to keep only buildings whose short amenity list mentions pets; the full pet policy for a building is not part of this reply, only the pet_policy_summary and amenities list each row already carries. Set body.specials_only to keep only buildings advertising a move-in special, and body.amenities to require one or more exact phrases, matched case-insensitively against each building's own short list.
Set body.has_3d_tour or body.has_video to true on apartments-search to keep only buildings carrying one of those media types; either can be combined with the other filters in the same call. Each returned building also carries its own has_3d_tour and has_video fields, so a caller filtering on one can still read whether a kept row also has the other.
total_units counts every available unit across the whole searched area, a different measure from the number of building rows that one call actually returns, since body.limit caps that count at between 1 and 200. new_unit_count reports how many of the units in that area are newly listed, and both figures describe the full area rather than only the page a call returned.
Send whatever value is already in hand — the listing key, or a full apartments.com URL — straight into body.property_id on apartments-property-detail; the same field also accepts id, listing_id and listing_key as alternative names for the same value. A row returned by apartments-search already carries both property_id and url, so either can be sent directly without edits.
Set body.sort to one of its eight values — a default best-match order, ascending or descending rent, newest or recently updated listings, distance from the box centre, or buildings with a 3D tour or video first — and that order is set before the rent, bed, pet, amenity and media filters remove any rows, so the filtered rows keep their relative order. body.page and body.limit then step through what remains, from page 1 up to page 100.