How is your API implemented? As a web page or a web service, or something else altogether?
A web page or a web service could check the request's server variables to determine where the request came from. For instance,
Request.ServerVariables("REMOTE_ADDR") returns the IP address of the remote client making the request.