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.

300 lines
6.7 KiB

# valid search query
10 years ago
*Generated: Fri Sep 19 2014 14:38:01 GMT+0100 (BST)*
## Request
```javascript
{
"protocol": "http:",
"host": "localhost",
"method": "GET",
"port": 3100,
"path": "/search?input=lake&lat=29.49136&lon=-82.50622"
}
```
## Response
```javascript
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",
10 years ago
"content-length": "3549",
"etag": "W/\"Koi2nJQQ+otDRPmBy8JU7g==\"",
"date": "Fri, 19 Sep 2014 13:38:01 GMT",
"connection": "close"
}
```
```javascript
{
10 years ago
"date": 1411133881591,
"body": [
{
10 years ago
"admin2": "Alachua",
"admin1": "Florida",
10 years ago
"admin0": "United States",
"name": {
"default": "Hidden Lake"
},
10 years ago
"gn_id": 0,
"suggest": {
"input": [
10 years ago
"hidden lake"
],
"payload": {
10 years ago
"id": "neighborhood/29372:_:_:_:hidden_lake",
"geo": "-82.357442,29.720890"
},
10 years ago
"output": "Hidden Lake, Alachua, United States"
},
"woe_id": 0,
"center_point": {
"lon": "-82.357442",
"lat": "29.720890"
}
},
{
"admin0": "United States",
10 years ago
"name": {
"default": "Lake Butler",
"alt": "Lake Butler city"
},
10 years ago
"gn_id": "4161171",
"suggest": {
"input": [
10 years ago
"lake butler",
"lake butler city"
],
"payload": {
10 years ago
"id": "locality/4387:locality:u:us:lake_butler",
"geo": "-82.339724,30.015529"
},
10 years ago
"output": "Lake Butler, United States"
},
"woe_id": null,
"center_point": {
"lon": "-82.339724",
"lat": "30.015529"
}
},
{
"admin0": "United States",
10 years ago
"name": {
"default": "Lake City",
"alt": "Lake City city"
},
10 years ago
"gn_id": "4161187",
"suggest": {
"input": [
10 years ago
"lake city",
"lake city city"
],
"payload": {
10 years ago
"id": "locality/4346:locality:u:us:lake_city",
"geo": "-82.659959,30.201687"
},
10 years ago
"output": "Lake City, United States"
},
"woe_id": null,
"center_point": {
"lon": "-82.659959",
"lat": "30.201687"
}
},
{
10 years ago
"admin2": "Lake",
"admin1": "Florida",
10 years ago
"admin0": "United States",
"name": {
"default": "Villages Of Lady Lake"
},
10 years ago
"gn_id": 0,
"suggest": {
"input": [
10 years ago
"villages of lady lake"
],
"payload": {
10 years ago
"id": "neighborhood/34180:_:_:_:villages_of_lady_lake",
"geo": "-81.952515,28.916553"
},
10 years ago
"output": "Villages Of Lady Lake, Lake, United States"
},
"woe_id": 0,
"center_point": {
"lon": "-81.952515",
"lat": "28.916553"
}
},
{
"admin0": "United States",
10 years ago
"name": {
"default": "Lady Lake",
"alt": "Lady Lake town"
},
10 years ago
"gn_id": "4161118",
"suggest": {
"input": [
10 years ago
"lady lake",
"lady lake town"
],
"payload": {
10 years ago
"id": "locality/4478:locality:u:us:lady_lake",
"geo": "-81.922691,28.921806"
},
10 years ago
"output": "Lady Lake, United States"
},
"woe_id": null,
"center_point": {
"lon": "-81.922691",
"lat": "28.921806"
}
},
{
"admin0": "United States",
10 years ago
"name": {
"default": "Lake Panasoffkee",
"alt": "Lake Panasoffkee CDP"
},
10 years ago
"gn_id": "4161327",
"suggest": {
"input": [
10 years ago
"lake panasoffkee",
"lake panasoffkee cdp"
],
"payload": {
10 years ago
"id": "locality/4888:locality:u:us:lake_panasoffkee",
"geo": "-82.125431,28.785189"
},
10 years ago
"output": "Lake Panasoffkee, United States"
},
"woe_id": null,
"center_point": {
"lon": "-82.125431",
"lat": "28.785189"
}
},
{
"admin0": "United States",
10 years ago
"name": {
"default": "Asbury Lake",
"alt": "Asbury Lake CDP"
},
10 years ago
"gn_id": "4146302",
"suggest": {
"input": [
10 years ago
"asbury lake",
"asbury lake cdp"
],
"payload": {
10 years ago
"id": "locality/4797:locality:u:us:asbury_lake",
"geo": "-81.780018,30.050684"
},
10 years ago
"output": "Asbury Lake, United States"
},
"woe_id": null,
"center_point": {
"lon": "-81.780018",
"lat": "30.050684"
}
},
{
"admin0": "United States",
10 years ago
"name": {
"default": "Silver Lake",
"alt": "Silver Lake CDP"
},
10 years ago
"gn_id": "4172971",
"suggest": {
"input": [
10 years ago
"silver lake",
"silver lake cdp"
],
"payload": {
10 years ago
"id": "locality/4992:locality:u:us:silver_lake",
"geo": "-81.804157,28.846269"
},
10 years ago
"output": "Silver Lake, United States"
},
"woe_id": null,
"center_point": {
"lon": "-81.804157",
"lat": "28.846269"
}
},
{
10 years ago
"admin2": "Lake",
"admin1": "Florida",
10 years ago
"admin0": "United States",
"name": {
"default": "Oaks At Lake Dorr"
},
10 years ago
"gn_id": 0,
"suggest": {
"input": [
10 years ago
"oaks at lake dorr"
],
"payload": {
10 years ago
"id": "neighborhood/33992:_:_:_:oaks_at_lake_dorr",
"geo": "-81.639404,28.993127"
},
10 years ago
"output": "Oaks At Lake Dorr, Lake, United States"
},
"woe_id": 0,
"center_point": {
"lon": "-81.639404",
"lat": "28.993127"
}
},
{
10 years ago
"admin2": "Lake",
"admin1": "Florida",
10 years ago
"admin0": "United States",
"name": {
"default": "Lake South"
},
10 years ago
"gn_id": 0,
"suggest": {
"input": [
10 years ago
"lake south"
],
"payload": {
10 years ago
"id": "neighborhood/34534:_:_:_:lake_south",
"geo": "-81.742766,28.797112"
},
10 years ago
"output": "Lake South, Lake, United States"
},
"woe_id": 0,
"center_point": {
"lon": "-81.742766",
"lat": "28.797112"
}
}
]
}
```
## Tests
### ✓ valid response
```javascript
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
```javascript
response.statusCode.should.equal 200
```