title: How can I parse just the latitude and longitude information from a JSON string in C# ASP.NET?
body: <p>I've looked everywhere and can't find a solution that works for me with this problem.</p>
  
  <p>I'm using the Google Maps API and need to take an address, convert it to latitude/longitude, and then generate my map with those values. </p>
  
  <p>I'm using NewtonSoft.Json to try and deserialize my string but am getting different errors for every method I try.</p>
  
  <p>Here is how I'm accessing my JSON:</p>
  
  <pre><code>var webClient = new WebClient();
  var json = webClient.DownloadString(@"https://maps.googleapis.com/maps/api/geocode/json?address=1600%20Pennsylvania%20Ave%20NW,%20Washington,%20DC%2020500&amp;key=AIzaSyAKORLziVDRpaIlRs7NrPwGsye9NNn6Mdw");
  </code></pre>
  
  <p>Right now I'm only using a static address for debugging purposes, but will be switching to variables later.</p>
  
  <p><a href="https://maps.googleapis.com/maps/api/geocode/json?address=1600%20Pennsylvania%20Ave%20NW,%20Washington,%20DC%2020500&amp;key=AIzaSyAKORLziVDRpaIlRs7NrPwGsye9NNn6Mdw" rel="nofollow noreferrer" title="Here is the URL to see the JSON">Here is the URL to see the JSON:</a></p>
  
  <p>I know that this is imported correctly because I'm using <code>System.Diagnostics.Debug.WriteLine("json "+json);</code> to check and debug.</p>
  
  <p>I've also confirmed with <a href="https://jsonlint.com/" rel="nofollow noreferrer">https://jsonlint.com/</a> that it is valid JSON.</p>
  
  <p>So now, I need to deserialize this String to grab</p>
  
  <blockquote>
  <pre><code>        "location" : {
             "lat" : 38.8976633,
             "lng" : -77.03657389999999
  </code></pre>
  </blockquote>
  
  <p>and save them into variables for later access. </p>
  
  <p>I would like to do this without making an entire class, but if that's what needs to be done I can manage. </p>
  
  <p>Can anyone help me format the <code>JsonConvert.DeserializeObject()</code> command to work for this?</p>