# xarray.DataTree.get

#### DataTree.get(key, default=None)[[source]](https://github.com/pydata/xarray/blob/main/xarray/core/datatree.py#L992-L1014)

Access child nodes, variables, or coordinates stored in this node.

Returned object will be either a DataTree or DataArray object depending on whether the key given points to a
child or variable.

* **Parameters:**
  * **key** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str)) – Name of variable / child within this node. Must lie in this immediate node (not elsewhere in the tree).
  * **default** (`DataTree | DataArray | None`, *optional*) – A value to return if the specified key does not exist. Default return value is None.
