@cR0w @edolnx If it's a compliance requirement, just use MaxMind.
If that is not good enough, I don't know what would be. I can tell you how to check BGP data in near real time, but ASN registration data is not always accurate, and originating ASN can be faked (I've seen it done).
If I deeply cared about this I would probably run traceroutes to the IP in question from a bunch of known reference points and trilaterate (there is a published paper about this, nobody's bothered to commercialize it AFAIK), but then you need to wait a nontrivial amount of time (half a second minimum) for the data.
Also, it would make network operators mad.