How to Check Remaining API Credits in Your Salesforce Instance

How to Check Remaining API Credits in Your Salesforce Instance

Monitoring your API usage in Salesforce is crucial for maintaining the performance and ensuring smooth operations. Whether you're using Salesforce Lightning Experience or Salesforce Classic, checking your remaining API credits is a straightforward process. Here’s how you can do it:

Checking API Limits in Lightning Experience

  1. Access Setup: Click on the gear icon in the upper right corner of the Salesforce interface and select "Setup".
  2. Navigate to Company Information:some text
    • Go to "Company Settings".
    • Click on "Company Information".
  3. View Usage-Based Entitlements: Under the "Usage-Based Entitlements" section, you will find the details about your API usage and remaining credits.

Checking API Limits in Salesforce Classic

  1. Access Setup: Click on "Setup" at the top right corner of the page.
  2. Navigate to Company Information:some text
    • Go to "Company Profile".
    • Click on "Company Information".
  3. View Usage-Based Entitlements: Look for the "Usage-Based Entitlements" section to see your API usage details.

Checking API LImits from the API

Go to this Salesforce documentation page and use the REST API endpoint.

With the Stacksync API proxy, the endpoint looks like:

curl -X GET https://eu.api-proxy.stacksync.cloud/v1/proxy/https://stacksync2.my.salesforce.com/services/data/v40.0/limits/ \ -H "Authorization: Bearer your_bearer_token"

Understanding API Limits and Allocations

Salesforce imposes several types of limits to ensure optimal performance:

  1. Concurrent API Request Limits: These limits vary by organization type. For instance, production orgs have a limit of 25 concurrent long-running requests (20 seconds or longer).
  2. API Timeout Limits: The default timeout for API calls is 10 minutes, except for query calls which are governed by SOQL limits.
  3. Total API Request Allocations: This limit is based on your Salesforce edition and license type. For example, an Enterprise Edition org has a base allocation plus additional calls per license.

Handling API Request Limits

If you reach or exceed your API limits, Salesforce has mechanisms to handle occasional spikes. However, continuous overage can impact performance and operations. To avoid this, consider:

  • Optimizing API Calls: Streamline your applications to use fewer API calls with batching operations.
  • User services like Stacksync (real-time and bidirectional sync between CRMs and Databases) that provide synchronous and asynchronous real-time Salesforce API alternatives. Stacksync performs real-time batching so even if you edit 10’000 records in 10’000 different SQL queries against your database within a few milliseconds, Stacksync will write all of them as one single API call of 10'000 records to Salesforce. Companies of all sizes use Stacksync to improve their system performance and decrease API usage and costs.
  • Using Composite Resources: Minimize round-trips between client and server to improve efficiency.
  • Purchasing Additional API Calls: If necessary, you can buy more API calls through the Your Account app.

By regularly monitoring your API usage and optimizing your applications, you can maintain the performance and reliability of your Salesforce instance.

For more detailed information, you can always refer to the official Stacksync documentation, the Stacksync API proxy for Salesforce or the Salesforce documentation.