# build_sheets_service_with_api_key

> **Function** in `langchain_google_community`

📖 [View in docs](https://reference.langchain.com/python/langchain-google-community/sheets/utils/build_sheets_service_with_api_key)

Build a Google Sheets service with API key (read-only access).

## Signature

```python
build_sheets_service_with_api_key(
    api_key: str,
) -> Resource
```

## Description

!!! note

API key authentication only works with public spreadsheets.

For private spreadsheets, use OAuth2 credentials instead.

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `api_key` | `str` | Yes | Google API key for authentication. |

## Returns

`Resource`

Google Sheets API service with read-only access to public
spreadsheets.

---

[View source on GitHub](https://github.com/langchain-ai/langchain-google/blob/a3f016b2a6c4af535df275545f76fa7424aa39e5/libs/community/langchain_google_community/sheets/utils.py#L62)