directions-api icon indicating copy to clipboard operation
directions-api copied to clipboard

Maximum locations per request in "info" endpoint

Open fbonzon opened this issue 8 years ago • 0 comments

It would be nice to know, before sending a routing request to the API, what is the maximum locations per request allowed with our API key. This number varies with GraphHopper account types. E.g. 5 with Free accounts, 30 with Basic accounts, etc.

Currently, there is no way to programmatically know if my routing query with n locations will be allowed, other than issuing it and check if it returns an error or not.

My first use case is the GraphHopper Maps UI. Creating a new intermediate point could be disabled once the maximum allowed count of intermediate points is reached.

E.g. if using a free account (max. 5 locations: start, end and 3 intermediates), and you already defined 3 intermediate points, then the + icon in the left margin to add a new location would be disabled, as well as the "Add intermediate point" item in the context menu.

You should create and return a new key max_locations in the answer to the info endpoint calls.

fbonzon avatar Oct 17 '16 17:10 fbonzon