# How to run Data Explorer queries with Python

**URL:** <https://meta.discourse.org/t/how-to-run-data-explorer-queries-with-python/145803>\
**Category:** Data & reporting\
**Tags:** rest-api\
**Created:** [March 27, 2020, 12:19pm UTC](https://meta.discourse.org/t/how-to-run-data-explorer-queries-with-python/145803 "2020-03-27T12:19:26Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)\
**Post date:** [March 27, 2020, 5:58pm UTC](https://meta.discourse.org/t/how-to-run-data-explorer-queries-with-python/145803/2 "2020-03-27T17:58:40Z")

</div>

You will need to put the api credentials in with the headers.

```plaintext
headers = {'Content-Type': 'multipart/form-data', 'Api-Key': API_KEY, 'Api-Username': API_USERNAME}

```

And for the actual request you might need to specify it like this:

```plaintext
requests.post(endpoint, headers=headers)

```

---

_[View the full topic](https://meta.discourse.org/t/how-to-run-data-explorer-queries-with-python/145803)._
