function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Marc Mastrocola 21Marc Mastrocola 21 

Find out where API calls are coming from

I've been having a recurring issue with my SFDC org every 3-4 days or so, and this is what happens:
  • I get a notification that our API Usage is at 101%+ usage
  • Our Marketo and Workato integrations cease to work

When I check out the API usage by user report in the last 24 hours I see nothing coming close to 100% usage. After stumbling upon this page: https://help.salesforce.com/HTViewSolution?id=000003706&language=en_US which mentions:

"NOTE: This report displays SOAP API usage, but REST API (including Bulk API) calls are not included in the report, which might explain why the data displayed in the report does not match the figure returned by the System Overview page."

I'm lead to believe it's our REST API usage that is causing us to go over our API limit.

Is there any way to find out where these API calls are coming from? If more details are needed, I'd be happy to provide them.

Thanks in advance!
 

Best Answer chosen by Marc Mastrocola 21
James LoghryJames Loghry
 Generally speaking, it's guess and check as far as figuring out what's eating up your API requests.  The reason you're seeing < 100% usage could be that most of the API requests happened around 24 hours ago and have since been removed from that report, since it's a rolling 24 hour window.  Check your login history as well (System->Manage Users->Login History), and see if you notice integration users logging in or users/developers logging in through the API (for example using eclipse or mavensmate development evironments).

Between the login history and the system overview mentioned in the link above, you should be able to narrow it down to the culprit.
 

All Answers

James LoghryJames Loghry
 Generally speaking, it's guess and check as far as figuring out what's eating up your API requests.  The reason you're seeing < 100% usage could be that most of the API requests happened around 24 hours ago and have since been removed from that report, since it's a rolling 24 hour window.  Check your login history as well (System->Manage Users->Login History), and see if you notice integration users logging in or users/developers logging in through the API (for example using eclipse or mavensmate development evironments).

Between the login history and the system overview mentioned in the link above, you should be able to narrow it down to the culprit.
 
This was selected as the best answer
Daniel BallingerDaniel Ballinger
The Event Monitoring API could be useful here. In particular, you can monitor the exact REST API calls using the corresponding REST API event. Note that this is a paid feature outside the developer edition orgs.

You can pull the log information down via the REST API or SOAP API. This could be somewhat problematic when the API limit is hit, but you should be able to get it once the limit clears. I've made a free log viewer if you don't want to work directly with the APIs.

There is a Trailhead module that explains how to use it in further detail.
 
Marc D BehrMarc D Behr
You can see your overall API usage stats by using the REST explorer in Workbench (https://workbench.developerforce.com/restExplorer.php) and then doing a GET of '/services/data/v35.0/limits'. Look for DailyApiRequests and open that and it will show you how many calls you are allows and how many you have left.

Example:
User-added image


As for where they are coming from, that is harder. For REST calls that we developed, I created a logging class that logs the calls so I can report on those, but anything that uses a standard REST call, can't be tracked. I have not tried either of the options that Daniel mentioned, but maybe they would help.
Alina VandenbergheAlina Vandenberghe
How ironic is it that when you're out of APIs you can't check who's eating them ! 

User-added image