title: How can I determine US County by zip-code?
body: <p>Is it possible to implement a function on clientside in javascript to use it like this:</p>
  
  <pre><code>var county = get_county(zip_code);
  </code></pre>
  
  <p>I mean is it possible to do it online by script? Or I have to dig some database?
  Or I have to buy it?<br></p>
  
  <p>Any help is appreciated! </p>
  
  <p>P.S.<br>
  By the help of Dyrandz Famador, I did this funciton for GAS:</p>
  
  <pre><code>function get_county(zip) {
   var county, response, result, adresses, i, j, n, type;
   response = Maps.newGeocoder().geocode(zip);
   for (i = 0; i &lt; response.results.length; i++) {
     result = response.results[i];
     adresses = result.address_components;
     n = adresses.length;
     for (j=0;j&lt;n;j++) {
       type = adresses[j].types[0];
       if (type == 'locality') county = (adresses[j].long_name);
       if (type == 'administrative_area_level_2')   {county =(adresses[j].long_name);}
     }
   }
   return (county);
  }
  </code></pre>