Location Object

Location obejcts can exist within the actor obejct set on the Twitter account level or within the profileLocations object of the gnip object. Location objects have a place object type and can have a name, address, or geo coordinates. Location objects are similar to Geo in native enriched format.

Location data dictionary

Field Type Description
objectType string See here for more detailed information. Example:
"objectType": "place"
displayName string The full name of the location.

"displayName": "United States"
name string Name of the location from Twitter's place JSON format.
link string A link to the full Twitter JSON representation of the place.

"link": "https://api.twitter.com/1.1/geo/id/27c45d804c777999.json"
geo object The geo coordintates object from Twitter. Either a polygon, or point.


See geo
countryCode String Shortened country code representing the country containing this place. Example:

"countryCode": "US
country String Name of the country containing this place. Example:
"country": "United States"


profileLocations derived obejcts

Field Type Description
address object Within profileLocation location object within the gnip object. Address of location derived by the profile geo enrichement. Level of granularity will vary.
"address": {
"country": "United States",
"countryCode": "US",
"locality": "Providence",
"region": "Rhode Island",
"subRegion": "Providence County"
}
geo object Within profileLocation location object within the gnip object. Centroid coordinates of the location derived by the profile geo enrichement.
"geo": {
"coordinates": [
-98.5,
39.76
],
"type": "point"
}

 

Examples

      "location": {
    "objectType": "place",
    "displayName": "Kansas, USA",
    "name": "Kansas",
    "country_code": "United States",
    "twitter_country_code": "US",
    "twitter_place_type": "admin",
    "link": "https://api.twitter.com/1.1/geo/id/27c45d804c777999.json",
    "geo": {
      "type": "Polygon",
      "coordinates": [
        [
          [
            -102.051769,
            36.99311
          ],
          [
            -102.051769,
            40.003282
          ],
          [
            -94.588081,
            40.003282
          ],
          [
            -94.588081,
            36.99311
          ]
        ]
      ]
    }

    
          "location": {
      "objectType": "place",
      "displayName": "California, USA"
    }
    
Was this document helpful?
Thank you

Thank you for the feedback. We’re really glad we could help!

Thank you for the feedback. How could we improve this document?
Thank you for the feedback. Your comments will help us improve our documents in the future.