# Connect to Elastic Cloud using python client

**URL:** <https://discuss.elastic.co/t/connect-to-elastic-cloud-using-python-client/330875>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [April 26, 2023, 6:56pm UTC](https://discuss.elastic.co/t/connect-to-elastic-cloud-using-python-client/330875 "2023-04-26T18:56:22Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [April 26, 2023, 7:22pm UTC](https://discuss.elastic.co/t/connect-to-elastic-cloud-using-python-client/330875/2 "2023-04-26T19:22:14Z")

</div>

Hi @Venkatesh_Guruprasad

Perhaps take a look at this thread

> [@Connecting to Elasticsearch node in Elastic cloud through python promt](https://discuss.elastic.co/t/connecting-to-elasticsearch-node-in-elastic-cloud-through-python-promt/289028/4):
>
> I just did this from elasticsearch import Elasticsearch # you can use RFC-1738 to specify the url # ... or specify common parameters as kwargs es = Elasticsearch( cloud\_id="mycluster:sdfgsdfgdsfgdsfglvdsfgsdfgdsfgmNiM2JkNzRjNDY3JGIxZTUyOWEwNTBkNjRkODZhMzIxZTBhMjU3YjRlODhh", http\_auth=("elastic", "dsfgsdfgsdfgg"), ) output = es.info(), print(output, end=" ") and it worked fine... This also worked fine... es = Elasticsearch( cloud\_id="mycluster:sdfgsdfgdsfgdsfgsdfgsdfgsdfgsdfg…

Perhaps you are using the wrong type of API Key as this user was

> remember this is NOT and Elastic Cloud API key it is an Elasticsearch API key which can only be created via and API call see [here](https://www.elastic.co/guide/en/elasticsearch/reference/8.7/security-api-create-api-key.html)

Actually API Keys can now be created via Kibana -\> Stack Management -\> API Keys as well now

---

_[View the full topic](https://discuss.elastic.co/t/connect-to-elastic-cloud-using-python-client/330875)._
