What are the maximum no of records that can be fetched using 1 SOAP API call

  • can you clarify if you mean the standard SOAP apis, or a custom soap api you want to write in apex.
    – superfell
    Oct 10 '12 at 2:19
  • Standard SOAP APIs whic are exposed by Salesforce Oct 10 '12 at 9:58

You can get up to 2,000 records at a time from a query using the SOAP API by changing the batchSize: http://bit.ly/TfkKge

You can then get additional records by calling queryMore with the queryLocator returned with the result.

If the records you are querying for are wide (because you are querying for many fields or long fields), you will get fewer than 2,000 records in each result set even if that's your batch size.

  • So this means that maximum number of records via SOAP API call i.e. QueryResult qr = binding.query("select ... from ... where"); is unlimited. This means we are talking about stream.
    – broadband
    Jan 7 '14 at 12:36
  • The number of records you can retrieve via the SOAP API during a 24-hour period is constrained by the number of API calls allowed in your org, but this question asked how many records can be retrieved in a single API call.
    – xn.
    Jan 7 '14 at 16:56
  • You are correct about the question. Also I did not test it but I suppose one queryMore() subtracts one API calls. My question was how to get let's say 500k records via SOAP API and the answer is by calling queryMore() which you provided. It's just that SalesForce has limit on everything (which is justified as they have lots of users). Now I'm calm because I know there is a way to transfer unlimited data from SalesForce via SOAP API as long as your organization has enough allowed api calls (in found it in setup -> company profile -> company information).
    – broadband
    Jan 8 '14 at 8:23
  • Tested that queryMore() results subtraction (-1) of allowed API calls in SalesForce.
    – broadband
    Jan 8 '14 at 9:25

The Maximum no of records a query can fetch is 50000 rows and also there is an apex limit of 3MB for output response for any service(REST OR SOAP)

If we use @Readonly annotation then we can increase the no of records that will be fetched by the query .But note then we cannot do any DML over the data.

  • More info on apex limits can be found here on page 30 onwards: login.salesforce.com/help/doc/en/…
    – Jon Hazan
    Oct 8 '12 at 13:14
  • So in a single external SOAP API call I can fetch 50000 records, is that correct. ANd how many records can I update using A single SOAP API call? Oct 9 '12 at 5:04

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.