Yes. In fact, zero-knowledge proofs make it possible for me to do something like prove my age in a way that is verifiable by the site without the site knowing any other information about me AND without the government knowing what website I’m asking. It doesn’t even require an API. The government needs to digitally sign my identity papers and publish its signature. One time download and you can even do offline checks.
The EU digital ID program does this. Everyone has privacy.