Link to home
Start Free TrialLog in
Avatar of ITsolutionWizard
ITsolutionWizardFlag for United States of America

asked on

google api c# place, json

I have the google c# api code and it works fine.But I want to get
child node : photos {height and width}.
rating
open now
weekday text
viewport

Can you help me what I need to do with the codes below? Thank

reference: https://developers.google.com/places/web-service/search


       
protected void Page_Load(object sender, EventArgs e)
        {
             WebClient wc = new WebClient();
            string jsonStr = wc.DownloadString("https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=37.753,-122.443&radius=10000&type=rv_park&key=AIzaSyCietasdfasdfasdfasdfxzD65Uc19X6DgrJFumdi-nCZYSHjg");
            GooglePlacesResponse gpr = (GooglePlacesResponse)JsonConvert.DeserializeObject<GooglePlacesResponse>(jsonStr);
            Response.Write(gpr.status + "<br><br>");
            foreach (results r in gpr.results)
                {
                
                Response.Write
                    (r.name + " "  + 
                     r.geometry.location.lat + " " + 
                     r.geometry.location.lng + " " +
                     r.reference + " " +
                     r.vicinity  + " " +                         
                     "<br><br>");
            }

         } 
        public class GooglePlacesResponse
        {
            public string status { get; set; }
            public results[] results { get; set; }
        }
        public class results
        {
            public geometry geometry { get; set; }
            public string name { get; set; }
            public string reference { get; set; }
            public string vicinity { get; set; }              
        }
        public class geometry
        {
            public location location { get; set; }             
        }         
        public class location
        {
            public string lat { get; set; }
            public string lng { get; set; }
        } 

Open in new window

Avatar of ITsolutionWizard
ITsolutionWizard
Flag of United States of America image

ASKER

any helps?
ASKER CERTIFIED SOLUTION
Avatar of Flabio Gates
Flabio Gates

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial