Title: Google Maps for Plugin JSON
Last modified: September 1, 2016

---

# Google Maps for Plugin JSON

 *  Resolved [DenisCGN](https://wordpress.org/support/users/deniscgn/)
 * (@deniscgn)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/google-maps-for-plugin-json/)
 * Hello,
 * I need some help how to get the answers from them google API into PHP.
 *     ```
       {
          "results" : [
             {
                "address_components" : [
                   {
                      "long_name" : "51061",
                      "short_name" : "51061",
                      "types" : [ "postal_code" ]
                   },
                   {
                      "long_name" : "Köln",
                      "short_name" : "Köln",
                      "types" : [ "locality", "political" ]
                   },
                   {
                      "long_name" : "Köln",
                      "short_name" : "K",
                      "types" : [ "administrative_area_level_2", "political" ]
                   },
                   {
                      "long_name" : "Nordrhein-Westfalen",
                      "short_name" : "NRW",
                      "types" : [ "administrative_area_level_1", "political" ]
                   },
                   {
                      "long_name" : "Deutschland",
                      "short_name" : "DE",
                      "types" : [ "country", "political" ]
                   }
                ],
                "formatted_address" : "51061 Köln, Deutschland",
                "geometry" : {
                   "bounds" : {
                      "northeast" : {
                         "lat" : 51.0225911,
                         "lng" : 7.0548179
                      },
                      "southwest" : {
                         "lat" : 50.973904,
                         "lng" : 6.962263
                      }
                   },
                   "location" : {
                      "lat" : 50.9958446,
                      "lng" : 7.004471499999999
                   },
                   "location_type" : "APPROXIMATE",
                   "viewport" : {
                      "northeast" : {
                         "lat" : 51.0225911,
                         "lng" : 7.0548179
                      },
                      "southwest" : {
                         "lat" : 50.973904,
                         "lng" : 6.962263
                      }
                   }
                },
                "place_id" : "ChIJZbBmcTMvv0cRcJElq_9gJxw",
                "types" : [ "postal_code" ]
             }
          ],
          "status" : "OK"
       }
       ```
   
 * For the Geodata and the formated address it is works fine.
 *     ```
       $_lat = $_coordinates->results[0]->geometry->location->lat;
       $_lng = $_coordinates->results[0]->geometry->location->lng;
       $_formAddress = $_coordinates->results[0]->formatted_address;
       ```
   
 * But how do I get the
 * > administrative_area_level_1
 * I tried
 * `$_theLand = $_coordinates->results[0]->address_components[0]->administrative_area_level_1;`
 * but nothing returns only NULL.
 * Any suggestion?
 * Denis

Viewing 1 replies (of 1 total)

 *  Thread Starter [DenisCGN](https://wordpress.org/support/users/deniscgn/)
 * (@deniscgn)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/google-maps-for-plugin-json/#post-7651291)
 * I got it 🙂
 * `$_coordinates->results[0]->address_components[3]->long_name;`

Viewing 1 replies (of 1 total)

The topic ‘Google Maps for Plugin JSON’ is closed to new replies.

## Tags

 * [Google Map API](https://wordpress.org/support/topic-tag/google-map-api/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 1 reply
 * 1 participant
 * Last reply from: [DenisCGN](https://wordpress.org/support/users/deniscgn/)
 * Last activity: [9 years, 9 months ago](https://wordpress.org/support/topic/google-maps-for-plugin-json/#post-7651291)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
