# How to connect to Elastic App Cloud with API endpoint?

**URL:** <https://discuss.elastic.co/t/how-to-connect-to-elastic-app-cloud-with-api-endpoint/267537>\
**Category:** Elastic Search\
**Tags:** elastic-app-search\
**Created:** [March 17, 2021, 3:10pm UTC](https://discuss.elastic.co/t/how-to-connect-to-elastic-app-cloud-with-api-endpoint/267537 "2021-03-17T15:10:43Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ryan\_Lane](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ryan_lane/32/77556_2.png) [@Ryan\_Lane](https://discuss.elastic.co/u/Ryan_Lane)\
**Post date:** [March 17, 2021, 3:10pm UTC](https://discuss.elastic.co/t/how-to-connect-to-elastic-app-cloud-with-api-endpoint/267537/1 "2021-03-17T15:10:43Z")

</div>

The documentation and demos use hostIdentifier to connect, but Elastic App only has an API Endpoint under Credentials. There is no Host Identifier.

When I take one of the demos, such as the Vue demo (using Hearthstone cards) and change the connector to connect to my Elastic App (with Heartstone data) using: searchKey, engineName, and endpointBase (with the API endpoint below), nothing is returned.

I am scratching my head over this. How do I connect to the [Elastic.co](http://Elastic.co) cloud App search? I am using Nuxt (Vue). Thanks a lot!

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/e/4/e49e0e07bde7a5112a51da287fef540fd085bd70.png)

---

<div class="post-metadata">

**Author:** ![Sean\_Story](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sean_story/32/69987_2.png) [@Sean\_Story](https://discuss.elastic.co/u/Sean_Story)\
**Post date:** [March 17, 2021, 9:36pm UTC](https://discuss.elastic.co/t/how-to-connect-to-elastic-app-cloud-with-api-endpoint/267537/2 "2021-03-17T21:36:56Z")

</div>

Hi @Ryan_Lane, thanks for using Elastic App Search!

Valid question. I wasn't familiar with the Vue demo using Hearthstone cards, but looking it up, I see the `host_identifier` you were mentioning here: [vue-search-ui-demo/searchConfig.js at master · elastic/vue-search-ui-demo · GitHub](https://github.com/elastic/vue-search-ui-demo/blob/master/src/searchConfig.js#L7)

You wouldn't have any way to know this, but just from looking, I can tell that this demo was built for an old [swiftype.com](http://swiftype.com) version of App Search. The App Search that you have deployed in Elastic Cloud doesn't have a host\_identifier, but instead an endpoint (as you noticed).

While there's not an updated hearthstone demo with modern App Search, there is the [Search UI](https://github.com/elastic/search-ui) repo that can help you set up a similar search experience (you'll have to have your data already indexed in App Search though). I recently followed those instructions to make a very basic search experience for my own personal use, if you want to see [an example](https://github.com/seanstory/aon-react-demo-ui). Notice that in this updated approach, your configuration includes an [`endpointBase`](https://github.com/seanstory/aon-react-demo-ui/blob/main/src/config/engine.json#L3), instead of a `hostIdentifier`:

Let me know if that helps!

---

<div class="post-metadata">

**Author:** ![Sean\_Story](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sean_story/32/69987_2.png) [@Sean\_Story](https://discuss.elastic.co/u/Sean_Story)\
**Post date:** [March 17, 2021, 9:41pm UTC](https://discuss.elastic.co/t/how-to-connect-to-elastic-app-cloud-with-api-endpoint/267537/3 "2021-03-17T21:41:38Z")

</div>

@Ryan_Lane a follow-up - you said:

> The documentation [...] use hostIdentifier to connect

Just want to make sure - you should be using [App Search documentation [8.11] | Elastic](https://www.elastic.co/guide/en/app-search/current) for your App Search documentation. Not [Getting Started with App Search | Swiftype Documentation](https://swiftype.com/documentation/app-search/) - which as I mentioned above, is "legacy" and does not apply to App Search deployments launched from Elastic Cloud.

---

<div class="post-metadata">

**Author:** ![Ryan\_Lane](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ryan_lane/32/77556_2.png) [@Ryan\_Lane](https://discuss.elastic.co/u/Ryan_Lane)\
**Post date:** [March 17, 2021, 10:07pm UTC](https://discuss.elastic.co/t/how-to-connect-to-elastic-app-cloud-with-api-endpoint/267537/4 "2021-03-17T22:07:42Z")

</div>

Hi Sean - Thanks a lot! I just tried using your example and when I ran it locally using `npm start`, I got "An unexpected error occurred: Failed to fetch."

---

<div class="post-metadata">

**Author:** ![Sean\_Story](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sean_story/32/69987_2.png) [@Sean\_Story](https://discuss.elastic.co/u/Sean_Story)\
**Post date:** [March 18, 2021, 2:55pm UTC](https://discuss.elastic.co/t/how-to-connect-to-elastic-app-cloud-with-api-endpoint/267537/5 "2021-03-18T14:55:10Z")

</div>

Hi @Ryan_Lane ,

Oof, looks like I made at least two mistakes. ☹

1. I pointed you to the Search UI repo, but I meant to point you towards the [Reference UI repo](https://github.com/elastic/app-search-reference-ui-react). _That_ is the easy way to get spun up with a sample UI.
2. My example repo that I pointed you to was pointing to an old deployment of App Search that has since been decommissioned 🤦‍♂️ . I just updated its configuration to point at the current deployment. Can you `git pull origin main` and then try `npm start` again?

Sorry about that. Totally my bad. 😅

---

<div class="post-metadata">

**Author:** ![Ryan\_Lane](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ryan_lane/32/77556_2.png) [@Ryan\_Lane](https://discuss.elastic.co/u/Ryan_Lane)\
**Post date:** [March 18, 2021, 3:40pm UTC](https://discuss.elastic.co/t/how-to-connect-to-elastic-app-cloud-with-api-endpoint/267537/6 "2021-03-18T15:40:05Z")

</div>

No problem. Thanks a lot @Sean_Story !! Very much appreciate all of your help! 😀 Have a great day!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 15, 2021, 3:40pm UTC](https://discuss.elastic.co/t/how-to-connect-to-elastic-app-cloud-with-api-endpoint/267537/7 "2021-04-15T15:40:35Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
