title: How to get more than 1000 objects from S3 by using list_objects_v2?
body: <p>I have more than 500,000 objects on s3. I am trying to get the size of each object. I am using the following python code for that</p>
  <pre class="lang-py prettyprint-override"><code>import boto3
  
  bucket = 'bucket'
  prefix = 'prefix'
  
  contents = boto3.client('s3').list_objects_v2(Bucket=bucket,  MaxKeys=1000, Prefix=prefix)[&quot;Contents&quot;]
  
  for c in contents:
      print(c[&quot;Size&quot;])
  </code></pre>
  <p>But it just gave me the size of the top 1000 objects. Based on the documentation we can't get more than 1000. Is there any way I can get more than that?</p>