Example GET with lat/long queries Invalid Coordinates


The documented example GET requests using lat and long query keep giving me Invalid Coordinates.


{“errors”:[{“code”:3,“message”:“Invalid coordinates.”}]}


Hey, please verify that you are encoding these values right. You need to use URL encoding. I just tried it and it works fine here:

    "result": { 
        "places": [ 
                "id": "5a110d312052166f", 
                "url": "https://api.twitter.com/1.1/geo/id/5a110d312052166f.json", 
                "place_type": "city", 
                "name": "San Francisco", 
                "full_name": "San Francisco, CA", 
               /* Truncated */

If the url encoding is not the issue, please let us know, as it might be an issue with the API then.


Thanks ePirat. Could you show the command? I am a little of a noob with GET commands.

I am using twurl (oauth authenticated) which works for most of the other GETs (I haven’t tried all of them), including trends/places.json?id=

This works:
twurl /1.1/search/tweets.json?q=%23freebandnames&since_id=…

This doesn’t
twurl /1.1/trends/closest.json?lat=37.781157&long=-122.400612831116

Thanks again!


Maybe you forgot quoting the string?

twurl "/1.1/trends/closest.json?lat=37.781157&long=-122.400612831116"
[{"name":"San Francisco","placeType":{"code":7,"name":"Town"},"url":"http:\/\/where.yahooapis.com\/v1\/place\/2487956","parentid":23424977,"country":"United States","woeid":2487956,"countryCode":"US"}]

works fine for me.


Hmmm, I thought I had before. All that because of quotes, doh! Thanks ePirat!!!