Has Optimization API limit changed?


I am getting the following error using the optimization service for routes of over 50 locations (https://api.openrouteservice.org/optimization):

Too many locations ( 53 ) in query, maximum is set to 50 )

Mostly my code is optimizing routes of well under 50 locations, but occasionally it will be just a slightly more than 50.

I don’t seem to have had this issue before (and I’m pretty sure I’ve optimized routes of just over 50 locations before), so I am wondering if the optimization limit has recently changed? I have checked the changelog and couldn’t see anything.

Is there anything I can do?

Thanks for your help,

Hi @jda,

we did an update yesterday to our optimisation endpoint to the latest version of Vroom, and it seems this now enforces restrictions that should have been in place from the beginning. The restrictions are a maximum of 50 locations and 3 vehicles.

As the optimisation endpoint is outside of the main openrouteservice code, you won’t see updates in the changelog there as that is just for the code changes in the main openrouteservice code.

We are currently looking at getting the restrictions that are in place on the various endpoints documented.


Hi @adam

Thank you for replying so quickly. :slight_smile:

I have just had a look at project vroom on github but can’t see any references to their limits or any questions about their limits on their github issues page, which seems strange if their limit is low like this you’d expect it to be mentioned in their docs and people asking in their issues…

I’ve got to work out what to do now… would you mind double checking with Vroom themselves that this limit is definitely correct? If so then I suppose I’ll have to look at using some other service for the optimization and rewriting a lot of code, which is a shame as I really like openroute service and it’s been working really well.

If you have any ideas what I can do that’d be really appreciated.

Thanks so much for your help,


The configuration is something specified in a config file in our implementation of Vroom, and I have just updated the page on our main site that details the restrictions (https://openrouteservice.org/restrictions/) to reflect this.

We are seeing a lot more users over the last year or so, and so we are having to really be careful about not having restrictions too loose else we run into the problem of our servers becoming over used and so unstable.

It’s our limit, not vroom’s. We’re running it as a software on one of our servers. And since we potentially serve everyone we have to be very careful about resources.

I’d recommend you to do the same. Have a look here:

It contains a docker-compose.yml to set up the whole stack, vroom and openrouteservice.

EDIT: not entirely sure how up-to-date the ORS section of the compose file is, there’s been some movements lately, I might not have updated it properly…

@adam @nils,

Ok understood, thank you, I’ll install it on my server.