View
 

Foursquare View

URL | Parameters | Response Properties | Example | Query | Response

 

The foursquare method takes any valid entity's guid and returns an array of JSON object name/value pairs representing Foursquare tip messages and their associated metadata. The returned tips are about places within 1km of point location entities or within the boundaries of a polygon/boundary defined location.

 

By default, Foursquare returns up to 30 tips. If there are no tips in the specified area, the result is [], the empty list.

 

Click here for more information about Foursquare's API and its properties.

 

URL          [Top]

 

http://api.geoapi.com/v1/e/<guid>/view/foursquare

 

Parameters          [Top]

 

  • guid:
    • Required.
    • Any entity's guid.
    • Format: String. Can be the guid of any entity type.
  • apikey:
    • Required.
    • Your application's GeoAPI key.
    • Format: String.
  • pretty:
    • Optional.
    • Enables easier to read prettified JSON in 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.

 

Response Properties          [Top]

 

  • distance: An integer, the number of meters from either the entity's point location or the center of its polygon. 
  • created: A string, when the tip was posted, in the format "Sat, 23 May 09 10:18:58 +0000"..
  • url: A string, a url the poster wants associated with the post. Optional, and if it has no value, this property doesn't appear in the response.
  • text: A string, the tip message content.
  • venue: A JSON object consisting of the following property fields that describe the location the user sent the tip about. 
    • city: A string, the name of the venue's city. Note that since this value comes from Foursquare, not GeoAPI, it may differ from GeoAPI's city entity for the post's location.
    • geolat: A floating point number, latitude coordinate value.
    • name: A string, the venue's name.
    • zip: A string (not a number), the location's zip code. This value is optional, and may not be returned.
    • phone: A string, the venue's phone number. This value is optional, and may not be returned.
    • geolong: A floating point number, longitude coordinate value.
    • state: A string, the official abbreviation of the location's state.
    • crossstreet: A string, description of a nearby cross street such as "Next to Homestead".
    • address: A string, the street number and street part of the venue's address.
    • id: An integer, the venue's unique Foursquare id.
  • user: A JSON object consisting of the following property fields that describe the Foursquare user who posted the tip.
    • lastname: A string, the value Foursquare has for the poster's last name. It's user-provided, so, for example, may only be an initial.
    • photo: A string, a url for the poster's Foursquare profile picture.
    • id: An integer, the poster's unique Foursquare id.
    • firstname: A string, the value Foursquare has for the poster's first name.
    • gender: A string, the value Foursquare has for the poster's gender.
  • id: An integer, Foursquare's unique identifier for this tip message.

 

Example          [Top]

 

Query          [Top]

 

http://api.geoapi.com/v1/e/mission-san-francisco-ca/view/foursquare?apikey=demo&pretty=1

 

Response          [Top]

 

{
"query": {
"type": "entity-view", 
"params": {
"guid": "mission-san-francisco-ca", 
"view": "foursquare"
}
}, 
"result": [
{
"distance": 5, 
"created": "Sat, 23 May 09 10:18:58 +0000", 
"text": "Question: do you enjoy the high life? Answer: Come to the room.", 
"venue": {
"city": "San Francisco", 
"geolat": 37.760051, 
"name": "the Champagne Room (of beer)", 
"zip": "94110", 
"geolong": -122.414535, 
"state": "CA", 
"crossstreet": "Next to Homestead", 
"address": "2325 Folsom", 
"id": 51044
}, 
"user": {
"lastname": "Z.", 
"photo": "http://playfoursquare.s3.amazonaws.com/userpix_thumbs/2846_1259358338760.jpg", 
"id": 2846, 
"firstname": "Jessica", 
"gender": "female"
}, 
"id": 10760
}, 
{
"distance": 12, 
"created": "Tue, 24 Nov 09 10:21:00 +0000", 
"text": "always bring a lime for the tecate.", 
"venue": {
"city": "San Francisco", 
"geolat": 37.759983, 
"name": "The Year 2331", 
"zip": "94110", 
"geolong": -122.414528, 
"state": "CA", 
"crossstreet": "19th", 
"address": "2331 Folsom", 
"id": 160978
}, 
"user": {
"lastname": "H.", 
"photo": "http://playfoursquare.s3.amazonaws.com/userpix_thumbs/115634_1259711221051.jpg", 
"id": 115634, 
"firstname": "Jenn", 
"gender": "female"
}, 
"id": 93604
}, 
{
"distance": 56, 
"created": "Thu, 05 Nov 09 00:47:46 +0000", 
"url": "secretsociety.org", 
"text": "Hang out with Secret Society Scooter Club (if you can find them)...", 
"venue": {
"city": "San Francisco", 
"geolat": 37.7604, 
"name": "Homestead", 
"zip": "94110", 
"geolong": -122.415, 
"state": "CA", 
"crossstreet": "at 19th St", 
"address": "2301 Folsom St", 
"id": 23637
}, 
"user": {
"lastname": "L.", 
"photo": "http://playfoursquare.s3.amazonaws.com/userpix_thumbs/84131_1257888672921.jpg", 
"id": 84131, 
"firstname": "Chris (CJ)", 
"gender": "male"
}, 
"id": 72374
}, 
...
]
}