/1.0/search/cities Resource

GET /1.0/search/cities

Search for a city.

Request Parameters
name type description default constraints
country query the city's country    
name query name of the city    
p query the number of the result page you'd like to have 1 int
state query state the city lies in    
stateCode query state code the city lies in    
Response Body
media type data type description
application/json cities (JSON) a list of matching cities
application/xml cities (XML)

Example

Request
GET /1.0/search/cities
Accept: application/json

              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "cities" : [ {
    "id" : "5357527",
    "name" : "Hollywood",
    "stateCode" : "CA",
    "state" : "California",
    "coords" : {
      "long" : -118.3267434,
      "lat" : 34.0983425
    },
    "country" : {
      "code" : "US",
      "name" : "United States"
    }
  }, {
    "id" : "...",
    "name" : "...",
    "stateCode" : "...",
    "state" : "...",
    "coords" : {
      "long" : 12345.0,
      "lat" : 12345.0
    },
    "country" : {
      "code" : "...",
      "name" : "..."
    }
  } ],
  "total" : 42,
  "page" : 1,
  "itemsPerPage" : 20
}