I don't know how to do it. I am not a programmer. I do know that other similar plugins/services do it. So there is a way to do it.
It doesn't have to be exact for each country, maybe just an average. Any problem that can be solved manually can be solved programatically, if there is a will to...