# Public transport profile in direction

**URL:** <https://ask.openrouteservice.org/t/public-transport-profile-in-direction/7265>\
**Category:** openrouteservice\
**Created:** [April 25, 2025, 11:26am UTC](https://ask.openrouteservice.org/t/public-transport-profile-in-direction/7265 "2025-04-25T11:26:21Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bhavin](https://ask.openrouteservice.org/letter_avatar_proxy/v4/letter/b/50afbb/32.png) [@Bhavin](https://ask.openrouteservice.org/u/Bhavin)\
**Post date:** [April 25, 2025, 11:26am UTC](https://ask.openrouteservice.org/t/public-transport-profile-in-direction/7265/1 "2025-04-25T11:26:21Z")

</div>

Hi,  
I am interested in studying the efficiency of the public transport. I need to know how much duration does public transport takes for given day and time. The following code does give the duration for car,

```from
import os
import openrouteservice

load_dotenv() # Load variables from .env
client = openrouteservice.Client(key=os.getenv("ORS_API_KEY"))

# Coordinates as (longitude, latitude)
coords = ((2.3522, 48.8566), (2.1204, 48.8014))

route = client.directions(coords, profile='driving-car')
# route = client.directions(coords, profile='public-transport')
duration = route['routes'][0]['summary']['duration'] / 60 # in minutes
print(f"Travel time: {duration:.1f} minutes")

```

However, I would like to know if `route = client.directions(coords, profile='public-transport')` sort of function exist or not. I did try this command and it does not work.

Thanks very much.

---

<div class="post-metadata">

**Author:** ![sascha](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/sascha/32/715_2.png) [@sascha](https://ask.openrouteservice.org/u/sascha)\
**Post date:** [April 28, 2025, 6:30am UTC](https://ask.openrouteservice.org/t/public-transport-profile-in-direction/7265/2 "2025-04-28T06:30:52Z")

</div>

The ORS backend software has experimental support for public transport. However, this profile is not deployed on the public service. If you like to use this experimental profile, you need to run the ORS yourself.

---

<div class="post-metadata">

**Author:** ![Bhavin](https://ask.openrouteservice.org/letter_avatar_proxy/v4/letter/b/50afbb/32.png) [@Bhavin](https://ask.openrouteservice.org/u/Bhavin)\
**Post date:** [April 28, 2025, 9:20am UTC](https://ask.openrouteservice.org/t/public-transport-profile-in-direction/7265/3 "2025-04-28T09:20:40Z")

</div>

Thanks very much @sascha I am beginner in the area. Could you please give me some directions about how could I run it myself?

---

<div class="post-metadata">

**Author:** ![sascha](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/sascha/32/715_2.png) [@sascha](https://ask.openrouteservice.org/u/sascha)\
**Post date:** [April 29, 2025, 6:04am UTC](https://ask.openrouteservice.org/t/public-transport-profile-in-direction/7265/4 "2025-04-29T06:04:07Z")

</div>

Sure. Sorry, I forgot to put the link in my previous post.

> **[Running your own openrouteservice instance | openrouteservice backend...](https://giscience.github.io/openrouteservice/run-instance/)**
>
> openrouteservice backend documentation

---

<div class="post-metadata">

**Author:** ![Bhavin](https://ask.openrouteservice.org/letter_avatar_proxy/v4/letter/b/50afbb/32.png) [@Bhavin](https://ask.openrouteservice.org/u/Bhavin)\
**Post date:** [April 30, 2025, 11:59am UTC](https://ask.openrouteservice.org/t/public-transport-profile-in-direction/7265/5 "2025-04-30T11:59:42Z")

</div>

Thanks very much!

---

<div class="post-metadata">

**Author:** ![Bhavin](https://ask.openrouteservice.org/letter_avatar_proxy/v4/letter/b/50afbb/32.png) [@Bhavin](https://ask.openrouteservice.org/u/Bhavin)\
**Post date:** [May 5, 2025, 12:18pm UTC](https://ask.openrouteservice.org/t/public-transport-profile-in-direction/7265/6 "2025-05-05T12:18:51Z")

</div>

Hi,

I have been trying to run Docker. But not successful with public transport yet. And the car profile is still working on localhost after running docker. I have a question.

1. Does “experimental support for public transport” mean not fully functional yet?

---

<div class="post-metadata">

**Author:** ![Bhavin](https://ask.openrouteservice.org/letter_avatar_proxy/v4/letter/b/50afbb/32.png) [@Bhavin](https://ask.openrouteservice.org/u/Bhavin)\
**Post date:** [May 6, 2025, 8:21pm UTC](https://ask.openrouteservice.org/t/public-transport-profile-in-direction/7265/7 "2025-05-06T20:21:38Z")

</div>

Hi,

I am running it locally. However, public transport is not working, I get the following error,

`Traceback (most recent call last): File "test_openrouter.py", line 13, in <module> route = client.directions((start_coords, end_coords), profile='public-transport') File "/home/bhavin/.local/lib/python3.10/site-packages/openrouteservice/client.py", line 299, in wrapper result = func(*args, **kwargs) File "/home/bhavin/.local/lib/python3.10/site-packages/openrouteservice/directions.py", line 281, in directions return client.request("/v2/directions/" + profile + '/' + format, {}, post_json=params, dry_run=dry_run) File "/home/bhavin/.local/lib/python3.10/site-packages/openrouteservice/client.py", line 204, in request result = self._get_body(response) File "/home/bhavin/.local/lib/python3.10/site-packages/openrouteservice/client.py", line 242, in _get_body raise exceptions.ApiError( openrouteservice.exceptions.ApiError: 500 ({'error': {'code': 2099, 'message': 'Unable to get an appropriate route profile for RoutePreference = unknown'}, 'info': {'engine': {'build_date': '2024-03-21T13:55:54Z', 'version': '8.0.0'}, 'timestamp': 1746562755033}}) Error in sys.excepthook: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 76, in apport_excepthook binary = os.path.realpath(os.path.join(os.getcwd(), sys.argv[0])) FileNotFoundError: [Errno 2] No such file or directory Original exception was: Traceback (most recent call last): File "test_openrouter.py", line 13, in <module> route = client.directions((start_coords, end_coords), profile='public-transport') File "/home/bhavin/.local/lib/python3.10/site-packages/openrouteservice/client.py", line 299, in wrapper result = func(*args,**kwargs) File "/home/bhavin/.local/lib/python3.10/site-packages/openrouteservice/directions.py", line 281, in directions return client.request("/v2/directions/" + profile + '/' + format, {}, post_json=params, dry_run=dry_run) File "/home/bhavin/.local/lib/python3.10/site-packages/openrouteservice/client.py", line 204, in request result = self._get_body(response) File "/home/bhavin/.local/lib/python3.10/site-packages/openrouteservice/client.py", line 242, in _get_body raise exceptions.ApiError( openrouteservice.exceptions.ApiError: 500 ({'error': {'code': 2099, 'message': 'Unable to get an appropriate route profile for RoutePreference = unknown'}, 'info': {'engine': {'build_date': '2024-03-21T13:55:54Z', 'version': '8.0.0'}, 'timestamp': 1746562755033}}) `
