openapi: 3.0.0
info:
  title: Zillow Agent Profile API
  description: |
    Get one real estate agent's or team's Zillow profile: contact details, brokerage, licenses, about section, sales stats, up to 10 reviews Zillow shows with the review summary, the latest past sales, current listings and, for a team, its members.

    **Cross-linking**: pass the `username` of a Zillow Agents API result (or the agent's profile `link`) as `username`. The `zpid` and `link` of past sales and listings can be passed to the Zillow Property API.
  version: 1.0.0
servers:
  - url: https://www.searchapi.io/api/v1
paths:
  /search:
    get:
      summary: Zillow Agent Profile
      security:
        - ApiKeyAuth: []
        - ApiKeyQuery: []
      parameters:
        - name: engine
          in: query
          required: true
          description: Search engine identifier
          schema:
            type: string
            enum: ["zillow_agent_profile"]
            default: "zillow_agent_profile"
        - name: username
          in: query
          required: true
          description: The agent's or team's Zillow screen name (e.g., "everydoorrealestate" or "Erica Clibborn"), as the Zillow Agents API returns it in username, or their profile URL (e.g., "https://www.zillow.com/profile/everydoorrealestate"). A screen name has up to 100 characters.
          schema:
            type: string
        - name: zero_retention
          in: query
          required: false
          description: Set to true to disable all logging and persistent storage. No request parameters, HTML, or JSON responses are stored or logged. Enterprise only.
          schema:
            type: boolean
            default: false
      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
      properties:
        search_metadata:
          $ref: '#/components/schemas/SearchMetadata'
        search_parameters:
          $ref: '#/components/schemas/SearchParameters'
        agent:
          $ref: '#/components/schemas/Agent'
        team:
          $ref: '#/components/schemas/Team'
        sales_stats:
          $ref: '#/components/schemas/SalesStats'
        review_summary:
          type: string
          description: Zillow's summary of the agent's reviews.
        review_types:
          type: array
          description: Number of reviews per kind of service.
          items:
            $ref: '#/components/schemas/ReviewType'
        reviews:
          type: array
          description: Reviews Zillow shows on the profile, up to 10.
          items:
            $ref: '#/components/schemas/Review'
        past_sales:
          type: array
          description: The latest past sales.
          items:
            $ref: '#/components/schemas/PastSale'
        for_sale_total:
          type: integer
          description: Number of the agent's listings for sale.
        for_rent_total:
          type: integer
          description: Number of the agent's listings for rent.
        listings:
          type: array
          description: The agent's latest listings for sale, then for rent.
          items:
            $ref: '#/components/schemas/Listing'
        team_members:
          type: array
          description: Members of the team.
          items:
            $ref: '#/components/schemas/TeamMember'
        error:
          type: string
          description: Message explaining why no profile was returned, such as a screen name Zillow could not find.
    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: "Zillow profile URL for this search"
        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
        username:
          type: string
        zero_retention:
          type: boolean
    Agent:
      type: object
      required: [agent_id, username, name, link, is_top_agent, is_team, reviews]
      properties:
        agent_id:
          type: string
          description: Zillow's encoded identifier of the agent or team.
        username:
          type: string
          description: Screen name of the profile.
        name:
          type: string
          description: Name of the agent or team.
        title:
          type: string
          description: Professional title the agent gives.
        brokerage:
          type: string
          description: Brokerage the agent works with.
        address:
          type: string
          description: Business address.
        link:
          type: string
          description: URL of the Zillow profile.
        thumbnail:
          type: string
          description: URL of the profile photo.
        is_top_agent:
          type: boolean
          description: Whether Zillow marks the agent as a Top Agent.
        is_team:
          type: boolean
          description: Whether the profile is a team, whose sales figures cover all team members.
        rating:
          type: number
          description: Average review rating out of 5.
        reviews:
          type: integer
          description: Number of reviews.
        phones:
          type: object
          description: Phone numbers the profile lists.
          properties:
            cell:
              type: string
              description: Cell phone number.
            business:
              type: string
              description: Business phone number.
            brokerage:
              type: string
              description: Brokerage phone number.
        email:
          type: string
          description: Email address the profile lists.
        years_of_experience:
          type: integer
          description: Years in the industry.
        member_since:
          type: string
          description: Date the agent joined Zillow, as Zillow prints it (MM/DD/YYYY).
        description:
          type: string
          description: The agent's about text.
        specialties:
          type: array
          description: Specialties the agent lists.
          items:
            type: string
        languages:
          type: array
          description: Languages the agent lists.
          items:
            type: string
        website:
          type: string
          description: The agent's website.
        social_links:
          type: object
          description: Social profiles the agent links.
          properties:
            facebook:
              type: string
              description: Facebook URL.
            linkedin:
              type: string
              description: LinkedIn URL.
            x:
              type: string
              description: X URL.
            instagram:
              type: string
              description: Instagram URL.
            youtube:
              type: string
              description: YouTube URL.
        video:
          type: string
          description: URL of the agent's introduction video.
        licenses:
          type: array
          description: Real estate licenses.
          items:
            $ref: '#/components/schemas/License'
        service_areas:
          type: array
          description: Areas the agent serves.
          items:
            type: string
    License:
      type: object
      properties:
        number:
          type: string
          description: License number.
        state:
          type: string
          description: Two-letter state code of the license.
        type:
          type: string
          description: License type.
        status:
          type: string
          description: Status on Zillow's record of the license, such as active, pending or disabled, or expired once the recorded expiration date has passed, even for an agent with recent sales.
        expiration:
          type: string
          format: date
          description: Expiration date on Zillow's record of the license.
    Team:
      type: object
      description: Team the agent belongs to.
      properties:
        name:
          type: string
          description: Name of the team.
        agent_id:
          type: string
          description: Zillow's encoded identifier of the team.
        username:
          type: string
          description: Screen name of the team's profile.
        link:
          type: string
          description: URL of the team's Zillow profile.
    SalesStats:
      type: object
      properties:
        sales_last_12_months:
          type: integer
          description: Number of homes sold in the last 12 months.
        total_sales:
          type: integer
          description: Number of homes sold in total.
        price_range:
          type: string
          description: Price range of the homes sold, as Zillow displays it.
        average_price:
          type: string
          description: Average price of the homes sold, as Zillow displays it.
    ReviewType:
      type: object
      required: [name, reviews]
      properties:
        name:
          type: string
          description: Kind of service the reviews are about.
        reviews:
          type: integer
          description: Number of reviews of that kind.
    Review:
      type: object
      required: [review_id, rating, date, iso_date, transaction, text, user]
      properties:
        review_id:
          type: string
          description: Zillow review identifier.
        rating:
          type: integer
          description: Rating out of 5.
        rating_details:
          type: object
          description: Ratings out of 5 by category, such as local_knowledge, process_expertise, responsiveness and negotiation_skills.
          additionalProperties:
            type: integer
        date:
          type: string
          description: Date of the review, as Zillow prints it (M/D/YYYY).
        iso_date:
          type: string
          format: date
          description: Date of the review in ISO 8601 format.
        transaction:
          type: string
          description: The transaction the review is about.
        text:
          type: string
          description: Text of the review.
        user:
          type: object
          description: Author of the review.
          properties:
            name:
              type: string
              description: Name Zillow shows for the reviewer.
        agent:
          type: object
          description: Team member the review is for.
          properties:
            name:
              type: string
              description: Name of the team member.
            username:
              type: string
              description: Screen name of the team member's profile.
            link:
              type: string
              description: URL of the team member's Zillow profile.
        response:
          type: object
          description: The agent's reply to the review.
          properties:
            author:
              type: object
              description: Author of the reply.
              properties:
                name:
                  type: string
                  description: Name of the author.
                link:
                  type: string
                  description: URL of the author's Zillow profile.
            text:
              type: string
              description: Text of the reply.
            date:
              type: string
              description: Date of the reply, as Zillow prints it (MM/DD/YYYY).
            iso_date:
              type: string
              format: date
              description: Date of the reply in ISO 8601 format.
    PastSale:
      type: object
      required: [zpid, date_sold]
      properties:
        zpid:
          type: string
          description: Zillow property identifier.
        address:
          type: string
          description: Address of the home.
        price:
          type: string
          description: Sale price as Zillow displays it.
        extracted_price:
          type: number
          description: Sale price in US dollars.
        date_sold:
          type: string
          format: date
          description: Date the home sold.
        represented:
          type: string
          enum: ["buyer", "seller", "buyer_and_seller"]
          description: Side of the sale the agent represented.
        beds:
          type: number
          description: Number of bedrooms.
        baths:
          type: number
          description: Number of bathrooms.
        sqft:
          type: integer
          description: Living area in square feet.
        latitude:
          type: number
          description: Latitude of the home.
        longitude:
          type: number
          description: Longitude of the home.
        thumbnail:
          type: string
          description: URL of a photo of the home.
        link:
          type: string
          description: URL of the home's Zillow page.
    Listing:
      type: object
      required: [zpid, address, extracted_price, home_type, home_status, link, is_open_house]
      properties:
        zpid:
          type: string
          description: Zillow property identifier.
        address:
          type: string
          description: Address of the home.
        extracted_price:
          type: number
          description: List price in US dollars, or the monthly rent for a rental.
        home_type:
          type: string
          description: Home type as Zillow names it, such as singleFamily, condo or townhome.
        home_status:
          type: string
          enum: ["FOR_SALE", "FOR_RENT"]
          description: Whether the home is for sale or for rent.
        beds:
          type: number
          description: Number of bedrooms.
        baths:
          type: number
          description: Number of bathrooms.
        latitude:
          type: number
          description: Latitude of the home.
        longitude:
          type: number
          description: Longitude of the home.
        thumbnail:
          type: string
          description: URL of the main photo.
        link:
          type: string
          description: URL of the home's Zillow page.
        is_open_house:
          type: boolean
          description: Whether the home has an open house scheduled.
    TeamMember:
      type: object
      required: [position, agent_id, username, name, reviews, is_top_agent, link]
      properties:
        position:
          type: integer
          description: Position of the member in the team list, starting at 1.
        agent_id:
          type: string
          description: Zillow's encoded identifier of the member.
        username:
          type: string
          description: Screen name of the member's profile.
        name:
          type: string
          description: Name of the member.
        rating:
          type: number
          description: Average review rating out of 5.
        reviews:
          type: integer
          description: Number of reviews.
        is_top_agent:
          type: boolean
          description: Whether Zillow marks the member as a Top Agent.
        thumbnail:
          type: string
          description: URL of the member's photo.
        link:
          type: string
          description: URL of the member's Zillow profile.
    ErrorResponse:
      type: object
      required: [error]
      properties:
        error:
          type: string
          description: Error message describing what went wrong
