{"_id":"560dac8a2254e70d00f90b6b","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"},"githubsync":"","editedParams":true,"user":"560d5a4faf97231900938125","__v":1,"editedParams2":true,"project":"560d5ac71ec45619006069d6","category":{"_id":"560dac2cd10a730d0081ac92","project":"560d5ac71ec45619006069d6","version":"560d5ac71ec45619006069d9","__v":2,"pages":["560dac776660a03700976de2","560dac8a2254e70d00f90b6b"],"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-10-01T21:57:00.777Z","from_sync":false,"order":2,"slug":"on-highway-functionality","title":"On Highway Functionality"},"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-10-01T21:58:34.946Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[]},"method":"get","results":{"codes":[{"name":"Search ID Omitted","code":"{\n  \"starting_exit\": {\n    \"id\": 14690,\n    \"exit_latitude\": \"33.508211\",\n    \"exit_longitude\": \"-86.818687\",\n    \"destination_latitude\": \"33.510356\",\n    \"destination_longitude\": \"-86.819406\",\n    \"city\": \"Birmingham\",\n    \"state\": \"Alabama\",\n    \"postal_code\": \"35203\",\n    \"exit_description\": \"3rd Ave N\",\n    \"sign_label_line_one\": \"EXIT\",\n    \"sign_label_line_two\": \"260B\",\n    \"sign_number\": \"260B\",\n    \"formatted_sign_name\": \"Exit 260B\",\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    \"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  },\n  \"reverse_exit\": {\n    \"id\": 15102,\n    \"exit_latitude\": \"33.504237\",\n    \"exit_longitude\": \"-86.816302\",\n    \"destination_latitude\": \"33.503129\",\n    \"destination_longitude\": \"-86.814477\",\n    \"city\": \"Birmingham\",\n    \"state\": \"Alabama\",\n    \"postal_code\": \"35233\",\n    \"exit_description\": \"4th Ave S\",\n    \"sign_label_line_one\": \"EXIT\",\n    \"sign_label_line_two\": \"259B\",\n    \"sign_number\": \"259B\",\n    \"formatted_sign_name\": \"Exit 259B\",\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  },\n  \"next_exit\": {\n    \"id\": 14713,\n    \"exit_latitude\": \"34.362856\",\n    \"exit_longitude\": \"-86.891239\",\n    \"destination_latitude\": \"34.368137\",\n    \"destination_longitude\": \"-86.890104\",\n    \"city\": \"Falkville\",\n    \"state\": \"Alabama\",\n    \"postal_code\": \"35622\",\n    \"exit_description\": \"Falkville; Eva\",\n    \"sign_label_line_one\": \"EXIT\",\n    \"sign_label_line_two\": \"322\",\n    \"sign_number\": \"322\",\n    \"formatted_sign_name\": \"Exit 322\",\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  },\n  \"exits\": [\n    {\n      \"id\": 14690,\n      \"exit_latitude\": \"33.508211\",\n      \"exit_longitude\": \"-86.818687\",\n      \"destination_latitude\": \"33.510356\",\n      \"destination_longitude\": \"-86.819406\",\n      \"city\": \"Birmingham\",\n      \"state\": \"Alabama\",\n      \"postal_code\": \"35203\",\n      \"exit_description\": \"3rd Ave N\",\n      \"sign_label_line_one\": \"EXIT\",\n      \"sign_label_line_two\": \"260B\",\n      \"sign_number\": \"260B\",\n      \"formatted_sign_name\": \"Exit 260B\",\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\": 8,\n          \"name\": \"Coupon\",\n          \"background_color\": \"#0066CC\",\n          \"image_prefix\": \"Coupon\"\n        },\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\": 4,\n          \"name\": \"Attractions\",\n          \"background_color\": \"#DA70D6\",\n          \"image_prefix\": \"ExitArrow\"\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.633\",\n          \"num_stations_for_avg\": 7,\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-25T16:42:00.000Z\",\n          \"business\": {\n            \"id\": 877038,\n            \"establishment_id\": 384,\n            \"phone\": \"1-205-251-5040\",\n            \"latitude\": \"33.513898\",\n            \"longitude\": \"-86.826233\",\n            \"name\": \"Wavaho\",\n            \"brand_name\": \"Independent Gas\",\n            \"formatted_address\": \"707 Reverend Abraham Woods Jr Blvd, Birmingham, AL 35203\",\n            \"website\": \"\",\n            \"claimed\": 0,\n            \"exit_mapping\": {\n              \"exit_id\": 14690,\n              \"distance\": \"0.29\",\n              \"cardinal_direction_short\": \"NW\",\n              \"cardinal_direction_long\": \"Northwest\",\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          \"price\": \"1.909\",\n          \"avg_price\": \"2.051\",\n          \"num_stations_for_avg\": 6,\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-25T16:42:00.000Z\",\n          \"business\": {\n            \"id\": 877038,\n            \"establishment_id\": 384,\n            \"phone\": \"1-205-251-5040\",\n            \"latitude\": \"33.513898\",\n            \"longitude\": \"-86.826233\",\n            \"name\": \"Wavaho\",\n            \"brand_name\": \"Independent Gas\",\n            \"formatted_address\": \"707 Reverend Abraham Woods Jr Blvd, Birmingham, AL 35203\",\n            \"website\": \"\",\n            \"claimed\": 0,\n            \"exit_mapping\": {\n              \"exit_id\": 14690,\n              \"distance\": \"0.29\",\n              \"cardinal_direction_short\": \"NW\",\n              \"cardinal_direction_long\": \"Northwest\",\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          \"price\": \"2.179\",\n          \"avg_price\": \"2.295\",\n          \"num_stations_for_avg\": 5,\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-25T16:42:00.000Z\",\n          \"business\": {\n            \"id\": 877038,\n            \"establishment_id\": 384,\n            \"phone\": \"1-205-251-5040\",\n            \"latitude\": \"33.513898\",\n            \"longitude\": \"-86.826233\",\n            \"name\": \"Wavaho\",\n            \"brand_name\": \"Independent Gas\",\n            \"formatted_address\": \"707 Reverend Abraham Woods Jr Blvd, Birmingham, AL 35203\",\n            \"website\": \"\",\n            \"claimed\": 0,\n            \"exit_mapping\": {\n              \"exit_id\": 14690,\n              \"distance\": \"0.29\",\n              \"cardinal_direction_short\": \"NW\",\n              \"cardinal_direction_long\": \"Northwest\",\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          \"price\": \"1.899\",\n          \"avg_price\": \"2.099\",\n          \"num_stations_for_avg\": 5,\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-14T06:00:00.000Z\",\n          \"business\": {\n            \"id\": 151374,\n            \"establishment_id\": 397,\n            \"phone\": \"1-205-252-6599\",\n            \"latitude\": \"33.51037\",\n            \"longitude\": \"-86.8194\",\n            \"name\": \"Citgo\",\n            \"brand_name\": \"Citgo\",\n            \"formatted_address\": \"1101 3rd Ave N, Birmingham, AL 35203-1533\",\n            \"website\": \"\",\n            \"claimed\": 0,\n            \"exit_mapping\": {\n              \"exit_id\": 14690,\n              \"distance\": \"0.0\",\n              \"cardinal_direction_short\": \"NE\",\n              \"cardinal_direction_long\": \"Northeast\",\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    },...\n  ]\n}","language":"json","status":200},{"name":"Gas Search ID Included","code":"{\n  \"starting_exit\": {\n    \"id\": 14690,\n    \"exit_latitude\": \"33.508211\",\n    \"exit_longitude\": \"-86.818687\",\n    \"destination_latitude\": \"33.510356\",\n    \"destination_longitude\": \"-86.819406\",\n    \"city\": \"Birmingham\",\n    \"state\": \"Alabama\",\n    \"postal_code\": \"35203\",\n    \"exit_description\": \"3rd Ave N\",\n    \"sign_label_line_one\": \"EXIT\",\n    \"sign_label_line_two\": \"260B\",\n    \"sign_number\": \"260B\",\n    \"formatted_sign_name\": \"Exit 260B\",\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    \"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  },\n  \"reverse_exit\": {\n    \"id\": 15102,\n    \"exit_latitude\": \"33.504237\",\n    \"exit_longitude\": \"-86.816302\",\n    \"destination_latitude\": \"33.503129\",\n    \"destination_longitude\": \"-86.814477\",\n    \"city\": \"Birmingham\",\n    \"state\": \"Alabama\",\n    \"postal_code\": \"35233\",\n    \"exit_description\": \"4th Ave S\",\n    \"sign_label_line_one\": \"EXIT\",\n    \"sign_label_line_two\": \"259B\",\n    \"sign_number\": \"259B\",\n    \"formatted_sign_name\": \"Exit 259B\",\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  },\n  \"next_exit\": {\n    \"id\": 14713,\n    \"exit_latitude\": \"34.362856\",\n    \"exit_longitude\": \"-86.891239\",\n    \"destination_latitude\": \"34.368137\",\n    \"destination_longitude\": \"-86.890104\",\n    \"city\": \"Falkville\",\n    \"state\": \"Alabama\",\n    \"postal_code\": \"35622\",\n    \"exit_description\": \"Falkville; Eva\",\n    \"sign_label_line_one\": \"EXIT\",\n    \"sign_label_line_two\": \"322\",\n    \"sign_number\": \"322\",\n    \"formatted_sign_name\": \"Exit 322\",\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  },\n  \"exits\": [\n    {\n      \"id\": 14690,\n      \"exit_latitude\": \"33.508211\",\n      \"exit_longitude\": \"-86.818687\",\n      \"destination_latitude\": \"33.510356\",\n      \"destination_longitude\": \"-86.819406\",\n      \"city\": \"Birmingham\",\n      \"state\": \"Alabama\",\n      \"postal_code\": \"35203\",\n      \"exit_description\": \"3rd Ave N\",\n      \"sign_label_line_one\": \"EXIT\",\n      \"sign_label_line_two\": \"260B\",\n      \"sign_number\": \"260B\",\n      \"formatted_sign_name\": \"Exit 260B\",\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\": 151374,\n          \"establishment_id\": 397,\n          \"phone\": \"1-205-252-6599\",\n          \"latitude\": \"33.51037\",\n          \"longitude\": \"-86.8194\",\n          \"name\": \"Citgo\",\n          \"brand_name\": \"Citgo\",\n          \"formatted_address\": \"1101 3rd Ave N, Birmingham, AL 35203-1533\",\n          \"website\": \"\",\n          \"claimed\": 0,\n          \"favorite\": 0,\n          \"exit_mapping\": {\n            \"exit_id\": 14690,\n            \"distance\": \"0.0\",\n            \"cardinal_direction_short\": \"NE\",\n            \"cardinal_direction_long\": \"Northeast\",\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.659\",\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-25T16:40:00.000Z\"\n            },\n            {\n              \"price\": \"1.999\",\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-25T16:40:00.000Z\"\n            },\n            {\n              \"price\": \"2.399\",\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-25T16:40:00.000Z\"\n            },\n            {\n              \"price\": \"1.899\",\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-14T06:00:00.000Z\"\n            }\n          ]\n        },...\n      ]\n    },...\n  ]\n}","language":"json","status":200}]},"settings":"","auth":"optional","params":[{"_id":"560eb179cac9dc0d007af870","ref":"","in":"path","required":true,"desc":"The starting [Exit](doc:exit) `id` from where to begin loading. This should be obtained from the [On Highway Detection API](doc:on-highway-detection).","default":"","type":"int","name":"exit_id"},{"_id":"560eb179cac9dc0d007af86f","ref":"","in":"path","required":false,"desc":"[Optional] [Search Result](doc:search-result) `id`","default":"","type":"int","name":"search_result_id"}],"url":"/upcoming/exits/:exit_id/:search_result_id"},"isReference":false,"order":1,"body":"** JSON Response **\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Key\",\n    \"h-1\": \"Value\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"`starting_exit`\",\n    \"0-1\": \"[Exit](doc:exit)\",\n    \"1-0\": \"``reverse_exit`\",\n    \"1-1\": \"[Exit](doc:exit)\",\n    \"2-0\": \"`next_exit`\",\n    \"2-1\": \"[Exit](doc:exit)\",\n    \"3-0\": \"`exits`\",\n    \"3-1\": \"Array of [Exit](doc:exit)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    \"0-2\": \"The [Exit](doc:exit) object for the supplied starting `exit_id`. This is the first of 25 [Exit](doc:exit)s loaded in the `exits` array. \\n\\nThis [Exit](doc:exit) contains a full [Highway In State](doc:highway-in-state) child object under the key `highway_in_state`. That means it contains a child [Highway](doc:highway) object to figure out the name of the highway the user is on, as well as a child [Direction](doc:direction) object to figure out what direction on the highway the user is traveling.\",\n    \"1-2\": \"This is the closest [Exit](doc:exit) for the other side of the highway. This will allow you to build a \\\"Reverse Direction\\\" feature into your app if you would like to. \\n\\nFor instance, if you are traveling on I-65 Northbound starting from Exit 252 in Alabama, the `reverse_exit` would be Exit 252 Southbound.\",\n    \"2-2\": \"[Optional]. This API returns up to 25 [Exit](doc:exit)s in the `exits` field. In the event that more [Exit](doc:exit)s exist beyond these 25, then `next_exit` will provide you the 26th [Exit](doc:exit) ahead.\\n\\nYou can use `next_exit`.`id` and feed it back to this API to retrieve the next 25 [Exit](doc:exit)s ahead from that point. In your iExit API client, you should append these results onto the already fetched list of [Exit](doc:exit)s.\"\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 `starting_exit`, `reverse_exit`, and `next_exit` 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/WPZFtjoSTLWB8J8ddXdt_UpcomingExitsI20.png\",\n        \"UpcomingExitsI20.png\",\n        \"922\",\n        \"1517\",\n        \"#0c184b\",\n        \"\"\n      ],\n      \"caption\": \"The Upcoming Exits 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/OrhdvhFLRlebZ9FS7DqJ_UpcomingExitsI20SearchGas.png\",\n        \"UpcomingExitsI20SearchGas.png\",\n        \"768\",\n        \"1184\",\n        \"#0ba9a4\",\n        \"\"\n      ],\n      \"caption\": \"The Upcoming Exits 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)","excerpt":"View up to the next 25 Exits ahead when given a starting Exit ID.","slug":"upcoming-exits","type":"endpoint","title":"Upcoming Exits"}

getUpcoming Exits

View up to the next 25 Exits ahead when given a starting Exit ID.

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

exit_id:
required
integer
The starting [Exit](doc:exit) `id` from where to begin loading. This should be obtained from the [On Highway Detection API](doc:on-highway-detection).
search_result_id:
integer
[Optional] [Search Result](doc:search-result) `id`

Result Format


Documentation

** JSON Response ** [block:parameters] { "data": { "h-0": "Key", "h-1": "Value", "h-2": "Description", "0-0": "`starting_exit`", "0-1": "[Exit](doc:exit)", "1-0": "``reverse_exit`", "1-1": "[Exit](doc:exit)", "2-0": "`next_exit`", "2-1": "[Exit](doc:exit)", "3-0": "`exits`", "3-1": "Array of [Exit](doc:exit)s", "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.", "0-2": "The [Exit](doc:exit) object for the supplied starting `exit_id`. This is the first of 25 [Exit](doc:exit)s loaded in the `exits` array. \n\nThis [Exit](doc:exit) contains a full [Highway In State](doc:highway-in-state) child object under the key `highway_in_state`. That means it contains a child [Highway](doc:highway) object to figure out the name of the highway the user is on, as well as a child [Direction](doc:direction) object to figure out what direction on the highway the user is traveling.", "1-2": "This is the closest [Exit](doc:exit) for the other side of the highway. This will allow you to build a \"Reverse Direction\" feature into your app if you would like to. \n\nFor instance, if you are traveling on I-65 Northbound starting from Exit 252 in Alabama, the `reverse_exit` would be Exit 252 Southbound.", "2-2": "[Optional]. This API returns up to 25 [Exit](doc:exit)s in the `exits` field. In the event that more [Exit](doc:exit)s exist beyond these 25, then `next_exit` will provide you the 26th [Exit](doc:exit) ahead.\n\nYou can use `next_exit`.`id` and feed it back to this API to retrieve the next 25 [Exit](doc:exit)s ahead from that point. In your iExit API client, you should append these results onto the already fetched list of [Exit](doc:exit)s." }, "cols": 3, "rows": 4 } [/block] As 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**. It is very important to realize that the `exits` responses returned from Regular Mode are quite different in structure than Search Mode. The data for `starting_exit`, `reverse_exit`, and `next_exit` are the same regardless of which mode you are in, but `exits` will be different. ** Regular Mode ** When 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. [block:parameters] { "data": { "h-0": "Key", "h-1": "Value", "h-2": "Description", "0-0": "`categories`", "0-1": "Array of [Category](doc:category)s", "0-2": "Array of [Category](doc:category) objects for each major amenity category (eg: Gas, Food, Lodging, etc) found at that exit." }, "cols": 3, "rows": 1 } [/block] [block:image] { "images": [ { "image": [ "https://files.readme.io/WPZFtjoSTLWB8J8ddXdt_UpcomingExitsI20.png", "UpcomingExitsI20.png", "922", "1517", "#0c184b", "" ], "caption": "The Upcoming Exits API in Regular Mode rendered in the iExit Android app." } ] } [/block] ** Search Mode ** When 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. [block:parameters] { "data": { "h-0": "Key", "h-1": "Value", "h-2": "Description", "0-0": "`businesses`", "0-1": "Array of [Business / POI](doc:business-poi)s", "0-2": "Array of [Business / POI](doc:business-poi) objects that are found at the parent [Exit](doc:exit)." }, "cols": 3, "rows": 1 } [/block] [block:image] { "images": [ { "image": [ "https://files.readme.io/OrhdvhFLRlebZ9FS7DqJ_UpcomingExitsI20SearchGas.png", "UpcomingExitsI20SearchGas.png", "768", "1184", "#0ba9a4", "" ], "caption": "The Upcoming Exits API in Search Mode (searching for Gas) rendered in the iExit Android app." } ] } [/block] ** Common Next API(s) ** - [Exit Details](doc:exit-details) (by using `exits[]`.`id`) - [POI Details](doc:poi-details) (by using `exits[]`.`businesses[]`.`id` when in Search Mode)

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 }}