Code to extract annotations from exported JSON

I think I was able to make a viable alternative. I changed the order of the steps and there’s no wait period between calls now but it does at least work:

keep <-
  c("id", "observed_on", "taxon.name", "location", "uri", "ofvs","annotations") # values to keep

### Request url
url <-
  paste0(
    "https://api.inaturalist.org/v1/observations?quality_grade=any&identifications=any&taxon_id=1195335&page=1&per_page=200&order=desc&order_by=created_at"
)
nobs <- fromJSON(url)
npages <- ceiling(nobs$total_results / 200)
xout <- flatten(nobs$results)
xout <- xout[,keep]

for(i in 2:npages) {
  # Get json and flatten
  page <- paste0("&page=", i)
  x <- fromJSON(gsub("&page=1", page, url))
  x <- flatten(x$results)
  x1 <- x[,keep]
  xout <- rbind(xout,x1)
  }

x <- xout