> For the complete documentation index, see [llms.txt](https://developer.fotokite.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.fotokite.com/code-examples/system-information.md).

# System Information

This section explains how to use system endpoints to identify the connected system, access component information, and subscribe to real-time updates via WebSockets.

For more details, see [System](/fotokite-api/system.md) or the [GitHub repository](https://github.com/fotokite/fotokite-api/tree/main/example/).

### Get system info

Retrieve basic system information, such as:

* System ID
* Timezone
* Hardware configuration (main board components)

```python
def system_info(access_token: str = "") -> SystemMessage:
    """Fetches system information.

    Args:
        access_token: Bearer token for API authentication. Defaults to "".

    Returns:
        Parsed system information message if the request is successful.
        Empty dictionary if an error occurs.

    Raises:
        requests.HTTPError: If the HTTP request fails with a non-200 status code.
        Exception: For any other exceptions encountered during the request.
    """
    try:
        response = requests.get(
            f"{BASE_REST_API_URL}/system/info",
            headers={"Authorization": f"Bearer {access_token}"},
        )
        if response.status_code == 200:
            return cast(SystemMessage, response.json())
        else:
            response.raise_for_status()
    except Exception as e:
        logging.error(f"Error fetching system info: {e}")

    return {}
```

### Subscribe system state

This example shows how to subscribe to frequently changing data, such as:

* Ground station battery level
* Kite battery level
* GPS status

It enables real-time monitoring of the system’s overall health and readiness.

```python
def system_telemetry(
    on_message_callback: Callable[[SystemMessage], None],
    access_token: str = "",
    max_messages: int | None = None,
) -> None:
    """Subscribes to system info telemetry

    Args:
        on_message_callback: A callback function to handle incoming messages.
        access_token: The authentication token to use in the websocket connection.
        max_messages: The maximum number of messages to process. Defaults to None.
    """
    ws_url = f"{BASE_WEBSOCKET_API_URL}/system/state/subscribe?access_token={access_token}"
    try:
        with connect(
            ws_url, additional_headers={"Authorization": f"Bearer {access_token}"}
        ) as websocket:
            logging.info("Connected to system telemetry")
            count = 0
            while True:
                message = websocket.recv()
                data = json.loads(message)

                on_message_callback(data)

                count += 1
                if max_messages is not None and count >= max_messages:
                    break
    except Exception as e:
        logging.error(f"Error in system telemetry: {e}")
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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 following URL with the `ask` and `goal` query parameters:

```
GET https://developer.fotokite.com/code-examples/system-information.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `build a script that syncs our docs to a CMS` lets GitBook tailor the answer to that use case.

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.
