Home > Net >  Google Places API returns "Unsupported field name 'address_component'"
Google Places API returns "Unsupported field name 'address_component'"

Time:04-11

I'm using the Google Places API to find the address details of a small village in India, following this documentation from Google. My https request looks as follows:

https://maps.googleapis.com/maps/api/place/findplacefromtext/json?key=MY_API_KEY&inputtype=textquery&input=Dahigaon&fields=name,geometry,address_component

My problem is that the request above returns the following error:

Error while parsing 'fields' parameter: Unsupported field name 'address_component'.

I've tried a couple of other 'field' values, and they all seem to work except for address_component. Any thoughts on what I'm doing wrong?

CodePudding user response:

Figured this one out. Apparently "Place Search, Nearby Search, and Text Search requests all return a subset of the fields that are returned by Place Details requests." See here for details: LINK

address_component is one of those fields...

  • Related