샘플
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
이 섹션에서는 Google Sheets API를 숙지하는 데 사용할 수 있는 codelab을 소개합니다. 또한 의도한 Google Sheets 작업을 API 요청으로 변환하는 방법을 보여주는 '레시피' 예시도 제공됩니다.
API를 사용하여 주어진 작업을 완료하는 방법은 여러 가지인 경우가 많습니다. 작업에 접근하는 방법을 결정할 때는 다음 사항에 유의하세요.
레시피
이 섹션에 나열된 예에서는 Sheets의 일반적인 작업을 Sheets API v4 요청으로 표현하는 방법을 보여줍니다.
이러한 예는 언어에 구애받지 않도록 HTTP 요청의 형태로 제공됩니다. Google API 클라이언트 라이브러리를 사용하여 특정 언어로 Sheets API 요청 프로토콜을 구현하는 방법을 알아보려면 셀 값 읽기 및 쓰기 및 스프레드시트 업데이트 가이드를 참고하세요.
이 섹션의 레시피는 다음 카테고리로 나뉩니다.
- 기본 읽기 - 시트에서 값을 읽는 방법을 보여주는 레시피입니다.
- 기본 쓰기: 시트에 값을 쓰는 방법을 보여주는 레시피입니다.
- 기본 서식 지정 - 시트와 셀의 모양을 변경하는 방법을 보여주는 레시피입니다.
- 차트: 시트에서 차트를 만들고 변경하는 방법을 보여주는 레시피입니다.
- 조건부 서식: 조건에 따라 셀 모양을 변경하는 방법을 보여주는 레시피입니다.
- 데이터 작업: 스프레드시트에서 데이터를 만들고 이동하고 조작하는 방법을 보여주는 레시피입니다.
- 이름이 지정되고 보호된 범위 - 스프레드시트에서 이름이 지정되고 보호된 범위를 만들고, 업데이트하고, 삭제하는 방법을 보여주는 레시피입니다.
- 피벗 테이블: 시트에서 피벗 테이블을 만드는 방법을 보여주는 레시피입니다.
- 행 및 열 작업: 행과 열을 추가, 삭제, 이동하고 속성을 업데이트하는 방법을 보여주는 레시피입니다.
- 시트 작업 - 시트를 만들고, 지우고, 복사하고, 삭제하는 방법과 시트 속성을 제어하는 방법을 보여주는 레시피입니다.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-08-29(UTC)
[null,null,["최종 업데이트: 2025-08-29(UTC)"],[],[],null,["# Samples\n\nThis section presents a\n[codelab](https://codelabs.developers.google.com/codelabs/sheets-api/) you can\nuse to become familiar with the Google Sheets API. Also provided are a set of\n\"recipe\" examples that demonstrate how to translate an intended Google Sheets\naction into an API request.\n\nOften there's more than one way to complete a given task with the API. When\nyou're deciding on how to approach a task, keep the following in mind:\n\n- If you need to read or write cell values, the [`spreadsheets.values`](/workspace/sheets/api/reference/rest/v4/spreadsheets.values) collection is a better choice than the [`spreadsheets`](/workspace/sheets/api/reference/rest/v4/spreadsheets) collection. The former's interface is easier to use for simple read/write operations.\n- Wherever possible, use the batch methods\n ([`spreadsheet.batchUpdate`](/workspace/sheets/api/reference/rest/v4/spreadsheets/batchUpdate),\n [`spreadsheet.values.batchGet`](/workspace/sheets/api/reference/rest/v4/spreadsheets.values/batchGet),\n and\n [`spreadsheet.values.batchUpdate`](/workspace/sheets/api/reference/rest/v4/spreadsheets.values/batchUpdate))\n to bundle multiple requests into a single method call. Using these batch\n methods improves efficiency as they:\n\n - Reduce client HTTP overhead.\n - Reduce the number of queries made.\n - Reduce the number of revisions on the doc.\n - Ensure atomicity of all the changes in the batch.\n\nRecipes\n-------\n\nThe examples listed in this section demonstrate how to express common actions in\nSheets as Sheets API v4 requests.\n\nThese examples are presented in the form of HTTP requests to be language\nneutral. To learn how to implement Sheets API request protocols in a\nspecific language using Google API client libraries, see the [Read \\& write cell\nvalues](/workspace/sheets/api/guides/values) and [Update\nspreadsheets](/workspace/sheets/api/guides/batchupdate) guides.\n\nRecipes in this section are divided into the following categories:\n\n- [Basic reading](/workspace/sheets/api/samples/reading)---Recipes that show how to read values from a sheet.\n- [Basic writing](/workspace/sheets/api/samples/writing)---Recipes that show how to write values to a sheet.\n- [Basic formatting](/workspace/sheets/api/samples/formatting)---Recipes that show how to change the appearance of sheets and cells.\n- [Charts](/workspace/sheets/api/samples/charts)---Recipes that show how to create and alter charts in a sheet.\n- [Conditional formatting](/workspace/sheets/api/samples/conditional-formatting)--- Recipes that show how to alter cell appearance based on conditions.\n- [Data operations](/workspace/sheets/api/samples/data)---Recipes that show how to create, move, and manipulate data in a spreadsheet.\n- [Named \\& protected\n ranges](/workspace/sheets/api/samples/ranges)---Recipes that show how to create, update, and remove named and protected ranges in a spreadsheet.\n- [Pivot tables](/workspace/sheets/api/samples/pivot-tables)---Recipes that show how to create pivot tables in a sheet.\n- [Row \\& column\n operations](/workspace/sheets/api/samples/rowcolumn)---Recipes that show how to add, remove, and move rows and columns, and update their properties.\n- [Sheet operations](/workspace/sheets/api/samples/sheet)---Recipes that show how to create, clear, copy, and delete sheets, and also control their properties."]]