---
title: ViewerApi
summary: Python SDK: the Viewer operations, 1 method, each with its parameters, result and a complete example.
order: 20
languages: [python]
sdk-package: Python SDK · bimworks
link-terms: true
---

# ViewerApi

[[page:reference/sdk/python|Python SDK]] · `bimworks` · class · 1 method

What the viewers need to place and load models

Construct it with the client of [[page:reference/sdk/python#connect|the connect step]]: `bimworks.ViewerApi(client)`. Each method is one operation of the [[page:api|API part]], where it runs on its page.

<table class="dense">
<thead><tr><th>Method</th><th>Operation</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>[[page:reference/sdk/python/viewerapi#getgeometrymetadata|get_geometry_meta_data]]</code></td><td>[[openapi:GetGeometryMetaData]]</td><td>What a viewer needs to place and load models</td></tr>
</tbody>
</table>

## `get_geometry_meta_data` {#getgeometrymetadata}

```python
def get_geometry_meta_data(self, get_geometry_meta_data_request: GetGeometryMetaDataRequest) -> Dict[str, Dict[str, object]]
```

What a viewer needs to place and load models. Per Version (keyed by its uuid): the metadata of its geometry (bounds, units, the unquantization, the file types and the geometry encoding the viewer should load), and its placement (georeference, anchor point, alignment, grid convergence). The keys follow the indexed-model metadata, which the viewers read as they are.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:GetGeometryMetaData]] · <code>POST /openapi/viewer/GetGeometryMetaData</code></td></tr>
<tr><th>Scope</th><td>[[scope:geometry:read]]</td></tr>
</tbody>
</table>

### Parameters

<table class="dense">
<thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>get_geometry_meta_data_request</code></td><td><code>[[page:reference/sdk/python/models#GetGeometryMetaDataRequest|GetGeometryMetaDataRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:GetGeometryMetaData]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>Dict[str, Dict[str, object]]</code> — The metadata per Version uuid

### Example

```python
import json

import bimworks

# 1. Connect to BIM.works and log in with your API token
client = bimworks.ApiClient(bimworks.Configuration(host="BIM_WORKS_ADDRESS/openapi"))
auth = bimworks.AuthApi(client).login_with_api_token(
    bimworks.LoginWithApiTokenRequest(token="BIM_WORKS_API_TOKEN"))
client.configuration.access_token = auth.actual_instance.var_base64

# 2. The request
request = bimworks.GetGeometryMetaDataRequest.from_json(r"""
{
  "models": [
    {
      "type": "UrlModelIdentifier"
    }
  ]
}
""")

# 3. The call
result = bimworks.ViewerApi(client).get_geometry_meta_data(request)

# 4. The result
print(json.dumps(client.sanitize_for_serialization(result), indent=2))
```
