openapi: 3.0.0
info:
  title: Redfin Property API
  description: |
    The Redfin Property API returns one home from Redfin, in the United States or Canada, by its Redfin property ID or its Redfin home URL. The response has the home's address, coordinates, status, facts, Redfin Estimate, rent estimate, price and tax history, MLS amenities, Walk Score, nearby schools and comparable homes, plus, while Redfin shows a listing for the home, its photos, listing remarks, HOA fee, key facts, listing agent and broker.

    `home_status` follows Redfin's own status label: a home sold long enough ago that Redfin calls it off market is `off_market`, with its last sale in `last_sold_price` and `date_sold`. Homes listed for rent return their property record. The rental listing itself is not included. Rental building pages (`/apartment/` URLs) are not supported. Redfin shows no Redfin Estimate, rent estimate or comparable homes in Canada.

    `description` holds the listing remarks, cut at 699 characters. In states that keep sale prices private, the `price` of a sold home, or of a sold comparable home, is its last list price and its `is_last_list_price` is `true`. An ID Redfin has no property for returns an `error` message. When part of the home's data could not be retrieved, the response leaves that part out and sets `is_partial`.

    **Cross-linking**: each property in the Redfin Search API returns the `property_id` and `link` this API takes as `property_id`, and each comparable home's `property_id` and `link` work the same way.
  version: 1.0.0
servers:
  - url: https://www.searchapi.io/api/v1
paths:
  /search:
    get:
      summary: Redfin Property
      security:
        - ApiKeyAuth: []
        - ApiKeyQuery: []
      parameters:
        - name: engine
          in: query
          required: true
          description: Engine to use for the search
          schema:
            type: string
            enum: ["redfin_property"]
            default: "redfin_property"
        - name: property_id
          in: query
          required: true
          description: A Redfin property ID, such as `1752`, or a Redfin home URL on `redfin.com` or `redfin.ca`, such as `https://www.redfin.com/WA/Seattle/2100-3rd-Ave-98121/unit-602/home/1752`. Rental building pages (`/apartment/` URLs) are not supported.
          schema:
            type: string
            maxLength: 2048
            pattern: '^(\d{1,12}|([Hh][Tt][Tt][Pp][Ss]?://)?([Ww][Ww][Ww]\.)?[Rr][Ee][Dd][Ff][Ii][Nn]\.([Cc][Oo][Mm]|[Cc][Aa])(/[^/?#\s]+)*/[Hh][Oo][Mm][Ee]/\d{1,12}/?([?#]\S*)?)$'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchResponse'
        '400':
          description: Validation Error. There is an issue with query parameters, such as missing required parameters or invalid values.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Authentication Error. The API key is missing or invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate Limit Exceeded. The number of allowed requests has been exceeded. Consider upgrading your plan or waiting for the limit to reset.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Server Error. Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: Timeout. We could not retrieve results in 90 seconds.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: 'Use Bearer authentication. Format: "Bearer YOUR_API_KEY"'
    ApiKeyQuery:
      type: apiKey
      in: query
      name: api_key
      description: Pass API key as query parameter
  schemas:
    SearchResponse:
      type: object
      required: [search_metadata, search_parameters]
      properties:
        search_metadata:
          $ref: '#/components/schemas/SearchMetadata'
        search_parameters:
          $ref: '#/components/schemas/SearchParameters'
        property:
          $ref: '#/components/schemas/Property'
        attribution:
          $ref: '#/components/schemas/Attribution'
        comparables:
          type: array
          items:
            $ref: '#/components/schemas/Comparable'
          description: Recently sold or listed homes Redfin compares the home with for its Redfin Estimate
        nearby_schools:
          type: array
          items:
            $ref: '#/components/schemas/School'
          description: Schools Redfin shows near the home, the ones serving it first
        is_partial:
          type: boolean
          description: True when part of the home's data could not be retrieved for this response
        error:
          type: string
          description: Message explaining why the search returned no property
    SearchMetadata:
      type: object
      required: [status, created_at]
      properties:
        id:
          type: string
          description: Unique identifier for the search request
        status:
          type: string
          description: Status of the search request
        created_at:
          type: string
          format: date-time
          description: Timestamp when the search was created
        request_time_taken:
          type: number
          description: Time taken to make the request in seconds
        parsing_time_taken:
          type: number
          description: Time taken to parse the results in seconds
        total_time_taken:
          type: number
          description: Total time taken for the search in seconds
        request_url:
          type: string
          description: Redfin URL of the home
        html_url:
          type: string
          description: URL to view HTML results
        json_url:
          type: string
          description: URL to view JSON results
    SearchParameters:
      type: object
      properties:
        engine:
          type: string
          description: Engine used for the search
        property_id:
          type: string
          description: Redfin property ID or home URL searched
    Property:
      type: object
      required: [property_id]
      properties:
        property_id:
          type: string
          description: Redfin property ID
        listing_id:
          type: string
          description: Redfin ID of the home's current or most recent listing
        mls_id:
          type: string
          description: MLS number of the home's current or most recent listing
        link:
          type: string
          description: Redfin page of the home
        home_status:
          type: string
          enum: ["for_sale", "coming_soon", "pending", "sold", "off_market"]
          description: Status of the home, following Redfin's own status label
        status_text:
          type: string
          description: Status label Redfin shows for the home, such as `Active`, `Contingent` or `Off market`
        home_type:
          type: string
          enum: ["house", "condo", "townhouse", "multi_family", "land", "other", "manufactured", "co_op"]
          description: Type of home
        description:
          type: string
          description: Listing remarks, cut at 699 characters
        address:
          type: string
          description: Full address as Redfin writes it
        street:
          type: string
          description: Street address without the unit
        unit:
          type: string
          description: Unit number
        city:
          type: string
          description: City
        state:
          type: string
          description: State or province code
        zipcode:
          type: string
          description: ZIP or postal code
        country:
          type: string
          description: ISO country code
        county:
          type: string
          description: County
        neighborhood:
          type: string
          description: Neighborhood Redfin places the home in
        latitude:
          type: number
          description: Latitude
        longitude:
          type: number
          description: Longitude
        parcel_id:
          type: string
          description: Assessor's parcel number
        county_fips:
          type: string
          description: FIPS code of the county
        price:
          type: number
          description: List price of a home on the market, or the sale price of a sold home
        is_last_list_price:
          type: boolean
          description: Whether the price of a sold home is its last list price, in states that keep sale prices private
        currency:
          type: string
          enum: ["USD", "CAD"]
          description: Currency of the prices
        price_per_sqft:
          type: number
          description: Price per square foot
        beds:
          type: integer
          description: Number of bedrooms
        baths:
          type: number
          description: Number of bathrooms
        sqft:
          type: integer
          description: Interior size in square feet
        lot_size:
          type: integer
          description: Lot size in square feet
        year_built:
          type: integer
          description: Year the home was built
        year_renovated:
          type: integer
          description: Year the home was last renovated, from public records
        monthly_hoa_fee:
          type: number
          description: Monthly homeowners association fee
        days_on_market:
          type: integer
          description: Days the listing has been on the market
        last_sold_price:
          type: number
          description: Price of the home's last sale
        date_sold:
          type: string
          format: date
          description: Date of the home's last sale
        redfin_estimate:
          type: number
          description: Redfin Estimate of the home's value
        rent_estimate:
          type: number
          description: Redfin's estimate of the home's monthly rent
        rent_estimate_low:
          type: number
          description: Low end of Redfin's monthly rent estimate
        rent_estimate_high:
          type: number
          description: High end of Redfin's monthly rent estimate
        thumbnail:
          type: string
          description: Main photo of the listing
        images:
          type: array
          items:
            type: string
          description: Photos of the listing
        photo_count:
          type: integer
          description: Number of photos in the listing
        virtual_tour_url:
          type: string
          description: Virtual tour of the listing
        key_facts:
          type: array
          items:
            type: string
          description: Key facts Redfin highlights for the listing
        tags:
          type: array
          items:
            type: string
          description: Listing highlights from the listing agent
        price_history:
          type: array
          items:
            $ref: '#/components/schemas/PriceHistoryEvent'
          description: Listing and sale events of the home, newest first
        tax_history:
          type: array
          items:
            $ref: '#/components/schemas/TaxYear'
          description: Property taxes and assessed values by year, newest first
        amenities:
          type: array
          items:
            $ref: '#/components/schemas/Amenity'
          description: Property details from the listing's MLS and from public records, in groups
        walk_and_transit_scores:
          $ref: '#/components/schemas/WalkAndTransitScores'
    PriceHistoryEvent:
      type: object
      required: [date, event]
      properties:
        date:
          type: string
          format: date
          description: Date of the event in the home's time zone
        event:
          type: string
          description: Event, such as `Listed`, `Price Changed` or `Sold (Public Records)`
        price:
          type: number
          description: Price at the event
        source:
          type: string
          description: MLS or public records source of the event
        mls_id:
          type: string
          description: MLS number of the listing the event belongs to
    TaxYear:
      type: object
      required: [year]
      properties:
        year:
          type: integer
          description: Tax roll year
        tax_paid:
          type: number
          description: Property taxes due for the year
        value:
          type: number
          description: Assessed value, land and improvements together
        land_value:
          type: number
          description: Assessed value of the land
        improvement_value:
          type: number
          description: Assessed value of the improvements
    Amenity:
      type: object
      required: [entries]
      properties:
        category:
          type: string
          description: Section the group belongs to, such as `Interior` or `Parking`
        title:
          type: string
          description: Title of the group
        entries:
          type: array
          items:
            $ref: '#/components/schemas/AmenityEntry'
          description: Details in the group
    AmenityEntry:
      type: object
      required: [values]
      properties:
        name:
          type: string
          description: Name of the detail
        values:
          type: array
          items:
            type: string
          description: Values of the detail, as plain text or a link
    WalkAndTransitScores:
      type: object
      required: [walk_score]
      properties:
        walk_score:
          type: integer
          minimum: 0
          maximum: 100
          description: Walk Score of the home's location
        walk_score_description:
          type: string
          description: Label of the Walk Score, such as `Walker's Paradise`
        transit_score:
          type: integer
          minimum: 0
          maximum: 100
          description: Transit Score of the home's location
        bike_score:
          type: integer
          minimum: 0
          maximum: 100
          description: Bike Score of the home's location
    Attribution:
      type: object
      properties:
        agent_name:
          type: string
          description: Listing agent
        broker_name:
          type: string
          description: Listing brokerage
        mls_name:
          type: string
          description: MLS the listing comes from
    Comparable:
      type: object
      required: [property_id, link]
      properties:
        property_id:
          type: string
          description: Redfin property ID of the comparable home
        listing_id:
          type: string
          description: Redfin ID of the comparable home's listing
        link:
          type: string
          description: Redfin page of the comparable home
        address:
          type: string
          description: Full address of the comparable home
        price:
          type: number
          description: Sale price of a sold comparable home, or list price of one on the market
        is_last_list_price:
          type: boolean
          description: Whether the price of a sold comparable home is its last list price, in states that keep sale prices private
        beds:
          type: integer
          description: Number of bedrooms
        baths:
          type: number
          description: Number of bathrooms
        sqft:
          type: integer
          description: Interior size in square feet
        home_type:
          type: string
          enum: ["house", "condo", "townhouse", "multi_family", "land", "other", "manufactured"]
          description: Type of home
        home_status:
          type: string
          enum: ["for_sale", "coming_soon", "pending", "sold"]
          description: Status of the comparable home
        date_sold:
          type: string
          format: date
          description: Date the comparable home sold
        latitude:
          type: number
          description: Latitude
        longitude:
          type: number
          description: Longitude
    School:
      type: object
      required: [name, is_serving_home]
      properties:
        name:
          type: string
          description: Name of the school
        rating:
          type: integer
          minimum: 1
          maximum: 10
          description: GreatSchools rating out of 10
        grades:
          type: string
          description: Grades the school teaches, such as `PreK-5`
        distance:
          type: number
          description: Distance from the home in miles
        type:
          type: string
          description: Type of school, such as `Public` or `Private`
        link:
          type: string
          description: Redfin page of the school
        is_serving_home:
          type: boolean
          description: Whether Redfin lists the school as serving the home
    ErrorResponse:
      type: object
      required: [error]
      properties:
        error:
          type: string
          description: Error message describing what went wrong
