# How to execute one call with multiple base urls

**URL:** <https://community.postman.com/t/how-to-execute-one-call-with-multiple-base-urls/61045>\
**Category:** Help Hub\
**Tags:** tests, variables, collections, api\
**Created:** [May 15, 2024, 7:06am UTC](https://community.postman.com/t/how-to-execute-one-call-with-multiple-base-urls/61045 "2024-05-15T07:06:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![maintenance-partic14](https://avatars.discourse-cdn.com/v4/letter/m/f4b2a3/32.png) [@maintenance-partic14](https://community.postman.com/u/maintenance-partic14)\
**Post date:** [May 15, 2024, 7:06am UTC](https://community.postman.com/t/how-to-execute-one-call-with-multiple-base-urls/61045/1 "2024-05-15T07:06:36Z")

</div>

I have one API call and i have written test scripts against it. The URL has a variable baseUrl. I have multiple baseurls for which i want to execute that request. One way is through collection runner and attaching data file. Can somebody please recommend a better way ?

---

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [May 15, 2024, 9:57am UTC](https://community.postman.com/t/how-to-execute-one-call-with-multiple-base-urls/61045/2 "2024-05-15T09:57:33Z")

</div>

The collection runner\data file method would be the recommend way.

The only other way is to use a script\loop with setNextRequest() which also needs the collection runner to work. Please search the forum for examples.

The following has an example that you can use as a starting point.

[How can I add the loop? - 🌱 Just Getting Started - Postman Community](https://community.postman.com/t/how-can-i-add-the-loop/60976)

Instead of having an array of numbers, you would have an array of URL’s.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/system/32/29796_2.png) [@system](https://community.postman.com/u/system)\
**Post date:** [June 14, 2024, 9:57am UTC](https://community.postman.com/t/how-to-execute-one-call-with-multiple-base-urls/61045/3 "2024-06-14T09:57:49Z")

</div>

Closed on June 14, 2024, 9:57am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
