using System.Collections.Generic;
using System.Threading.Tasks;
public static void Main()
var geohasher = new Geohasher();
string[] subhashes = geohasher.GetSubhashes(topLevel);
var client = new HttpClient();
client.DefaultRequestHeaders.TryAddWithoutValidation("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36 Edg/119.0.0");
client.DefaultRequestHeaders.TryAddWithoutValidation("Origin", "https://www.amazon.com.au");
client.DefaultRequestHeaders.TryAddWithoutValidation("Referer", "https://www.amazon.com.au");
Parallel.ForEachAsync(subhashes, async (hash, cancellationToken) => {
var url = "https://www.amazon.com.au/location_selector/fetch_locations?clientId=amazon_au_add_to_addressbook_mkt_mobile&countryCode=AU&sortType=NEAREST&userBenefit=false&showFreeShippingLabel=false&showPromotionDetail=false&showAvailableLocations=false&";
(double latitude, double longitude) = geohasher.Decode(hash);
url += $"longitude={longitude}&latitude={latitude}";
var response = await client.GetStringAsync(url);
var i = JsonConvert.DeserializeObject<Result>(response);
if (i.LocationList.Count >= 20)
public class LocationItem
public string Id { get; set; }
[JsonProperty("storeId")]
public string StoreId { get; set; }
[JsonProperty("ownerId")]
public string OwnerId { get; set; }
public string Name { get; set; }
[JsonProperty("addressId")]
public string AddressId { get; set; }
[JsonProperty("legacyAddressId")]
public string LegacyAddressId { get; set; }
[JsonProperty("destinationId")]
public string DestinationId { get; set; }
[JsonProperty("countryCode")]
public string CountryCode { get; set; }
[JsonProperty("postalCode")]
public string PostalCode { get; set; }
[JsonProperty("districtOrCounty")]
public object DistrictOrCounty { get; set; }
[JsonProperty("stateOrRegion")]
public string StateOrRegion { get; set; }
public string City { get; set; }
[JsonProperty("landmark")]
public object Landmark { get; set; }
[JsonProperty("contactNumber")]
public object ContactNumber { get; set; }
[JsonProperty("addressLine1")]
public string AddressLine1 { get; set; }
[JsonProperty("addressLine2")]
public object AddressLine2 { get; set; }
[JsonProperty("addressLine3")]
public object AddressLine3 { get; set; }
[JsonProperty("friendlyDirections")]
public object FriendlyDirections { get; set; }
[JsonProperty("timeZone")]
public string TimeZone { get; set; }
[JsonProperty("distance")]
public string Distance { get; set; }
public object CtaUrl { get; set; }
[JsonProperty("locationSelectorUrl")]
public object LocationSelectorUrl { get; set; }
[JsonProperty("ctaText")]
public object CtaText { get; set; }
[JsonProperty("programType")]
public object ProgramType { get; set; }
[JsonProperty("accessPointType")]
public string AccessPointType { get; set; }
[JsonProperty("apisAccessPointType")]
public string ApisAccessPointType { get; set; }
[JsonProperty("location")]
public Location Location { get; set; }
[JsonProperty("isEligible")]
public object IsEligible { get; set; }
[JsonProperty("isRestricted")]
public bool IsRestricted { get; set; }
[JsonProperty("restrictionCode")]
public object RestrictionCode { get; set; }
[JsonProperty("restrictionReasonCode")]
public object RestrictionReasonCode { get; set; }
[JsonProperty("isCTAEnabled")]
public bool IsCTAEnabled { get; set; }
[JsonProperty("hasLowerLocker")]
public object HasLowerLocker { get; set; }
[JsonProperty("isStaffAssisted")]
public bool IsStaffAssisted { get; set; }
[JsonProperty("isFeaturedAccessPoint")]
public bool IsFeaturedAccessPoint { get; set; }
[JsonProperty("freeShipOptionAvailable")]
public bool FreeShipOptionAvailable { get; set; }
[JsonProperty("isAmazonStore")]
public bool IsAmazonStore { get; set; }
[JsonProperty("operationalInfo")]
public List<OperationalInfo> OperationalInfo { get; set; }
[JsonProperty("longitude")]
public double Longitude { get; set; }
[JsonProperty("latitude")]
public double Latitude { get; set; }
public class OperationalInfo
[JsonProperty("operationalDayOfWeek")]
public string OperationalDayOfWeek { get; set; }
[JsonProperty("operationalHours")]
public string OperationalHours { get; set; }
public class ReferenceGeocode
[JsonProperty("longitude")]
public double Longitude { get; set; }
[JsonProperty("latitude")]
public double Latitude { get; set; }
[JsonProperty("locationList")]
public List<LocationItem> LocationList { get; set; }
[JsonProperty("isErrored")]
public bool IsErrored { get; set; }
[JsonProperty("referenceGeocode")]
public ReferenceGeocode ReferenceGeocode { get; set; }
[JsonProperty("isNonFreeShippingWeblabTriggered")]
public bool IsNonFreeShippingWeblabTriggered { get; set; }