# Подключение и работа с Google Таблицам

## Подготовка для работы с Google Таблицами

Для работы с Google Таблицами необходимо выполнить подготовительные шаги:

<details>

<summary>Подготовка Google аккаунта и получение ключа для интеграции</summary>

1. Зайти на <https://console.cloud.google.com/>
2. В верхнем меню выберите или создайте новый проект\
   ![](/files/vr7AhKPC4Qzgg67oJHjN)
3. Нажмите на меню\
   ![](/files/uyklbeddGQ4Rx0n9sDNs)
4. перейдите в APIs & Services -> Enabled APIs & services\
   ![](/files/9IZTBypM6njLx2cpl6Ob)
5. Enable APIs and services\
   ![](/files/QRi7spTWFPQDjkfRIXZC)
6. Найдите Google Drive API\
   ![](/files/unoakXZpXT93xlOK6yx8)
7. Нажмите Enable\
   ![](/files/AJNcMPiH4l7Y4qzKjqwq)
8. Вернитесь назад
9. Найдите Google Sheets API\
   ![](/files/rhkz52NGwGiap6mOMjgW)
10. Нажмите Enable\
    ![](/files/jamv56Qf7gHMFJts18wq)
11. Далее надо создать сервисный аккаунт если его нет\
    меню->IAM & Admin -> Service Accounts\
    ![](/files/Ch8E0UQ6eJVbFfugqwPJ)<br>
12. Нажмите 'Create service account'\
    ![](/files/ws1RNme2MKbap4UXtuoQ)
13. Впишите любое имя на английском и нажмите Done\
    ![](/files/wv5lSmSzzByeHfLZA0zU)
14. Скопируйте имя в буфер обмена полное имя оно понадобится далее\
    \
    ![](/files/uLU56nrlqGbb41eF8TTW)
15. Зайдите в созданный аккаунт.\
    ![](/files/xqc8VBW4p054Sm3fsMA3)
16. Перейдите на вкладку Keys и нажмите Add Key->Create New Key\
    ![](/files/hWv8bZWEUsehoEJKLfrX)
17. Выберите JSON и нажмите Create\
    ![](/files/ClSHu0WTXvEOitsbcx6L)
18. Скачается JSON файл.\
    ![](/files/GftsCjzfCwMYZSzPzxVV)<br>

</details>

<details>

<summary>Подготовка Google Таблицы</summary>

1. Зайдите <https://console.cloud.google.com/iam-admin/serviceaccounts>
2. Найдите имя вашего сервисного аккаунта\
   ![](/files/IGjsox1xa2VRKiUe5ysB)
3. Создайте гугл таблицу и дайте ей осмысленное название
4. Зайдите в настройки доступа\
   ![](/files/OC9ph4jpR8DzuGr1tA5C)
5. Вставьте ПОЛНОЕ имя сервисного аккаунта и выберите роль Редактор и нажмите открыть доступ.\
   ![](/files/nRFimi3Px46ry8IpDQo4)

</details>

После выполнения подготовки у вас должен быть JSON-файл с ключом и Google Таблица, в которую добавлен ваш сервисный аккаунт в качестве редактора.

## Продолжение работы с Google Таблицами

[Запись в Google Таблицы](/functional/functions/sending-result/python/podklyuchenie-i-rabota-s-google-tablicam/zapis-v-google-tablicu.md)

[Чтение из Google Таблиц](/functional/functions/sending-result/python/podklyuchenie-i-rabota-s-google-tablicam/chtenie-iz-google-tablicy.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.nextbot.ru/functional/functions/sending-result/python/podklyuchenie-i-rabota-s-google-tablicam.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
