Check the headers returned from the API call you’re using.
X-Rate-Limit-Limit: the allocation of calls to this endpoint per 15 minutes
X-Rate-Limit-Remaining: how many of the allocation you have left
X-Rate-Limit-Reset: the time when your allocation will reset
Using these values you can track how many API calls you have left. This is all covered at https://dev.twitter.com/rest/public/rate-limiting.