# API Data source (Content API-data) seems to be called twice

**URL:** <https://forum.builder.io/t/api-data-source-content-api-data-seems-to-be-called-twice/1941>\
**Category:** Bugs\
**Tags:** api, faq\
**Created:** [March 18, 2022, 5:29pm UTC](https://forum.builder.io/t/api-data-source-content-api-data-seems-to-be-called-twice/1941 "2022-03-18T17:29:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![3VI](https://avatars.discourse-cdn.com/v4/letter/3/e99b99/32.png) [@3VI](https://forum.builder.io/u/3VI)\
**Post date:** [March 18, 2022, 5:29pm UTC](https://forum.builder.io/t/api-data-source-content-api-data-seems-to-be-called-twice/1941/1 "2022-03-18T17:29:14Z")

</div>

I followed the tutorial, but there seems to be a bug with the content API data called twice:  
(tutorial: [Connecting your API data to builder - Builder.io](https://www.builder.io/c/docs/guides/connecting-api-data))

**Builder content link**

> **[Builder.io: Drag and drop page builder and CMS](https://builder.io/content/be50f98815ec4fbca55b0ca29287735c)**
>
> Build and optimize digital experiences for any tech stack, visually.

**Builder public api key**  
bfb6be823cbe425fbdfe7ac5d3414f95

**Detailed steps to reproduce the bug**

- Followed steps of tutorial, using New API data source:
- URL: [https://randomuser.me/api/?results=10](https://randomuser.me/api/?results=10)
- Element binding with a repeater, e.g. text and image url.

Now, everytime I call the page, the API seems to be called twice, because the title names quickly display with random names A and then switch to random names B (as the API delivers correctly).

---

<div class="post-metadata">

**Author:** ![ancheetah](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.builder.io/ancheetah/32/751_2.png) [@ancheetah](https://forum.builder.io/u/ancheetah)\
**Post date:** [March 22, 2022, 3:17pm UTC](https://forum.builder.io/t/api-data-source-content-api-data-seems-to-be-called-twice/1941/2 "2022-03-22T15:17:22Z")

</div>

Hi @3VI, welcome to the forum! This is a good question. You see the data flash due to the nature of the random user API. The data source gets called twice because Builder pre-renders content server-side first before re-hydrating the page in the browser. Since the random user API returns a new set of users on each fetch there is a brief flash of the users fetched from the initial server side call.

To prevent the mismatch you can delay the rendering to the browser by adding a `showIf: state.ready` binding to the content so that only the fetch which is called client-side gets rendered. Alternatively, instead of adding the data source in the **Content API data** section of the **Data** tab, you can perform the fetch in your custom JS and wrap it with a `Builder.isBrowser` conditional. Then it will only be fetched once when the browser is ready.

Demo: [https://builder.io/fiddle/b4dc662f3ca9483e9436ed11d3fba61c](https://builder.io/fiddle/b4dc662f3ca9483e9436ed11d3fba61c)
