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
nicksquashnicksquash 

what constitutes an API request?

Hi

We've just being doing some CLI implementation of the data loader, and we keep exceeding the number of API requests per 24 hour period.

I can't work out how this script is making this many API requests, so I was wondering what constitutes an API request and what can we do to reduce the number of requests we're making?

thanks
Nick
HardhatHardhat
An API request is any request that goes over the wire -- so a query, retrieve, search, insert, update, delete, single Apex webservice call, or any other such thing.  If you're using a Developer Edition org you'll find that you're limited to something small like 30,000 requests per day (or maybe less, I don't entirely remember it).

Depending on what you're doing, some strategies to reduce the number of calls would be:

1.  Use SOQL relationships (aka joins) wherever possible in your queries rather than doing multiple subsequent queries.
2.  If you have a complex set of queries to spit out a result, think about making an Apex webService that encapsulates them all and spits out the same result.  Then you'll just be burning one API hit (for the Apex web service) to do all those queries.