{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"🚗 TraceRoute – Step-by-Step Beginner Tutorial","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"-traceroute--step-by-step-beginner-tutorial","__idx":0},"children":["🚗 TraceRoute – Step-by-Step Beginner Tutorial"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"em","attributes":{},"children":["“How to build your first route request in JSON”"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"-what-we-want-to-do","__idx":1},"children":["🎯 What We Want to Do"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["We want to ask the API:"]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["“Give me the best route by car from point A to point B.”"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To do this, we’ll build a small JSON file that the API understands."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"-step-1-define-the-transport-mode","__idx":2},"children":["📦 Step 1: Define the Transport Mode"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Start by saying ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["what kind of vehicle"]}," you're using."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In our case, we use a car:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"\"routingVehicleProfile\": {\n  \"transportMode\": \"CAR\"\n}\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["🔍 This tells the API to compute a route suitable for a car."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"-step-2-add-useful-options","__idx":3},"children":["📦 Step 2: Add Useful Options"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can ask the API to return useful data, such as:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POLYLINE"]}," → the route on the map"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ROUTESHEET"]}," → step-by-step instructions (like GPS)"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["We add them in a list:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"\"options\": [\"POLYLINE\", \"ROUTESHEET\"]\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"-step-3-add-the-coordinates-start-and-end","__idx":4},"children":["📦 Step 3: Add the Coordinates (Start and End)"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Now give the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["GPS positions"]}," for the start and end of the trip."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Each point must include:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["lon"]}," → longitude"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["lat"]}," → latitude"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["speed"]}," → estimated speed at that moment"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["time"]}," → timestamp in milliseconds (you can copy/paste this part)"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"\"destinations\": [\n  {\n    \"coordinateSat\": {\n      \"lon\": 2.3488,\n      \"lat\": 48.8534,\n      \"speed\": 20.0,\n      \"time\": 1720519200000\n    }\n  },\n  {\n    \"coordinateSat\": {\n      \"lon\": 2.3600,\n      \"lat\": 48.8580,\n      \"speed\": 35.0,\n      \"time\": 1720519260000\n    }\n  }\n]\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"-final-complete-request","__idx":5},"children":["✅ Final Complete Request"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Now put all the pieces together:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"{\n  \"geoserver\": \"osm\",\n  \"routingVehicleProfile\": {\n    \"transportMode\": \"CAR\"\n  },\n  \"options\": [\"POLYLINE\"],\n  \"destinations\": [\n    {\n      \"coordinateSat\": {\n        \"lon\": 2.3488,\n        \"lat\": 48.8534,\n        \"speed\": 20.0,\n        \"time\": 1720519200000\n      }\n    },\n    {\n      \"coordinateSat\": {\n        \"lon\": 2.3600,\n        \"lat\": 48.8580,\n        \"speed\": 35.0,\n        \"time\": 1720519260000\n      }\n    }\n  ]\n}\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"-how-to-use-this-request","__idx":6},"children":["🧪 How to Use This Request"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["1."]}," Open your favorite API testing tool (e.g. Postman, Insomnia, or curl)."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["2."]}," Paste this JSON in the body of a POST request."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["3."]}," Send the request to your TraceRoute API endpoint."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["4."]}," Read the response: you'll get a map polyline and a route sheet."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"-tips-for-new-users","__idx":7},"children":["💡 Tips for New Users"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Don’t worry too much about ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["speed"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["time"]}," values — just copy them from examples for now."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can add more points to create a route with stops."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can always test with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transportMode: \"CAR\""]}," first."]}]}]}]},"headings":[{"value":"🚗 TraceRoute – Step-by-Step Beginner Tutorial","id":"-traceroute--step-by-step-beginner-tutorial","depth":1},{"value":"🎯 What We Want to Do","id":"-what-we-want-to-do","depth":2},{"value":"📦 Step 1: Define the Transport Mode","id":"-step-1-define-the-transport-mode","depth":3},{"value":"📦 Step 2: Add Useful Options","id":"-step-2-add-useful-options","depth":3},{"value":"📦 Step 3: Add the Coordinates (Start and End)","id":"-step-3-add-the-coordinates-start-and-end","depth":3},{"value":"✅ Final Complete Request","id":"-final-complete-request","depth":2},{"value":"🧪 How to Use This Request","id":"-how-to-use-this-request","depth":2},{"value":"💡 Tips for New Users","id":"-tips-for-new-users","depth":2}],"frontmatter":{"seo":{"title":"🚗 TraceRoute – Step-by-Step Beginner Tutorial"}},"lastModified":"2025-09-25T07:10:32.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/api-reference/traceroute/tutorial/1traceroute_first_request","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}