docs-v2/content/influxdb/v2.2/api-guide/api_intro.md

2.7 KiB

title seotitle description weight menu aliases influxdb/cloud/tags
API Quick Start Use the InfluxDB API Interact with InfluxDB using a rich API for writing and querying data and more. 3
influxdb_2_2
name parent
Quick start Develop with the API
/influxdb/v2.2/tools/api/
api

InfluxDB offers a rich API and client libraries ready to integrate with your application. Use popular tools like Curl and Postman for rapidly testing API requests.

This section will guide you through the most commonly used API methods.

For detailed documentation on the entire API, see InfluxDBv2 API Reference.

{{% note %}} If you need to use InfluxDB {{< current-version >}} with InfluxDB 1.x API clients and integrations, see the 1.x compatibility API. {{% /note %}}

Bootstrap your application

With most API requests, you'll need to provide a minimum of your InfluxDB URL, Organization, and Authorization Token.

Install InfluxDB OSS v2.x or upgrade to an InfluxDB Cloud account.

Authentication

InfluxDB uses API tokens to authorize API requests.

  1. Before exploring the API, use the InfluxDB UI to create an initial API token for your application.

  2. Include your API token in an Authentication: Token YOUR_API_TOKEN HTTP header with each request.

{{< code-tabs-wrapper >}} {{% code-tabs %}} curl Node.js {{% /code-tabs %}} {{% code-tab-content %}}

{{% get-shared-text "api/v2.0/auth/oss/token-auth.sh" %}}

{{% /code-tab-content %}} {{% code-tab-content %}}

{{% get-shared-text "api/v2.0/auth/oss/token-auth.js" %}}

{{% /code-tab-content %}} {{< /code-tabs-wrapper >}}

Postman is another popular tool for exploring APIs. See how to [send authenticated requests with Postman](/{{< latest "influxdb" >}}/api-guide/postman/#send-authenticated-api-requests-with-postman).

Buckets API

Before writing data you'll need to create a Bucket in InfluxDB. Create a bucket using an HTTP request to the InfluxDB API /buckets endpoint.

{{% get-shared-text "api/v2.0/buckets/oss/create.sh" %}}

Write API

Write data to InfluxDB using an HTTP request to the InfluxDB API /write endpoint.

Query API

Query from InfluxDB using an HTTP request to the /query endpoint.