Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

Is there a way to programmatically query how many API calls an organization has made for the 24-hour period? We have a program that imports data from external databases to SFDC in a fancy way, and we are trying to gauge how many API calls we are consuming. Furthermore, we import data from DBs of different sizes, and we would like to track how many API calls are consumed per database we import. Therefore, we are hoping that there is a solution similar to using the Limits class in APEX (so we can query how many API calls we have left for the 24-hour period both before and after we use our program, and then the difference should indicate how many API calls were consumed to import that DB).

Currently, we are referencing the API Usage via the System Overview link in the Setup and performing the calculation manually (which isn't sufficing). We also know of the API Usage Report, but we don't have enough available users to wield this report to satisfy our needs (have certain users import certain DBs over time, and we can watch/analyze the results).

share|improve this question
add comment

1 Answer

up vote 6 down vote accepted

Starting in a relativley recent release (I believe APIv29) the SOAP API (and possibly others) returns a header describing your org's API limits.

This LimitInfoHeader should be returned on all SOAP calls made from the APIv29 WSDL, and shows you the current use and 24hr rolling limit.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.