6

I've read plenty of Salesforce articles about the rolling 24-hour limit on API calls, but the information provided by Salesforce doesn't match up with what I've seen. For several days, I've had a machine requesting the number of API requests every 60 seconds from the Company Information page. My initial expectation was that this number should steadily increase if yesterday's usage was lighter from that time of day, decrease if the app was under more use 24 hours ago, or hover at a roughly constant amount in the unlikely scenario that we're hitting the API just as hard today as we did yesterday.

Instead, this is the general pattern I see:

Five hours of API calls

This implies that the total number of calls that Salesforce shows when I request the 24-hour total is not actually 24 hours worth of calls, but instead 24 hours plus or minus a few minutes to round it to the nearest hour (not sure which). I've found one article that supports that idea, but even that can't be the full story. Here's another snippet of the total requests over time:

No hourly reset

Each day's worth of data I have includes multiple hours where there's no drop on the hour, sometimes four hours in a row. Additionally, there are a few cases (usually just after midnight) where an extra drop occurs on the quarter-hour or half-hour.

This is only a problem because we have a particularly API-hungry application that's bringing us dangerously close to our call limit. These inconsistent drops make it difficult to predict where we stand at any given time. So until we can get our chatty legacy app reigned in...

How exactly does Salesforce calculate the number of API requests for the last 24 hours?

3
  • Eric, Have you seen this
    – abhi
    May 24, 2016 at 18:10
  • Yes, unfortunately the information there is incorrect (or at best, a simplification). From the page: "For example, if you are viewing this on Monday at 2:30 PM, it'll show you the calls made since Sunday at 2:30 PM."
    – Eric Dobbs
    May 24, 2016 at 18:23
  • 1
    Maybe submitting a case to have your API call limit increased will solve your need to worry about this tight usage? Not an answer I know but they will increase it for you within reason and you would not have to monitor it so closely.
    – Eric
    May 24, 2016 at 22:33

2 Answers 2

0

FWIW, I did the following experiment:

  • Did some API requests up to 16:15
  • Stopped doing any requests for 24h

Usage was down to zero at 16:00 next day.

So it looks like it keeps track of how many calls were made each hour and forgets about hour T-24 as soon as hour T-0 begins.

0

Since Salesforce is a multi-tenant environment thus there are API limits enforced. We have 3 types of API limits:

  1. Concurrent API Request Limits
  2. API Timeout Limits
  3. Total API Request Allocations

The Total API Request Allocation limit is a rolling 24-hour limit, Meaning let's say if you have consumed 10 API allocation limits at 2200 hours then these 10 limits will be automatically released the next day at 2200 hours(24 hours), and so on.

APIs that count toward this allocation include the Lightning Platform REST API, the Lightning Platform SOAP API, Bulk API, and Bulk API 2.0. API calls issued by certain Salesforce-connected apps (for example, the Salesforce mobile app) don’t count. To determine which APIs affect the allocation, see Monitoring Your API Usage.

Limits and allocations are enforced against the aggregate of all API calls made to the org in a 24-hour period. Limits and allocations are on a per-user basis.

For more information on API Limits, usage, metrics, etc please refer to the following Salesforce article.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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