{"_id":"560daaa96660a03700976ddd","project":"560d5ac71ec45619006069d6","__v":13,"category":{"_id":"560dabb698a6ae3700673f9f","project":"560d5ac71ec45619006069d6","version":"560d5ac71ec45619006069d9","pages":[],"__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-10-01T21:55:02.327Z","from_sync":false,"order":4,"slug":"search-components","title":"Search Components"},"githubsync":"","version":{"_id":"560d5ac71ec45619006069d9","__v":6,"project":"560d5ac71ec45619006069d6","createdAt":"2015-10-01T16:09:43.711Z","releaseDate":"2015-10-01T16:09:43.711Z","categories":["560d5ac81ec45619006069da","560dabb698a6ae3700673f9f","560dabe1961d492300d94b4b","560dac2cd10a730d0081ac92","560dacb26660a03700976de4","560ebbffcac9dc0d007af87a"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"user":"560d5a4faf97231900938125","parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-10-01T21:50:33.044Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[]},"method":"get","results":{"codes":[{"name":null,"code":"{\n    \"searchview\": {\n        \"id\": 1,\n        \"name\": \"Search\",\n        \"is_main\": true,\n        \"sections\": [\n            {\n                \"name\": \"Sponsored\",\n                \"more\": {},\n                \"items\": [\n                    {\n                        \"id\": 322,\n                        \"name\": \"Cracker Barrel\",\n                        \"favoriteable\": true,\n                        \"display_amenities\": false,\n                        \"background_color\": \"#CC3333\",\n                        \"image_prefix\": \"Food\",\n                        \"image_name\": \"1024px-Cracker_Barrel_Old_Country_Store_logo.svg.png\",\n                        \"image_path\": \"https://s3.amazonaws.com/iexit/images/logos/000/000/832/small/\",\n                        \"sponsored_banner_url\": \"https://ad.doubleclick.net/ddm/ad/N884.2508100IEXIT_USA_884/B11445485.152313246;sz=320x50\"\n                    }\n                ]\n            },\n            {\n                \"name\": \"Popular Searches\",\n                \"more\": {},\n                \"items\": [\n                    {\n                        \"id\": 1,\n                        \"name\": \"Gas\",\n                        \"favoriteable\": false,\n                        \"display_amenities\": false,\n                        \"background_color\": \"#0099FF\",\n                        \"image_prefix\": \"Gas\",\n                        \"image_name\": \"\",\n                        \"image_path\": \"\",\n                        \"sponsored_banner_url\": \"\"\n                    },\n                    {\n                        \"id\": 2,\n                        \"name\": \"Food\",\n                        \"favoriteable\": false,\n                        \"display_amenities\": true,\n                        \"background_color\": \"#CC3333\",\n                        \"image_prefix\": \"Food\",\n                        \"image_name\": \"\",\n                        \"image_path\": \"\",\n                        \"sponsored_banner_url\": \"\"\n                    },\n                    {\n                        \"id\": 3,\n                        \"name\": \"Lodging\",\n                        \"favoriteable\": false,\n                        \"display_amenities\": false,\n                        \"background_color\": \"#333333\",\n                        \"image_prefix\": \"Lodging\",\n                        \"image_name\": \"\",\n                        \"image_path\": \"\",\n                        \"sponsored_banner_url\": \"\"\n                    },\n                    {\n                        \"id\": 4,\n                        \"name\": \"Coffee\",\n                        \"favoriteable\": false,\n                        \"display_amenities\": false,\n                        \"background_color\": \"#8B7765\",\n                        \"image_prefix\": \"Coffee\",\n                        \"image_name\": \"\",\n                        \"image_path\": \"\",\n                        \"sponsored_banner_url\": \"\"\n                    },\n                    {\n                        \"id\": 5,\n                        \"name\": \"Rest Areas\",\n                        \"favoriteable\": true,\n                        \"display_amenities\": true,\n                        \"background_color\": \"#0066FF\",\n                        \"image_prefix\": \"ExitArrow\",\n                        \"image_name\": \"\",\n                        \"image_path\": \"\",\n                        \"sponsored_banner_url\": \"\"\n                    }\n                ]\n            },\n            {\n                \"name\": \"Fuel\",\n                \"more\": {\n                    \"name\": \"All Fuel Options\",\n                    \"search_view_id\": 2\n                },\n                \"items\": [\n                    {\n                        \"id\": 6,\n                        \"name\": \"Unleaded\",\n                        \"favoriteable\": false,\n                        \"display_amenities\": false,\n                        \"background_color\": \"#0099FF\",\n                        \"image_prefix\": \"Gas\",\n                        \"image_name\": \"\",\n                        \"image_path\": \"\",\n                        \"sponsored_banner_url\": \"\"\n                    },\n                    {\n                        \"id\": 7,\n                        \"name\": \"Diesel\",\n                        \"favoriteable\": false,\n                        \"display_amenities\": false,\n                        \"background_color\": \"#006600\",\n                        \"image_prefix\": \"Diesel\",\n                        \"image_name\": \"\",\n                        \"image_path\": \"\",\n                        \"sponsored_banner_url\": \"\"\n                    },\n                    {\n                        \"id\": 8,\n                        \"name\": \"Electric\",\n                        \"favoriteable\": false,\n                        \"display_amenities\": false,\n                        \"background_color\": \"#ffd700\",\n                        \"image_prefix\": \"AltFuel\",\n                        \"image_name\": \"\",\n                        \"image_path\": \"\",\n                        \"sponsored_banner_url\": \"\"\n                    },\n                    {\n                        \"id\": 23,\n                        \"name\": \"Mid Grade\",\n                        \"favoriteable\": false,\n                        \"display_amenities\": false,\n                        \"background_color\": \"#9b59b6\",\n                        \"image_prefix\": \"Gas\",\n                        \"image_name\": \"\",\n                        \"image_path\": \"\",\n                        \"sponsored_banner_url\": \"\"\n                    },\n                    {\n                        \"id\": 24,\n                        \"name\": \"Premium\",\n                        \"favoriteable\": false,\n                        \"display_amenities\": false,\n                        \"background_color\": \"#e74c3c\",\n                        \"image_prefix\": \"Gas\",\n                        \"image_name\": \"\",\n                        \"image_path\": \"\",\n                        \"sponsored_banner_url\": \"\"\n                    }\n                ]\n            },\n            {\n                \"name\": \"Food\",\n                \"more\": {\n                    \"name\": \"All Food Options\",\n                    \"search_view_id\": 3\n                },\n                \"items\": [\n                    {\n                        \"id\": 30,\n                        \"name\": \"Fast Food\",\n                        \"favoriteable\": false,\n                        \"display_amenities\": false,\n                        \"background_color\": \"#ff0000\",\n                        \"image_prefix\": \"FastFood\",\n                        \"image_name\": \"\",\n                        \"image_path\": \"\",\n                        \"sponsored_banner_url\": \"\"\n                    },\n                    {\n                        \"id\": 9,\n                        \"name\": \"American\",\n                        \"favoriteable\": false,\n                        \"display_amenities\": false,\n                        \"background_color\": \"#3498db\",\n                        \"image_prefix\": \"\",\n                        \"image_name\": \"united_states_of_america_round_icon.png\",\n                        \"image_path\": \"https://s3.amazonaws.com/iexit/images/search_items/000/000/009/small/\",\n                        \"sponsored_banner_url\": \"\"\n                    },\n                    {\n                        \"id\": 10,\n                        \"name\": \"Mexican\",\n                        \"favoriteable\": false,\n                        \"display_amenities\": false,\n                        \"background_color\": \"#19B580\",\n                        \"image_prefix\": \"\",\n                        \"image_name\": \"mexico_round_icon.png\",\n                        \"image_path\": \"https://s3.amazonaws.com/iexit/images/search_items/000/000/010/small/\",\n                        \"sponsored_banner_url\": \"\"\n                    },\n                    {\n                        \"id\": 11,\n                        \"name\": \"BBQ\",\n                        \"favoriteable\": false,\n                        \"display_amenities\": false,\n                        \"background_color\": \"#ffcc33\",\n                        \"image_prefix\": \"\",\n                        \"image_name\": \"bbqnew.png\",\n                        \"image_path\": \"https://s3.amazonaws.com/iexit/images/search_items/000/000/011/small/\",\n                        \"sponsored_banner_url\": \"\"\n                    },\n                    {\n                        \"id\": 39,\n                        \"name\": \"Grocery Stores\",\n                        \"favoriteable\": false,\n                        \"display_amenities\": false,\n                        \"background_color\": \"#8A2BE2\",\n                        \"image_prefix\": \"Shop\",\n                        \"image_name\": \"\",\n                        \"image_path\": \"\",\n                        \"sponsored_banner_url\": \"\"\n                    },\n                    {\n                        \"id\": 41,\n                        \"name\": \"Sweets/Ice Cream\",\n                        \"favoriteable\": false,\n                        \"display_amenities\": false,\n                        \"background_color\": \"#FF0099\",\n                        \"image_prefix\": \"Sweets\",\n                        \"image_name\": \"\",\n                        \"image_path\": \"\",\n                        \"sponsored_banner_url\": \"\"\n                    },\n                    {\n                        \"id\": 20,\n                        \"name\": \"Drinks\",\n                        \"favoriteable\": false,\n                        \"display_amenities\": false,\n                        \"background_color\": \"#a71bac\",\n                        \"image_prefix\": \"\",\n                        \"image_name\": \"drink.png\",\n                        \"image_path\": \"https://s3.amazonaws.com/iexit/images/search_items/000/000/020/small/\",\n                        \"sponsored_banner_url\": \"\"\n                    }\n                ]\n            },\n            {\n                \"name\": \"Lodging\",\n                \"more\": {\n                    \"name\": \"All Lodging Options\",\n                    \"search_view_id\": 4\n                },\n                \"items\": [\n                    {\n                        \"id\": 28,\n                        \"name\": \"Best Same-Day Rates\",\n                        \"favoriteable\": false,\n                        \"display_amenities\": false,\n                        \"background_color\": \"#d93535\",\n                        \"image_prefix\": \"\",\n                        \"image_name\": \"travelcoupons_logo_small.png\",\n                        \"image_path\": \"https://s3.amazonaws.com/iexit/images/search_items/000/000/028/small/\",\n                        \"sponsored_banner_url\": \"\"\n                    },\n                    {\n                        \"id\": 29,\n                        \"name\": \"Pet Friendly\",\n                        \"favoriteable\": false,\n                        \"display_amenities\": false,\n                        \"background_color\": \"#7c590d\",\n                        \"image_prefix\": \"\",\n                        \"image_name\": \"dogprint.png\",\n                        \"image_path\": \"https://s3.amazonaws.com/iexit/images/search_items/000/000/029/small/\",\n                        \"sponsored_banner_url\": \"\"\n                    }\n                ]\n            },\n            {\n                \"name\": \"Family Friendly\",\n                \"more\": {},\n                \"items\": [\n                    {\n                        \"id\": 31,\n                        \"name\": \"Playground\",\n                        \"favoriteable\": false,\n                        \"display_amenities\": false,\n                        \"background_color\": \"#c71585\",\n                        \"image_prefix\": \"Family\",\n                        \"image_name\": \"\",\n                        \"image_path\": \"\",\n                        \"sponsored_banner_url\": \"\"\n                    }\n                ]\n            },\n            {\n                \"name\": \"Truckers\",\n                \"more\": {\n                    \"name\": \"All Truck Options\",\n                    \"search_view_id\": 5\n                },\n                \"items\": [\n                    {\n                        \"id\": 12,\n                        \"name\": \"Truck Friendly\",\n                        \"favoriteable\": false,\n                        \"display_amenities\": true,\n                        \"background_color\": \"#FF9966\",\n                        \"image_prefix\": \"Truck\",\n                        \"image_name\": \"\",\n                        \"image_path\": \"\",\n                        \"sponsored_banner_url\": \"\"\n                    },\n                    {\n                        \"id\": 13,\n                        \"name\": \"Truck Stops\",\n                        \"favoriteable\": false,\n                        \"display_amenities\": true,\n                        \"background_color\": \"#CC3333\",\n                        \"image_prefix\": \"TruckStop\",\n                        \"image_name\": \"\",\n                        \"image_path\": \"\",\n                        \"sponsored_banner_url\": \"\"\n                    }\n                ]\n            },\n            {\n                \"name\": \"Outdoors\",\n                \"more\": {\n                    \"name\": \"All Outdoor Options\",\n                    \"search_view_id\": 6\n                },\n                \"items\": [\n                    {\n                        \"id\": 32,\n                        \"name\": \"RV Friendly\",\n                        \"favoriteable\": false,\n                        \"display_amenities\": true,\n                        \"background_color\": \"#666600\",\n                        \"image_prefix\": \"RV\",\n                        \"image_name\": \"\",\n                        \"image_path\": \"\",\n                        \"sponsored_banner_url\": \"\"\n                    },\n                    {\n                        \"id\": 33,\n                        \"name\": \"Campgrounds\",\n                        \"favoriteable\": false,\n                        \"display_amenities\": true,\n                        \"background_color\": \"#996633\",\n                        \"image_prefix\": \"Camp\",\n                        \"image_name\": \"\",\n                        \"image_path\": \"\",\n                        \"sponsored_banner_url\": \"\"\n                    },\n                    {\n                        \"id\": 34,\n                        \"name\": \"Outdoor Supplies\",\n                        \"favoriteable\": false,\n                        \"display_amenities\": false,\n                        \"background_color\": \"#228b22\",\n                        \"image_prefix\": \"Camp\",\n                        \"image_name\": \"\",\n                        \"image_path\": \"\",\n                        \"sponsored_banner_url\": \"\"\n                    }\n                ]\n            },\n            {\n                \"name\": \"Medical\",\n                \"more\": {},\n                \"items\": [\n                    {\n                        \"id\": 35,\n                        \"name\": \"Hospitals\",\n                        \"favoriteable\": false,\n                        \"display_amenities\": false,\n                        \"background_color\": \"#0000CD\",\n                        \"image_prefix\": \"Hospital\",\n                        \"image_name\": \"\",\n                        \"image_path\": \"\",\n                        \"sponsored_banner_url\": \"\"\n                    },\n                    {\n                        \"id\": 36,\n                        \"name\": \"Pharmacies\",\n                        \"favoriteable\": false,\n                        \"display_amenities\": false,\n                        \"background_color\": \"#3CB371\",\n                        \"image_prefix\": \"Pharmacy\",\n                        \"image_name\": \"\",\n                        \"image_path\": \"\",\n                        \"sponsored_banner_url\": \"\"\n                    },\n                    {\n                        \"id\": 37,\n                        \"name\": \"Vet Offices\",\n                        \"favoriteable\": false,\n                        \"display_amenities\": false,\n                        \"background_color\": \"#7B68EE\",\n                        \"image_prefix\": \"Vet\",\n                        \"image_name\": \"\",\n                        \"image_path\": \"\",\n                        \"sponsored_banner_url\": \"\"\n                    }\n                ]\n            },\n            {\n                \"name\": \"Other\",\n                \"more\": {},\n                \"items\": [\n                    {\n                        \"id\": 44,\n                        \"name\": \"WiFi Available\",\n                        \"favoriteable\": false,\n                        \"display_amenities\": false,\n                        \"background_color\": \"#1b73ac\",\n                        \"image_prefix\": \"\",\n                        \"image_name\": \"wifi.png\",\n                        \"image_path\": \"https://s3.amazonaws.com/iexit/images/search_items/000/000/044/small/\",\n                        \"sponsored_banner_url\": \"\"\n                    },\n                    {\n                        \"id\": 38,\n                        \"name\": \"Attractions\",\n                        \"favoriteable\": false,\n                        \"display_amenities\": false,\n                        \"background_color\": \"#DA70D6\",\n                        \"image_prefix\": \"ExitArrow\",\n                        \"image_name\": \"\",\n                        \"image_path\": \"\",\n                        \"sponsored_banner_url\": \"\"\n                    },\n                    {\n                        \"id\": 43,\n                        \"name\": \"Automotive\",\n                        \"favoriteable\": false,\n                        \"display_amenities\": false,\n                        \"background_color\": \"#CC99FF\",\n                        \"image_prefix\": \"Auto\",\n                        \"image_name\": \"\",\n                        \"image_path\": \"\",\n                        \"sponsored_banner_url\": \"\"\n                    },\n                    {\n                        \"id\": 42,\n                        \"name\": \"Shopping\",\n                        \"favoriteable\": false,\n                        \"display_amenities\": false,\n                        \"background_color\": \"#00CC99\",\n                        \"image_prefix\": \"Shop\",\n                        \"image_name\": \"\",\n                        \"image_path\": \"\",\n                        \"sponsored_banner_url\": \"\"\n                    }\n                ]\n            }\n        ]\n    }\n}","language":"json","status":200}]},"settings":"","auth":"optional","params":[{"_id":"5940042eaccc6b001b4cbe1d","ref":"","in":"path","required":true,"desc":"1 if this is the main (default) Search View, in which case `search_view_id` can be omitted. 0 if it's not the main Search View, in which case you must specify `search_view_id`","default":"0","type":"int","name":"is_main"},{"_id":"594004822a6092000f75cc80","ref":"","in":"path","required":false,"desc":"This only matters if `is_main` is 0.","default":"","type":"int","name":"search_view_id"}],"url":"/searchview/:is_main/:search_view_id"},"isReference":false,"order":0,"body":"** JSON Response **\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Key\",\n    \"h-1\": \"Value\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"`searchview`\",\n    \"0-1\": \"[Search View](doc:search-view)\",\n    \"0-2\": \"The Search View object defined by either `is_main` being 1, or otherwise `search_view_id`\"\n  },\n  \"cols\": 3,\n  \"rows\": 1\n}\n[/block]\nThis API allows you to show the hierarchy of [Search View](doc:search-view) views in iExit. If you want to show the default [Search View](doc:search-view), call this API with `is_main` equal to 1 and you can omit `search_view_id`. From there, you can call this API with `is_main` equal to 0 and specify the `search_view_id` desired from the returned data.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/6bd77bd-IMG_9585.PNG\",\n        \"IMG_9585.PNG\",\n        750,\n        1334,\n        \"#3eaa5d\"\n      ],\n      \"caption\": \"This is the Default [Search View] returned by setting `is_main` equal to 1 (regardless of `search_view_id`)\"\n    }\n  ]\n}\n[/block]\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/132ae14-IMG_9586.PNG\",\n        \"IMG_9586.PNG\",\n        750,\n        1334,\n        \"#49805a\"\n      ],\n      \"caption\": \"This is the child [Search View] for \\\"All Fuel Options\\\". The data for this view was retrieved by setting `is_main` to 0 and setting `search_view_id` appropriately.\"\n    }\n  ]\n}\n[/block]\n** Common Next API(s) **\n- [Upcoming Exits](doc:upcoming-exits) (assuming the Search Button was selected while viewing Upcoming Exits, supply it with `results[]`.`search_result_id`)\n- [Exits for Highway in State](doc:exits-for-highway-in-state) (assuming the Search Button was selected while viewing Exits For Highway In State, , supply it with `results[]`.`search_result_id`)","excerpt":"Retrieve common keyword searches used to filter exit results.","slug":"preset-searches","type":"endpoint","title":"Search View"}

getSearch View

Retrieve common keyword searches used to filter exit results.

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

is_main:
required
integer0
1 if this is the main (default) Search View, in which case `search_view_id` can be omitted. 0 if it's not the main Search View, in which case you must specify `search_view_id`
search_view_id:
integer
This only matters if `is_main` is 0.

Result Format


Documentation

** JSON Response ** [block:parameters] { "data": { "h-0": "Key", "h-1": "Value", "h-2": "Description", "0-0": "`searchview`", "0-1": "[Search View](doc:search-view)", "0-2": "The Search View object defined by either `is_main` being 1, or otherwise `search_view_id`" }, "cols": 3, "rows": 1 } [/block] This API allows you to show the hierarchy of [Search View](doc:search-view) views in iExit. If you want to show the default [Search View](doc:search-view), call this API with `is_main` equal to 1 and you can omit `search_view_id`. From there, you can call this API with `is_main` equal to 0 and specify the `search_view_id` desired from the returned data. [block:image] { "images": [ { "image": [ "https://files.readme.io/6bd77bd-IMG_9585.PNG", "IMG_9585.PNG", 750, 1334, "#3eaa5d" ], "caption": "This is the Default [Search View] returned by setting `is_main` equal to 1 (regardless of `search_view_id`)" } ] } [/block] [block:image] { "images": [ { "image": [ "https://files.readme.io/132ae14-IMG_9586.PNG", "IMG_9586.PNG", 750, 1334, "#49805a" ], "caption": "This is the child [Search View] for \"All Fuel Options\". The data for this view was retrieved by setting `is_main` to 0 and setting `search_view_id` appropriately." } ] } [/block] ** Common Next API(s) ** - [Upcoming Exits](doc:upcoming-exits) (assuming the Search Button was selected while viewing Upcoming Exits, supply it with `results[]`.`search_result_id`) - [Exits for Highway in State](doc:exits-for-highway-in-state) (assuming the Search Button was selected while viewing Exits For Highway In State, , supply it with `results[]`.`search_result_id`)

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}