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
    Commented Oct 10, 2012 at 2:19
  • Standard SOAP APIs whic are exposed by Salesforce Commented Oct 10, 2012 at 9:58

2 Answers 2


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
    Commented Jan 7, 2014 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.
    Commented Jan 7, 2014 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
    Commented Jan 8, 2014 at 8:23
  • Tested that queryMore() results subtraction (-1) of allowed API calls in SalesForce.
    – broadband
    Commented Jan 8, 2014 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
    Commented Oct 8, 2012 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? Commented Oct 9, 2012 at 5:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .