What API are you exposing? There are many different APIs - I suppose you are not revealing your operating system API ...
Assuming you want to open several web application APIs , you can take a look at OAuth , which is based on callback URLs - you can simply block certain domains from calling through the callback URL.
Learn more about OAuth .
source share