# How to create API calls to external sources?

**URL:** https://community.glideapps.com/t/how-to-create-api-calls-to-external-sources/46754
**Category:** Ask for Help
**Created:** [August 15, 2022, 2:03am UTC](https://community.glideapps.com/t/how-to-create-api-calls-to-external-sources/46754 "2022-08-15T02:03:49Z")
**Posts on this page:** 1
**Showing post:** 9

<div class="post-metadata">

### Author: ![gvalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gvalero/32/1037_2.png) [@gvalero](https://community.glideapps.com/u/gvalero)
#### Post date: [August 17, 2022, 5:17am UTC](https://community.glideapps.com/t/how-to-create-api-calls-to-external-sources/46754/9 "2022-08-17T05:17:04Z")

</div>

Hola!

I will try to give you another way to solve your request:

Do you need to make a GET or POST request?  
Unfortunately, the Fetch JSON plugin does not support POST requests but using a JS code you can do it depending on parameters you are using.

If you need a GET request, your JS code can be something like this:

```auto
var Response = await fetch('https://yesno.wtf/api')
const Result= await Response.json();
return Result.answer + "|" + Result.forced + "|" + Result.image

```

but pay attention to Thinh’s advice:

> Using JavaScript to do it from the app is not an ideal way, since it might trigger the payload to send more times than you want it to.

The plan B to avoid the above problem is to create a button to fire the API call manually, otherwise, you will face this [problem](https://community.glideapps.com/t/be-careful-with-geoapify-it-will-spent-all-of-3000-free-credits-in-minutes-not-even-in-hours/46401), a headache 😡

Are you using a cURL command? If so, share the cURL command to evaluate how can it be converted to a JS code or better, use this [online tool](https://curlconverter.com/javascript) to convert it automatically.

Saludos!

---

_[View the full topic](https://community.glideapps.com/t/how-to-create-api-calls-to-external-sources/46754)._
