NewAPIVerve Academy: free courses and certifications anyone can verify.Explore the Academy →

SQL Explainer API

POST

Translate any SQL query into plain English.

SQL Explainer analyzes SQL queries and provides clear, plain English explanations of what they do. Perfect for learning SQL, code reviews, or documentation.

Try it — live request, no key required

Request
POSTapi.apiverve.com/v1/sqlexplainer
Body
Verification
Format

No key required to try it. Get a key to use it in your app.

Example
{
  "status": "ok",
  "error": null,
  "data": {
    "explanation": "This SQL query retrieves the names of users and the number of orders they have placed. It filters users who were created after January 1, 2024. The query then groups the results by user ID and only includes users who have placed more than 5 orders, finally ordering the results by the order count in descending order.",
    "operation": "SELECT",
    "tables": [
      "users",
      "orders"
    ],
    "complexity": "moderate"
  }
}

About the SQL Explainer API

A SQL explainer API that turns a query into plain English. Send a SELECT, INSERT, UPDATE, DELETE, CREATE or other statement and get back a readable explanation of what it does, the type of operation, and the list of tables it touches. Joins, filters, grouping and ordering are described in terms a non-specialist can follow.

It helps people learning SQL, reviewers reading an unfamiliar query in a pull request, analysts documenting saved reports, and internal tools that show a non-technical user what a query will do before it runs. The tables list is also handy on its own for tagging queries by the data they read or write.

The Free plan returns a short one- or two-sentence explanation, the operation type and the tables. Paid plans let you choose brief, standard, or detailed explanation depth, where detailed adds a step-by-step breakdown, and add a complexity rating of simple, moderate or complex for each query.

How it works

SQL Explainer sends the query you POST, up to 50,000 characters, to a Gemini language model with instructions to explain it in plain English and return structured JSON. The model runs at temperature 0, so the same query normally produces the same explanation. Output is always in English, whatever language the query's comments or identifiers use.

The detail parameter sets the length. brief, the default, asks for one or two sentences. standard asks for two to four. detailed asks for a step-by-step breakdown and allows the longest output. An unrecognised value falls back to brief.

explanation is the prose description. operation is the primary statement type, such as SELECT, INSERT, UPDATE, DELETE or CREATE. tables lists the table names the model identifies in the query. complexity is one of simple, moderate or complex.

The model also judges whether the input is SQL at all. If it is not, the call returns a 400 with an example of a valid query instead of an explanation. Input that fails the text safety check is rejected with a 400 before the model is called. The query is never executed or connected to a database, so the explanation describes intent from the text alone: it cannot know your schema, indexes or row counts, and complexity reflects the query's structure, not its run time. On the Free plan detail is ignored, so every explanation is brief, and complexity is removed.

What people use it for

Learning SQL
Understand complex queries while learning database concepts
Code Reviews
Quickly grasp what SQL queries do during reviews
Documentation
Generate explanations for query documentation
Debugging
Understand legacy or unfamiliar queries

Ways to call it

One endpoint, many ways in — REST with JSON, XML, YAML and CSV, plus GraphQL and an MCP interface for AI agents.

JSON
Default REST response
XML
Markup format
YAML
Human-readable
CSV
Tabular export
Beta
GraphQL
Query language
New
MCP
For AI agents

Other ways to use SQL Explainer

Same data, same APIVerve account, same credit balance — one key works on all of them.

Questions.

Common questions about the SQL Explainer API.

Read the docs →
Which types of SQL statements can this analyze?
It handles major database commands including SELECT, INSERT, UPDATE, DELETE, and CREATE statements, along with other common query types. Each response identifies the operation type and delivers a plain English breakdown of what the statement executes.
Can I adjust how detailed the generated explanation is?
Yes, on paid plans. You can request brief, standard, or detailed explanations depending on whether you need a quick summary for a pull request or an in-depth breakdown for team documentation.
Are query complexity ratings and detail depth controls included on the Free plan?
No. The complexity rating and the detail level parameter require a paid plan, starting with Starter. The Free plan provides basic explanations and extracted table lists for up to 20 queries per month.
How far does the Starter plan go for explaining SQL queries?
The Starter plan covers 20,000 SQL explanations every month. Each request uses 10 credits, which works out to $1.50 per 1,000 calls or about $0.0015 per query. If you only need to run occasional checks, the Free plan provides 20 calls each month.
Does the API identify the database tables referenced in each query?
Yes. Alongside the written explanation, the response returns a list of database tables referenced within the query. This lets you inspect which tables an operation targets without parsing the SQL syntax yourself.

Ready to build with SQL Explainer? Start with 200 free credits — one key unlocks all 300+ APIs.

Explore the catalog

300+ APIs on the same key and the same response shape.

Browse all APIs