InnerSpace API
  • Overview
  • Metrics and Features
  • Groups
  • Authentication
  • Granularity
  • DateTime
  • GraphQL Playground
  • API Reference (v2)
    • building_insights (nightly)
    • zone_insights (nightly)
    • zone_type_insights (nightly)
    • buildings (nightly)
    • sites (nightly) [TBD]
    • zone_occupancy (realtime) [TBD]
    • zone_occupancy (nightly) [TBD]
    • groups (nightly) [TBD]
    • zones (nightly) [TBD]
  • Deprecated API (2025-05-26)
    • Authentication (v1 - deprecated)
    • API Reference (v1 - deprecated)
      • zone_occupancy (realtime)
      • zone_metrics (nightly)
      • zone_features (nightly)
      • site_metrics (nightly)
      • site_features (nightly)
      • building_metrics (nightly)
      • building_features (nightly)
      • zone_occupancy (nightly)
      • groups (nightly) (TBD)
      • buildings (nightly) (TBD)
      • sites (nightly) (TBD)
      • zones (nightly) (TBD)
Powered by GitBook
On this page

Was this helpful?

  1. Deprecated API (2025-05-26)

API Reference (v1 - deprecated)

Description of the core GraphQL API calls

This is a graphql API.

Insights are published for buildings, floors (site) and zones (polygon on a floorplan).

All GraphQL APIs are available at https://metrics-api.innrspc.com

Example

The following example uses building_id 71, which is the DEMO building.

Python GraphQL

import logging
import sys
from is_common.logging import LogManager
from gql import gql, Client
from gql.transport.aiohttp import AIOHTTPTransport
from gql.transport.aiohttp import log as requests_logger
requests_logger.setLevel(logging.WARNING)
logger = LogManager(config={"app-log-level": "INFO"})


def main(argv):
    # Select your transport with a defined url endpoint, using the auth token from above
    transport = AIOHTTPTransport(url="https://metrics-api.innrspc.com/", headers={"Authorization": "Bearer {access_token}"})

    # Create a GraphQL client using the defined transport
    client = Client(transport=transport, fetch_schema_from_transport=True)

    # Execute the query on the transport
    query = """
        query sample_graphql {
              data: building_features(
                 where: {_and: [{building_id: {_eq: 71}}, {feature_name: {_eq: "weekly_frequency_dist"}}, {granularity: {_eq: "P1W"}}, {group_id: {_eq: "all-e707b3a8-0732-49ae-9156-13ff1138540e"}}, {date_time_start: {_gte: "2024-01-01T06:00:00.000Z", _lt: "2024-01-08T06:00:00.000Z"}}]}
                  ) {
                    feature_value
                    date_time_start
                  }
            }
        """
    print(client.execute(gql(query)))


if __name__ == "__main__":
    main(sys.argv)
PreviousAuthentication (v1 - deprecated)Nextzone_occupancy (realtime)

Last updated 10 months ago

Was this helpful?