# How to grab variable from one API and add it to the endpoint of another api so it is called many times?

**URL:** <https://community.postman.com/t/how-to-grab-variable-from-one-api-and-add-it-to-the-endpoint-of-another-api-so-it-is-called-many-times/16446>\
**Category:** Help Hub\
**Created:** [October 2, 2020, 9:58pm UTC](https://community.postman.com/t/how-to-grab-variable-from-one-api-and-add-it-to-the-endpoint-of-another-api-so-it-is-called-many-times/16446 "2020-10-02T21:58:45Z")\
**Posts on this page:** 1\
**Showing post:** 32

<div class="post-metadata">

**Author:** ![shahbaz.shiekhqa](https://avatars.discourse-cdn.com/v4/letter/s/c5a1d2/32.png) [@shahbaz.shiekhqa](https://community.postman.com/u/shahbaz.shiekhqa)\
**Post date:** [October 16, 2020, 5:09pm UTC](https://community.postman.com/t/how-to-grab-variable-from-one-api-and-add-it-to-the-endpoint-of-another-api-so-it-is-called-many-times/16446/32 "2020-10-16T17:09:45Z")

</div>

> [@How to grab variable from one API that is within a nested Array response body?](https://community.postman.com/t/how-to-grab-variable-from-one-api-that-is-within-a-nested-array-response-body/16758):
>
> How to grab the contentID and content title add it within an array and have it used in the URL of API 2 if i use the code below for section title and sectionid it is working because it is not in an nested array but for the contentid and contenttitle it is not working as it is in a nested array. API 1 test tab i have: for (i = 0; i \< resultCount; i++) { var id = jsonData[i].contents[0].contentId; var modelString = jsonData[i].contents[0].contentTitle; console.log(id) console.log(modelStrin…

---

_[View the full topic](https://community.postman.com/t/how-to-grab-variable-from-one-api-and-add-it-to-the-endpoint-of-another-api-so-it-is-called-many-times/16446)._
