There is a simple query to google API
https://maps.googleapis.com/maps/api/geocode/json?address=&components=country:Russia&language=ru&key=MY_API_KEY
You can use http://country.io/continent.json to map country ISO2 code to continent ISO2 code.
And convert continent ISO2 code to its with this dataset https://github.com/datasets/continent-codes/blob/master/data/continent-codes.csv
Example of country ISO2 code to continent ISO2 code {"BD": "AS", "BE": "EU", "BF": "AF"...}