Find a guide, feature, or API endpoint. Try “FTP”, “alerts”, or “instruments”.

Browse documentation

Docs/API reference / Observations

Query observations

Requires `developer_api.instrument_data.query` on the project-scoped Developer API connection. Use the API origin supplied for your deployment. Unknown query parameters and unexpected request bodies are rejected. Time ranges use an inclusive from and exclusive to. Query current raw/corrected observations or current calculated materializations; never treat nil readings as zero. Deployed limits are available from the public OpenAPI metadata endpoint.

POST/dev-api/v1/p/{project_id}/observations/queryAll endpoints ↗

The request panel saves credentials and API settings in this browser. Privacy details

POST
/dev-api/v1/p/{project_id}/observations/query

Authorization

developerApiKey
AuthorizationBearer <token>

Project-scoped Developer API connection key. Grant only the required operation permissions.

In: header

Path Parameters

project_id*string
Match.*\S.*
Length1 <= length <= 128

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

The total number of variable_ids across all instruments is subject to the whole-request maximum declared by x-sansignal-max-total-variable-ids, in addition to each instrument's array bound.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

bash
curl -X POST "https://example.com/dev-api/v1/p/string/observations/query" \
  -H "Content-Type: application/json" \
  -d '{
    "instruments": [
      {
        "instrument_id": "string",
        "variable_ids": [
          "string"
        ]
      }
    ],
    "from": "2019-08-24T14:15:22Z",
    "to": "2019-08-24T14:15:22Z"
  }'
json
{
  "request_id": "string",
  "data": {
    "variables": [
      {
        "instrument_id": "string",
        "instrument_name": "string",
        "instrument_lifecycle_state": "active",
        "id": "string",
        "name": "string",
        "variable_lifecycle_state": "active",
        "value_type": "decimal",
        "unit": "cm"
      }
    ],
    "observations": [
      {
        "instrument_id": "string",
        "variable_id": "string",
        "instrument_timestamp": "2019-08-24T14:15:22Z",
        "value_type": "decimal",
        "decimal_value": 0,
        "string_value": "string",
        "quality": "pass",
        "status": "raw",
        "nil_reason": "string"
      }
    ]
  },
  "next_cursor": "string"
}