# Module: scenarioplanner.linkingapi

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/google/meridian/blob/v2.2.2/scenarioplanner/linkingapi/__init__.py) |

Builds Looker Studio report URLs.

This package provides tools to construct URLs for Looker Studio reports that
embed data directly within the URL itself. This is achieved through the creation
of shareable, pre-configured reports without requiring a separate, pre-existing
data source.

The primary functionality is exposed through the `url_generator` module.

#### Typical Usage:

1. Use [`url_generator.create_report_url()`](https://developers.google.com/meridian/reference/api/scenarioplanner/linkingapi/url_generator/create_report_url.md.txt) to create the complete URL, based on a [`sheets.Spreadsheet`](https://developers.google.com/meridian/reference/api/scenarioplanner/converters/sheets/Spreadsheet.md.txt) object.

#### Example:

```python
from lookerstudio.linkingapi import url_generator
from lookerstudio.converters import sheets

# Generate the URL
looker_studio_report_url = url_generator.create_report_url(
    url="some_url",
    id="some_id",
    sheet_id_by_tab_name={},
)
# The `looker_studio_report_url` can now be shared to open a pre-populated
# report.
```

## Modules

[`constants`](https://developers.google.com/meridian/reference/api/scenarioplanner/linkingapi/constants.md.txt) module: Constants shared for the Linking API usage for the Meridian UI.

[`url_generator`](https://developers.google.com/meridian/reference/api/scenarioplanner/linkingapi/url_generator.md.txt) module: Utility library for generating a Looker Studio report and outputting the URL.