You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

6.1 KiB

valid search query

Generated: Fri Sep 19 2014 01:19:18 GMT-0400 (EDT)

Request

{
  "protocol": "http:",
  "host": "localhost",
  "method": "GET",
  "port": 3100,
  "path": "/search?input=lake&lat=29.49136&lon=-82.50622"
}

Response

Status: 200
{
  "x-powered-by": "mapzen",
  "charset": "utf8",
  "cache-control": "public,max-age=60",
  "server": "Pelias/0.0.0",
  "access-control-allow-origin": "*",
  "access-control-allow-methods": "GET",
  "access-control-allow-headers": "X-Requested-With,content-type",
  "access-control-allow-credentials": "true",
  "content-type": "application/json; charset=utf-8",
  "content-length": "3127",
  "etag": "W/\"w8ylf9fjcQKf+FF+Qzff1Q==\"",
  "date": "Fri, 19 Sep 2014 05:19:18 GMT",
  "connection": "close"
}
{
  "date": 1411103958550,
  "body": [
    {
      "name": {
        "default": "Blue Pete Lake"
      },
      "admin0": "United States",
      "admin1": "Florida",
      "admin2": "Alachua County",
      "center_point": {
        "lat": "29.50312",
        "lon": "-82.5052"
      },
      "suggest": {
        "input": [
          "blue pete lake"
        ],
        "payload": {
          "id": "geoname/4148289",
          "geo": "-82.5052,29.50312"
        },
        "output": "Blue Pete Lake, Alachua County, United States"
      }
    },
    {
      "name": {
        "default": "Sawgrass Lake"
      },
      "admin0": "United States",
      "admin1": "Florida",
      "admin2": "Levy County",
      "center_point": {
        "lat": "29.47185",
        "lon": "-82.52097"
      },
      "suggest": {
        "input": [
          "sawgrass lake"
        ],
        "payload": {
          "id": "geoname/4172213",
          "geo": "-82.52097,29.47185"
        },
        "output": "Sawgrass Lake, Levy County, United States"
      }
    },
    {
      "name": {
        "default": "Johnson Lake"
      },
      "admin0": "United States",
      "admin1": "Florida",
      "admin2": "Marion County",
      "center_point": {
        "lat": "29.4468",
        "lon": "-82.39141"
      },
      "suggest": {
        "input": [
          "johnson lake"
        ],
        "payload": {
          "id": "geoname/4160400",
          "geo": "-82.39141,29.4468"
        },
        "output": "Johnson Lake, Marion County, United States"
      }
    },
    {
      "name": {
        "default": "Ledwith Lake"
      },
      "admin0": "United States",
      "admin1": "Florida",
      "admin2": "Alachua County",
      "center_point": {
        "lat": "29.49526",
        "lon": "-82.35435"
      },
      "suggest": {
        "input": [
          "ledwith lake"
        ],
        "payload": {
          "id": "geoname/4161738",
          "geo": "-82.35435,29.49526"
        },
        "output": "Ledwith Lake, Alachua County, United States"
      }
    },
    {
      "name": {
        "default": "Levy Lake"
      },
      "admin0": "United States",
      "admin1": "Florida",
      "admin2": "Alachua County",
      "center_point": {
        "lat": "29.52469",
        "lon": "-82.35316"
      },
      "suggest": {
        "input": [
          "levy lake"
        ],
        "payload": {
          "id": "geoname/4047808",
          "geo": "-82.35316,29.52469"
        },
        "output": "Levy Lake, Alachua County, United States"
      }
    },
    {
      "name": {
        "default": "Fox Lake"
      },
      "admin0": "United States",
      "admin1": "Florida",
      "admin2": "Levy County",
      "center_point": {
        "lat": "29.54036",
        "lon": "-82.66311"
      },
      "suggest": {
        "input": [
          "fox lake"
        ],
        "payload": {
          "id": "geoname/4156149",
          "geo": "-82.66311,29.54036"
        },
        "output": "Fox Lake, Levy County, United States"
      }
    },
    {
      "name": {
        "default": "Lake Kanapaha"
      },
      "admin0": "United States",
      "admin1": "Florida",
      "admin2": "Alachua County",
      "center_point": {
        "lat": "29.61705",
        "lon": "-82.40502"
      },
      "suggest": {
        "input": [
          "lake kanapaha"
        ],
        "payload": {
          "id": "geoname/4161281",
          "geo": "-82.40502,29.61705"
        },
        "output": "Lake Kanapaha, Alachua County, United States"
      }
    },
    {
      "name": {
        "default": "Doorshutter Lake"
      },
      "admin0": "United States",
      "admin1": "Florida",
      "admin2": "Levy County",
      "center_point": {
        "lat": "29.53274",
        "lon": "-82.70873"
      },
      "suggest": {
        "input": [
          "doorshutter lake"
        ],
        "payload": {
          "id": "geoname/4153479",
          "geo": "-82.70873,29.53274"
        },
        "output": "Doorshutter Lake, Levy County, United States"
      }
    },
    {
      "name": {
        "default": "Wauberg Lake"
      },
      "admin0": "United States",
      "admin1": "Florida",
      "admin2": "Alachua County",
      "center_point": {
        "lat": "29.52978",
        "lon": "-82.30215"
      },
      "suggest": {
        "input": [
          "wauberg lake"
        ],
        "payload": {
          "id": "geoname/4177568",
          "geo": "-82.30215,29.52978"
        },
        "output": "Wauberg Lake, Alachua County, United States"
      }
    },
    {
      "name": {
        "default": "Lake Stafford"
      },
      "admin0": "United States",
      "admin1": "Florida",
      "admin2": "Levy County",
      "center_point": {
        "lat": "29.30795",
        "lon": "-82.47914"
      },
      "suggest": {
        "input": [
          "lake stafford"
        ],
        "payload": {
          "id": "geoname/4173950",
          "geo": "-82.47914,29.30795"
        },
        "output": "Lake Stafford, Levy County, United States"
      }
    }
  ]
}

Tests

✓ valid response

now = new Date().getTime()
should.exist json
should.not.exist json.error
should.exist json.date
json.date.should.be.within now-2000, now+2000
should.exist json.body
json.body.should.be.instanceof Array

✓ 200 ok

response.statusCode.should.equal 200