# API is failing to call with Netlify. Could it be blocking it?

**URL:** <https://answers.netlify.com/t/api-is-failing-to-call-with-netlify-could-it-be-blocking-it/31082>\
**Category:** Support\
**Tags:** deployment\
**Created:** [January 26, 2021, 1:31am UTC](https://answers.netlify.com/t/api-is-failing-to-call-with-netlify-could-it-be-blocking-it/31082 "2021-01-26T01:31:17Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ethan242](https://avatars.discourse-cdn.com/v4/letter/e/7993a0/32.png) [@Ethan242](https://answers.netlify.com/u/Ethan242)\
**Post date:** [January 26, 2021, 1:31am UTC](https://answers.netlify.com/t/api-is-failing-to-call-with-netlify-could-it-be-blocking-it/31082/1 "2021-01-26T01:31:17Z")

</div>

Hello, I built a covid-tracker web app using javascript, HTML, and CSS. The API is from [covid19api.com](http://covid19api.com). The app works when I serve the app on my localhost server but when I deploy the same site via Netlify the API call never seems to occur.

Could it be something wrong with the API? Could it be Netlify blocking it? Please Help thanks.

---

<div class="post-metadata">

**Author:** ![hrishikesh](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/hrishikesh/32/74607_2.png) [@hrishikesh](https://answers.netlify.com/u/hrishikesh)\
**Post date:** [January 26, 2021, 7:20am UTC](https://answers.netlify.com/t/api-is-failing-to-call-with-netlify-could-it-be-blocking-it/31082/2 "2021-01-26T07:20:03Z")

</div>

A link to your webpage or repo would be slightly more helpful.

---

<div class="post-metadata">

**Author:** ![luke](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/luke/32/39_2.png) [@luke](https://answers.netlify.com/u/luke)\
**Post date:** [January 26, 2021, 7:33am UTC](https://answers.netlify.com/t/api-is-failing-to-call-with-netlify-could-it-be-blocking-it/31082/3 "2021-01-26T07:33:43Z")

</div>

Hi, @Ethan242. There are several possible reasons so, instead of guessing, being able to look at your site is important. As, @hrishikesh said above, would you please send is a link to the site so we can see the error in our own browsers?

Also, did you check for errors in the console in the browser devtools?

---

<div class="post-metadata">

**Author:** ![Ethan242](https://avatars.discourse-cdn.com/v4/letter/e/7993a0/32.png) [@Ethan242](https://answers.netlify.com/u/Ethan242)\
**Post date:** [January 26, 2021, 3:19pm UTC](https://answers.netlify.com/t/api-is-failing-to-call-with-netlify-could-it-be-blocking-it/31082/4 "2021-01-26T15:19:59Z")

</div>

[https://windsor-covid19.netlify.app/](https://windsor-covid19.netlify.app/) When you get there click the menu then Stats or scroll down till you find live covid 19 tracker thanks so much.

---

<div class="post-metadata">

**Author:** ![hrishikesh](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/hrishikesh/32/74607_2.png) [@hrishikesh](https://answers.netlify.com/u/hrishikesh)\
**Post date:** [January 26, 2021, 3:22pm UTC](https://answers.netlify.com/t/api-is-failing-to-call-with-netlify-could-it-be-blocking-it/31082/5 "2021-01-26T15:22:35Z")

</div>

Just like we suspected, it’s not a Netlify issue. It’s the browser blocking it:

 ![image](https://global.discourse-cdn.com/netlify/original/3X/c/9/c926304331d6afa15199df4da34e4da390b085a4.png)

This happens when you try to load a script with `http://` on a `https://` website. Try switching the script’s source to `https`.

---

<div class="post-metadata">

**Author:** ![Ethan242](https://avatars.discourse-cdn.com/v4/letter/e/7993a0/32.png) [@Ethan242](https://answers.netlify.com/u/Ethan242)\
**Post date:** [January 26, 2021, 3:24pm UTC](https://answers.netlify.com/t/api-is-failing-to-call-with-netlify-could-it-be-blocking-it/31082/6 "2021-01-26T15:24:40Z")

</div>

You and Luke are amazing thank you for your help.

---

<div class="post-metadata">

**Author:** ![Ethan242](https://avatars.discourse-cdn.com/v4/letter/e/7993a0/32.png) [@Ethan242](https://answers.netlify.com/u/Ethan242)\
**Post date:** [January 26, 2021, 4:20pm UTC](https://answers.netlify.com/t/api-is-failing-to-call-with-netlify-could-it-be-blocking-it/31082/8 "2021-01-26T16:20:38Z")

</div>

I am using a geo plugin by [https://www.geoplugin.com/webservices/javascript](https://www.geoplugin.com/webservices/javascript) it only comes with a http. So I wouldn’t be able to use that one?

---

<div class="post-metadata">

**Author:** ![hrishikesh](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/hrishikesh/32/74607_2.png) [@hrishikesh](https://answers.netlify.com/u/hrishikesh)\
**Post date:** [January 26, 2021, 4:22pm UTC](https://answers.netlify.com/t/api-is-failing-to-call-with-netlify-could-it-be-blocking-it/31082/9 "2021-01-26T16:22:43Z")

</div>

Try using https anyways. If they’ve configured their API to work on https and just mentioned http in the documention, it’ll work. However if it only works on http, then it won’t and you should look for some secure alternative.

---

<div class="post-metadata">

**Author:** ![Ethan242](https://avatars.discourse-cdn.com/v4/letter/e/7993a0/32.png) [@Ethan242](https://answers.netlify.com/u/Ethan242)\
**Post date:** [January 26, 2021, 4:23pm UTC](https://answers.netlify.com/t/api-is-failing-to-call-with-netlify-could-it-be-blocking-it/31082/10 "2021-01-26T16:23:35Z")

</div>

Yes it doesn’t work with https. Ok thank you I will look for an alternative.

---

<div class="post-metadata">

**Author:** ![benprice0](https://avatars.discourse-cdn.com/v4/letter/b/8dc957/32.png) [@benprice0](https://answers.netlify.com/u/benprice0)\
**Post date:** [January 18, 2022, 5:20pm UTC](https://answers.netlify.com/t/api-is-failing-to-call-with-netlify-could-it-be-blocking-it/31082/11 "2022-01-18T17:20:07Z")

</div>

Hi, did you ever find a solution to this? Are there https equivalents to Geo Plugin? Thanks.

---

<div class="post-metadata">

**Author:** ![HumbleAssassin](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/humbleassassin/32/34758_2.png) [@HumbleAssassin](https://answers.netlify.com/u/HumbleAssassin)\
**Post date:** [February 25, 2022, 5:03am UTC](https://answers.netlify.com/t/api-is-failing-to-call-with-netlify-could-it-be-blocking-it/31082/13 "2022-02-25T05:03:32Z")

</div>

I am getting similar issue on [my advice generator app](https://slip-advice-generator.netlify.app/). Every button click is generating new advice on the [GitHub page](https://humbleassassin.github.io/advice-generator/) but same app in Netlify is not generating any new advice from second click. I used url [https://api.adviceslip.com/advice](https://api.adviceslip.com/advice) for this. Please Help!

---

<div class="post-metadata">

**Author:** ![coelmay](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/coelmay/32/24427_2.png) [@coelmay](https://answers.netlify.com/u/coelmay)\
**Post date:** [February 25, 2022, 6:20am UTC](https://answers.netlify.com/t/api-is-failing-to-call-with-netlify-could-it-be-blocking-it/31082/14 "2022-02-25T06:20:42Z")

</div>

Hey @HumbleAssassin

I see the same behaviour when running your code locally too—the same advice every time. If I use cURL (`curl https://api.adviceslip.com/advice`) or visit `https://api.adviceslip.com/advice` in the browser and refresh the page several times, I do see different advice each time.

---

<div class="post-metadata">

**Author:** ![Benkaz3](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/benkaz3/32/51144_2.png) [@Benkaz3](https://answers.netlify.com/u/Benkaz3)\
**Post date:** [August 25, 2023, 6:49am UTC](https://answers.netlify.com/t/api-is-failing-to-call-with-netlify-could-it-be-blocking-it/31082/15 "2023-08-25T06:49:29Z")

</div>

This fixed my issue. Thanks!
