Wild card search in an API query

I'm relatively new, please excuse the ignorance. I have successfully used a API to get vehicle information. But I would like to perform a search where all possible vehicle meeting the vin criteria is returned. "5UXWX7C5*BA" is a specific vin but I would like to use "5UX" and have it return everything with this criteria. Is this possible?

api_call <- httr::GET ("https://vpic.nhtsa.dot.gov/api/vehicles/DecodeVinValuesExtended/5UXWX7C5*BA?format=json&modelyear=2011")



api_char <- base :: rawToChar(api_call$content)
api_JSON <-jsonlite::fromJSON(api_char, )

This is not something you get from R but from the API, you would need to check the API's documentation to see if it provides wildcard or regex searching functionalities.

The API owner does not provide much. Vehicle API

Are there any conventions I can play around with like "", * or a function that is widely used?

APIs are only a mean or protocol of communication among different systems or software so there are no standard functionalities, it all depends on what has been implemented on the specific API. As I said, this is not R dependent at all, I think your best hope is to contact the API provider and ask them if that kind of request is supported.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.