示例#1
0
        static void Main()
        {
            ZooplaDotNetClient         client             = new ZooplaDotNetClient("INSERT KEY HERE");
            StandardLocationParameters locationParameters = new StandardLocationParameters();

            Console.WriteLine("Enter in a postcode:");
            locationParameters.PostCode   = Console.ReadLine();
            locationParameters.OutputType = OutputType.OUTCODE;
            locationParameters.AreaType   = AreaType.POSTCODES;

            Console.WriteLine("Enter minimum number of beds: ");
            locationParameters.MinimumBeds = Convert.ToInt32(Console.ReadLine());

            ListingBaseOptions listingBaseOptions = new ListingBaseOptions
            {
                PageSize      = 100,
                PageNumber    = 1,
                OrderBy       = OrderBy.AGE,
                ListingStatus = "sale"
            };

            Console.WriteLine("Enter the max price you are willing to pay:");
            int MaxPrice                  = Convert.ToInt32(Console.ReadLine());
            var listingResponse           = client.GetPropertyListings(locationParameters, listingBaseOptions);
            int AverageCurrentMarketPrice = (int)CalculateAverageHouseValue(listingResponse.Result);

            CalculateUndervaluedHouses(listingResponse.Result, AverageCurrentMarketPrice, MaxPrice);
            Console.WriteLine(AverageCurrentMarketPrice);
        }
示例#2
0
        /// <summary>
        /// Gets the Zoopla Zed-Index for an area.
        /// </summary>
        /// <param name="options">
        /// The standard location parameters.
        /// OutputType for this endpoint can only be TOWN, OUTCODE, COUNTY, or COUNTRY
        /// </param>
        /// <returns>The Zed Indexes for the last 5 years for the given area.</returns>
        public Task <ZedIndexResponse> GetZedIndex(StandardLocationParameters locationParams)
        {
            string url = Endpoints.ZED_INDEX + "?api_key=" + _accessToken;

            url += locationParams.GetUrlParams();

            return(_httpClient.GetObject <ZedIndexResponse>(url));
        }
示例#3
0
        /// <summary>
        /// Gets the average sold prices for an area.
        /// </summary>
        /// <param name="locationParams">The standard location parameters.</param>
        /// <returns>The number of sales, and average sold prices, for the area within the last 1, 3, 5 and 7 years.</returns>
        public Task <AverageAreaSoldPriceResponse> GetAverageAreaSoldPrice(StandardLocationParameters locationParams)
        {
            string url = Endpoints.AVERAGE_AREA_SOLD_PRICE + "?api_key=" + _accessToken;

            url += locationParams.GetUrlParams();

            return(_httpClient.GetObject <AverageAreaSoldPriceResponse>(url));
        }
示例#4
0
        /// <summary>
        /// Gets the property rich list values for a particular area.
        /// </summary>
        /// <param name="locationParams">The standard location parameters.</param>
        /// <returns>A list of the highest and lowest average Zed-Index estimates for sub-areas within the area.</returns>
        public Task <PropertyRichListResponse> GetPropertyRichList(StandardLocationParameters locationParams)
        {
            string url = Endpoints.PROPERTY_RICH_LIST + "?api_key=" + _accessToken;

            url += locationParams.GetUrlParams();

            return(_httpClient.GetObject <PropertyRichListResponse>(url));
        }
示例#5
0
        /// <summary>
        /// Generate a set of graphs of local info for an outcode and return the URL to the generated image.
        /// </summary>
        /// <param name="locationParams">The standard location parameters.</param>
        /// <returns>URLs of info graphs for the area for crime, education, people, and council tax.</returns>
        public Task <LocalInfoGraphResponse> GetLocalInfoGraphs(StandardLocationParameters locationParams)
        {
            string url = Endpoints.LOCAL_INFO_GRAPHS + "?api_key=" + _accessToken;

            url += locationParams.GetUrlParams();

            return(_httpClient.GetObject <LocalInfoGraphResponse>(url));
        }
示例#6
0
        /// <summary>
        /// Gets listings of properties either for sale or rent, depending on the supplied options.
        /// </summary>
        /// <param name="locationParams">The standard location parameters.</param>
        /// <param name="options">The rental or sales listing options.</param>
        /// <returns>A list of properties matching the given criteria.</returns>
        public Task <PropertyListingsResponse> GetPropertyListings(StandardLocationParameters locationParams, ListingBaseOptions options)
        {
            string url = Endpoints.PROPERTY_LISTINGS + "?api_key=" + _accessToken;

            url += locationParams.GetUrlParams();
            url += options.GetUrlParams();

            return(_httpClient.GetObject <PropertyListingsResponse>(url));
        }
示例#7
0
        /// <summary>
        /// Generates a graph of values for an outcode over the previous 3 months and return the URL to the generated image.
        /// </summary>
        /// <param name="locationParams">
        /// The standard location parameters.
        /// OutputType must be OUTCODE.
        /// </param>
        /// <param name="options">The size option for the graph.</param>
        /// <returns>URLs for Home Values, Value Trend, Value Ranges, and Average Values graphs.</returns>
        public Task <AreaValueGraphResponse> GetAreaValueGraphs(StandardLocationParameters locationParams, AreaValueGraphOptions options)
        {
            string url = Endpoints.AREA_VALUE_GRAPHS + "?api_key=" + _accessToken;

            url += locationParams.GetUrlParams();
            url += options.GetUrlParams();

            return(_httpClient.GetObject <AreaValueGraphResponse>(url));
        }
示例#8
0
        /// <summary>
        /// Gets a list of house price estimates for the requested area.
        /// </summary>
        /// <param name="locationParams">The standard location parameters.</param>
        /// <param name="options">The options.</param>
        /// <returns>A list of results containing the Zed-Index value, and the Latitude, Longitude and Name of the result.</returns>
        public Task <ZedIndicesResponse> GetAreaZedIndices(StandardLocationParameters locationParams, ZedIndicesOptions options)
        {
            string url = Endpoints.ZED_INDICES + "?api_key=" + _accessToken;

            url += locationParams.GetUrlParams();
            url += options.GetUrlParams();

            return(_httpClient.GetObject <ZedIndicesResponse>(url));
        }
示例#9
0
        /// <summary>
        /// Gets the average sold prices for a particular sub-area type.
        /// </summary>
        /// <param name="locationParams">The standard location parameters.</param>
        /// <param name="options">The paging and ordering options.</param>
        /// <returns>A list of average sold prices for each given sub-area type in the area.</returns>
        public Task <AverageSoldPriceResponse> GetAverageSoldPrices(StandardLocationParameters locationParams, AverageSoldPricesOptions options)
        {
            var url = Endpoints.AVERAGE_SOLD_PRICES + "?api_key=" + _accessToken;

            url += locationParams.GetUrlParams();
            url += options.GetUrlParams();

            return(_httpClient.GetObject <AverageSoldPriceResponse>(url));
        }
        public async Task Should_Get_GetAverageAreaSoldPrice()
        {
            AverageAreaSoldPriceResponse result;

            using (var api = new ZooplaDotNetClient(ApiKey.Value))
            {
                var parameters = new StandardLocationParameters {
                    PostCode = "e8", OutputType = OutputType.OUTCODE
                };

                result = await api.GetAverageAreaSoldPrice(parameters);
            }


            Assert.That(result.PricesUrl,
                        Is.EqualTo("https://www.zoopla.co.uk/home-values/london/e8/hackney-dalston"));
        }
示例#11
0
        public async Task Should_Get_GetAverageSoldPrices()
        {
            AverageSoldPriceResponse result;

            using (var api = new ZooplaDotNetClient(ApiKey.Value))
            {
                var options     = new AverageSoldPricesOptions();
                var paramerters = new StandardLocationParameters
                {
                    PostCode   = "e84dt",
                    OutputType = OutputType.OUTCODE,
                    AreaType   = AreaType.POSTCODES
                };

                result = await api.GetAverageSoldPrices(paramerters, options);
            }

            Assert.That(result.Areas.Count, Is.EqualTo(10));
        }
示例#12
0
        public async Task Should_Get_GetAreaValueGraphs()
        {
            AreaValueGraphResponse result;

            using (var api = new ZooplaDotNetClient(ApiKey.Value))
            {
                var options = new AreaValueGraphOptions {
                    Size = Size.MEDIUM
                };
                var parameters = new StandardLocationParameters {
                    PostCode = "e84dt"
                };

                result = await api.GetAreaValueGraphs(parameters, options);
            }


            Assert.That(result.AverageValuesGraphUrl,
                        Is.EqualTo("https://www.zoopla.co.uk/dynimgs/graph/average_prices/E8?width=400&height=212"));
        }