Search code examples
swiftcore-locationgoogle-maps-sdk-ios

How do you get all the businesses within 10 miles of my location in Swift using corelocation?


I want to get all the businesses within 10 miles of my location in Swift. I tried using the geocoder from CoreLocation and GoogleMaps and it gives me random places but I just want to see all the businesses near my location. Is that possible or do I have to cut my search to restaurants, cafe, etc.?


Solution

  • you can use this google api for getting nearby businesses

    https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=-33.8670522,151.1957362&radius=1500&type=restaurant&keyword=cruise&key=YOUR_API_KEY

    also you can see all available keywords from https://developers.google.com/places/web-service/supported_types

    for using multiple keywords simultaneously

    https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=-33.8670522,151.1957362&radius=1500&type=atm%7Chospital&key=YOUR_API_KEY

    add keywords seperated by %7C