# How to pass APIs URL from file to postman

**URL:** <https://community.postman.com/t/how-to-pass-apis-url-from-file-to-postman/15837>\
**Category:** Help Hub\
**Tags:** tests, variables, collections\
**Created:** [September 14, 2020, 10:17am UTC](https://community.postman.com/t/how-to-pass-apis-url-from-file-to-postman/15837 "2020-09-14T10:17:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bhaumik](https://avatars.discourse-cdn.com/v4/letter/b/df705f/32.png) [@Bhaumik](https://community.postman.com/u/Bhaumik)\
**Post date:** [September 14, 2020, 10:17am UTC](https://community.postman.com/t/how-to-pass-apis-url-from-file-to-postman/15837/1 "2020-09-14T10:17:24Z")

</div>

Hello,  
i am exploring postman from couple of weeks still new for me. i am curious if i can perform below task with post man or no ?  
I have 500 API in file. i need to pass each of them and check status code.  
Please help.

---

<div class="post-metadata">

**Author:** ![allenheltondev](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/allenheltondev/32/31738_2.png) [@allenheltondev](https://community.postman.com/u/allenheltondev)\
**Post date:** [September 14, 2020, 11:34am UTC](https://community.postman.com/t/how-to-pass-apis-url-from-file-to-postman/15837/2 "2020-09-14T11:34:30Z")

</div>

Assuming you are using a csv/json file, in your prerequest script you can do:

```auto
pm.request.url = pm.iterationData.get('<name of column with your url>');

```

This will set the url for the request.  
If you also need to set the method, you can do the same thing

```auto
pm.request.method = pm.iterationData.get('<name of column with the http method>');

```

---

<div class="post-metadata">

**Author:** ![Bhaumik](https://avatars.discourse-cdn.com/v4/letter/b/df705f/32.png) [@Bhaumik](https://community.postman.com/u/Bhaumik)\
**Post date:** [September 14, 2020, 12:52pm UTC](https://community.postman.com/t/how-to-pass-apis-url-from-file-to-postman/15837/3 "2020-09-14T12:52:07Z")

</div>

Thank you for prompt response @allenheltondev  
i wrote same script in prerequest and i have csv file with column name as “URL” i have selected that file while i run collection in runner, but What to put in Request url ? should i create variable of url ? without it console shows request url is empty.

---

<div class="post-metadata">

**Author:** ![Bhaumik](https://avatars.discourse-cdn.com/v4/letter/b/df705f/32.png) [@Bhaumik](https://community.postman.com/u/Bhaumik)\
**Post date:** [September 14, 2020, 12:55pm UTC](https://community.postman.com/t/how-to-pass-apis-url-from-file-to-postman/15837/4 "2020-09-14T12:55:38Z")

</div>

for every run it should read url from file.

---

<div class="post-metadata">

**Author:** ![allenheltondev](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/allenheltondev/32/31738_2.png) [@allenheltondev](https://community.postman.com/u/allenheltondev)\
**Post date:** [September 14, 2020, 1:04pm UTC](https://community.postman.com/t/how-to-pass-apis-url-from-file-to-postman/15837/5 "2020-09-14T13:04:18Z")

</div>

You could make it a variable, sure. If you did that, it actually would make my suggestion even simpler.

Instead of what I had suggested, you should be able to just pass the url variable directly in there.

![image](https://us1.discourse-cdn.com/getpostman/original/3X/5/7/572b14baae58e2543944a0e3b881182df585a6a5.png)
