Geotagging API

14 views
Skip to first unread message

Raffi Krikorian

unread,
Nov 19, 2009, 4:51:29 PM11/19/09
to twitter-ap...@googlegroups.com, twitter-deve...@googlegroups.com
As you may have seen on the Twitter blog [1], geotagging is now
available for all users and developers throughout Twitter's APIs.
Specific geotagging methods have been added and existing formats
expanded to accommodate this rich new information.

To get started developing with this API and sending geotweets, check out

http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-statuses%C2%A0update

Geotweets now carry the geotag whenever available and whenever they
appear in our REST, Search, and Streaming APIs.

Remember, geotagging is disabled by default on users' accounts.
Encourage your users to enable it by sending them to their settings
page [2]. From that page, a user can turn this feature on by checking
the "Enable geotagging" checkbox. Alternatively, we're also providing
a mobile optimized geotagging settings page [3] that you can send them
too as well. As a developer, you can determine whether a user has
enabled geotagging by calling the users/show method [4] or in any
other <user> element returned by the REST API where a user object
shows up -- just look for the geo_enabled flag.

For more hints on how to use geotagging, check out our Geotagging Best
Practices page [5] where we have UX mock-ups, hints on how to best
support user privacy, and more.

We're really excited about this feature! And more is coming.

Go get lost. We'll send help.

[1] http://blog.twitter.com/2009/11/think-globally-tweet-locally.html
[2] http://twitter.com/account/settings
[3] http://m.twitter.com/account/settings/geo
[4] http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-users%C2%A0show
[5] http://help.twitter.com/forums/26810/entries/78525

--
Raffi Krikorian
Twitter Platform Team
ra...@twitter.com | @raffi




djMax

unread,
Nov 20, 2009, 4:55:31 PM11/20/09
to Twitter Development Talk
How does this interact with the search mechanism, if at all? i.e. when
I do a near search, I *don't* want tweets that come from people who's
profile sets them near that place, but instead only for *tweets*
marked as near that place.

On Nov 19, 4:51 pm, Raffi Krikorian <ra...@twitter.com> wrote:
> As you may have seen on the Twitter blog [1], geotagging is now  
> available for all users and developers throughout Twitter's APIs.  
> Specific geotagging methods have been added and existing formats  
> expanded to accommodate this rich new information.
>
> To get started developing with this API and sending geotweets, check out
>
> http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-statuses%C2%A0u...

Raffi Krikorian

unread,
Nov 20, 2009, 4:57:55 PM11/20/09
to twitter-deve...@googlegroups.com
that is currently unsupported -- right now you will get both. you
could, once receiving the search results, filter on the values in the
<geo> tag that is returned in the search API.

> How does this interact with the search mechanism, if at all? i.e. when
> I do a near search, I *don't* want tweets that come from people who's
> profile sets them near that place, but instead only for *tweets*
> marked as near that place.
>

djMax

unread,
Nov 20, 2009, 5:11:13 PM11/20/09
to Twitter Development Talk
That's not so bad. So you're saying search is going to consider
either user loc or tweet loc (and I assume pick the closest)?

Raffi Krikorian

unread,
Nov 20, 2009, 5:13:15 PM11/20/09
to twitter-deve...@googlegroups.com
search should override profile location with tweet location (on the
assumption that tweet location is more specific information).

> That's not so bad. So you're saying search is going to consider
> either user loc or tweet loc (and I assume pick the closest)?
>

JOHN OBRIEN

unread,
Nov 20, 2009, 5:21:04 PM11/20/09
to twitter-deve...@googlegroups.com
Quick question...

What format will [geo] be from the /search api?

just the lat long, something like...

[geo] => 37.78029 -122.39697

I am watching a bunch of tweets coming into our service, but I can't find one that is populated, so just thought I would ask.

(And I can't see anything from my account just yet... )

Thanks,
John 

Raffi Krikorian

unread,
Nov 20, 2009, 5:40:13 PM11/20/09
to twitter-deve...@googlegroups.com
here is something i just ran against the search API (i formatted the JSON for readability).

[raffi@tw-mbp13-raffi twitter (homing_pigeon)]$ curl "http://search.twitter.com/search.json?q=&ands=twitter+FTW&from=raffi"
{
    "results":
    [
        {
            "created_at":"Fri,
             20 Nov 2009 15:40:40 +0000",
            "from_user":"raffi",
            "to_user_id":null,
            "text":"Soy milk, FTW (@ Twitter in SF) http://bit.ly/NUNGf",
            "id":5892191934,
            "from_user_id":278432,
            "geo":
            {
                "type":"Point",
                "coordinates":
                [
                    37.7824,
                    -122.4009
                ]
            },
            "iso_language_code":"en",
            "source":"&lt;a href=&quot;http://foursquare.com&quot; rel=&quot;nofollow&quot;&gt;foursquare&lt;/a&gt;"
        }
    ],
    "max_id":5900232920,
    "since_id":0,
    "refresh_url":"?since_id=5900232920&q=+twitter+FTW+from%3Araffi",
    "results_per_page":15,
    "page":1,
    "completed_in":0.01934,
    "query":"+twitter+FTW+from%3Araffi"
}

JOHN OBRIEN

unread,
Nov 20, 2009, 5:50:31 PM11/20/09
to twitter-deve...@googlegroups.com, twitter-deve...@googlegroups.com


Sent from my iPhone

Paveo

unread,
Nov 20, 2009, 4:21:54 AM11/20/09
to Twitter Development Talk
that's a cool feature, I hope if a tweet has a geo info, that can be
shown in twitter.com web.

On Nov 20, 5:51 am, Raffi Krikorian <ra...@twitter.com> wrote:
> As you may have seen on the Twitter blog [1], geotagging is now  
> available for all users and developers throughout Twitter's APIs.  
> Specific geotagging methods have been added and existing formats  
> expanded to accommodate this rich new information.
>
> To get started developing with this API and sending geotweets, check out
>
> http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-statuses%C2%A0u...

JOHN OBRIEN

unread,
Nov 21, 2009, 5:17:45 PM11/21/09
to twitter-deve...@googlegroups.com
Raffi, 
Thanks again for this.  Is there anywhere in the wiki that explains the various "types" (Point, etc) and if the object model is different?

[I didn't see anything offhand...]

Thanks again,
John
@jobrieniii

JOHN OBRIEN

unread,
Nov 21, 2009, 5:20:49 PM11/21/09
to twitter-deve...@googlegroups.com
Wait - I did a little reading and figured out you are aligned with http://geojson.org/

Thanks,
John
@jobrieniii

Raffi Krikorian

unread,
Nov 21, 2009, 5:53:29 PM11/21/09
to twitter-deve...@googlegroups.com

right now we only support point types -- you'll see georss for XML and geojson for JSON.

does that help?

JOHN OBRIEN

unread,
Nov 22, 2009, 11:51:52 AM11/22/09
to twitter-deve...@googlegroups.com
Raffi - thanks for confirming that only type Point is being leveraged at this time... made my update to TwapperKeeper much easier this morning.

Of course, I created a little technical baggage depending on when other types are leveraged.. but will cross that bridge when the time comes.

Thanks again,
John
@jobrieniii

JOHN OBRIEN

unread,
Nov 23, 2009, 12:25:12 PM11/23/09
to twitter-deve...@googlegroups.com
Raffi / list - thanks again for confirming things with re: to GeoJSON.

It will be interesting to see the adoption of the Geo tagging across the numerous hashtags we are tracking at TwapperKeeper.


Thanks again,
John
@jobrieniii
On Nov 21, 2009, at  5:53 PM, Raffi Krikorian wrote:

Reply all
Reply to author
Forward
0 new messages