Introducing the First Natural Language to SQL API – Hacker Noon

What if, instead of running complex SQL scripts, you could simply ask your database a question? What were my sales yesterday? What were my top selling products in June?

This natural search capability has become more common over the past year as companies such as ThoughtSpot, Salesforce, and Tableau all develop similar technologies. This trend of “data democratization” is forcing us to leverage existing technology in new ways.

The idea that data should be accessible to the average end user, not confined to data analysts or forced to go through a complex queuing system where time and convenience often rule the day, is our new expectation.

Data should be accessible beyond the dashboards and beyond analysts. That is why we developed a natural language to SQL API and interface.

We utilize the latest in natural language processing and machine learning to convert questions into structured SQL queries.

Below you can see that we have utilized the API as part of a chat interface.

You can see the user asks a question, the engine contrasts the question against the database metadata and then return an answer. You can also see the SQL that was generated as part of that response.

We are now ready to make this API publicly available, so that others can build similar natural search capabilities into their own products. No more forms for generating reports, instead use natural search to empower the user to ask new questions.

You can view the API documentation here:

Sending a request for a SQL-query, based on a natural language questions is simple.

"token": "1242ab77d1202aff87bd0b9e96e5a436",
"usertoken": ["1242ab77d1202aff87bd0b9e96e5a436"],
"database": "foodmart_demo",
"params": "total sales"

This request will generate the following response; First it evaluates the “foodmart_demo” database metadata and then produces the SQL response.

"status": "OK",
"data": {
"trash_list": []
"result": "SELECT SUM(sales_fact.store_sales) as `sum.sales_fact.store_sales`nFROM sales_factn ",
"method": "server.getSql"

read original article here