How to retrieve basyonim and all synonims of a vector of species using RGBIF

Hi there,
I would like to retrieve the basionym and synonyms of a vector of species using R, similar to what gbif does automatically when we download the occurence records. I am collecting occurrence count data for species and have run into the issue of not being able to collect all the occurrence data for a species and its synonyms.
The synonyms names I am looking for is on the left of the screen, and the basionym is just below the name on the top of the screen on the GBIF website when you do a search for a species (e.g., Achyrocline satureioides (Lam.) DC.).
I would appreciate if someone can help me with that

Thanks
Bianca

Hello @biaabio1,

library(rgbif)
name_backbone("Achyrocline satureioides (Lam.) DC.")$usageKey
# 3139534 is the taxonKey for Achyrocline satureioides (Lam.) DC.
# Use this number to look up the basionym  and synonyms 
name_usage(key=3139534)$data # look at basionym column
name_usage(key=3139534,data="synonyms")$data # this will get all the synonyms 
1 Like