I am using the Bloomberg API in R (package Rblpapi) to find the nearby price at elevator locations for Soybean/Corn in given states in the US. I use the function lookupSecurity:
lookupSecurity("CRNYUSOH", yellowkey="indx", maxResults=1000)
The problem is that there is a maximum of 1000 results returned, which seems to originate from the API, not from R. Now I hit this limit for many states, mainly because it returns sometimes multiple maturities per location, while I am only interested in one single maturity.
I get for example duplicates like:
- CRNYUSAL AAAA xxx CGB
- CRNYUSAL AAAA xxy CGB
- CRNYUSAL AAAA xxz CGB
where xxx, xxy and xxz stand for different matirities, while I am only interested in one single maturity.
How can I handle this case? I would like to search for terms without the xxx, but it seems the API is not allowing to do a search with regular expressions? Any other solutions?