API key error when using ORS Tools in QGIS 3.6

Hi, I am using QGIS 3.6 and encounter the below error when trying to use ORS Tools to make drive-time isochrones for a few points, after also adding the Open Street Map layer to the map and using my (valid) token and API key.

ApiError:
401 ({
“error”: “Authorization field/api_key missing in request. If you do not have a token, please sign up for one at…” (openrouteservice url)
}

I am using the exact instructions from this tutorial: https://www.youtube.com/watch?v=Rsxl_0IUSFM&t=552s

Which means that I

  1. added the Open Streets Map layer from the browser tab.
  2. added a .csv points layer (you can see the data points here)
  3. went to the Web menu, ORS Tools, opened settings and pasted my valid openrouteservice API key, clicked okay.
  4. under the Batch Jobs tab of the ORS Tools menu, I selected “Isochrones from Layer”, selected open route service provider, selected the input point layer, unique ID for the input layer ID field, set travel mode to driving-car, time, isochrones (15, 30, 45, 60).

With this result:

Input parameters:
{ ‘INPUT_FIELD’ : ‘Clave de localidad INEGI’, ‘INPUT_METRIC’ : 0, ‘INPUT_POINT_LAYER’ : ‘file:///F:/39PUNTOS/ChiapasNuevasSucursales.csv?type=csv&detectTypes=yes&xField=Longitud&yField=Latitud&crs=EPSG:4326&spatialIndex=no&subsetIndex=no&watchFile=no’, ‘INPUT_PROFILE’ : 0, ‘INPUT_PROVIDER’ : 0, ‘INPUT_RANGES’ : ‘15, 30, 45, 60’, ‘OUTPUT’ : ‘TEMPORARY_OUTPUT’ }

Feature ID 70120001 caused a ApiError:
401 ({
“error”: "Authorization field/api_key missing in request. If you do not have a token, please sign up for one at … (url)
}

The same error is repeated for each unique Feature ID.

After running, I double-check that the API key is still correctly saved in the ORS Tools settings, and it is.

Any ideas what is going wrong?

ORS tools settings:
image

Hi,

Can you send me your API key on nils@openrouteservice.org? I’ll check what’s going on, shouldn’t be what you describe, if your key is valid.

Thank you so much! I sent the API key to your email, please let me know if you notice anything wrong!

Has anyone else had this error? I have not received a response so far ;.(

Hi @Lori_Diane_Smith,

Could you send me your key again, please?
Nils currently has a lot of other stuff on his to do list :slight_smile:
Just send it to enquiry@openrouteservice.org.

Do you remember when you did the last working request with this key?

Best regards

hi !

how can I receive the API key for ORS tools QGIS 3.6 . I need to use isochrones ! ~ ~
thank you for your work ^^

@0417wlghks,
you have to sign up at our website openrouteservice.org/dev/#/signup , log-in and request a key to get your free api key

I am also facing similar problem, how do I resolve this?

Hey,

the process is described here.

Best regards

Thanks, I have followed the process but getting the error posted in image in red. I want to correct the same.

Hey,

if you correctly set API key and URL for your request, then the only thing I can think of is the selection of the correct provider in the parameters - could you check that?

Best regards

Hi JSCHNELL,

I have successfully used the process and have generated isochrones in the same file previously a month back. I was reworking in the same and got this error. My API key is still valid, I did check the same.

Hey,

could you provide the following:

  • Screenshot of your Provider Setting with the one you want to use unfolded
  • Screenshot of your Isochrones from Layer-settings

What version of QGIS are you running? What version of the plugin are you running?

Best regards

  1. Service provider is open route. But I do not see open street map in the layers.
  2. isochrone(hope this is what is expected)

ors version 1.5.2
qgis version 3.24

you can also see isochrones generated previosly.

Hi @Archana_Gaikwad,

the Provider you choose is linked to a configuration in the Plugin settings (Web → OrsTools → Provider settings) that’s the one that is interesting as it contains the base URL Requests are being sent to and the API key. Which could be the source of the error.

In the Isochrones from Layer window you didn’t specify an input layer for that run. But i guess you have run it with one selected, as it would result in a different error.

Best regards

2 Likes

Thanks @ amandus. I will check.

1 Like

Hi @Archana_Gaikwad , today I faced the same problem, I solved it by copying the key from my Dashboard gain into the ORStools app window in Qguis, following @amandus explanation.

2 Likes

yes, this works! thanks a ton…

1 Like

Hello,
I am using ORC to create an isochrones map for public transportation stations.
I have installed the ORC, and I added the API key but I still have this issue:
Algorithm started at: 2025-02-24T11:28:32

Algorithm ‘Isochrones from Point-Layer’ starting…

Input parameters:

{ ‘INPUT_AVOID_BORDERS’ : None, ‘INPUT_AVOID_COUNTRIES’ : ‘’, ‘INPUT_AVOID_FEATURES’ : , ‘INPUT_AVOID_POLYGONS’ : None, ‘INPUT_FIELD’ : ‘’, ‘INPUT_METRIC’ : 0, ‘INPUT_POINT_LAYER’ : ‘C:/Users/LUCP13588/Downloads/gtfs (5)/GG.gpkg|layername=stops_bus’, ‘INPUT_PROFILE’ : 0, ‘INPUT_PROVIDER’ : 0, ‘INPUT_RANGES’ : ‘5, 10’, ‘INPUT_SMOOTHING’ : None, ‘LOCATION_TYPE’ : 0, ‘OUTPUT’ : ‘TEMPORARY_OUTPUT’ }

Traceback (most recent call last):
File “C:\Users/LUCP13588/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\ORStools\common\client.py”, line 167, in request
response, content = self.nam.request(
^^^^^^^^^^^^^^^^^
File “C:\Users/LUCP13588/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\ORStools\common\networkaccessmanager.py”, line 278, in request
raise self.http_call_result.exception
ORStools.common.networkaccessmanager.RequestsExceptionConnectionError: Network error: Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “C:\Users/LUCP13588/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\ORStools\proc\isochrones_layer_proc.py”, line 197, in processAlgorithm
response = ors_client.request(“/v2/isochrones/” + profile, {}, post_json=params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users/LUCP13588/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\ORStools\common\client.py”, line 175, in request
self._check_status()
File “C:\Users/LUCP13588/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\ORStools\common\client.py”, line 226, in _check_status
raise Exception(
Exception: Network error: Connection refused. Are your provider settings correct and the provider ready?

Execution failed after 4.40 seconds

Loading resulting layers

Algorithm ‘Isochrones from Point-Layer’ finished