# API Reference (v1 - deprecated)

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.

{% code title="Python GraphQL" lineNumbers="true" %}

```python

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)
```

{% endcode %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.innerspace.io/deprecated-api-2025-05-26/api-reference-v1-deprecated.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
