# Using extra parameters with Viam's SDKs

How to [use](https://docs.viam.com/reference/sdks/use-extra-params/#use) and [define](https://docs.viam.com/reference/sdks/use-extra-params/#define) the `extra` parameters that many resource [API methods](https://docs.viam.com/reference/apis/) offer in the Go and Python SDKs.

## Use

You can use `extra` parameters with modular resource implementations that are _models_ of built-in resource types.

For example, a new model of [sensor](https://docs.viam.com/hardware/common-components/add-a-sensor/), or a new model of SLAM service.

The `extra` parameters in that built-in resource type’s [API](https://docs.viam.com/reference/apis/) allow users to pass information to a resource’s driver that isn’t specified as a parameter for all models of the resource type. This is necessary to keep the API of resource types consistent across, for example, all models of [motor](https://docs.viam.com/hardware/common-components/add-a-motor/) or all models of [camera](https://docs.viam.com/hardware/common-components/add-a-camera/).

Send extra information in an API call in `extra` parameters as follows:

- [Python](https://docs.viam.com/reference/sdks/use-extra-params/#tabset-referencesdksuse-extra-params-2-0)
- [Go](https://docs.viam.com/reference/sdks/use-extra-params/#tabset-referencesdksuse-extra-params-2-1)

[`Optional[Dict[str, Any]]`](https://docs.python.org/3/library/typing.html#typing.Optional) indicates you are required to pass in an object of either type `Dict[str, Any]` or `None` as a parameter when calling this method.

An object of type `Dict[str, Any]` is a [dictionary](https://docs.python.org/3/tutorial/datastructures.html#dictionaries) with keys of type [`str`](https://docs.python.org/3/library/stdtypes.html#str) and values of [`any type`](https://docs.python.org/3/library/typing.html#typing.Any),

For example:

```python

```

Copy

#### Tip

If passing an object of type `None`, you do not have to specify `None` in the method call.

`extra (map[string]interface{})` indicates you are required to pass in an object of either type `map[string]interface{}` or `nil` as a parameter when calling this method.

An object of type `map[string]interface{}` is an [map](https://go.dev/blog/maps) with keys of type [`string`](https://go.dev/blog/strings) and values of [any type that you have cast to an interface](https://jordanorelli.com/post/32665860244/how-to-use-interfaces-in-go).

For example:

```go

```

Copy

#### Important

If passing an object of type `nil`, you must specify `nil` in the method call or the method will fail.

## Define

If `extra` information must be passed to a resource, it is handled within a new, _modular_ resource model’s [custom API](https://docs.viam.com/build-modules/write-a-driver-module/) wrapper.

##### Click for instructions on defining a custom model to use extra params

To do this, define a custom implementation of the resource’s API as a new _model_, and modify the resource’s API methods to handle the `extra` information you send. Follow the steps in the [Modular Resources documentation](https://docs.viam.com/build-modules/write-a-driver-module/) to do so.

For an example of how to check the values of keys in an `extra` parameter of a built-in resource [API method](https://docs.viam.com/reference/apis/), reference this modification to the built-in [sensor](https://docs.viam.com/hardware/common-components/add-a-sensor/) resource type’s [Readings](https://docs.viam.com/reference/apis/components/sensor/#getreadings) method in the code of a new sensor model:

- [Python](https://docs.viam.com/reference/sdks/use-extra-params/#tabset-referencesdksuse-extra-params-1-0)
- [Go](https://docs.viam.com/reference/sdks/use-extra-params/#tabset-referencesdksuse-extra-params-1-1)

```python

```

Copy

```go

```

Copy

See [Create a module](https://docs.viam.com/build-modules/write-a-driver-module/) for more information and instructions on modifying built-in API specifications.
