```console
curl -X POST http://localhost:8428/api/v1/import/native -T filename.bin
```
Cluster version of VictoriaMetrics:
Additional information:
* [How to import time series](https://docs.victoriametrics.com/#how-to-import-time-series-data)
* [How to export time series](https://docs.victoriametrics.com/#how-to-export-time-series)
* [URL format for VictoriaMetrics cluster](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html#url-format)
## /api/v1/import/prometheus
**Imports data to VictoriaMetrics in Prometheus text exposition format**
Single-node VictoriaMetrics:
```console
curl -d 'metric_name{foo="bar"} 123' -X POST http://localhost:8428/api/v1/import/prometheus
```
Cluster version of VictoriaMetrics:
```console
curl -d 'metric_name{foo="bar"} 123' -X POST http://:8480/insert/0/prometheus/api/v1/import/prometheus
```
Additional information:
* [How to import time series](https://docs.victoriametrics.com/#how-to-import-time-series-data)
* [How to export time series](https://docs.victoriametrics.com/#how-to-export-time-series)
* [URL format for VictoriaMetrics cluster](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html#url-format)
## /api/v1/labels
**Get a list of label names at the given time range**
Single-node VictoriaMetrics:
```console
curl http://localhost:8428/prometheus/api/v1/labels
```
Cluster version of VictoriaMetrics:
```console
curl http://:8481/select/0/prometheus/api/v1/labels
```
By default VictoriaMetrics returns labels seen during the last day starting at 00:00 UTC. An arbitrary time range can be set via `start` and `end` query args.
The specified `start..end` time range is rounded to day granularity because of performance optimization concerns.
Additional information:
* [Prometheus querying API usage](https://docs.victoriametrics.com/#prometheus-querying-api-usage)
* [Querying label values](https://prometheus.io/docs/prometheus/latest/querying/api/#querying-label-values)
* [URL format for VictoriaMetrics cluster](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html#url-format)
## /api/v1/label/.../values
**Get a list of values for a particular label on the given time range**
Single-node VictoriaMetrics:
```console
curl http://localhost:8428/prometheus/api/v1/label/job/values
```
Cluster version of VictoriaMetrics:
```console
curl http://:8481/select/0/prometheus/api/v1/label/job/values
```
By default VictoriaMetrics returns labels values seen during the last day starting at 00:00 UTC. An arbitrary time range can be set via `start` and `end` query args.
The specified `start..end` time range is rounded to day granularity because of performance optimization concerns.
Additional information:
* [Prometheus querying API usage](https://docs.victoriametrics.com/#prometheus-querying-api-usage)
* [Getting label names](https://prometheus.io/docs/prometheus/latest/querying/api/#getting-label-names)
* [URL format for VictoriaMetrics cluster](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html#url-format)
## /api/v1/query
**Performs PromQL/MetricsQL instant query**
Single-node VictoriaMetrics:
```console
curl http://localhost:8428/prometheus/api/v1/query -d 'query=vm_http_request_errors_total'
```
Cluster version of VictoriaMetrics:
```console
curl http://:8481/select/0/prometheus/api/v1/query -d 'query=vm_http_request_errors_total'
```
Additional information:
* [Prometheus querying API usage](https://docs.victoriametrics.com/#prometheus-querying-api-usage)
* [Instant queries](https://docs.victoriametrics.com/keyConcepts.html#instant-query)
* [Query language](https://docs.victoriametrics.com/keyConcepts.html#metricsql)
* [URL format for VictoriaMetrics cluster](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html#url-format)
## /api/v1/query_range
**Performs PromQL/MetricsQL range query**
Single-node VictoriaMetrics:
```console
curl http://localhost:8428/prometheus/api/v1/query_range -d 'query=sum(increase(vm_http_request_errors_total{job="foo"}[5m]))' -d 'start=-1d' -d 'step=1h'
```
Cluster version of VictoriaMetrics:
```console
curl http://:8481/select/0/prometheus/api/v1/query_range -d 'query=sum(increase(vm_http_request_errors_total{job="foo"}[5m]))' -d 'start=-1d' -d 'step=1h'
```
Additional information:
* [Prometheus querying API usage](https://docs.victoriametrics.com/#prometheus-querying-api-usage)
* [Range queries](https://docs.victoriametrics.com/keyConcepts.html#range-query)
* [Query language](https://docs.victoriametrics.com/keyConcepts.html#metricsql)
* [URL format for VictoriaMetrics cluster](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html#url-format)
## /api/v1/series
**Returns series names with their labels on the given time range**
Single-node VictoriaMetrics:
```console
curl http://localhost:8428/prometheus/api/v1/series -d 'match[]=vm_http_request_errors_total'
```
Cluster version of VictoriaMetrics:
```console
curl http://:8481/select/0/prometheus/api/v1/series -d 'match[]=vm_http_request_errors_total'
```
By default VictoriaMetrics returns time series seen during the last day starting at 00:00 UTC. An arbitrary time range can be set via `start` and `end` query args.
The specified `start..end` time range is rounded to day granularity because of performance optimization concerns.
Additional information:
* [Prometheus querying API usage](https://docs.victoriametrics.com/#prometheus-querying-api-usage)
* [Finding series by label matchers](https://prometheus.io/docs/prometheus/latest/querying/api/#finding-series-by-label-matchers)
* [URL format for VictoriaMetrics cluster](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html#url-format)
VictoriaMetrics accepts `limit` query arg for `/api/v1/series` handlers for limiting the number of returned entries. For example, the query to `/api/v1/series?limit=5` returns a sample of up to 5 series, while ignoring the rest. If the provided `limit` value exceeds the corresponding `-search.maxSeries` command-line flag values, then limits specified in the command-line flags are used.
## /api/v1/status/tsdb
**Cardinality statistics**
Single-node VictoriaMetrics:
```console
curl http://localhost:8428/prometheus/api/v1/status/tsdb
```
Cluster version of VictoriaMetrics:
```console
curl http://:8481/select/0/prometheus/api/v1/status/tsdb
```
Additional information:
* [Prometheus querying API usage](https://docs.victoriametrics.com/#prometheus-querying-api-usage)
* [TSDB Stats](https://prometheus.io/docs/prometheus/latest/querying/api/#tsdb-stats)
* [URL format for VictoriaMetrics cluster](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html#url-format)
## /datadog
**DataDog URL for Single-node VictoriaMetrics**
```
http://victoriametrics:8428/datadog
```
**DataDog URL for Cluster version of VictoriaMetrics**
```
http://vminsert:8480/insert/0/datadog
```
## /datadog/api/v1/series
**Imports data in DataDog format into VictoriaMetrics**
Single-node VictoriaMetrics:
```console
echo '
{
"series": [
{
"host": "test.example.com",
"interval": 20,
"metric": "system.load.1",
"points": [[
0,
0.5
]],
"tags": [
"environment:test"
],
"type": "rate"
}
]
}
' | curl -X POST --data-binary @- http://localhost:8428/datadog/api/v1/series
```
Cluster version of VictoriaMetrics:
```console
echo '
{
"series": [
{
"host": "test.example.com",
"interval": 20,
"metric": "system.load.1",
"points": [[
0,
0.5
]],
"tags": [
"environment:test"
],
"type": "rate"
}
]
}
' | curl -X POST --data-binary @- 'http://:8480/insert/0/datadog/api/v1/series'
```
Additional information:
* [How to send data from datadog agent](https://docs.victoriametrics.com/#how-to-send-data-from-datadog-agent)
* [URL format for VictoriaMetrics cluster](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html#url-format)
## /federate
**Returns federated metrics**
Single-node VictoriaMetrics:
```console
curl http://localhost:8428/federate -d 'match[]=vm_http_request_errors_total'
```
Cluster version of VictoriaMetrics:
```console
curl http://:8481/select/0/prometheus/federate -d 'match[]=vm_http_request_errors_total'
```
Additional information:
* [Federation](https://docs.victoriametrics.com/#federation)
* [Prometheus-compatible federation data](https://prometheus.io/docs/prometheus/latest/federation/#configuring-federation)
* [URL format for VictoriaMetrics cluster](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html#url-format)
## /graphite/metrics/find
**Searches Graphite metrics in VictoriaMetrics**
Single-node VictoriaMetrics:
```console
curl http://localhost:8428/graphite/metrics/find -d 'query=vm_http_request_errors_total'
```
Cluster version of VictoriaMetrics:
```console
curl http://:8481/select/0/graphite/metrics/find -d 'query=vm_http_request_errors_total'
```
Additional information:
* [Metrics find API in Graphite](https://graphite-api.readthedocs.io/en/latest/api.html#metrics-find)
* [Graphite API in VictoriaMetrics](https://docs.victoriametrics.com/#graphite-api-usage)
* [How to send Graphite data to VictoriaMetrics](https://docs.victoriametrics.com/Single-server-VictoriaMetrics.html#how-to-send-data-from-graphite-compatible-agents-such-as-statsd)
* [URL Format](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html#url-format)
## /influx/write
**Writes data with InfluxDB line protocol to VictoriaMetrics**
Single-node VictoriaMetrics:
```console
curl -d 'measurement,tag1=value1,tag2=value2 field1=123,field2=1.23' -X POST http://localhost:8428/write
```
Cluster version of VictoriaMetrics:
```console
curl -d 'measurement,tag1=value1,tag2=value2 field1=123,field2=1.23' -X POST http://:8480/insert/0/influx/write
```
Additional information:
* [How to send Influx data to VictoriaMetrics](https://docs.victoriametrics.com/#how-to-send-data-from-influxdb-compatible-agents-such-as-telegraf)
* [URL Format](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html#url-format)
## TCP and UDP
### How to send data from OpenTSDB-compatible agents to VictoriaMetrics
Turned off by default. Enable OpenTSDB receiver in VictoriaMetrics by setting `-opentsdbListenAddr` command-line flag.
*If run from docker, '-opentsdbListenAddr' port should be exposed*
Single-node VictoriaMetrics:
```console
echo "put foo.bar.baz `date +%s` 123 tag1=value1 tag2=value2" | nc -N localhost 4242
```
Cluster version of VictoriaMetrics:
```console
echo "put foo.bar.baz `date +%s` 123 tag1=value1 tag2=value2" | nc -N http:// 4242
```
Enable HTTP server for OpenTSDB /api/put requests by setting `-opentsdbHTTPListenAddr` command-line flag.
Single-node VictoriaMetrics:
```console
curl -H 'Content-Type: application/json' -d '[{"metric":"foo","value":45.34},{"metric":"bar","value":43}]' http://localhost:4242/api/put
```
Cluster version of VictoriaMetrics:
```console
curl -H 'Content-Type: application/json' -d '[{"metric":"foo","value":45.34},{"metric":"bar","value":43}]' http://:8480/insert/42/opentsdb/api/put
```
Additional information:
* [OpenTSDB http put API](http://opentsdb.net/docs/build/html/api_http/put.html)
* [How to send data OpenTSDB data to VictoriaMetrics](https://docs.victoriametrics.com/Single-server-VictoriaMetrics.html#how-to-send-data-from-opentsdb-compatible-agents)
### How to send Graphite data to VictoriaMetrics
Enable Graphite receiver in VictoriaMetrics by setting `-graphiteListenAddr` command-line flag.
Single-node VictoriaMetrics:
```console
echo "foo.bar.baz;tag1=value1;tag2=value2 123 `date +%s`" | nc -N localhost 2003
```
Cluster version of VictoriaMetrics:
```console
echo "foo.bar.baz;tag1=value1;tag2=value2 123 `date +%s`" | nc -N http:// 2003
```
Additional information:
* [How to send Graphite data to VictoriaMetrics](https://docs.victoriametrics.com/Single-server-VictoriaMetrics.html#how-to-send-data-from-graphite-compatible-agents-such-as-statsd)
* [Multitenancy in cluster version of VictoriaMetrics](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html#multitenancy)