zillow

package module
v0.0.0-...-fe56713 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2020 License: MIT Imports: 6 Imported by: 0

README

Zillow GoDoc Build Status Go Report Card

GoLang Zillow Api Client http://www.zillow.com/howto/api/APIOverview.htm

Services

Home Valuation
  • GetZestimate
  • GetSearchResults
  • GetChart
  • GetComps
Property Details
  • GetDeepComps
  • GetDeepSearchResults
  • GetUpdatedPropertyDetails
Neighborhood Data
  • GetRegionChildren
  • GetRegionChart
Mortgage Rates
  • GetRateSummary
Mortgage Calculators
  • GetMonthlyPayments
  • CalculateMonthlyPaymentsAdvanced
  • CalculateAffordability

Documentation

Overview

Package zillow implements a client for the Zillow api http://www.zillow.com/howto/api/APIOverview.htm

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	Street    string `xml:"street"`
	Zipcode   string `xml:"zipcode"`
	City      string `xml:"city"`
	State     string `xml:"state"`
	Latitude  string `xml:"latitude"`
	Longitude string `xml:"longitude"`
}

type AdvancedPayment

type AdvancedPayment struct {
	BeginningBalance int `xml:"beginningbalance"`
	Amount           int `xml:"amount"`
	Principal        int `xml:"principal"`
	Interest         int `xml:"interest"`
	EndingBalance    int `xml:"endingbalance"`
}

type Affordability

type Affordability struct {
	XMLName xml.Name `xml:"affordabilitydetails"`

	Request AffordabilityRequest `xml:"request"`
	Message Message              `xml:"message"`

	AffordabilityAmount         int                               `xml:"response>affordabilityamount"`
	MonthlyPrincipalAndInterest int                               `xml:"response>monthlyprincipalandinterest"`
	MonthlyPropertyTaxes        int                               `xml:"response>monthlypropertytaxes"`
	MonthlyHazardInsurance      int                               `xml:"response>monthlyhazardinsurance"`
	MonthlyPMI                  int                               `xml:"response>monthlypmi"`
	MonthlyHOADues              int                               `xml:"response>monthlyhoadues"`
	TotalMonthlyPayment         int                               `xml:"response>totalmonthlypayment"`
	TotalPayments               int                               `xml:"response>totalpayments"`
	TotalInterestPayments       int                               `xml:"response>totalinterestpayments"`
	TotalPrincipal              int                               `xml:"response>totalprincipal"`
	TotalTaxesFeesAndInsurance  int                               `xml:"response>totaltaxesfeesandinsurance"`
	MonthlyIncome               int                               `xml:"response>monthlyincome"`
	MonthlyDebts                int                               `xml:"response>monthlydebts"`
	MonthlyIncomeTax            int                               `xml:"response>monthlyincometax"`
	MonthlyRemainingBudget      int                               `xml:"response>monthlyremainingbudget"`
	AmortizationSchedule        AffordabilityAmortizationSchedule `xml:"response>amortizationschedule"`
}

type AffordabilityAmortizationSchedule

type AffordabilityAmortizationSchedule struct {
	Type     string                 `xml:"type,attr"`
	Payments []AffordabilityPayment `xml:"payment"`
}

type AffordabilityPayment

type AffordabilityPayment struct {
	Period           int `xml:"period"`
	BeginningBalance int `xml:"beginningbalance"`
	Payment          int `xml:"payment"`
	Principal        int `xml:"principal"`
	Interest         int `xml:"interest"`
	EndingBalance    int `xml:"endingbalance"`
}

type AffordabilityRequest

type AffordabilityRequest struct {
	AnnualIncome   int     `xml:"annualincome"`
	MonthlyPayment int     `xml:"monthlypayment"`
	Down           int     `xml:"down"`
	MonthlyDebts   int     `xml:"monthlydebts"`
	Rate           float32 `xml:"rate"`
	Schedule       string  `xml:"schedule"`
	TermInMonths   int     `xml:"terminmonths"`
	DebtToIncome   float32 `xml:"debttoincome"`
	IncomeTax      float32 `xml:"incometax"`
	Estimate       bool    `xml:"estimate"`
	PropertyTax    float32 `xml:"propertytax"`
	Hazard         int     `xml:"hazard"`
	PMI            int     `xml:"pmi"`
	HOA            int     `xml:"hoa"`
	Zip            string  `xml:"zip"`
}

type AmortizationSchedule

type AmortizationSchedule struct {
	Frequency string            `xml:"frequency,attr"`
	Payments  []AdvancedPayment `xml:"payment"`
}

type ChartRequest

type ChartRequest struct {
	Zpid     string `xml:"zpid"`
	UnitType string `xml:"unit-type"`
	Width    int    `xml:"width"`
	Height   int    `xml:"height"`
	Duration string `xml:"chartDuration"`
}

type ChartResult

type ChartResult struct {
	XMLName xml.Name `xml:"chart"`

	Request ChartRequest `xml:"request"`
	Message Message      `xml:"message"`
	Url     string       `xml:"response>url"`
}

type Comp

type Comp struct {
	Score     float64   `xml:"score,attr"`
	Zpid      string    `xml:"zpid"`
	Links     Links     `xml:"links"`
	Address   Address   `xml:"address"`
	Zestimate Zestimate `xml:"zestimate"`
}

type CompsRequest

type CompsRequest struct {
	Zpid          string `xml:"zpid"`
	Count         int    `xml:"count"`
	Rentzestimate bool   `xml:"rentzestimate"`
}

type CompsResult

type CompsResult struct {
	XMLName xml.Name `xml:"comps"`

	Request CompsRequest `xml:"request"`
	Message Message      `xml:"message"`

	Principal   Principal `xml:"response>properties>principal"`
	Comparables []Comp    `xml:"response>properties>comparables>comp"`
}

type DeepComp

type DeepComp struct {
	Score            float64   `xml:"score,attr"`
	Zpid             string    `xml:"zpid"`
	Links            Links     `xml:"links"`
	Address          Address   `xml:"address"`
	TaxAssesmentYear int       `xml:"taxAssessmentYear"`
	TaxAssesment     float64   `xml:"taxAssessment"`
	YearBuilt        int       `xml:"yearBuilt"`
	LotSizeSqFt      int       `xml:"lotSizeSqFt"`
	FinishedSqFt     int       `xml:"finishedSqFt"`
	Bathrooms        float64   `xml:"bathrooms"`
	Bedrooms         int       `xml:"bedrooms"`
	LastSoldDate     string    `xml:"lastSoldDate"`
	LastSoldPrice    Value     `xml:"lastSoldPrice"`
	Zestimate        Zestimate `xml:"zestimate"`
}

type DeepCompsResult

type DeepCompsResult struct {
	XMLName xml.Name `xml:"comps"`

	Request CompsRequest `xml:"request"`
	Message Message      `xml:"message"`

	Principal   DeepPrincipal `xml:"response>properties>principal"`
	Comparables []DeepComp    `xml:"response>properties>comparables>comp"`
}

type DeepPrincipal

type DeepPrincipal struct {
	Zpid             string             `xml:"zpid"`
	Links            Links              `xml:"links"`
	Address          Address            `xml:"address"`
	TaxAssesmentYear int                `xml:"taxAssessmentYear"`
	TaxAssesment     float64            `xml:"taxAssessment"`
	YearBuilt        int                `xml:"yearBuilt"`
	LotSizeSqFt      int                `xml:"lotSizeSqFt"`
	FinishedSqFt     int                `xml:"finishedSqFt"`
	Bathrooms        float64            `xml:"bathrooms"`
	Bedrooms         int                `xml:"bedrooms"`
	LastSoldDate     string             `xml:"lastSoldDate"`
	LastSoldPrice    Value              `xml:"lastSoldPrice"`
	Zestimate        Zestimate          `xml:"zestimate"`
	LocalRealEstate  []RealEstateRegion `xml:"localRealEstate>region"`
}

type DeepSearchResult

type DeepSearchResult struct {
	XMLName xml.Name `xml:"result"`

	Zpid              string             `xml:"zpid"`
	Links             Links              `xml:"links"`
	Address           Address            `xml:"address"`
	FIPSCounty        string             `xml:"FIPScounty"`
	UseCode           string             `xml:"useCode"`
	TaxAssessmentYear int                `xml:"taxAssessmentYear"`
	TaxAssessment     float64            `xml:"taxAssessment"`
	YearBuilt         int                `xml:"yearBuilt"`
	LotSizeSqFt       int                `xml:"lotSizeSqFt"`
	FinishedSqFt      int                `xml:"finishedSqFt"`
	Bathrooms         float64            `xml:"bathrooms"`
	Bedrooms          int                `xml:"bedrooms"`
	LastSoldDate      string             `xml:"lastSoldDate"`
	LastSoldPrice     Value              `xml:"lastSoldPrice"`
	Zestimate         Zestimate          `xml:"zestimate"`
	LocalRealEstate   []RealEstateRegion `xml:"localRealEstate>region"`
}

type DeepSearchResults

type DeepSearchResults struct {
	XMLName xml.Name `xml:"searchresults"`

	Request SearchRequest `xml:"request"`
	Message Message       `xml:"message"`

	Results []DeepSearchResult `xml:"response>results>result"`
}

type EditedFacts

type EditedFacts struct {
	UseCode        string  `xml:"useCode"`
	Bedrooms       int     `xml:"bedrooms"`
	Bathrooms      float64 `xml:"bathrooms"`
	FinishedSqFt   int     `xml:"finishedSqFt"`
	LotSizeSqFt    int     `xml:"lotSizeSqFt"`
	YearBuilt      int     `xml:"yearBuilt"`
	YearUpdated    int     `xml:"yearUpdated"`
	NumFloors      int     `xml:"numFloors"`
	Basement       string  `xml:"basement"`
	Roof           string  `xml:"roof"`
	View           string  `xml:"view"`
	ParkingType    string  `xml:"parkingType"`
	HeatingSources string  `xml:"heatingSources"`
	HeatingSystem  string  `xml:"heatingSystem"`
	Appliances     string  `xml:"appliances"`
	FloorCovering  string  `xml:"floorCovering"`
	Rooms          string  `xml:"rooms"`
}

type Images

type Images struct {
	Count int      `xml:"count"`
	Urls  []string `xml:"image>url"`
}
type Links struct {
	XMLName xml.Name `xml:"links"`

	HomeDetails   string `xml:"homedetails"`
	GraphsAndData string `xml:"graphsanddata"`
	MapThisHome   string `xml:"mapthishome"`
	MyZestimator  string `xml:"myzestimator"`
	Comparables   string `xml:"comparables"`
}

type Message

type Message struct {
	Text         string `xml:"text"`
	Code         int    `xml:"code"`
	LimitWarning bool   `xml:"limit-warning"`
}

type MonthlyPayments

type MonthlyPayments struct {
	XMLName xml.Name `xml:"paymentsSummary"`

	Request MonthlyPaymentsRequest `xml:"request"`
	Message Message                `xml:"message"`

	Payments               []Payment `xml:"response>payment"`
	DownPayment            int       `xml:"response>downPayment"`
	MonthlyPropertyTaxes   int       `xml:"response>monthlyPropertyTaxes"`
	MonthlyHazardInsurance int       `xml:"response>monthlyHazardInsurance"`
}

type MonthlyPaymentsAdvanced

type MonthlyPaymentsAdvanced struct {
	XMLName xml.Name `xml:"paymentsdetails"`

	Request MonthlyPaymentsAdvancedRequest `xml:"request"`
	Message Message                        `xml:"message"`

	MonthlyPrincipalAndInterest int                  `xml:"response>monthlyprincipalandinterest"`
	MonthlyPropertyTaxes        int                  `xml:"response>monthlypropertytaxes"`
	MonthlyHazardInsurance      int                  `xml:"response>monthlyhazardinsurance"`
	MonthlyPMI                  int                  `xml:"response>monthlypmi"`
	MonthlyHOADues              int                  `xml:"response>monthlyhoadues"`
	TotalMonthlyPayment         int                  `xml:"response>totalmonthlypayment"`
	TotalPayments               int                  `xml:"response>totalpayments"`
	TotalInterest               int                  `xml:"response>totalinterest"`
	TotalPrincipal              int                  `xml:"response>totalprincipal"`
	TotalTaxesFeesAndInsurance  int                  `xml:"response>totaltaxesfeesandinsurance"`
	AmortizationSchedule        AmortizationSchedule `xml:"response>amortizationschedule"`
}

type MonthlyPaymentsAdvancedRequest

type MonthlyPaymentsAdvancedRequest struct {
	Price        int     `xml:"price"`
	Down         int     `xml:"down"`
	Amount       int     `xml:"amount"`
	Rate         float32 `xml:"rate"`
	Schedule     string  `xml:"schedule"`
	TermInMonths int     `xml:"terminmonths"`
	PropertyTax  int     `xml:"propertytax"`
	Hazard       int     `xml:"hazard"`
	PMI          int     `xml:"pmi"`
	HOA          int     `xml:"hoa"`
	Zip          string  `xml:"zip"`
}

type MonthlyPaymentsRequest

type MonthlyPaymentsRequest struct {
	Price       int    `xml:"price"`
	Down        int    `xml:"down"`
	DollarsDown int    `xml:"dollarsdown"`
	Zip         string `xml:"zip"`
}

type Payment

type Payment struct {
	LoanType                    string  `xml:"loanType,attr"`
	Rate                        float64 `xml:"rate"`
	MonthlyPrincipalAndInterest int     `xml:"monthlyPrincipalAndInterest"`
	MonthlyMortgageInsurance    int     `xml:"monthlyMortgageInsurance"`
}

type Posting

type Posting struct {
	Status          string `xml:"status"`
	AgentName       string `xml:"agentName"`
	AgentProfileUrl string `xml:"agentProfileUrl"`
	Brokerage       string `xml:"brokerage"`
	Type            string `xml:"type"`
	LastUpdatedDate string `xml:"lastUpdatedDate"`
	ExternalUrl     string `xml:"externalUrl"`
	MLS             string `xml:"mls"`
}

type Principal

type Principal struct {
	Zpid      string    `xml:"zpid"`
	Links     Links     `xml:"links"`
	Address   Address   `xml:"address"`
	Zestimate Zestimate `xml:"zestimate"`
}

type Rate

type Rate struct {
	LoanType string  `xml:"loanType,attr"`
	Count    int     `xml:"count,attr"`
	Value    float64 `xml:",chardata"`
}

type RateSummary

type RateSummary struct {
	XMLName xml.Name `xml:"rateSummary"`

	Request RateSummaryRequest `xml:"request"`
	Message Message            `xml:"message"`

	Today    []Rate `xml:"response>today>rate"`
	LastWeek []Rate `xml:"response>lastWeek>rate"`
}

type RateSummaryRequest

type RateSummaryRequest struct {
	State string `xml:"state"`
}

type RealEstateRegion

type RealEstateRegion struct {
	XMLName xml.Name `xml:"region"`

	ID                  string  `xml:"id,attr"`
	Type                string  `xml:"type,attr"`
	Name                string  `xml:"name,attr"`
	ZIndex              string  `xml:"zindexValue"`
	ZIndexOneYearChange float64 `xml:"zindexOneYearChange"`
	// Links
	Overview       string `xml:"links>overview"`
	ForSaleByOwner string `xml:"links>forSaleByOwner"`
	ForSale        string `xml:"links>forSale"`
}

type Region

type Region struct {
	Id        string `xml:"id"`
	Name      string `xml:"name"`
	Country   string `xml:"country"`
	State     string `xml:"state"`
	County    string `xml:"county"`
	City      string `xml:"city"`
	CityUrl   string `xml:"cityurl"`
	Latitude  string `xml:"latitude"`
	Longitude string `xml:"longitude"`
	ZIndex    Value  `xml:"zindex"`
	Url       string `xml:"url"`
}

type RegionChartRequest

type RegionChartRequest struct {
	City          string `xml:"city"`
	State         string `xml:"state"`
	Neighborhood  string `xml:"neighborhood"`
	Zipcode       string `xml:"zip"`
	UnitType      string `xml:"unit-type"`
	Width         int    `xml:"width"`
	Height        int    `xml:"height"`
	ChartDuration string `xml:"chartDuration"`
}

type RegionChartResult

type RegionChartResult struct {
	XMLName xml.Name `xml:"regionchart"`

	Request RegionChartRequest `xml:"request"`
	Message Message            `xml:"message"`

	Url    string `xml:"response>url"`
	Zindex Value  `xml:"response>zindex"`
}

type RegionChildren

type RegionChildren struct {
	XMLName xml.Name `xml:"regionchildren"`

	Request RegionChildrenRequest `xml:"request"`
	Message Message               `xml:"message"`

	Region        Region   `xml:"response>region"`
	SubRegionType string   `xml:"response>subregiontype"`
	Regions       []Region `xml:"response>list>region"`
}

type RegionChildrenRequest

type RegionChildrenRequest struct {
	RegionId  string `xml:"regionId"`
	State     string `xml:"state"`
	Country   string `xml:"country"`
	City      string `xml:"city"`
	ChildType string `xml:"childtype"`
}

type SearchRequest

type SearchRequest struct {
	Address       string `xml:"address"`
	CityStateZip  string `xml:"citystatezip"`
	Rentzestimate bool   `xml:"rentzestimate"`
}

type SearchResult

type SearchResult struct {
	XMLName xml.Name `xml:"result"`

	Zpid string `xml:"zpid"`

	Links           Links              `xml:"links"`
	Address         Address            `xml:"address"`
	Zestimate       Zestimate          `xml:"zestimate"`
	RentZestimate   *Zestimate         `xml:"rentzestimate"`
	LocalRealEstate []RealEstateRegion `xml:"localRealEstate>region"`
}

type SearchResults

type SearchResults struct {
	XMLName xml.Name `xml:"searchresults"`

	Request SearchRequest `xml:"request"`
	Message Message       `xml:"message"`

	Results []SearchResult `xml:"response>results>result"`
}

type UpdatedPropertyDetails

type UpdatedPropertyDetails struct {
	XMLName xml.Name `xml:"updatedPropertyDetails"`

	Request UpdatedPropertyDetailsRequest `xml:"request"`
	Message Message                       `xml:"message"`

	PageViewCountMonth int `xml:"response>pageViewCount>currentMonth"`
	PageViewCountTotal int `xml:"response>pageViewCount>total"`

	Address Address `xml:"response>address"`

	Posting          Posting `xml:"response>posting"`
	Price            Value   `xml:"response>price"`
	HomeDetailsLink  string  `xml:"response>links>homeDetails"`
	PhotoGalleryLink string  `xml:"response>links>photoGallery"`
	HomeInfoLink     string  `xml:"response>links>homeInfo"`

	Images           Images      `xml:"response>images"`
	EditedFacts      EditedFacts `xml:"response>editedFacts"`
	HomeDescriptions string      `xml:"homeDesription"`
	Neighborhood     string      `xml:"neighborhood"`
	SchoolDistrict   string      `xml:"schoolDistrict"`
	ElementarySchool string      `xml:"elementarySchool"`
	MiddleSchool     string      `xml:"middleSchool"`
}

type UpdatedPropertyDetailsRequest

type UpdatedPropertyDetailsRequest struct {
	Zpid string `xml:"zpid"`
}

type Value

type Value struct {
	Currency string `xml:"currency,attr"`
	Value    int    `xml:",chardata"`
}

type ValueChange

type ValueChange struct {
	Duration int    `xml:"duration,attr"`
	Currency string `xml:"currency,attr"`
	Value    int    `xml:",chardata"`
}

type Zestimate

type Zestimate struct {
	Amount      Value  `xml:"amount"`
	LastUpdated string `xml:"last-updated"`
	// TODO(pedge): fix
	//ValueChange ValueChange `xml:"valueChange"`
	Low        Value  `xml:"valuationRange>low"`
	High       Value  `xml:"valuationRange>high"`
	Percentile string `xml:"percentile"`
}

type ZestimateRequest

type ZestimateRequest struct {
	Zpid          string `xml:"zpid"`
	Rentzestimate bool   `xml:"rentzestimate"`
}

type ZestimateResult

type ZestimateResult struct {
	XMLName xml.Name `xml:"zestimate"`

	Request ZestimateRequest `xml:"request"`
	Message Message          `xml:"message"`

	Links           Links              `xml:"response>links"`
	Address         Address            `xml:"response>address"`
	Zestimate       Zestimate          `xml:"response>zestimate"`
	LocalRealEstate []RealEstateRegion `xml:"response>localRealEstate>region"`

	// Regions
	ZipcodeID string `xml:"response>regions>zipcode-id"`
	CityID    string `xml:"response>regions>city-id"`
	CountyID  string `xml:"response>regions>county-id"`
	StateID   string `xml:"response>regions>state-id"`
}

type Zillow

type Zillow struct {
	// contains filtered or unexported fields
}

func New

func New(zwsId string) *Zillow

New creates a new zillow client.

func NewExt

func NewExt(zwsId, baseUrl string) *Zillow

NewExt creates a new zillow client. It's like New but accepts more options.

func (*Zillow) CalculateAffordability

func (z *Zillow) CalculateAffordability(ctx context.Context, request AffordabilityRequest) (*Affordability, error)

func (*Zillow) CalculateMonthlyPaymentsAdvanced

func (z *Zillow) CalculateMonthlyPaymentsAdvanced(ctx context.Context, request MonthlyPaymentsAdvancedRequest) (*MonthlyPaymentsAdvanced, error)

func (*Zillow) GetChart

func (z *Zillow) GetChart(ctx context.Context, request ChartRequest) (*ChartResult, error)

func (*Zillow) GetComps

func (z *Zillow) GetComps(ctx context.Context, request CompsRequest) (*CompsResult, error)

func (*Zillow) GetDeepComps

func (z *Zillow) GetDeepComps(ctx context.Context, request CompsRequest) (*DeepCompsResult, error)

func (*Zillow) GetDeepSearchResults

func (z *Zillow) GetDeepSearchResults(ctx context.Context, request SearchRequest) (*DeepSearchResults, error)

func (*Zillow) GetMonthlyPayments

func (z *Zillow) GetMonthlyPayments(ctx context.Context, request MonthlyPaymentsRequest) (*MonthlyPayments, error)

func (*Zillow) GetRateSummary

func (z *Zillow) GetRateSummary(ctx context.Context, request RateSummaryRequest) (*RateSummary, error)

func (*Zillow) GetRegionChart

func (z *Zillow) GetRegionChart(ctx context.Context, request RegionChartRequest) (*RegionChartResult, error)

func (*Zillow) GetRegionChildren

func (z *Zillow) GetRegionChildren(ctx context.Context, request RegionChildrenRequest) (*RegionChildren, error)

func (*Zillow) GetSearchResults

func (z *Zillow) GetSearchResults(ctx context.Context, request SearchRequest) (*SearchResults, error)

func (*Zillow) GetUpdatedPropertyDetails

func (z *Zillow) GetUpdatedPropertyDetails(ctx context.Context, request UpdatedPropertyDetailsRequest) (*UpdatedPropertyDetails, error)

func (*Zillow) GetZestimate

func (z *Zillow) GetZestimate(ctx context.Context, request ZestimateRequest) (*ZestimateResult, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL