Our org has hit API Request Limit again yesterday which is 25k in 24 hours. Since it is not a small number I am wondering how does that count. Suppose we were running a test class, how many API calls will be used? By understanding that we can analyse what is going wrong.
Every call to the API counts. This doesn't include test methods, because they can't call the API. API requests include Salesforce for Outlook, mobile apps, the Data Loader, etc. If many users are using Salesforce1, or if you have many integrations, such as synchronizing with Oracle or a third-party system, can consume many calls. For example, with a batch size of 200, if a user uploads 20,000 records, that is 100 API calls. A process that synchronizes just once every five minutes between Salesforce and an external system would use at least 288 calls per day, assuming no data was modified. It could easily be thousands of calls per day if there is a lot of activity in your organization. Apps that do not cache session IDs (e.g. those that login every five minutes when performing a sync) would consume extra calls. The Force.com IDE can easily consume hundreds of calls a day per user. You can work with Salesforce support to try and identify which apps or integrations are causing excessive API usage. The limit is aggregated every hour, and the last 24 hours are used for the total. This means if you use 10,000 calls in an hour between 12pm and 1pm, those calls will count against the limit until 1pm the next day. If this is an unusual case, it most likely has to do with a user uploading a large amount of data with the data loader.