RStudio Error: Openrouteservice API request failed [3099] Unable to build an isochrone map

When I run this code:

for(i in 1:29){
cat(paste(“Calculating isochrone for grocery stores in Henderson:”, i,“\n”))
res = ors_isochrones(
grocery_coords1[i, ],
range = 5*60,
profile = “foot-walking”,
output = “sf”)
Sys.sleep(1) # Pause for 1 seconds to avoid IP blocking
output = rbind(output, res) # Add the output incrementally
}

I get this error:

Error: Openrouteservice API request failed
[3099] Unable to build an isochrone map.

Thanks for reaching out. Would you mind submitting an actually reproducible example such that the exact parameters and circumstances for which your requests fail are clear and can be followed up on? Cheers!

I was getting the same error and discovered that storing ors_api_key() created an environment. I removed that and just saved my key Rtoken ← “key”, and put that variable in as option api_key = Rtoken

Rtoken <- "key"
example_locations <- data.frame(
  lon = c(-101.77995, -101.77995),
  lat = c(33.51971, 33.51971)
)

drivetime <- ors_isochrones(
  # set the starting point
  locations = example_locations,
  # use a cycling-regular for example profile
  profile = "driving-car",
  # 8 hrs drivetime
  range = 2800,
  # split into 2 hour intervals
  interval = 720,
  # return a sf object
  output = "sf",
  api_key = Rtoken
)