# Where is the host identifier?

**URL:** <https://discuss.elastic.co/t/where-is-the-host-identifier/230779>\
**Category:** Elastic Search\
**Tags:** elastic-app-search\
**Created:** [May 2, 2020, 12:45am UTC](https://discuss.elastic.co/t/where-is-the-host-identifier/230779 "2020-05-02T00:45:51Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![A\_Tran](https://avatars.discourse-cdn.com/v4/letter/a/e19adc/32.png) [@A\_Tran](https://discuss.elastic.co/u/A_Tran)\
**Post date:** [May 2, 2020, 12:45am UTC](https://discuss.elastic.co/t/where-is-the-host-identifier/230779/1 "2020-05-02T00:45:52Z")

</div>

Hi, to index documents with python I need to find my "host identifier". The host identifier should be in this credential page, but I don't see it anywhere. Is the first parte of the api endpoint? thanks!

[app|690x315](https://discuss.elastic.co/uploads/short-url/nMKMJUkNqZmYyGOn707QEaNiaK0.jpeg)

---

<div class="post-metadata">

**Author:** ![ropc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ropc/32/47022_2.png) [@ropc](https://discuss.elastic.co/u/ropc)\
**Post date:** [May 3, 2020, 9:06am UTC](https://discuss.elastic.co/t/where-is-the-host-identifier/230779/2 "2020-05-03T09:06:06Z")

</div>

Hi @A_Tran - Welcome to our community forums!

I see that you are using:

- Python client: [https://github.com/elastic/app-search-python](https://github.com/elastic/app-search-python)
- Elastic App Search (App Search with Elasticsearch Service (ESS))

The `host_identifier` is only available in Swiftype App Search. I believe you can use `API Endpoint` URL as the `base_endpoint`.

@JasonStoltz - We probably need to update the documentation in [https://github.com/elastic/app-search-python](https://github.com/elastic/app-search-python) to include a section about Elastic App Search (with ESS). Appreciate your help 🙂 Feel free to add further comments in this Discuss post in case I missed anything.

Thank you.

---

<div class="post-metadata">

**Author:** ![A\_Tran](https://avatars.discourse-cdn.com/v4/letter/a/e19adc/32.png) [@A\_Tran](https://discuss.elastic.co/u/A_Tran)\
**Post date:** [May 4, 2020, 12:38am UTC](https://discuss.elastic.co/t/where-is-the-host-identifier/230779/3 "2020-05-04T00:38:10Z")

</div>

Thanks for all. But is not working. I tried using my Api Endpoint as you said but I get the same login error.

---

<div class="post-metadata">

**Author:** ![jason.schultz](https://avatars.discourse-cdn.com/v4/letter/j/e56c9b/32.png) [@jason.schultz](https://discuss.elastic.co/u/jason.schultz)\
**Post date:** [May 4, 2020, 2:45am UTC](https://discuss.elastic.co/t/where-is-the-host-identifier/230779/4 "2020-05-04T02:45:31Z")

</div>

Tagging @JasonStoltz here, I think Romain intended this for you 🙂

---

<div class="post-metadata">

**Author:** ![ropc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ropc/32/47022_2.png) [@ropc](https://discuss.elastic.co/u/ropc)\
**Post date:** [May 4, 2020, 3:01am UTC](https://discuss.elastic.co/t/where-is-the-host-identifier/230779/5 "2020-05-04T03:01:44Z")

</div>

That's right @jason.schultz - Thanks 🙂

---

<div class="post-metadata">

**Author:** ![JasonStoltz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasonstoltz/32/49893_2.png) [@JasonStoltz](https://discuss.elastic.co/u/JasonStoltz)\
**Post date:** [May 4, 2020, 1:00pm UTC](https://discuss.elastic.co/t/where-is-the-host-identifier/230779/6 "2020-05-04T13:00:13Z")

</div>

Hey all,

Follow the instructions here: [https://github.com/elastic/app-search-python#instantiating-a-client](https://github.com/elastic/app-search-python#instantiating-a-client)

And set the endpoint base to the endpoint from your screenshot:

```
>>> from elastic_app_search import Client
>>> client = Client(
    base_endpoint='20b...{rest of your url}.found.io/api/as/v1',
    api_key='your api key'
)

```

Be sure to omit the protocol from the base\_endpoint. I will update the documentation.

---

<div class="post-metadata">

**Author:** ![A\_Tran](https://avatars.discourse-cdn.com/v4/letter/a/e19adc/32.png) [@A\_Tran](https://discuss.elastic.co/u/A_Tran)\
**Post date:** [May 4, 2020, 1:50pm UTC](https://discuss.elastic.co/t/where-is-the-host-identifier/230779/7 "2020-05-04T13:50:17Z")

</div>

Thanks Jason, but now Im getting this error:

File "C:\Python37\lib\site-packages\requests\adapters.py", line 516,  
raise ConnectionError(e, request=request)  
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='https',  
: Max retries exceeded with url: [//20becbexxx.app](https://20becbexxx.app)  
[s-east-1.aws.found.io/api/as/v1/engines/dequienescl/documents](http://s-east-1.aws.found.io/api/as/v1/engines/dequienescl/documents) (Caused b  
ectionError('\<urllib3.connection.VerifiedHTTPSConnection object at 0x02  
Failed to establish a new connection: [Errno 11004] getaddrinfo failed'

Do you have any idea why could be?  
Thanks again.

---

<div class="post-metadata">

**Author:** ![JasonStoltz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasonstoltz/32/49893_2.png) [@JasonStoltz](https://discuss.elastic.co/u/JasonStoltz)\
**Post date:** [May 4, 2020, 2:06pm UTC](https://discuss.elastic.co/t/where-is-the-host-identifier/230779/8 "2020-05-04T14:06:22Z")

</div>

Please post your exact code (but obfuscate the key and endpoint a bit so you don't give away any secrets).

---

<div class="post-metadata">

**Author:** ![A\_Tran](https://avatars.discourse-cdn.com/v4/letter/a/e19adc/32.png) [@A\_Tran](https://discuss.elastic.co/u/A_Tran)\
**Post date:** [May 4, 2020, 3:36pm UTC](https://discuss.elastic.co/t/where-is-the-host-identifier/230779/9 "2020-05-04T15:36:22Z")

</div>

Im just trying to connect by python following the git example, but im getting an error:

from elastic\_app\_search import Client  
import requests  
import jwt

client = Client(base\_endpoint='[https://20becbeexxxx.app-search.us-east-1.aws.found.io/api/as/v1](https://20becbeexxxx.app-search.us-east-1.aws.found.io/api/as/v1)', api\_key='private-xxxx', use\_https=True)  
engine\_name = 'dequienescl'  
document = {  
'id': 'INscMGmhmX4',  
'body': 'A wonderful video of a magnificent cat.'  
}  
client.index\_document(engine\_name, document)  
{'id': 'INscMGmhmX4'}

---

<div class="post-metadata">

**Author:** ![JasonStoltz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasonstoltz/32/49893_2.png) [@JasonStoltz](https://discuss.elastic.co/u/JasonStoltz)\
**Post date:** [May 5, 2020, 12:20pm UTC](https://discuss.elastic.co/t/where-is-the-host-identifier/230779/10 "2020-05-05T12:20:55Z")

</div>

Make sure you exclude the `https` from the `base_endpoint` parameter: [Not able to connect to App search from Python script](https://discuss.elastic.co/t/not-able-to-connect-to-app-search-from-python-script/230579/9)

I've updated the example in the README to make that clearer. Sorry for the confusion.

---

<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:** [June 2, 2020, 12:20pm UTC](https://discuss.elastic.co/t/where-is-the-host-identifier/230779/11 "2020-06-02T12:20:59Z")

</div>

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