Documentation

Use the InfluxDB v1 HTTP query API and InfluxQL to query data

InfluxDB 3 Enterprise is in Public Alpha

InfluxDB 3 Enterprise is in public alpha and available for testing and feedback, but is not meant for production use. Both the product and this documentation are works in progress. We welcome and encourage your input about your experience with the alpha and invite you to join our public channels for updates and to share feedback.

Alpha expectations and recommendations

Use the InfluxDB v1 HTTP query API to query data in InfluxDB 3 Enterprise with InfluxQL.

The examples below use cURL to send HTTP requests to the InfluxDB v1 HTTP API, but you can use any HTTP client.

InfluxQL feature support

InfluxQL is being rearchitected to work with the InfluxDB 3 storage engine. This process is ongoing and some InfluxQL features are still being implemented. For information about the current implementation status of InfluxQL features, see InfluxQL feature support.

Use the v1 /query endpoint and the GET request method to query data with InfluxQL:

GET http://localhost:8181/query

Provide the following with your request:

  • Headers:

    • Authorization: Bearer AUTH_TOKEN

      While in alpha, InfluxDB 3 Enterprise does not require an authorization token. You can either omit this header or include it with an arbitrary token string.

  • Query parameters:

    • db: the database to query
    • rp: Optional: the retention policy to query
    • q: URL-encoded InfluxQL query
curl --get https://localhost:8181/query \
  --header "Authorization: Bearer 
AUTH_TOKEN
"
\
--data-urlencode "db=
DATABASE_NAME
"
\
--data-urlencode "q=SELECT * FROM home"

Replace the following configuration values:

  • DATABASE_NAME: the name of the database to query
  • AUTH_TOKEN: your authorization token

Return results as JSON or CSV

By default, the /query endpoint returns results in JSON, but it can also return results in CSV. To return results as CSV, include the Accept header with the application/csv or text/csv MIME type:

curl --get https://localhost:8181/query \
  --header "Authorization: BEARER 
AUTH_TOKEN
"
\
--header "Accept: application/csv" \ --data-urlencode "db=
DATABASE_NAME
"
\
--data-urlencode "q=SELECT * FROM home"

Was this page helpful?

Thank you for your feedback!


The future of Flux

Flux is going into maintenance mode. You can continue using it as you currently are without any changes to your code.

Read more

InfluxDB 3 Open Source Now in Public Alpha

InfluxDB 3 Open Source is now available for alpha testing, licensed under MIT or Apache 2 licensing.

We are releasing two products as part of the alpha.

InfluxDB 3 Core, is our new open source product. It is a recent-data engine for time series and event data. InfluxDB 3 Enterprise is a commercial version that builds on Core’s foundation, adding historical query capability, read replicas, high availability, scalability, and fine-grained security.

For more information on how to get started, check out: