It is possible to do using the API:
term_id=1&term_value_id=6
term id 1 is lifestage, and value 6 is larva
term_id=1&term_value_id=6
value 5 is nymph
term_id=1&term_value_id=4
value 4 is pupa
term_id=1&term_value_id=8
value 4 is juvenile
As far as I’m able to tell, these annotations aren’t passed to GBIF, so you couldn’t get them there or from rgbif.
I usually do this in R by querying the api using curlconverter, getting the total results, then making separate calls to get what I’m interested in. Here’s one for getting the json results for the first 200 observations tagged with pupa.
library(curlconverter)
library(tidyverse)
api <- "curl -X GET --header 'Accept: application/json' 'https://api.inaturalist.org/v1/observations?term_id=1&term_value_id=4&per_page=200'"
my_ip <- straighten(api) %>%
make_req()
dat <- content(my_ip[[1]](), as="parsed")
Since the API results are capped at 200, I usually then take the total results and use a for loop to page through it (I start with 2 because I usually get what I need from the first call for the first 200):
for (i in 2:ceiling(dat$total_results/200)){
api <- paste("curl -X GET --header 'Accept: application/json' 'https://api.inaturalist.org/v1/observations?term_id=1&term_value_id=4&per_page=200",
"&page=",
i,
"'",
sep = "")
my_ip <- straighten(api) %>%
make_req()
results <- content(my_ip[[1]](), as="parsed")
INSERT HERE THE STUFF YOU WANT TO DO WITH THE API RESULTS
Sys.sleep(1)
}
Then there’s some finagling with the .json file to get what you’re interested in, but that depends on your project goals. But this style of script you can paste in the curl call from the API https://api.inaturalist.org/v1/docs/ for whatever search terms you’re looking for.