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?

API Reference (v2)

Description of the core GraphQL API calls (2025-05)

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://api.innerspace.io

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 {
  BUILDING_INSIGHTS(where: {DATE_PARTITION: {_eq: 20250501}, BUILDING_ID: {_eq: 71}, GRANULARITY: {_eq: "PT1H"}, GROUP_ID: {_eq: "all-e707b3a8-0732-49ae-9156-13ff1138540e"}, SITE_ID: {_eq: 900000222}}, order_by: {DATE_TIME_START: desc}) {
    BUILDING_ID
    DATE_TIME_START
    OCCUPANCY_MEAN
    GRANULARITY
    GROUP_ID
    SITE_ID
  }
}
        """
    print(client.execute(gql(query)))


if __name__ == "__main__":
    main(sys.argv)
PreviousGraphQL PlaygroundNextbuilding_insights (nightly)

Last updated 6 days ago

Was this helpful?