What data is usually contained in the place field?

2,245 views
Skip to first unread message

D. Smith

unread,
Oct 12, 2010, 3:49:36 PM10/12/10
to Twitter Development Talk
I have seen this field in streaming api, but never got a chance to see
any actual data for this field. Can someone explain to me what usually
will be the the "place" when it's not null?

Matt Harris

unread,
Oct 12, 2010, 6:13:35 PM10/12/10
to twitter-deve...@googlegroups.com
Hi,

For countries where Geo is supported twitter.com allows you to set the
location you are tweeting from. The place chosen on this screen is the
one entered as the place information in a Tweet. For other
applications this information is set by passing the place_id parameter
when Tweeting. (More info:
http://dev.twitter.com/doc/post/statuses/update )

A quick request for the status from @twitterapi includes an example of
the place attribute:
twurl "/1/statuses/user_timeline.json?screen_name=twitterapi&trim_user=1&count=1"

[
{
"coordinates": null,
"favorited": false,
"created_at": "Tue Oct 12 17:40:03 +0000 2010",
"truncated": false,
"text": "Snowflake is on ice for the moment so no new IDs yet.
We'll post an update to the developer mailing list with more
information soon.",
"contributors": [
777925
],
"annotations": null,
"id": 27159735506,
"retweet_count": 0,
"geo": null,
"retweeted": false,
"in_reply_to_user_id": null,
"user": {
"id": 6253282
},
"source": "web",
"in_reply_to_screen_name": null,
"place": {
"name": "Twitter HQ",
"country": "The United States of America",
"country_code": "US",
"attributes": {
"street_address": "795 Folsom St"
},
"url": "http://api.twitter.com/1/geo/id/247f43d441defc03.json",
"id": "247f43d441defc03",
"bounding_box": {
"coordinates": [
[
[
-122.400612831116,
37.7821120598956
],
[
-122.400612831116,
37.7821120598956
],
[
-122.400612831116,
37.7821120598956
],
[
-122.400612831116,
37.7821120598956
]
]
],
"type": "Polygon"
},
"full_name": "Twitter HQ, San Francisco",
"place_type": "poi"
},
"in_reply_to_status_id": null
}
]

Hope that helps,

@themattharris
Developer Advocate, Twitter
http://twitter.com/themattharris

> --
> Twitter developer documentation and resources: http://dev.twitter.com/doc
> API updates via Twitter: http://twitter.com/twitterapi
> Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
> Change your membership to this group: http://groups.google.com/group/twitter-development-talk
>

D. Smith

unread,
Oct 12, 2010, 6:26:54 PM10/12/10
to Twitter Development Talk
Interesting. How is it that in the sample status the geo is null and
the place is not null?
How is the place determined if there is no geo data?

Does this mean that status can have place object not null even when
the geo is null?
> Developer Advocate, Twitterhttp://twitter.com/themattharris

Matt Harris

unread,
Oct 12, 2010, 6:51:49 PM10/12/10
to twitter-deve...@googlegroups.com
Great question.

Geo means the latitude and longitude of the user as reported by the
device they are using, was sent to us. A user can say they are at a
place, e.g. Twitter HQ, or San Francisco, without revealing their
exact latitude and longitude. Place support is relatively new and many
applications have not added it yet, so instead they pass the latitude
and longitude of the device location when Tweeting. If the latitude
and longitude is sent we will try and derive the neighborhood (place)
where that latitude and longitude is.

What this means is:

Just Geo: The Tweet was created with a latitude and longitude being
passed to it. The lat/long is for a place not yet know to our database
Geo and Place: The Tweet was created with a latitude and longitude
being passed to it. The lat/long is known to our database and the
neighborhood it corresponds to was set as the place.
Just Place: The Tweet was created with a place_id being passed to it,
but no lat/long.

Hope that explains the difference,
@themattharris
Developer Advocate, Twitter
http://twitter.com/themattharris

D. Smith

unread,
Oct 12, 2010, 6:55:48 PM10/12/10
to Twitter Development Talk
Great explanation, thanks.

On Oct 12, 6:51 pm, Matt Harris <thematthar...@twitter.com> wrote:
> Great question.
>
> Geo means the latitude and longitude of the user as reported by the
> device they are using, was sent to us. A user can say they are at a
> place, e.g. Twitter HQ, or San Francisco, without revealing their
> exact latitude and longitude. Place support is relatively new and many
> applications have not added it yet, so instead they pass the latitude
> and longitude of the device location when Tweeting. If the latitude
> and longitude is sent we will try and derive the neighborhood (place)
> where that latitude and longitude is.
>
> What this means is:
>
> Just Geo: The Tweet was created with a latitude and longitude being
> passed to it. The lat/long is for a place not yet know to our database
> Geo and Place: The Tweet was created with a latitude and longitude
> being passed to it. The lat/long is known to our database and the
> neighborhood it corresponds to was set as the place.
> Just Place: The Tweet was created with a place_id being passed to it,
> but no lat/long.
>
> Hope that explains the difference,
> @themattharris

D. Smith

unread,
Oct 12, 2010, 7:31:30 PM10/12/10
to Twitter Development Talk
I think it's also strange that you include Street address, Country but
NO City and NO State!
I think State and City/Town name would be very helpful

Matt Harris

unread,
Oct 12, 2010, 7:52:28 PM10/12/10
to twitter-deve...@googlegroups.com
We only return enough to display the basic information about a place.
This is because some places have a lot of information in their place
object, for example some cities and areas have a polygon with over 600
points. For more detailed information make a request to the URL given
in the place object:
http://api.twitter.com/1/geo/id/247f43d441defc03.json

Things like city and state come from the Geo hierarchy indicated by
the contained_within data returned from the place URL.

@themattharris
Developer Advocate, Twitter
http://twitter.com/themattharris

D. Smith

unread,
Oct 12, 2010, 8:05:22 PM10/12/10
to Twitter Development Talk
I understand, but without City and State it's really not very useful.
Sure I can lookup more using your place id, but with streaming api,
things are downloaded blindingly fast, really don't want to make a new
call for every status that has place ID.

I in interested in using streaming api to do stats on number of
mentions of certain words/people per city/state/day
Right not I can only record place id, then once a day download city/
state data per each place id, so it would not really be real time

On Oct 12, 7:52 pm, Matt Harris <thematthar...@twitter.com> wrote:
> We only return enough to display the basic information about a place.
> This is because some places have a lot of information in their place
> object, for example some cities and areas have a polygon with over 600
> points. For more detailed information make a request to the URL given
> in the place object:
>    http://api.twitter.com/1/geo/id/247f43d441defc03.json
>
> Things like city and state come from the Geo hierarchy indicated by
> the contained_within data returned from the place URL.
>
> @themattharris
Reply all
Reply to author
Forward
0 new messages