From d353d4c88781d117ab6641ce2227aa6ed2cf2c6b Mon Sep 17 00:00:00 2001 From: Diana Shkolnikov Date: Thu, 17 Sep 2015 12:48:51 -0400 Subject: [PATCH] Update 002-search.md --- getting-started/002-search.md | 56 +++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/getting-started/002-search.md b/getting-started/002-search.md index 3df5d6b..8c7b387 100644 --- a/getting-started/002-search.md +++ b/getting-started/002-search.md @@ -12,24 +12,50 @@ _{search text, global, no options}_ ### The most basic scenario +You just set the `text` parameter to whatever you want to find. + Let's say you wanted to find **Stinky Beach**, you would simply query the search API as follows: +| parameter | value | +| --- | --- | +| text | stinky beach | +| api_key | [get yours here](https://mapzen.com/developers) | + > [/v1/search?api_key={YOUR-KEY}&___text=stinky beach___](https://search.mapzen.com/v1/search?api_key={YOUR_API_KEY}&text=stinky beach) _...go ahead, and click that link, we'll wait_ Maybe you'd like to find an address, like this: + +| parameter | value | +| --- | --- | +| text | 30 west 26th street | +| api_key | [get yours here](https://mapzen.com/developers) | + + > [/v1/search?api_key={YOUR-KEY}&___text=30 west 26th street___](https://search.mapzen.com/v1/search?api_key={YOUR_API_KEY}&text=30 west 26th street) Or even a landmark, like **Yankee Stadium**: +| parameter | value | +| --- | --- | +| text | yankee stadium | +| api_key | [get yours here](https://mapzen.com/developers) | + + > [/v1/search?api_key={YOUR-KEY}&___text=yankee stadium___](https://search.mapzen.com/v1/search?api_key={YOUR_API_KEY}&text=yankee stadium) You may have noticed already that cApiTaliZAtioN isn't a big deal for search. You can type **yankee stadium** or **Yankee Stadium** or even **YANKEE STADIUM** if you're really excited about finding it. See for yourself: +| parameter | value | +| --- | --- | +| text | YANKEE STADIUM | +| api_key | [get yours here](https://mapzen.com/developers) | + + > [/v1/search?api_key={YOUR-KEY}&___text=YANKEE STADIUM___](https://search.mapzen.com/v1/search?api_key={YOUR_API_KEY}&text=YANKEE STADIUM) ### Results @@ -101,9 +127,21 @@ That's the _default_ number of results the API will return, unless otherwise spe **Want a single result?** +| parameter | value | +| --- | --- | +| text | stinky beach | +| size | 1 | +| api_key | [get yours here](https://mapzen.com/developers) | + > [/v1/search?api_key={YOUR-KEY}&text=stinky beach&___size=1___](https://pelias.bigdev.mapzen.com/v1/search?api_key={YOUR_API_KEY}&text=stinky beach&size=1) **How about 25 results?** + +| parameter | value | +| --- | --- | +| text | stinky beach | +| size | 25 | +| api_key | [get yours here](https://mapzen.com/developers) | > [/v1/search?api_key={YOUR-KEY}&text=stinky beach&___size=25___](https://pelias.bigdev.mapzen.com/v1/search?api_key={YOUR_API_KEY}&text=stinky beach&size=25) @@ -126,6 +164,15 @@ In the case where you need to specify the boundary using a rectangle, all we nee **What if you wanted to find museums in London?** +| parameter | value | +| --- | --- | +| text | museum | +| boundary.rect.min_lat | 51.286839 | +| boundary.rect.min_lon | -0.51035 | +| boundary.rect.max_lat | 51.692322 | +| boundary.rect.max_lon | 0.33403 | +| api_key | [get yours here](https://mapzen.com/developers) | + > [/v1/search?api_key={YOUR-KEY}&text=museum&___boundary.rect.min_lat=51.286839&boundary.rect.min_lon=-0.51035&boundary.rect.max_lat=51.692322&boundary.rect.max_lon=0.33403___](https://pelias.bigdev.mapzen.com/v1/search?api_key={YOUR_API_KEY}&text=tower&boundary.rect.min_lat=51.286839&boundary.rect.min_lon=-0.51035&boundary.rect.max_lat=51.692322&boundary.rect.max_lon=0.33403) Below is the region that will be searched. Museums located outside of this highlighted region will **NOT** be included in the results. The museums returned will be sorted based on how well they matched the `text` parameter, in this case **museum**. @@ -134,6 +181,15 @@ Below is the region that will be searched. Museums located outside of this highl **Or you wanted to find an address, such as 28 Main Ave., in New York City?** +| parameter | value | +| --- | --- | +| text | 28 Main Ave | +| boundary.rect.min_lat | 51.286839 | +| boundary.rect.min_lon | -74.258904 | +| boundary.rect.max_lat | 40.477421 | +| boundary.rect.max_lon | -73.700378 | +| api_key | [get yours here](https://mapzen.com/developers) | + > [/v1/search?api_key={YOUR-KEY}&text=28 Main Ave&___boundary.rect.min_lat=51.286839&boundary.rect.min_lon=-74.258904&boundary.rect.max_lat=40.477421&boundary.rect.max_lon=-73.700378___](http://pelias.bigdev.mapzen.com/v1/search?api_key={YOUR_API_KEY}&text=28 Main Ave&boundary.rect.min_lat=51.286839&boundary.rect.min_lon=-74.258904&boundary.rect.max_lat=40.477421&boundary.rect.max_lon=-73.700378)