Hello,
When I write this url 
https://maps.googleapis.com/maps/api/geocode/json?address=CARRETERA+B-500%2C+km+3%2C+TIANA&key=AIzaSyAfdSXpkZB7qctrEh_aQqt6CesRIcA4vRE
 in 
my web explorer I get the correct postal_code:

{
   "results" : [
      {
         "address_components" : [
            {
               "long_name" : "Barcelona",
               "short_name" : "Barcelona",
               "types" : [ "administrative_area_level_2", "political" ]
            },
            {
               "long_name" : "España",
               "short_name" : "ES",
               "types" : [ "country", "political" ]
            },
            {
               "long_name" : "08391",
               "short_name" : "08391",
               "types" : [ "postal_code" ]
            }
         ],
         "formatted_address" : "Carretera B-500 Badalona-Mollet km.3,2, 08391, 
Barcelona, España",
         "geometry" : {
            "location" : {
               "lat" : 41.478713,
               "lng" : 2.257954
            },
            "location_type" : "GEOMETRIC_CENTER",
            "viewport" : {
               "northeast" : {
                  "lat" : 41.4800619802915,
                  "lng" : 2.259302980291502
               },
               "southwest" : {
                  "lat" : 41.4773640197085,
                  "lng" : 2.256605019708498
               }
            }
         },
         "place_id" : "ChIJV6E_B7a7pBIROWN9PW2WDc8",
         "plus_code" : {
            "compound_code" : "F7H5+F5 Mas Ram, España",
            "global_code" : "8FH4F7H5+F5"
         },
         "types" : [ "establishment", "point_of_interest" ]
      }
   ],
   "status" : "OK"
}


But the same url in PHP no returns postal_code:

https://maps.googleapis.com/maps/api/geocode/json?address=CARRETERA+B500%2C+km+3%2C+TIANA&key=AIzaSyAfdSXpkZB7qctrEh_aQqt6CesRIcA4vRE
array(2) {
  ["results"]=>
  array(1) {
    [0]=>
    array(6) {
      ["address_components"]=>
      array(4) {
        [0]=>
        array(3) {
          ["long_name"]=>
          string(5) "B-500"
          ["short_name"]=>
          string(5) "B-500"
          ["types"]=>
          array(1) {
            [0]=>
            string(5) "route"
          }
        }
        [1]=>
        array(3) {
          ["long_name"]=>
          string(9) "Barcelona"
          ["short_name"]=>
          string(9) "Barcelona"
          ["types"]=>
          array(2) {
            [0]=>
            string(27) "administrative_area_level_2"
            [1]=>
            string(9) "political"
          }
        }
        [2]=>
        array(3) {
          ["long_name"]=>
          string(9) "Cataluña"
          ["short_name"]=>
          string(2) "CT"
          ["types"]=>
          array(2) {
            [0]=>
            string(27) "administrative_area_level_1"
            [1]=>
            string(9) "political"
          }
        }
        [3]=>
        array(3) {
          ["long_name"]=>
          string(5) "Spain"
          ["short_name"]=>
          string(2) "ES"
          ["types"]=>
          array(2) {
            [0]=>
            string(7) "country"
            [1]=>
            string(9) "political"
          }
        }
      }
      ["formatted_address"]=>
      string(23) "B-500, Barcelona, Spain"
      ["geometry"]=>
      array(4) {
        ["bounds"]=>
        array(2) {
          ["northeast"]=>
          array(2) {
            ["lat"]=>
            float(41.5351073)
            ["lng"]=>
            float(2.2630393)
          }
          ["southwest"]=>
          array(2) {
            ["lat"]=>
            float(41.4492844)
            ["lng"]=>
            float(2.2089109)
          }
        }
        ["location"]=>
        array(2) {
          ["lat"]=>
          float(41.5020788)
          ["lng"]=>
          float(2.244613)
        }
        ["location_type"]=>
        string(16) "GEOMETRIC_CENTER"
        ["viewport"]=>
        array(2) {
          ["northeast"]=>
          array(2) {
            ["lat"]=>
            float(41.5351073)
            ["lng"]=>
            float(2.2630393)
          }
          ["southwest"]=>
          array(2) {
            ["lat"]=>
            float(41.4492844)
            ["lng"]=>
            float(2.2089109)
          }
        }
      }
      ["partial_match"]=>
      bool(true)
      ["place_id"]=>
      string(27) "ChIJ6QO8C9K-pBIRxf0esCJr374"
      ["types"]=>
      array(1) {
        [0]=>
        string(5) "route"
      }
    }
  }
  ["status"]=>
  string(2) "OK"
}
array(2) {
  ["results"]=>
  array(1) {
    [0]=>
    array(6) {
      ["address_components"]=>
      array(4) {
        [0]=>
        array(3) {
          ["long_name"]=>
          string(5) "B-500"
          ["short_name"]=>
          string(5) "B-500"
          ["types"]=>
          array(1) {
            [0]=>
            string(5) "route"
          }
        }
        [1]=>
        array(3) {
          ["long_name"]=>
          string(9) "Barcelona"
          ["short_name"]=>
          string(9) "Barcelona"
          ["types"]=>
          array(2) {
            [0]=>
            string(27) "administrative_area_level_2"
            [1]=>
            string(9) "political"
          }
        }
        [2]=>
        array(3) {
          ["long_name"]=>
          string(9) "Cataluña"
          ["short_name"]=>
          string(2) "CT"
          ["types"]=>
          array(2) {
            [0]=>
            string(27) "administrative_area_level_1"
            [1]=>
            string(9) "political"
          }
        }
        [3]=>
        array(3) {
          ["long_name"]=>
          string(5) "Spain"
          ["short_name"]=>
          string(2) "ES"
          ["types"]=>
          array(2) {
            [0]=>
            string(7) "country"
            [1]=>
            string(9) "political"
          }
        }
      }
      ["formatted_address"]=>
      string(23) "B-500, Barcelona, Spain"
      ["geometry"]=>
      array(4) {
        ["bounds"]=>
        array(2) {
          ["northeast"]=>
          array(2) {
            ["lat"]=>
            float(41.5351073)
            ["lng"]=>
            float(2.2630393)
          }
          ["southwest"]=>
          array(2) {
            ["lat"]=>
            float(41.4492844)
            ["lng"]=>
            float(2.2089109)
          }
        }
        ["location"]=>
        array(2) {
          ["lat"]=>
          float(41.5020788)
          ["lng"]=>
          float(2.244613)
        }
        ["location_type"]=>
        string(16) "GEOMETRIC_CENTER"
        ["viewport"]=>
        array(2) {
          ["northeast"]=>
          array(2) {
            ["lat"]=>
            float(41.5351073)
            ["lng"]=>
            float(2.2630393)
          }
          ["southwest"]=>
          array(2) {
            ["lat"]=>
            float(41.4492844)
            ["lng"]=>
            float(2.2089109)
          }
        }
      }
      ["partial_match"]=>
      bool(true)
      ["place_id"]=>
      string(27) "ChIJ6QO8C9K-pBIRxf0esCJr374"
      ["types"]=>
      array(1) {
        [0]=>
        string(5) "route"
      }
    }
  }
  ["status"]=>
  string(2) "OK"
}



Can anyone help me?


Thanks


-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/f6a012b1-a498-497e-86ad-08c89c3384e1%40googlegroups.com.

Reply via email to