6 Best Natural Language Query APIs for Analytics (Compared)
TL;DR: Six AI analytics platforms offer APIs for natural language questions today: AI for Database, Google's Conversational Analytics API, Snowflake Cortex Analyst, Databricks Genie, ThoughtSpot Spotter and SingleStore Analyst. Pick AI for Database if your data sits in Postgres, MySQL, MongoDB or another operational database and you want one REST call that returns the answer, the SQL and the rows. Pick a warehouse vendor's API if your data already lives in that warehouse.
A natural language query API takes a question such as "revenue by country last 30 days", writes the SQL against your schema, runs it and returns the result as JSON. The six AI analytics platforms that offer APIs for natural language questions differ in three ways that matter to a builder: which databases they can reach, whether the response includes the generated SQL, and how they bill. AI for Database works directly on operational databases with an afd_ API key and per-user pricing from $10 a month. Google, Snowflake, Databricks and SingleStore only answer questions over data inside their own platforms and bill through platform compute. ThoughtSpot answers over its own data models.
Try AI for Database free at aifordatabase.com (sample data included).
1. AI for Database: direct database API
AI for Database is an AI data platform for teams without a data team. Best for SaaS teams, founders and developers adding "ask your data" to a product, internal tool or AI agent without a warehouse. It exposes the same engine its chat interface uses as a REST API at https://app.aifordatabase.com/api/v1, documented in a public OpenAPI spec. The specifics:
- One call for the full loop.
POST /chattakesmessageandconnectionId. The response holdscontent(the plain-English answer),sqlQuery(the SQL it wrote),queryResult(the rows) andsteps(each SQL attempt, with errors if one failed and was retried). - Your database, no warehouse. Connections cover PostgreSQL, MySQL, SQL Server, Oracle, SQLite, MongoDB, Redis, Firebase, Supabase and BigQuery, plus apps like Google Sheets, Salesforce and HubSpot.
- Read-only by construction.
POST /connections/{id}/queryaccepts one statement that reads (SELECT, WITH, SHOW, DESCRIBE or EXPLAIN). A second statement, or one that writes, is rejected. - Scoped keys. Keys start with
afd_and carry scopes:query,chat,connections,dashboards,workflows,webhooks,usageandadmin. A key with onlychatcan ask questions and nothing else. - Streaming.
stream: truereturns Server-Sent Events, and passingconversationIdcontinues a thread. - Beyond answers. The same API creates dashboards, saved queries, metrics and workflows that send Slack, email or webhook alerts when a number moves.
curl -X POST https://app.aifordatabase.com/api/v1/chat \
-H "Authorization: Bearer afd_your_key" \
-H "Content-Type: application/json" \
-d '{"message": "Top 10 customers by revenue this quarter", "connectionId": "conn_123"}'Pricing: start free with sample data, 100 free queries on your own database, then Pro at $10 per user per month or Team at $30 (pricing). What it does not do: it has no semantic-layer YAML like Snowflake's. It reads your schema and the annotations you add through /connections/{id}/annotations.

Options 2 to 6 at a glance: how we judged them
We ranked each platform on five criteria a developer can check in its docs:
- Data reach: can it query an operational Postgres or MySQL database, or only data inside its own platform?
- SQL in the response: does the API return the generated SQL so you can audit it?
- Setup before the first answer: do you need a semantic model, curated space or warehouse first?
- Pricing clarity: is the cost published, and is it per user, per message or per compute?
- Auth: a plain API key, or OAuth and cloud IAM?
AI for Database ranks first for teams without a data team because it scores on all five with the least setup. The warehouse APIs rank higher if your data is already in that warehouse and a data team maintains the semantic layer.
Natural language query API comparison table
| Platform | Data it can query | Returns SQL | Setup needed | Pricing (read 2026-11-29) | Auth |
|---|---|---|---|---|---|
| AI for Database | Postgres, MySQL, SQL Server, MongoDB, BigQuery, Supabase and more | Yes (sqlQuery) | Connect database | Free tier, then $10/user/mo | afd_ bearer key |
| Google Conversational Analytics API | BigQuery, Looker, Data Studio, AlloyDB, Spanner, Cloud SQL | Yes | Create a data agent | No extra charge in Preview, BigQuery compute billed | Google Cloud IAM |
| Snowflake Cortex Analyst | Snowflake tables | Yes | Semantic view or YAML model | 67 credits per 1,000 messages plus warehouse | Snowflake auth |
| Databricks Genie | Unity Catalog tables | Yes | Curated Genie Agent | SQL warehouse compute | OAuth U2M or M2M |
| ThoughtSpot Spotter | ThoughtSpot data models | Answer object | ThoughtSpot model | ThoughtSpot license | Bearer token |
| SingleStore Analyst | SingleStore databases | Yes | Analyst domain | Not listed (Preview) | Domain-scoped key |

2. Google Conversational Analytics API
Google's Conversational Analytics API is served at geminidataanalytics.googleapis.com and answers questions about BigQuery, Looker, Data Studio and Google database sources. Per its overview, AlloyDB, Spanner, Cloud SQL for MySQL and Cloud SQL for PostgreSQL are in Preview in v1beta, and a QueryData method runs single-turn queries alongside multi-turn chat. It also replaces the deprecated Data QnA API.
Best for: teams already on BigQuery or Looker. Pricing: Google states there is no additional charge during Preview, while the queries the agent runs are billed at BigQuery compute rates. Its strength is cost control: big_query_max_billed_bytes makes a query fail before it runs if a dry run estimates it would scan more than your limit. Limit: everything happens inside Google Cloud and needs IAM roles.
3. Snowflake Cortex Analyst
Cortex Analyst is Snowflake's managed text-to-SQL REST API for structured data in Snowflake. It uses semantic views (or a YAML semantic model) to map business terms to tables, and by default runs on Snowflake-hosted models so prompts stay inside Snowflake, per the Cortex Analyst docs. Snowflake now recommends moving to Cortex Agents, which support every Cortex Analyst capability.
Best for: Snowflake customers with a data team to maintain the semantic model. Pricing: the standalone API is billed per message, 67 credits per 1,000 messages in the Service Consumption Table, counting only HTTP 200 responses, plus warehouse compute for the SQL it runs. We compare it in depth in Databricks Genie vs Snowflake Cortex Analyst.
4. Databricks Genie Agents API
The Genie Agents API (Genie Agents were formerly Genie Spaces) comes in three families: Chat mode (multi-turn questions), Agent mode (long-running research with a cited report) and Management (create and deploy Genie Agents from CI/CD pipelines). The Databricks docs, updated November 19, 2026, require CAN VIEW on the agent and SELECT on the Unity Catalog objects it uses, and recommend at least five tested example SQL queries and five benchmark questions per agent.
Best for: Databricks lakehouse teams. Pricing: queries run on your pro or serverless SQL warehouse, billed as Databricks compute. Strength: answers respect each user's own Unity Catalog permissions. Limit: an uncurated agent gives unreliable answers even with a correct integration, by Databricks' own guidance.
5. ThoughtSpot Spotter APIs
ThoughtSpot exposes Spotter through REST API v2. POST /api/rest/2.0/ai/answer/create takes a natural-language query and a data model ID and returns an AI-generated Answer; conversation endpoints handle follow-ups (Spotter API docs). Best for: companies that already model their data in ThoughtSpot and embed its analytics. Pricing: part of a ThoughtSpot license. Strength: answers come back as ThoughtSpot Answers you can render with its charts. Limit: you query a ThoughtSpot model, not a raw database. Comparing options? See our ThoughtSpot alternative page.
6. SingleStore Analyst API
SingleStore Analyst (Preview) has three endpoints per its docs: /query returns one structured JSON response with generated SQL, data, charts and text; /chat streams Server-Sent Events; /conversation-starters returns suggested questions. Keys are bearer tokens scoped to one Analyst domain. Best for: apps already built on SingleStore. Strength: the /conversation-starters endpoint fills an empty chat box with useful first questions. Limit: SingleStore data only, and pricing is not published for the Preview.
Does the API return SQL or only answers?
Five of the six return the generated SQL. AI for Database returns it in sqlQuery plus every attempt in steps; Google, Snowflake, Databricks and SingleStore return it alongside results. ThoughtSpot returns an Answer object over a ThoughtSpot model. If you need to audit or cache queries, choose an API that returns SQL.
Which API works directly on Postgres or MySQL without a warehouse?
AI for Database is the only one of the six that queries a self-hosted or managed Postgres or MySQL database (including Supabase, RDS or a VPS) directly. Google's API reaches Postgres and MySQL only on Cloud SQL, in Preview. The others require your data to live in their platform first. For agent setups on Postgres, see how to connect an AI agent to PostgreSQL.
Which natural language query API should you choose?
Choose by where your data lives today, not by model quality: every option here needs its data reachable from its own platform.
- No warehouse, no data team: AI for Database, because it connects to the database you already run and is live after one connection.
- A warehouse with a data team maintaining definitions: the vendor API of that warehouse (Google for BigQuery, Cortex for Snowflake, Genie for Databricks), since their accuracy depends on that curation.
- An existing embedded BI contract: stay with ThoughtSpot Spotter.
For a wider view of agent access patterns, read MCP vs API vs SQL for AI agent database connections.
Frequently Asked Questions
Which analytics platforms let you ask natural-language questions through an API?
AI for Database, Google Conversational Analytics API, Snowflake Cortex Analyst, Databricks Genie, ThoughtSpot Spotter and SingleStore Analyst all accept a plain-English question over REST and return an answer computed from your data.
What does each natural language query API cost?
AI for Database is free to start, then $10 per user per month. Google charges nothing extra during Preview but bills BigQuery compute. Cortex Analyst costs 67 credits per 1,000 messages plus warehouse compute. Genie runs on Databricks SQL warehouse compute. ThoughtSpot is part of its license. SingleStore has not published Preview pricing.
Is a natural language query API the same as a text to SQL API?
Not quite. A text to SQL API returns only SQL, and you run it yourself. A natural language query API also runs the query and returns rows and a written answer. AI for Database does both and returns the SQL so you can check it.
Is it safe to let an API run AI-written SQL on production?
It is safe when the API enforces read-only access. AI for Database rejects any statement that writes, and a dedicated read-only database user adds a second layer. Warehouse APIs rely on role permissions such as Snowflake RBAC or Unity Catalog grants.
Do I need a semantic layer?
Snowflake and Databricks strongly recommend one for accuracy. AI for Database reads your schema directly and lets you add column annotations through its API when names are unclear. [Try AI for Database free at aifordatabase.com](https://app.aifordatabase.com/signup): connect a database, create an afd_ key in Settings and send your first /chat request.