# Iterate Through API And Download Results

**URL:** <https://community.postman.com/t/iterate-through-api-and-download-results/35539>\
**Category:** Help Hub\
**Tags:** data\
**Created:** [May 21, 2022, 2:25pm UTC](https://community.postman.com/t/iterate-through-api-and-download-results/35539 "2022-05-21T14:25:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![huguetteinc](https://avatars.discourse-cdn.com/v4/letter/h/ed655f/32.png) [@huguetteinc](https://community.postman.com/u/huguetteinc)\
**Post date:** [May 21, 2022, 2:25pm UTC](https://community.postman.com/t/iterate-through-api-and-download-results/35539/1 "2022-05-21T14:25:37Z")

</div>

Beginner problem here! I’m working with an API that looks like:

[https://api.com/{{number}](https://api.com/%7B%7Bnumber%7D)}?format=XML

I’d like to download the results for {{number}} 1 through 100, and ideally combine them into a single file. Even if the combining isn’t possible, I’d like to just download this big set of results

I see there is a postman.setNextRequest() but it runs 10x and then stop. Is there a better way to do this?

---

<div class="post-metadata">

**Author:** ![w4dd325](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/w4dd325/32/12436_2.png) [@w4dd325](https://community.postman.com/u/w4dd325)\
**Post date:** [May 24, 2022, 9:06am UTC](https://community.postman.com/t/iterate-through-api-and-download-results/35539/2 "2022-05-24T09:06:16Z")

</div>

Hi @huguetteinc

Take a look at @vdespa’s YouTube video for writing to files using the Newman Library;

[![](https://img.youtube.com/vi/cCRmry10874/maxresdefault.jpg "How to programmatically save the response to file in Postman") ](https://www.youtube.com/watch?v=cCRmry10874)
