POST geo/place

Updated on Wed, 2013-12-04 11:20

As of December 2nd, 2013, this endpoint is deprecated and retired and no longer functions. Place creation was used infrequently by third party applications and is generally no longer supported on Twitter. Requests will return with status 410 (Gone) with error code 251.

Follow the discussion about this retirement.

Created a new place object at the given latitude and longitude.

Before creating a place you needed to query GET geo/similar_places with the latitude, longitude and name of the place you wished to create. The query will return an array of places which are similar to the one you wish to create, and a token. If the place you wished to create wasn't in the returned array you could use the token with this method to create a new one.

Learn more about Finding Tweets about Places.

Resource URL

https://api.twitter.com/1.1/geo/place.json

Parameters

name required

The name a place is known as.

Example Values: Twitter%20HQ

contained_within required

The place_id within which the new place can be found. Try and be as close as possible with the containing place. For example, for a room in a building, set the contained_within as the building place_id.

Example Values: 247f43d441defc03

token required

The token found in the response from geo/similar_places.

Example Values: 36179c9bf78835898ebf521c1defd4be

lat required

The latitude the place is located at. This parameter will be ignored unless it is inside the range -90.0 to +90.0 (North is positive) inclusive. It will also be ignored if there isn't a corresponding long parameter.

Example Values: 37.7821120598956

long required

The longitude the place is located at. The valid ranges for longitude is -180.0 to +180.0 (East is positive) inclusive. This parameter will be ignored if outside that range, if it is not a number, if geo_enabled is disabled, or if there not a corresponding lat parameter.

Example Values: -122.400612831116

attribute:street_address optional

This parameter searches for places which have this given street address. There are other well-known, and application specific attributes available. Custom attributes are also permitted. Learn more About Geo Place Attributes.

Example Values: 795%20Folsom%20St

callback optional

If supplied, the response will use the JSONP format with a callback of the given name.

Example Request

POST

https://api.twitter.com/1.1/geo/create.json

POST Data

None

  1. {
  2.   "name": "Twitter 3rd Floor Lunch Room",
  3.   "polylines": [
  4.  
  5.   ],
  6.   "country": "The United States of America",
  7.   "country_code": "US",
  8.   "attributes": {
  9.  
  10.   },
  11.   "url": "http://api.twitter.com/1/geo/id/6b9811c8d9de10b9.json";,
  12.   "id": "6b9811c8d9de10b9",
  13.   "bounding_box": {
  14.     "coordinates": [
  15.       [
  16.         [
  17.           -122.400612831116,
  18.           37.7821120598956
  19.         ],
  20.         [
  21.           -122.400612831116,
  22.           37.7821120598956
  23.         ],
  24.         [
  25.           -122.400612831116,
  26.           37.7821120598956
  27.         ],
  28.         [
  29.           -122.400612831116,
  30.           37.7821120598956
  31.         ]
  32.       ]
  33.     ],
  34.     "type": "Polygon"
  35.   },
  36.   "contained_within": [
  37.     {
  38.       "name": "Twitter HQ",
  39.       "country": "The United States of America",
  40.       "country_code": "US",
  41.       "attributes": {
  42.         "street_address": "795 Folsom St"
  43.       },
  44.       "url": "http://api.twitter.com/1/geo/id/247f43d441defc03.json";,
  45.       "id": "247f43d441defc03",
  46.       "bounding_box": {
  47.         "coordinates": [
  48.           [
  49.             [
  50.               -122.400612831116,
  51.               37.7821120598956
  52.             ],
  53.             [
  54.               -122.400612831116,
  55.               37.7821120598956
  56.             ],
  57.             [
  58.               -122.400612831116,
  59.               37.7821120598956
  60.             ],
  61.             [
  62.               -122.400612831116,
  63.               37.7821120598956
  64.             ]
  65.           ]
  66.         ],
  67.         "type": "Polygon"
  68.       },
  69.       "full_name": "Twitter HQ, San Francisco",
  70.       "place_type": "poi"
  71.     }
  72.   ],
  73.   "geometry": {
  74.     "coordinates": [
  75.       -122.400612831116,
  76.       37.7821120598956
  77.     ],
  78.     "type": "Point"
  79.   },
  80.   "full_name": "Twitter 3rd Floor Lunch Room, Twitter HQ",
  81.   "place_type": "poi"
  82. }