# Issues connecting to App Search hosted on Elasticsearch service through Python API

**URL:** <https://discuss.elastic.co/t/issues-connecting-to-app-search-hosted-on-elasticsearch-service-through-python-api/236975>\
**Category:** Elastic Search\
**Tags:** elastic-app-search\
**Created:** [June 13, 2020, 10:45am UTC](https://discuss.elastic.co/t/issues-connecting-to-app-search-hosted-on-elasticsearch-service-through-python-api/236975 "2020-06-13T10:45:15Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [June 17, 2020, 3:30pm UTC](https://discuss.elastic.co/t/issues-connecting-to-app-search-hosted-on-elasticsearch-service-through-python-api/236975/2 "2020-06-17T15:30:05Z")

</div>

Make sure you exclude the protocol from "base\_endpoint".

> [@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):
>
> Hello! We have a problem connecting to our App Search engine from python using the elastic\_app\_search library. After creating a client instance with our proper credentials the server is rejecting to output anything. For illustration I am using the get\_schema method. from elastic\_app\_search import Client client = Client(base\_endpoint=base\_endpoint,api\_key=api\_key, use\_https=False) engine\_name = "our\_engine" client.get\_schema(engine\_name) We get the following error: HTTPConnectionPool(host='h…

> [@Where is the host identifier?](https://discuss.elastic.co/t/where-is-the-host-identifier/230779/9):
>
> 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'}

---

_[View the full topic](https://discuss.elastic.co/t/issues-connecting-to-app-search-hosted-on-elasticsearch-service-through-python-api/236975)._
