# Help to understand /v2/directions/{profile} post response

**URL:** <https://ask.openrouteservice.org/t/help-to-understand-v2-directions-profile-post-response/5110>\
**Category:** directions\
**Created:** [July 27, 2023, 8:12pm UTC](https://ask.openrouteservice.org/t/help-to-understand-v2-directions-profile-post-response/5110 "2023-07-27T20:12:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rish7](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/rish7/32/2426_2.png) [@rish7](https://ask.openrouteservice.org/u/rish7)\
**Post date:** [July 27, 2023, 8:12pm UTC](https://ask.openrouteservice.org/t/help-to-understand-v2-directions-profile-post-response/5110/1 "2023-07-27T20:12:06Z")

</div>

Hi,

I used below API

```auto
  curl -X POST \
  'https://api.openrouteservice.org/v2/directions/driving-car' \
  -H 'Content-Type: application/json; charset=utf-8' \
  -H 'Accept: application/json, application/geo+json, application/gpx+xml, img/png; charset=utf-8' \
  -H 'Authorization: 5 ******* 283e' \
  -d '{"coordinates":[[8.681495,49.41461],[8.686507,49.41943],[8.687872,49.420318]]}'

```

Response I got is

```auto
{
    "bbox": [
        8.681423,
        49.414599,
        8.690123,
        49.420514
    ],
    "routes": [
        {
            "summary": {
                "distance": 1372.6,
                "duration": 292.79999999999995
            },
            "segments": [
                {
                    "distance": 891.1,
                    "duration": 189.7,
                    "steps": [
                        {
                            "distance": 1.8,
                            "duration": 0.4,
                            "type": 11,
                            "instruction": "Head west on Gerhart-Hauptmann-Straße",
                            "name": "Gerhart-Hauptmann-Straße",
                            "way_points": [
                                0,
                                1
                            ]
                        },
                        {
                            "distance": 313.8,
                            "duration": 75.3,
                            "type": 1,
                            "instruction": "Turn right onto Wielandtstraße",
                            "name": "Wielandtstraße",
                            "way_points": [
                                1,
                                6
                            ]
                        },
                        {
                            "distance": 251.7,
                            "duration": 36.2,
                            "type": 1,
                            "instruction": "Turn right onto Mönchhofstraße",
                            "name": "Mönchhofstraße",
                            "way_points": [
                                6,
                                10
                            ]
                        },
                        {
                            "distance": 211.8,
                            "duration": 50.8,
                            "type": 0,
                            "instruction": "Turn left onto Keplerstraße",
                            "name": "Keplerstraße",
                            "way_points": [
                                10,
                                13
                            ]
                        },
                        {
                            "distance": 109.5,
                            "duration": 26.3,
                            "type": 1,
                            "instruction": "Turn right onto Moltkestraße",
                            "name": "Moltkestraße",
                            "way_points": [
                                13,
                                14
                            ]
                        },
                        {
                            "distance": 2.4,
                            "duration": 0.6,
                            "type": 0,
                            "instruction": "Turn left onto Werderplatz",
                            "name": "Werderplatz",
                            "way_points": [
                                14,
                                15
                            ]
                        },
                        {
                            "distance": 0,
                            "duration": 0,
                            "type": 10,
                            "instruction": "Arrive at Werderplatz, on the right",
                            "name": "-",
                            "way_points": [
                                15,
                                15
                            ]
                        }
                    ]
                },
                {
                    "distance": 481.5,
                    "duration": 103.1,
                    "steps": [
                        {
                            "distance": 2.4,
                            "duration": 0.6,
                            "type": 11,
                            "instruction": "Head south on Werderplatz",
                            "name": "Werderplatz",
                            "way_points": [
                                15,
                                16
                            ]
                        },
                        {
                            "distance": 265.5,
                            "duration": 63.7,
                            "type": 0,
                            "instruction": "Turn left onto Moltkestraße",
                            "name": "Moltkestraße",
                            "way_points": [
                                16,
                                20
                            ]
                        },
                        {
                            "distance": 83,
                            "duration": 7.5,
                            "type": 2,
                            "instruction": "Turn sharp left onto Handschuhsheimer Landstraße, B 3",
                            "name": "Handschuhsheimer Landstraße, B 3",
                            "way_points": [
                                20,
                                22
                            ]
                        },
                        {
                            "distance": 130.6,
                            "duration": 31.4,
                            "type": 0,
                            "instruction": "Turn left onto Roonstraße",
                            "name": "Roonstraße",
                            "way_points": [
                                22,
                                23
                            ]
                        },
                        {
                            "distance": 0,
                            "duration": 0,
                            "type": 10,
                            "instruction": "Arrive at Roonstraße, straight ahead",
                            "name": "-",
                            "way_points": [
                                23,
                                23
                            ]
                        }
                    ]
                }
            ],
            "bbox": [
                8.681423,
                49.414599,
                8.690123,
                49.420514
            ],
            "geometry": "ghrlHir~s@?BIC{ELgDo@aBa@}@I?sB?k@BwD?_JgAJgHt@I@]iHC?B?KuB]oFASg@wImAt@y@f@d@bJ",
            "way_points": [
                0,
                15,
                23
            ],
            "legs": []
        }
    ],
    "metadata": {
        "attribution": "openrouteservice.org | OpenStreetMap contributors",
        "service": "routing",
        "timestamp": 1690487824223,
        "query": {
            "coordinates": [
                [
                    8.681495,
                    49.41461
                ],
                [
                    8.686507,
                    49.41943
                ],
                [
                    8.687872,
                    49.420318
                ]
            ],
            "profile": "driving-car",
            "format": "json"
        },
        "engine": {
            "version": "7.1.0",
            "build_date": "2023-07-09T01:31:50Z",
            "graph_date": "2023-07-23T10:09:25Z"
        }
    }
}

```

But How to draw a line string(route) on the map. In the playground, it is showing that in a red line.

 ![Screenshot 2023-07-27 at 21.09.07](https://ask.openrouteservice.org/uploads/default/original/2X/0/0372d53bfd712b7126f25f4f5efa291f2d186d1f.png)

And also I did not understand what is this value means

`"geometry": "ghrlHir~s@?BIC{ELgDo@aBa@}@I?sB?k@BwD?_JgAJgHt@I@]iHC?B?KuB]oFASg@wImAt@y@f@d@bJ"`

---

<div class="post-metadata">

**Author:** ![rish7](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/rish7/32/2426_2.png) [@rish7](https://ask.openrouteservice.org/u/rish7)\
**Post date:** [July 27, 2023, 8:26pm UTC](https://ask.openrouteservice.org/t/help-to-understand-v2-directions-profile-post-response/5110/2 "2023-07-27T20:26:51Z")

</div>

Thank you I got my answer.

> **[Geometry Decoding](https://giscience.github.io/openrouteservice/documentation/Geometry-Decoding.html)**
>
> documentation for the free open source routing service openrouteservice

---

<div class="post-metadata">

**Author:** ![Jules](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/jules/32/187_2.png) [@Jules](https://ask.openrouteservice.org/u/Jules)\
**Post date:** [July 28, 2023, 7:12am UTC](https://ask.openrouteservice.org/t/help-to-understand-v2-directions-profile-post-response/5110/3 "2023-07-28T07:12:22Z")

</div>

Thanks for following-up on this with your solution. Appreciate that!

If you would rather not deal with encoded geometries, try to query the GeoJSON endpoints directly:

```auto
# As described here: https://openrouteservice.org/dev/#/api-docs/v2/directions/%7Bprofile%7D/geojson/post
 
  curl -X POST \
  'https://api.openrouteservice.org/v2/directions/driving-car/geojson' \
  -H 'Content-Type: application/json; charset=utf-8' \
  -H 'Accept: application/json, application/geo+json, application/gpx+xml, img/png; charset=utf-8' \
  -H 'Authorization: your-api-key' \
  -d '{"coordinates":[[8.681495,49.41461],[8.686507,49.41943],[8.687872,49.420318]]}'

```

If you need any further information, just let us know.
