You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Learn how to use the HTTP API to query and access information about the database server and table schemas.
1
+
Use the HTTP query API to access and view information about your database server and table schemas in {{% product-name %}}.
2
2
3
-
The HTTP API for querying is reached via either a `GET` or `POST` to the endpoint `/api/v3/query_sql`. There is also an endpoint for InfluxQL at `/api/v3/query_influxql` but this guide will focus on just the SQL endpoint.
3
+
## Query using SQL
4
4
5
-
The `POST` endpoint is there for when the query is too large to fit in a URL. The `GET` endpoint is useful for quick queries that can be easily encoded in a URL.
5
+
{{% product-name %}} provides the HTTP API `/api/v3/query_sql` endpoint for querying
6
+
data, database server information, and system tables.
6
7
7
-
The HTTP Query API takes the following parameters:
8
-
-`q` - The SQL query to execute
9
-
-`db` - The database to execute the query against
10
-
-`params` - A JSON object containing parameters to be used in the query (for parameterize SQL)
11
-
-`format` - The format of the response. Can be `json`, `jsonl`, `csv`, `pretty`, or `parquet`. JSONL is the preferred format as it will stream the results back to the client. Pretty is for human-readable output.
8
+
> [!Note]
9
+
> {{% product-name %}} uses separate API endpoints for SQL and InfluxQL queries.
10
+
> Both endpoints support the same parameters.
11
+
>
12
+
> For more information about using InfluxQL, see [Query data with InfluxQL](/influxdb3/version/query-data/influxql/).
12
13
13
-
For example, running the `show tables`query, which will show all user created tables (listed as `table_schema` of `iox`), system tables, and information schema tables. Here's the command:
14
+
To execute a query, send a `GET` request or a `POST` request to the endpoint:
0 commit comments