{"metadata":{"image":[],"title":"","description":""},"api":{"url":"/exits/:highway_in_state_id/:direction/:search_result_id","auth":"optional","settings":"","examples":{"codes":[{"language":"text","code":"","name":""}]},"method":"get","params":[{"name":"highway_in_state_id","type":"int","default":"","desc":"[Highway In State](doc:highway-in-state) `id`","required":true,"in":"path","ref":"","_id":"560d773c05b3941700338767"},{"name":"direction","type":"string","default":"","desc":"eg: East, West, North, South","required":true,"in":"path","ref":"","_id":"560d773c05b3941700338766"},{"name":"search_result_id","type":"int","default":"","desc":"[Optional] [Search Result](doc:search-result) `id`","required":false,"in":"path","ref":"","_id":"560d7a3d1ec45619006069f1"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n \"highway_in_state\": {\n \"id\": 656,\n \"highway\": {\n \"id\": 42,\n \"display_name\": \"I-65\",\n \"sign_name\": \"65\",\n \"sign_web_background_image\": \"interstate-bg.svg\",\n \"sign_background_image_small\": \"interstatesign_small.png\",\n \"sign_background_image_large\": \"interstatesign_large.png\",\n \"sign_text_color\": \"#FFFFFF\",\n \"highway_sign_class\": \"interstate-bg\",\n \"highway_type_id\": 1,\n \"highway_type\": \"Interstate\",\n \"positive_direction\": \"North\",\n \"negative_direction\": \"South\",\n \"direction_suffix\": \"bound\"\n },\n \"state\": {\n \"id\": 1,\n \"short_name\": \"AL\",\n \"long_name\": \"Alabama\"\n },\n \"direction\": {\n \"current_direction\": \"North\",\n \"reverse_direction\": \"South\",\n \"direction_suffix\": \"bound\"\n }\n },\n \"next_highway_in_state\": {\n \"id\": 657,\n \"highway\": {\n \"id\": 42,\n \"display_name\": \"I-65\",\n \"sign_name\": \"65\",\n \"sign_web_background_image\": \"interstate-bg.svg\",\n \"sign_background_image_small\": \"interstatesign_small.png\",\n \"sign_background_image_large\": \"interstatesign_large.png\",\n \"sign_text_color\": \"#FFFFFF\",\n \"highway_sign_class\": \"interstate-bg\",\n \"highway_type_id\": 1,\n \"highway_type\": \"Interstate\",\n \"positive_direction\": \"North\",\n \"negative_direction\": \"South\",\n \"direction_suffix\": \"bound\"\n },\n \"state\": {\n \"id\": 40,\n \"short_name\": \"TN\",\n \"long_name\": \"Tennessee\"\n },\n \"direction\": {\n \"current_direction\": \"North\",\n \"reverse_direction\": \"South\",\n \"direction_suffix\": \"bound\"\n }\n },\n \"exits\": [\n {\n \"id\": 14626,\n \"exit_latitude\": \"30.648718\",\n \"exit_longitude\": \"-88.120811\",\n \"destination_latitude\": \"30.653223\",\n \"destination_longitude\": \"-88.120507\",\n \"city\": \"Mobile\",\n \"state\": \"Alabama\",\n \"postal_code\": \"36606\",\n \"exit_description\": \"US-90; Govt Blvd\",\n \"sign_label_line_one\": \"EXIT\",\n \"sign_label_line_two\": \"1\",\n \"sign_number\": \"1\",\n \"formatted_sign_name\": \"Exit 1\",\n \"highway_exit_type_id\": 1,\n \"highway_exit_type\": \"Exit\",\n \"highway_exit_sign_background_color\": \"#67B964\",\n \"highway_exit_sign_text_color\": \"#ffffff\",\n \"favorite\": 0,\n \"categories\": [\n {\n \"id\": 1,\n \"name\": \"Fuel\",\n \"background_color\": \"#0033CC\",\n \"image_prefix\": \"Gas\"\n },\n {\n \"id\": 14,\n \"name\": \"Alternative Fuel\",\n \"background_color\": \"#ffd700\",\n \"image_prefix\": \"AltFuel\"\n },\n {\n \"id\": 2,\n \"name\": \"Food\",\n \"background_color\": \"#CC3333\",\n \"image_prefix\": \"Food\"\n },\n {\n \"id\": 3,\n \"name\": \"Lodging\",\n \"background_color\": \"#333333\",\n \"image_prefix\": \"Lodging\"\n },\n {\n \"id\": 7,\n \"name\": \"Other\",\n \"background_color\": \"#67B964\",\n \"image_prefix\": \"Ellipsis\"\n }\n ],\n \"lowest_fuel_prices\": [\n {\n \"price\": \"1.499\",\n \"avg_price\": \"1.617\",\n \"num_stations_for_avg\": 12,\n \"fuel_type_id\": 3,\n \"fuel_type\": \"Regular\",\n \"background_color\": \"#0099FF\",\n \"currency\": \"USD\",\n \"liquid_measurement\": \"Gallons\",\n \"updated_at\": \"2016-01-25T19:32:00.000Z\",\n \"business\": {\n \"id\": 886965,\n \"establishment_id\": 305,\n \"phone\": \"1-251-308-7030\",\n \"latitude\": \"30.646737\",\n \"longitude\": \"-88.119364\",\n \"name\": \"Costco\",\n \"brand_name\": \"Costco\",\n \"formatted_address\": \"1450 Tingle Cir W, Mobile, AL 36606\",\n \"website\": \"\",\n \"claimed\": 0,\n \"exit_mapping\": {\n \"exit_id\": 14626,\n \"distance\": \"0.28\",\n \"cardinal_direction_short\": \"S\",\n \"cardinal_direction_long\": \"South\",\n \"turn_direction_short\": \"L\",\n \"turn_direction_long\": \"Left\"\n },\n \"top_priority_amenity\": {\n \"id\": 223,\n \"name\": \"Grocery Store\",\n \"priority\": 1,\n \"background_color\": \"#8A2BE2\",\n \"image_prefix\": \"Shop\"\n }\n }\n },\n {\n \"price\": \"1.739\",\n \"avg_price\": \"2.042\",\n \"num_stations_for_avg\": 11,\n \"fuel_type_id\": 4,\n \"fuel_type\": \"Mid Grade\",\n \"background_color\": \"#9b59b6\",\n \"currency\": \"USD\",\n \"liquid_measurement\": \"Gallons\",\n \"updated_at\": \"2016-01-25T15:26:00.000Z\",\n \"business\": {\n \"id\": 237732,\n \"establishment_id\": 489,\n \"phone\": \"1-251-476-0047\",\n \"latitude\": \"30.65488\",\n \"longitude\": \"-88.11644\",\n \"name\": \"Raceway\",\n \"brand_name\": \"Raceway\",\n \"formatted_address\": \"3051 Government Blvd., Mobile, AL 36606\",\n \"website\": \"http://racewaystores.com\",\n \"claimed\": 0,\n \"exit_mapping\": {\n \"exit_id\": 14626,\n \"distance\": \"0.17\",\n \"cardinal_direction_short\": \"E\",\n \"cardinal_direction_long\": \"East\",\n \"turn_direction_short\": \"R\",\n \"turn_direction_long\": \"Right\"\n },\n \"top_priority_amenity\": {\n \"id\": 2,\n \"name\": \"Diesel\",\n \"priority\": 1,\n \"background_color\": \"#006600\",\n \"image_prefix\": \"Diesel\"\n }\n }\n },\n {\n \"price\": \"1.919\",\n \"avg_price\": \"2.269\",\n \"num_stations_for_avg\": 10,\n \"fuel_type_id\": 5,\n \"fuel_type\": \"Premium\",\n \"background_color\": \"#e74c3c\",\n \"currency\": \"USD\",\n \"liquid_measurement\": \"Gallons\",\n \"updated_at\": \"2016-01-25T19:32:00.000Z\",\n \"business\": {\n \"id\": 886965,\n \"establishment_id\": 305,\n \"phone\": \"1-251-308-7030\",\n \"latitude\": \"30.646737\",\n \"longitude\": \"-88.119364\",\n \"name\": \"Costco\",\n \"brand_name\": \"Costco\",\n \"formatted_address\": \"1450 Tingle Cir W, Mobile, AL 36606\",\n \"website\": \"\",\n \"claimed\": 0,\n \"exit_mapping\": {\n \"exit_id\": 14626,\n \"distance\": \"0.28\",\n \"cardinal_direction_short\": \"S\",\n \"cardinal_direction_long\": \"South\",\n \"turn_direction_short\": \"L\",\n \"turn_direction_long\": \"Left\"\n },\n \"top_priority_amenity\": {\n \"id\": 223,\n \"name\": \"Grocery Store\",\n \"priority\": 1,\n \"background_color\": \"#8A2BE2\",\n \"image_prefix\": \"Shop\"\n }\n }\n },\n {\n \"price\": \"1.689\",\n \"avg_price\": \"2.032\",\n \"num_stations_for_avg\": 8,\n \"fuel_type_id\": 1,\n \"fuel_type\": \"Diesel\",\n \"background_color\": \"#006600\",\n \"currency\": \"USD\",\n \"liquid_measurement\": \"Gallons\",\n \"updated_at\": \"2016-01-24T15:35:00.000Z\",\n \"business\": {\n \"id\": 855739,\n \"establishment_id\": 384,\n \"phone\": \"1-251-665-0115\",\n \"latitude\": \"30.64178\",\n \"longitude\": \"-88.13999\",\n \"name\": \"Deepas Discount\",\n \"brand_name\": \"Independent Gas\",\n \"formatted_address\": \"1174 Azalea Rd, Mobile, AL 36693\",\n \"website\": \"\",\n \"claimed\": 0,\n \"exit_mapping\": {\n \"exit_id\": 14626,\n \"distance\": \"0.87\",\n \"cardinal_direction_short\": \"SW\",\n \"cardinal_direction_long\": \"Southwest\",\n \"turn_direction_short\": \"L\",\n \"turn_direction_long\": \"Left\"\n },\n \"top_priority_amenity\": {\n \"id\": 2,\n \"name\": \"Diesel\",\n \"priority\": 1,\n \"background_color\": \"#006600\",\n \"image_prefix\": \"Diesel\"\n }\n }\n }\n ]\n },\n ...\n ]\n}","name":"Search ID Omitted"},{"code":"{\n \"highway_in_state\": {\n \"id\": 656,\n \"highway\": {\n \"id\": 42,\n \"display_name\": \"I-65\",\n \"sign_name\": \"65\",\n \"sign_web_background_image\": \"interstate-bg.svg\",\n \"sign_background_image_small\": \"interstatesign_small.png\",\n \"sign_background_image_large\": \"interstatesign_large.png\",\n \"sign_text_color\": \"#FFFFFF\",\n \"highway_sign_class\": \"interstate-bg\",\n \"highway_type_id\": 1,\n \"highway_type\": \"Interstate\",\n \"positive_direction\": \"North\",\n \"negative_direction\": \"South\",\n \"direction_suffix\": \"bound\"\n },\n \"state\": {\n \"id\": 1,\n \"short_name\": \"AL\",\n \"long_name\": \"Alabama\"\n },\n \"direction\": {\n \"current_direction\": \"North\",\n \"reverse_direction\": \"South\",\n \"direction_suffix\": \"bound\"\n }\n },\n \"next_highway_in_state\": {\n \"id\": 657,\n \"highway\": {\n \"id\": 42,\n \"display_name\": \"I-65\",\n \"sign_name\": \"65\",\n \"sign_web_background_image\": \"interstate-bg.svg\",\n \"sign_background_image_small\": \"interstatesign_small.png\",\n \"sign_background_image_large\": \"interstatesign_large.png\",\n \"sign_text_color\": \"#FFFFFF\",\n \"highway_sign_class\": \"interstate-bg\",\n \"highway_type_id\": 1,\n \"highway_type\": \"Interstate\",\n \"positive_direction\": \"North\",\n \"negative_direction\": \"South\",\n \"direction_suffix\": \"bound\"\n },\n \"state\": {\n \"id\": 40,\n \"short_name\": \"TN\",\n \"long_name\": \"Tennessee\"\n },\n \"direction\": {\n \"current_direction\": \"North\",\n \"reverse_direction\": \"South\",\n \"direction_suffix\": \"bound\"\n }\n },\n \"exits\": [\n {\n \"id\": 14626,\n \"exit_latitude\": \"30.648718\",\n \"exit_longitude\": \"-88.120811\",\n \"destination_latitude\": \"30.653223\",\n \"destination_longitude\": \"-88.120507\",\n \"city\": \"Mobile\",\n \"state\": \"Alabama\",\n \"postal_code\": \"36606\",\n \"exit_description\": \"US-90; Govt Blvd\",\n \"sign_label_line_one\": \"EXIT\",\n \"sign_label_line_two\": \"1\",\n \"sign_number\": \"1\",\n \"formatted_sign_name\": \"Exit 1\",\n \"highway_exit_type_id\": 1,\n \"highway_exit_type\": \"Exit\",\n \"highway_exit_sign_background_color\": \"#67B964\",\n \"highway_exit_sign_text_color\": \"#ffffff\",\n \"favorite\": 0,\n \"businesses\": [\n {\n \"id\": 237732,\n \"establishment_id\": 489,\n \"phone\": \"1-251-476-0047\",\n \"latitude\": \"30.65488\",\n \"longitude\": \"-88.11644\",\n \"name\": \"Raceway\",\n \"brand_name\": \"Raceway\",\n \"formatted_address\": \"3051 Government Blvd., Mobile, AL 36606\",\n \"website\": \"http://racewaystores.com\",\n \"claimed\": 0,\n \"favorite\": 0,\n \"exit_mapping\": {\n \"exit_id\": 14626,\n \"distance\": \"0.17\",\n \"cardinal_direction_short\": \"E\",\n \"cardinal_direction_long\": \"East\",\n \"turn_direction_short\": \"R\",\n \"turn_direction_long\": \"Right\"\n },\n \"amenities\": [\n {\n \"id\": 1,\n \"name\": \"Unleaded\",\n \"priority\": 1,\n \"background_color\": \"#0099FF\",\n \"image_prefix\": \"Gas\"\n },\n {\n \"id\": 2,\n \"name\": \"Diesel\",\n \"priority\": 1,\n \"background_color\": \"#006600\",\n \"image_prefix\": \"Diesel\"\n }\n ],\n \"top_priority_amenity\": {\n \"id\": 2,\n \"name\": \"Diesel\",\n \"priority\": 1,\n \"background_color\": \"#006600\",\n \"image_prefix\": \"Diesel\"\n },\n \"fuel_prices\": [\n {\n \"price\": \"1.539\",\n \"fuel_type_id\": 3,\n \"fuel_type\": \"Regular\",\n \"background_color\": \"#0099FF\",\n \"currency\": \"USD\",\n \"liquid_measurement\": \"Gallons\",\n \"updated_at\": \"2016-01-26T02:22:00.000Z\"\n },\n {\n \"price\": \"1.739\",\n \"fuel_type_id\": 4,\n \"fuel_type\": \"Mid Grade\",\n \"background_color\": \"#9b59b6\",\n \"currency\": \"USD\",\n \"liquid_measurement\": \"Gallons\",\n \"updated_at\": \"2016-01-25T15:26:00.000Z\"\n },\n {\n \"price\": \"1.939\",\n \"fuel_type_id\": 5,\n \"fuel_type\": \"Premium\",\n \"background_color\": \"#e74c3c\",\n \"currency\": \"USD\",\n \"liquid_measurement\": \"Gallons\",\n \"updated_at\": \"2016-01-25T17:02:00.000Z\"\n },\n {\n \"price\": \"1.699\",\n \"fuel_type_id\": 1,\n \"fuel_type\": \"Diesel\",\n \"background_color\": \"#006600\",\n \"currency\": \"USD\",\n \"liquid_measurement\": \"Gallons\",\n \"updated_at\": \"2016-01-26T02:22:00.000Z\"\n }\n ]\n },...\n ]\n },...\n ]\n}","language":"json","status":200,"name":"Gas Search ID Included"}]}},"next":{"description":"","pages":[]},"title":"Exits for Highway in State","type":"endpoint","slug":"exits-for-highway-in-state","excerpt":"Get an ordered list of exits for a particular highway in a particular state.","body":"** JSON Response **\n[block:parameters]\n{\n \"data\": {\n \"h-0\": \"Key\",\n \"h-1\": \"Value\",\n \"h-2\": \"Description\",\n \"0-0\": \"`highway_in_state`\",\n \"0-1\": \"[Highway In State](doc:highway-in-state)\",\n \"0-2\": \"As the root object for this response, the [Highway In State](doc:highway-in-state) object will contain a [Highway](doc:highway) and [State](doc:state) object. Any child [Exit](doc:exit-reference) object in need of the [State](doc:state) or [Highway](doc:highway) data should pull it from the root [Highway In State](doc:highway-in-state)\",\n \"2-0\": \"`next_highway_in_state`\",\n \"2-1\": \"[Highway In State](doc:highway-in-state)\",\n \"2-2\": \"[optional] The [Highway In State](doc:highway-in-state) object for the next [State](doc:state) this [Highway](doc:highway) passes through. \\n\\nFor example, for I-65 in Alabama Northbound, the next [Highway In State](doc:highway-in-state) would be I-65 in Tennessee.\",\n \"1-1\": \"[Highway In State](doc:highway-in-state)\",\n \"1-0\": \"`previous_highway_in_state`\",\n \"1-2\": \"[optional] The [Highway In State](doc:highway-in-state) object for the previous [State](doc:state) this [Highway](doc:highway) passed through. \\n\\nFor example, for I-65 in Tennessee Northbound, the previous [Highway In State](doc:highway-in-state) would be I-65 in Alabama.\",\n \"3-0\": \"`exits`\",\n \"3-1\": \"Array of [Exit](doc:exit-reference)s\",\n \"3-2\": \"An ordered (based on direction query parameter) array of [Exit](doc:exit-reference)s for this [Highway](doc:highway) in this [State](doc:state).\\n\\nThe structure of this data is different depending on if a `search_result_id` was supplied to the API. Please read below for more details.\"\n },\n \"cols\": 3,\n \"rows\": 4\n}\n[/block]\nAs you can see above, this API accepts an optional `search_result_id` parameter. We will refer to this API with no `search_result_id` as **Regular Mode** and this API with an included `search_result_id` as **Search Mode**.\n\nIt is very important to realize that the `exits` responses returned from Regular Mode are quite different in structure than Search Mode. The data for `highway_in_state`, `previous_highway_in_state`, and `next_highway_in_state` are the same regardless of which mode you are in, but `exits` will be different.\n\n** Regular Mode **\n\nWhen in Regular Mode, the [Exit](doc:exit) objects in the `exits` array will have an optional `categories` child object. The `categories` object contains what major amenity categories (eg: Gas, Food, Lodging, etc) are found at that exit.\n[block:parameters]\n{\n \"data\": {\n \"h-0\": \"Key\",\n \"h-1\": \"Value\",\n \"h-2\": \"Description\",\n \"0-0\": \"`categories`\",\n \"0-1\": \"Array of [Category](doc:category)s\",\n \"0-2\": \"Array of [Category](doc:category) objects for each major amenity category (eg: Gas, Food, Lodging, etc) found at that exit.\"\n },\n \"cols\": 3,\n \"rows\": 1\n}\n[/block]\n\n[block:image]\n{\n \"images\": [\n {\n \"image\": [\n \"https://files.readme.io/0D4vf0ixQ26dtlYyXkLi_I65AlabamaNorth.png\",\n \"I65AlabamaNorth.png\",\n \"720\",\n \"1280\",\n \"#65bb65\",\n \"\"\n ],\n \"caption\": \"The Exits For Highway In State API in Regular Mode rendered in the iExit Android app.\"\n }\n ]\n}\n[/block]\n** Search Mode **\n\nWhen in Search Mode, the [Exit](doc:exit) objects in the `exits` array will have an optional 'businesses' child object. The `businesses` object contains an array of [Business / POI](doc:business-poi) objects that are found at that exit, each of which contains with [Exit Mapping](doc:exit-mapping) object that tells which side of the exit that business is located.\n[block:parameters]\n{\n \"data\": {\n \"h-0\": \"Key\",\n \"h-1\": \"Value\",\n \"h-2\": \"Description\",\n \"0-0\": \"`businesses`\",\n \"0-1\": \"Array of [Business / POI](doc:business-poi)s\",\n \"0-2\": \"Array of [Business / POI](doc:business-poi) objects that are found at the parent [Exit](doc:exit).\"\n },\n \"cols\": 3,\n \"rows\": 1\n}\n[/block]\n\n[block:image]\n{\n \"images\": [\n {\n \"image\": [\n \"https://files.readme.io/9gSMPFh3Qg6px64eUasP_I65AlabamaNorthWithGasSearch2.png\",\n \"I65AlabamaNorthWithGasSearch2.png\",\n \"720\",\n \"1280\",\n \"#31a78a\",\n \"\"\n ],\n \"caption\": \"The Exits For Highway In State API in Search Mode (searching for Gas) rendered in the iExit Android app.\"\n }\n ]\n}\n[/block]\n** Common Next API(s) **\n- [Exit Details](doc:exit-details) (by using `exits[]`.`id`)\n- [POI Details](doc:poi-details) (by using `exits[]`.`businesses[]`.`id` when in Search Mode)\n- [Exits for Highway in State](doc:exits-for-highway-in-state) (by using `previous_highway_in_state`.`id` and `highway_in_state`.`direction`.`current_direction`, or `next_highway_in_state`.`id` and `highway_in_state`.`direction`.`current_direction`)","updates":[],"order":2,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"560d773c05b3941700338764","category":{"sync":{"isSync":false,"url":""},"pages":["5611758fb177ce190073d70a","56128cc85b4fb72300748549"],"title":"Data Hierarchy","slug":"data-hierarchy","order":1,"from_sync":false,"reference":false,"_id":"560dacb26660a03700976de4","createdAt":"2015-10-01T21:59:14.130Z","project":"560d5ac71ec45619006069d6","version":"560d5ac71ec45619006069d9","__v":2},"editedParams2":true,"project":"560d5ac71ec45619006069d6","user":"560d5a4faf97231900938125","version":{"version":"1.0","version_clean":"1.0.0","codename":"","is_stable":true,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["560d5ac81ec45619006069da","560dabb698a6ae3700673f9f","560dabe1961d492300d94b4b","560dac2cd10a730d0081ac92","560dacb26660a03700976de4","560ebbffcac9dc0d007af87a"],"_id":"560d5ac71ec45619006069d9","releaseDate":"2015-10-01T16:09:43.711Z","__v":6,"createdAt":"2015-10-01T16:09:43.711Z","project":"560d5ac71ec45619006069d6"},"createdAt":"2015-10-01T18:11:08.890Z","githubsync":"","__v":2,"editedParams":true,"parentDoc":null}
getExits for Highway in State
Get an ordered list of exits for a particular highway in a particular state.
Definition
{{ api_url }}{{ page_api_url }}
Parameters
Path Params
highway_in_state_id:
required
integer
[Highway In State](doc:highway-in-state) `id`
direction:
required
string
eg: East, West, North, South
search_result_id:
integer
[Optional] [Search Result](doc:search-result) `id`