{"_id":"560d74da772ec32d00fa5856","__v":1,"project":"560d5ac71ec45619006069d6","category":{"_id":"560dacb26660a03700976de4","project":"560d5ac71ec45619006069d6","version":"560d5ac71ec45619006069d9","__v":2,"pages":["5611758fb177ce190073d70a","56128cc85b4fb72300748549"],"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-10-01T21:59:14.130Z","from_sync":false,"order":1,"slug":"data-hierarchy","title":"Data Hierarchy"},"user":"560d5a4faf97231900938125","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"},"editedParams":true,"editedParams2":true,"githubsync":"","parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-10-01T18:00:58.533Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"status":200,"name":"","code":"{\n  \"state\": {\n    \"id\": 1,\n    \"short_name\": \"AL\",\n    \"long_name\": \"Alabama\"\n  },\n  \"highway_in_states\": [\n    {\n      \"id\": 21,\n      \"highway\": {\n        \"id\": 13,\n        \"display_name\": \"I-10\",\n        \"sign_name\": \"10\",\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\": \"East\",\n        \"negative_direction\": \"West\",\n        \"direction_suffix\": \"bound\"\n      }\n    },\n    {\n      \"id\": 337,\n      \"highway\": {\n        \"id\": 168,\n        \"display_name\": \"I-165\",\n        \"sign_name\": \"165\",\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    } ...\n  ]\n}","language":"json"}]},"settings":"","examples":{"codes":[{"code":"","language":"text"}]},"method":"get","auth":"required","params":[{"_id":"560d75fc1ec45619006069eb","ref":"","in":"path","required":false,"desc":"[State](doc:state) `id`","default":"","type":"int","name":"state_id"}],"url":"/highways/:state_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\": \"`state`\",\n    \"0-1\": \"[State](doc:state)\",\n    \"0-2\": \"The [State](doc:state) defined by the query parameter ID\",\n    \"1-0\": \"`highway_in_states`\",\n    \"1-1\": \"Array of [Highway In State](doc:highway-in-state)s\",\n    \"1-2\": \"An array of [Highway In State](doc:highway-in-state) objects\"\n  },\n  \"cols\": 3,\n  \"rows\": 2\n}\n[/block]\nThe first step of the Exit Lookup feature is to select a [State](doc:state). You do this with the [States API](doc:states). \n\nUpon choosing a [State](doc:state) (in the below case, Alabama), you can feed its `id` to this API and receive all [Highway](doc:highway)s that pass through this [State](doc:state). These results are called [Highway In State](doc:highway-in-state) objects.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/6PQyQqUyS2W51Idv3fEY_AlabamaHighways.png\",\n        \"AlabamaHighways.png\",\n        \"720\",\n        \"1280\",\n        \"#2db15e\",\n        \"\"\n      ],\n      \"caption\": \"The Highways in State API in use inside the iExit Android app\"\n    }\n  ]\n}\n[/block]\nIt is important to know the difference between a [Highway](doc:highway) and a [Highway In State](doc:highway-in-state). A [Highway](doc:highway) defines a limited access road that **might** span multiple states. I-65, for instance, spans 4 states (Alabama, Tennessee, Kentucky, and Indiana), and thus there are 4 [Highway In State](doc:highway-in-state)s associated with the I-65 [Highway](doc:highway). \n\n** Common Next API(s) **\n- [Exits For Highway In State](doc:exits-for-highway-in-state) (read below)\n\nChoosing a `highway_in_state[]`.`id` is not enough to move on to the [Exits For Highway In State API](doc:exits-for-highway-in-state). We also need to select a direction for the chosen [Highway In State](doc:highway-in-state). \n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/Tf6d2XPTSI9RxVtLe0qG_AlabamaI65ChooseDirection.png\",\n        \"AlabamaI65ChooseDirection.png\",\n        \"720\",\n        \"1280\",\n        \"#53b6d1\",\n        \"\"\n      ],\n      \"caption\": \"After selecting a highway, you should further prompt the user to select which direction on that highway they plan to travel.\"\n    }\n  ]\n}\n[/block]\nI-65, for instance, travels northbound and southbound, and each side is different, so a direction is required for the [Exits For Highway In State API](doc:exits-for-highway-in-state). This direction options come from the `string` values in `highway_in_state`.`highway`.`positive_direction` and `highway_in_state`.`highway`.`negative_direction`.\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Note about \\\"positive\\\" and \\\"negative\\\" directions\",\n  \"body\": \"We use the term \\\"positive\\\" and \\\"negative\\\" directions as cardinal-direction-agnostic terms for highway travel. For a North/South [Highway](doc:highway), North is the \\\"positive\\\" direction and \\\"South is the \\\"negative\\\" direction. For an East/West [Highway](doc:highway), East is \\\"positive\\\" and West is \\\"negative\\\".\"\n}\n[/block]","excerpt":"Get all the highways that pass through a particular state.","slug":"highways-in-state","type":"endpoint","title":"Highways in State"}

getHighways in State

Get all the highways that pass through a particular state.

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

state_id:
integer
[State](doc:state) `id`

Result Format


Documentation

** JSON Response ** [block:parameters] { "data": { "h-0": "Key", "h-1": "Value", "h-2": "Description", "0-0": "`state`", "0-1": "[State](doc:state)", "0-2": "The [State](doc:state) defined by the query parameter ID", "1-0": "`highway_in_states`", "1-1": "Array of [Highway In State](doc:highway-in-state)s", "1-2": "An array of [Highway In State](doc:highway-in-state) objects" }, "cols": 3, "rows": 2 } [/block] The first step of the Exit Lookup feature is to select a [State](doc:state). You do this with the [States API](doc:states). Upon choosing a [State](doc:state) (in the below case, Alabama), you can feed its `id` to this API and receive all [Highway](doc:highway)s that pass through this [State](doc:state). These results are called [Highway In State](doc:highway-in-state) objects. [block:image] { "images": [ { "image": [ "https://files.readme.io/6PQyQqUyS2W51Idv3fEY_AlabamaHighways.png", "AlabamaHighways.png", "720", "1280", "#2db15e", "" ], "caption": "The Highways in State API in use inside the iExit Android app" } ] } [/block] It is important to know the difference between a [Highway](doc:highway) and a [Highway In State](doc:highway-in-state). A [Highway](doc:highway) defines a limited access road that **might** span multiple states. I-65, for instance, spans 4 states (Alabama, Tennessee, Kentucky, and Indiana), and thus there are 4 [Highway In State](doc:highway-in-state)s associated with the I-65 [Highway](doc:highway). ** Common Next API(s) ** - [Exits For Highway In State](doc:exits-for-highway-in-state) (read below) Choosing a `highway_in_state[]`.`id` is not enough to move on to the [Exits For Highway In State API](doc:exits-for-highway-in-state). We also need to select a direction for the chosen [Highway In State](doc:highway-in-state). [block:image] { "images": [ { "image": [ "https://files.readme.io/Tf6d2XPTSI9RxVtLe0qG_AlabamaI65ChooseDirection.png", "AlabamaI65ChooseDirection.png", "720", "1280", "#53b6d1", "" ], "caption": "After selecting a highway, you should further prompt the user to select which direction on that highway they plan to travel." } ] } [/block] I-65, for instance, travels northbound and southbound, and each side is different, so a direction is required for the [Exits For Highway In State API](doc:exits-for-highway-in-state). This direction options come from the `string` values in `highway_in_state`.`highway`.`positive_direction` and `highway_in_state`.`highway`.`negative_direction`. [block:callout] { "type": "warning", "title": "Note about \"positive\" and \"negative\" directions", "body": "We use the term \"positive\" and \"negative\" directions as cardinal-direction-agnostic terms for highway travel. For a North/South [Highway](doc:highway), North is the \"positive\" direction and \"South is the \"negative\" direction. For an East/West [Highway](doc:highway), East is \"positive\" and West is \"negative\"." } [/block]

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