Autumn Labs
DocsBlogCareers
API

Metrics

Retrieve metrics data for specified or all accessible stations and optional filters

GET
/metrics
AuthorizationBearer <token>

In: header

Query Parameters

station_ids?string

Comma-separated list of station IDs

to?string
Default"2025-06-27T23:46:42.268Z"
Formatdate-time
from?string
Default"2025-06-26T23:46:42.268Z"
Formatdate-time
names?array<string>

The names of the metrics to filter by

Default[]

Response Body

curl -X GET "http://localhost:3000/metrics?station_ids=507f1f77bcf86cd799439011%2C507f1f77bcf86cd799439012&to=2025-06-27T23%3A46%3A42.268Z&from=2025-06-26T23%3A46%3A42.268Z&names=temperature&names=humidity"
fetch("http://localhost:3000/metrics?station_ids=507f1f77bcf86cd799439011%2C507f1f77bcf86cd799439012&to=2025-06-27T23%3A46%3A42.268Z&from=2025-06-26T23%3A46%3A42.268Z&names=temperature&names=humidity")
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {
  url := "http://localhost:3000/metrics?station_ids=507f1f77bcf86cd799439011%2C507f1f77bcf86cd799439012&to=2025-06-27T23%3A46%3A42.268Z&from=2025-06-26T23%3A46%3A42.268Z&names=temperature&names=humidity"

  req, _ := http.NewRequest("GET", url, nil)
  
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "http://localhost:3000/metrics?station_ids=507f1f77bcf86cd799439011%2C507f1f77bcf86cd799439012&to=2025-06-27T23%3A46%3A42.268Z&from=2025-06-26T23%3A46%3A42.268Z&names=temperature&names=humidity"

response = requests.request("GET", url)

print(response.text)
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.http.HttpResponse.BodyHandlers;
import java.time.Duration;

HttpClient client = HttpClient.newBuilder()
  .connectTimeout(Duration.ofSeconds(10))
  .build();

HttpRequest.Builder requestBuilder = HttpRequest.newBuilder()
  .uri(URI.create("http://localhost:3000/metrics?station_ids=507f1f77bcf86cd799439011%2C507f1f77bcf86cd799439012&to=2025-06-27T23%3A46%3A42.268Z&from=2025-06-26T23%3A46%3A42.268Z&names=temperature&names=humidity"))
  .GET()
  .build();

try {
  HttpResponse<String> response = client.send(requestBuilder.build(), BodyHandlers.ofString());
  System.out.println("Status code: " + response.statusCode());
  System.out.println("Response body: " + response.body());
} catch (Exception e) {
  e.printStackTrace();
}
using System;
using System.Net.Http;
using System.Text;

var client = new HttpClient();
var response = await client.GetAsync("http://localhost:3000/metrics?station_ids=507f1f77bcf86cd799439011%2C507f1f77bcf86cd799439012&to=2025-06-27T23%3A46%3A42.268Z&from=2025-06-26T23%3A46%3A42.268Z&names=temperature&names=humidity");
var responseBody = await response.Content.ReadAsStringAsync();
{
  "data": [
    {
      "station_id": "string",
      "slot": "string",
      "unit_serial": "string",
      "time_created": "string",
      "tz": "string",
      "mode": "string",
      "tags": [
        "string"
      ],
      "name": "string",
      "value": "string",
      "unit": "string",
      "type": "string",
      "limit_upper": "string",
      "limit_lower": "string"
    }
  ],
  "message": "Success",
  "meta": {
    "timestamp": "2019-08-24T14:15:22Z",
    "request_id": "c2ed3e07-8c5f-4be9-b7ec-86bddcedd154",
    "query_duration_ms": 0
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "details": null
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "details": null
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "details": null
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "details": null
  }
}