library for validating bitcoin private and public keys
No sane application should EVER attempt to validate a private key by attempting to pass it to an external API. That's a ridiculously easy way to lose all your funds if the API operator is malicious, compromised, or someone is eavesdropping on your communication with said API.
You should do this yourself, preferably using a well tested, community supported, open source library for your choice of language - most major languages have such libraries.
If this is too much work, you should reconsider building something like this. Do not compromise on safety, especially if you intend for other people to trust this code with their funds.