# Elasticsearch query to SQL

**URL:** <https://discuss.elastic.co/t/elasticsearch-query-to-sql/324814>\
**Category:** Elasticsearch\
**Created:** [February 6, 2023, 4:41pm UTC](https://discuss.elastic.co/t/elasticsearch-query-to-sql/324814 "2023-02-06T16:41:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)\
**Post date:** [February 6, 2023, 4:41pm UTC](https://discuss.elastic.co/t/elasticsearch-query-to-sql/324814/1 "2023-02-06T16:41:32Z")

</div>

I know there is SQL API which can convert SQL query to REST

is there a way around. convert REST query to SQL ?

---

<div class="post-metadata">

**Author:** ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)\
**Post date:** [February 7, 2023, 3:30pm UTC](https://discuss.elastic.co/t/elasticsearch-query-to-sql/324814/2 "2023-02-07T15:30:13Z")

</div>

Anyone has any idea. any other way to do this?

---

<div class="post-metadata">

**Author:** ![Andrei\_Stefan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrei_stefan/32/47533_2.png) [@Andrei\_Stefan](https://discuss.elastic.co/u/Andrei_Stefan)\
**Post date:** [February 8, 2023, 10:35am UTC](https://discuss.elastic.co/t/elasticsearch-query-to-sql/324814/3 "2023-02-08T10:35:42Z")

</div>

Hi @elasticforme,  
If there is a way to do this, it's not from Elastic. ES SQL only has the `_sql/translate` API (as you mentioned) but there is no support for the reversed action.

---

<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:** [March 8, 2023, 10:36am UTC](https://discuss.elastic.co/t/elasticsearch-query-to-sql/324814/4 "2023-03-08T10:36:38Z")

</div>

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