URL | Parameters | Response Properties | Example | Query | Response
The twitter method takes an entity's guid and returns an array of JSON object name/value pairs representing tweets and their associated metadata. The tweets were made either within 1km of a point location entity or inside of a polygon/boundary defined entity. If no tweets were made in the area, the response is the empty list []. You can only run twitter on business, neighborhood, and intersection entities.
The tweet results use the format of Twitter's JSON Search API. Returned property values are all strings. If you submit a query with a non-existant or non-business/neighborhood/intersection guid, the caller gets an HTTP 404 error response.
http://api.geoapi.com/v1/e/<guid>/view/twitter
http://api.geoapi.com/v1/e/<guid>/view/twitter:<view parameters>
Parameters [Top]
- guid:
- Required.
- A business, intersection, or neighborhood entity guid. Other entity types are invalid.
- Format: String.
- apikey:
- Required.
- The application's GeoAPI key.
- Format: String.
- pretty:
- Optional.
- Enables easier to read prettified JSON in the result.
- Format: Set equal to 1 to enable prettification.
- jsoncallback:
- Optional.
- Return response in JSONP format. JQuery has nice support for JSONP callbacks.
- Format: JSON prefix string.
- <view-parameters>:
- Any of the parameters accepted by the Twitter's JSON Search API. These parameters are just passed onto Twitter. For example, /view/twitter:q=foo causes a Twitter search for "foo" and only tweets containing "foo" are returned. Note that if you include arguments that contain spaces, the spaces must be urlized. For example, to search for "Mixer Labs", you'd have to do /view/twitter:q=Mixer%20Labs
Response Properties [Top]
Results are in the format of Twitter's JSON Search API.
twitter is also used in the Media Layers and Twitter Empire demos.
http://api.geoapi.com/v1/e/ritual-coffee-roasters-san-francisco-ca-94110/view/twitter?apikey=demo&pretty=1
{
"query": {
"params": {
"guid": "ritual-coffee-roasters-san-francisco-ca-94110",
"view": "twitter"
},
"type": "entity-view"
},
"result": [
{
"iso_language_code": "en",
"text": "fired up on caffeine",
"created_at": "Thu, 12 Nov 2009 19:26:26 +0000",
"profile_image_url": "http://a3.twimg.com/profile_images/52568973/s907814_34585506_1293_normal.jpg",
"source": "<a href="http://twitter.com/">web</a>",
"location": "iPhone: 37.754241,-122.423147",
"from_user": "bailey_v",
"from_user_id": 153667,
"to_user_id": null,
"geo": null,
"id": 5657224157
},
...
]
}