Geocode search results not localizated

search
geo

#1

I’m using the geo/search endpoint to show the users a dropdown of places and all results I’m getting are in german.
When I do the same GET from the API console, the results are in english. I’m spanish and when I try it from a XAMPP server in local I get the results in spanish.

What I think is appening is that the API is using the language of the geolocation of the server IP (Production Server is in 1&1 - Germany, API console server in USA I supose, and my local development server in Spain).

Is there any way to set the language of the returning results? I don’t see any option in the documentation and using “language=es” in the query as no effects.

Thanks.


#2

Haven’t tried this using REST API, but try adding lang:es to your query to filter tweets in spanish only:

eg:
https://twitter.com/search?f=tweets&vertical=default&q=bueno%20lang%3Aes&src=typd
or English only:
https://twitter.com/search?f=tweets&vertical=default&q=bueno%20lang%3Aen&src=typd
or whatever 2 letter country code you need


#3

I’m using https://api.twitter.com/1.1/geo/search.json?query=Madrid to get locations, not tweets, but as you recomended, using “lang=es” instead of “language=es” give me the places in the right language.

I suppose twitter forgot to add this option to the documentation of the geo/search endpoint.

Thanks for the help.


#4

Oh! i totally missed that it was /geo search, but good to know it works there too!


#5

This is a good hint for us - we should update the docs! thanks (and apologies it wasn’t there already)