-1

I want to get the results of google geocode api in English language. I am using the following link. It is returning the results in arabic language.

Am I missing something ?

http://maps.googleapis.com/maps/api/geocode/json?latlng=24.744165,46.676800&sensor=true&language=en

geocodezip
  • 158,664
  • 13
  • 220
  • 245
Sohit
  • 13
  • 3
  • and you are trying to fetch which variable? – Jaymin Aug 11 '17 at 05:24
  • Show us your code and is it in PHP or IOS? – M. Eriksson Aug 11 '17 at 05:27
  • 1
    I am fetching 0 index of result array. country, administrative_area_level_1, locality – Sohit Aug 11 '17 at 05:28
  • Welcome to SO. Please read: [How to create a Minimal, Complete, and Verifiable example](http://stackoverflow.com/help/mcve) and also [How do I ask a good question?](http://stackoverflow.com/help/how-to-ask) – M. Eriksson Aug 11 '17 at 05:28
  • it's already in english, but some address name are not translatable like: New York in french is always New york, language=fr would change Saudi Arabia to Arabie saoudite – Fetrarij Aug 11 '17 at 05:28
  • is there any possibility to get country, administrative_area_level_1 in English from 0 index – Sohit Aug 11 '17 at 05:30
  • Did you check the response? Under `address_components` it's written with English characters. This question is of really poor quality. It has nothing to do with programming since it doesn't contain _any_ code what so ever (it's purely a "how does google's API work"), it's tagged with multiple unrelated tags and the answer is in the question itself... – M. Eriksson Aug 11 '17 at 05:33

2 Answers2

1

try this

$results['address_components']->formatted_address ;
Jaymin
  • 1,643
  • 1
  • 18
  • 39
0

I already faced this issue, as far as I know, the API provide the result in the language you ask if available, otherway it use the avalible language. In your case I guess, that only arabic is available. I'm sorry but I don't remember if it is clearly stated in the api documentation and where.

Have a look at this question: Inconsistent language in Google Place Details API

and at Google API documentation