# Can I call an external API from within Kintone?

**URL:** <https://forum.kintone.dev/t/can-i-call-an-external-api-from-within-kintone/179>\
**Category:** General\
**Created:** [November 14, 2018, 3:33pm UTC](https://forum.kintone.dev/t/can-i-call-an-external-api-from-within-kintone/179 "2018-11-14T15:33:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![legacy\_user](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/legacy_user/32/25_2.png) [@legacy\_user](https://forum.kintone.dev/u/legacy_user)\
**Post date:** [November 14, 2018, 3:33pm UTC](https://forum.kintone.dev/t/can-i-call-an-external-api-from-within-kintone/179/1 "2018-11-14T15:33:21Z")

</div>

I’ve been trying to make a call to an external service as part of a test but I get nothing back, not even an error. Is this possible?

---

<div class="post-metadata">

**Author:** ![legacy\_user](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/legacy_user/32/25_2.png) [@legacy\_user](https://forum.kintone.dev/u/legacy_user)\
**Post date:** [November 14, 2018, 3:55pm UTC](https://forum.kintone.dev/t/can-i-call-an-external-api-from-within-kintone/179/2 "2018-11-14T15:55:14Z")

</div>

Hi Nathan

Can you share with us the code that you used? Thanks!

---

<div class="post-metadata">

**Author:** ![legacy\_user](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/legacy_user/32/25_2.png) [@legacy\_user](https://forum.kintone.dev/u/legacy_user)\
**Post date:** [November 14, 2018, 4:41pm UTC](https://forum.kintone.dev/t/can-i-call-an-external-api-from-within-kintone/179/3 "2018-11-14T16:41:21Z")

</div>

```
(function() {

const apiKey = "api key removed";
const feed = `https://newsapi.org/v2/everything?q=texas&apiKey=${apiKey}`;

let changeName = "txtName";

const news = () => {
return fetch(feed)
.then((resp) => {
if (resp.status === 200) {
return resp;
}
}).then(data => {
let topStory = data.json();
return topStory;
}).catch((err) => {
console.log(err);
});
};

var events = ["app.record.create.change." + changeName, 'app.record.edit.change.' + changeName];
let record;

news().then((data) => {
kintone.events.on(events, function(event) {
record = event.record;
console.log(record);
record[changeName].value = data.articles[0].title;
});
});

}());
```

---

<div class="post-metadata">

**Author:** ![legacy\_user](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/legacy_user/32/25_2.png) [@legacy\_user](https://forum.kintone.dev/u/legacy_user)\
**Post date:** [November 15, 2018, 5:27pm UTC](https://forum.kintone.dev/t/can-i-call-an-external-api-from-within-kintone/179/4 "2018-11-15T17:27:02Z")

</div>

There are several ways to run an external API, and Kintone provides an API that allows you to run external APIs.

&nbsp;

Kintone.proxy ()  
[https://developer.kintone.io/hc/en-us/articles/213148917/](https://forum.kintone.dev/hc/en-us/articles/213148917/)

&nbsp;

As for the details of the parameter, it depends on the API you are trying to run, so I am not sure exactly what you need in your case but hopefully kintone.proxy run the desired API you are working on.

---

<div class="post-metadata">

**Author:** ![legacy\_user](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/legacy_user/32/25_2.png) [@legacy\_user](https://forum.kintone.dev/u/legacy_user)\
**Post date:** [November 15, 2018, 7:18pm UTC](https://forum.kintone.dev/t/can-i-call-an-external-api-from-within-kintone/179/5 "2018-11-15T19:18:04Z")

</div>

Thanks Junko, I’ll check out the link and see how I get on.
