다음 spreadsheets.values.get 코드 샘플은 Sheet1!A1:D5 범위에서 값을 읽고 응답으로 반환하지만 렌더링 옵션을 사용하여 정보가 반환되는 방식을 관리합니다. FORMULA의 ValueRenderOption 설정은 계산된 값 대신 수식을 반환해야 함을 나타내고 SERIAL_NUMBER의 DateTimeRenderOption 설정은 날짜를 숫자로 반환해야 함을 나타냅니다.
다른 설정도 가능합니다. 빈 후행 행과 열은 생략됩니다.
요청 프로토콜이 여기에 표시됩니다.
GET https://sheets.googleapis.com/v4/spreadsheets/SPREADSHEET_ID/values/Sheet1!A1:D5?
valueRenderOption=FORMULA&dateTimeRenderOption=SERIAL_NUMBER
다음 spreadsheets.values.batchGet 코드 샘플은 Sheet1!B:B 및 Sheet1!D:D 범위에서 값을 읽고 응답으로 반환하는 방법을 보여줍니다. UNFORMATTED_VALUE의 ValueRenderOption 설정은 값이 계산되지만 응답에서 형식이 지정되지 않음을 나타냅니다. 비어 있는 후행 행과 열은 생략됩니다.
요청 프로토콜이 여기에 표시됩니다.
GET https://sheets.googleapis.com/v4/spreadsheets/SPREADSHEET_ID/values:batchGet?
ranges=Sheet1!B:B&ranges=Sheet1!D:D&valueRenderOption=UNFORMATTED_VALUE&majorDimension=COLUMNS
이 메서드 호출에 대한 응답은 스프레드시트 ID가 있는 객체와 요청된 순서대로 나열된 각 요청된 범위에 해당하는 ValueRange 객체의 배열로 구성됩니다. majorDimension 필드는 배열이 열별로 구성된 값 목록임을 나타냅니다. 예를 들면 다음과 같습니다.
다음 spreadsheets.values.batchGet 코드 샘플은 시트 Sheet1!A1:D5, Products!D1:D100, Sales!E4:F6의 범위에서 값을 읽고 응답으로 반환하는 방법을 보여줍니다. UNFORMATTED_VALUE의 ValueRenderOption 설정은 값이 계산되지만 응답에서 형식이 지정되지 않음을 나타냅니다. 비어 있는 후행 행과 열은 생략됩니다.
요청 프로토콜이 여기에 표시됩니다.
GET https://sheets.googleapis.com/v4/spreadsheets/SPREADSHEET_ID/values:batchGet?
ranges=Sheet1!A1:D5&ranges=Products!D1:D100&ranges=Sales!E4:F6&valueRenderOption=UNFORMATTED_VALUE&majorDimension=COLUMNS
이 메서드 호출에 대한 응답은 스프레드시트 ID가 있는 객체와 요청된 순서대로 나열된 각 요청된 범위에 해당하는 ValueRange 객체의 배열로 구성됩니다. majorDimension 필드는 배열이 열별로 구성된 값 목록임을 나타냅니다. 예를 들면 다음과 같습니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-08-29(UTC)"],[],[],null,["# Basic reading\n\nThe Google Sheets API allows you to read values from cells, ranges, sets of ranges,\nand entire sheets. The examples on this page illustrate some common read\noperations with the\n[`spreadsheets.values`](/workspace/sheets/api/reference/rest/v4/spreadsheets.values)\nresource. You can also read cell values using the\n[`spreadsheets.get`](/workspace/sheets/api/reference/rest/v4/spreadsheets/get) method, but\nusually\n[`spreadsheets.values.get`](/workspace/sheets/api/reference/rest/v4/spreadsheets.values/get)\nor\n[`spreadsheets.values.batchGet`](/workspace/sheets/api/reference/rest/v4/spreadsheets.values/batchGet)\nis easier.\n\nThese examples are presented in the form of HTTP requests to be language\nneutral. To learn how to implement reads in different languages using the Google\nAPI client libraries, see [Read \\& write cell\nvalues](/workspace/sheets/api/guides/values#read).\n\nIn these examples, the placeholder \u003cvar translate=\"no\"\u003eSPREADSHEET_ID\u003c/var\u003e indicates where you\nwould provide the [spreadsheet ID](/workspace/sheets/api/guides/concepts#spreadsheet),\nwhich can be discovered from the spreadsheet URL. The ranges to read from are\nspecified using [A1 notation](/workspace/sheets/api/guides/concepts#cell) in the request\nURL. An example range is Sheet1!A1:D5.\n\nSource data\n-----------\n\nFor these examples, assume the spreadsheet being read has the following source\ndata in its first sheet (\"Sheet1\"). The strings in the first row are labels for\nthe individual columns. To view examples of how to read from other sheets in\nyour spreadsheet, see [A1 notation](/workspace/sheets/api/guides/concepts#cell).\n\n|---|--------|--------|---------|-----------|\n| | A | B | C | D |\n| 1 | Item | Cost | Stocked | Ship Date |\n| 2 | Wheel | $20.50 | 4 | 3/1/2016 |\n| 3 | Door | $15 | 2 | 3/15/2016 |\n| 4 | Engine | $100 | 1 | 3/20/2016 |\n| 5 | Totals | $135.5 | 7 | 3/20/2016 |\n\nRead a single range\n-------------------\n\nThe following\n[`spreadsheets.values.get`](/workspace/sheets/api/reference/rest/v4/spreadsheets.values/get)\ncode sample shows how to read the values from the range Sheet1!A1:D5 and returns\nthem in the response. Empty trailing rows and columns are omitted.\n\nThe request protocol is shown here. \n\n```\nGET https://sheets.googleapis.com/v4/spreadsheets/SPREADSHEET_ID/values/Sheet1!A1:D5\n```\n\nThe response consists of a\n[`ValueRange`](/workspace/sheets/api/reference/rest/v4/spreadsheets.values#resource:-valuerange)\nobject that describes the range values. The\n[`majorDimension`](/workspace/sheets/api/reference/rest/v4/spreadsheets.values) field\nindicates that the arrays are lists of values organized by rows. \n\n```text\n{\n \"range\": \"Sheet1!A1:D5\",\n \"majorDimension\": \"ROWS\",\n \"values\": [\n [\"Item\", \"Cost\", \"Stocked\", \"Ship Date\"],\n [\"Wheel\", \"$20.50\", \"4\", \"3/1/2016\"],\n [\"Door\", \"$15\", \"2\", \"3/15/2016\"],\n [\"Engine\", \"$100\", \"1\", \"30/20/2016\"],\n [\"Totals\", \"$135.5\", \"7\", \"3/20/2016\"]\n ],\n}\n```\n\nRead a single range grouped by column\n-------------------------------------\n\nThe following\n[`spreadsheets.values.get`](/workspace/sheets/api/reference/rest/v4/spreadsheets.values/get)\ncode sample shows how to read the values from the range Sheet1!A1:D3 and returns\nthem in the response, but grouped by column. Empty trailing rows and columns are\nomitted.\n\nThe request protocol is shown here. \n\n```\nGET https://sheets.googleapis.com/v4/spreadsheets/SPREADSHEET_ID/values/Sheet1!A1:D3?majorDimension=COLUMNS\n```\n\nThe response consists of a\n[`ValueRange`](/workspace/sheets/api/reference/rest/v4/spreadsheets.values#resource:-valuerange)\nobject that describes the range values. The\n[`majorDimension`](/workspace/sheets/api/reference/rest/v4/spreadsheets.values) field\nindicates that the arrays are lists of values organized by columns. \n\n```text\n{\n \"range\": \"Sheet1!A1:D3\",\n \"majorDimension\": \"COLUMNS\",\n \"values\": [\n [\"Item\", \"Wheel\", \"Door\"],\n [\"Cost\", \"$20.50\", \"$15\"],\n [\"Stocked\", \"4\", \"2\"],\n [\"Ship Date\", \"3/1/2016\", \"3/15/2016\"]\n ],\n}\n```\n\nRead a single range with rendering options\n------------------------------------------\n\nThe following\n[`spreadsheets.values.get`](/workspace/sheets/api/reference/rest/v4/spreadsheets.values/get)\ncode sample shows how to read the values from the range Sheet1!A1:D5 and returns\nthem in the response, but uses rendering options to manage how that information\nis returned. The\n[`ValueRenderOption`](/workspace/sheets/api/reference/rest/v4/ValueRenderOption) setting\nof `FORMULA` indicates that formulas are to be returned instead of the\ncalculated value, and the\n[`DateTimeRenderOption`](/workspace/sheets/api/reference/rest/v4/DateTimeRenderOption)\nsetting of `SERIAL_NUMBER` indicates that dates are to be returned as numbers.\nOther settings are possible as well. Empty trailing rows and columns are\nomitted.\n\nThe request protocol is shown here. \n\n```\nGET https://sheets.googleapis.com/v4/spreadsheets/SPREADSHEET_ID/values/Sheet1!A1:D5?\n valueRenderOption=FORMULA&dateTimeRenderOption=SERIAL_NUMBER\n```\n\nThe response consists of a\n[`ValueRange`](/workspace/sheets/api/reference/rest/v4/spreadsheets.values#resource:-valuerange)\nobject that describes the range values. The\n[`majorDimension`](/workspace/sheets/api/reference/rest/v4/spreadsheets.values) field\nindicates that the arrays are lists of values organized by rows. \n\n```text\n{\n \"range\": \"Sheet1!A1:D5\",\n \"majorDimension\": \"ROWS\",\n \"values\": [\n [\"Item\", \"Cost\", \"Stocked\", \"Ship Date\"],\n [\"Wheel\", \"$20.50\", \"4\", \"42430\"],\n [\"Door\", \"$15\", \"2\", \"42444\"],\n [\"Engine\", \"$100\", \"1\", \"42449\"],\n [\"Totals\", \"=SUM(B2:B4)\", \"=SUM(C2:C4)\", \"=MAX(D2:D4)\"]\n ],\n}\n```\n\nRead multiple ranges\n--------------------\n\nThe following\n[`spreadsheets.values.batchGet`](/workspace/sheets/api/reference/rest/v4/spreadsheets.values/batchGet)\ncode sample shows how to read values from ranges Sheet1!B:B and Sheet1!D:D and\nreturns them in the response. The\n[`ValueRenderOption`](/workspace/sheets/api/reference/rest/v4/ValueRenderOption) setting\nof `UNFORMATTED_VALUE` indicates that values are calculated, but not formatted\nin the response. Empty trailing rows and columns are omitted.\n\nThe request protocol is shown here. \n\n```\nGET https://sheets.googleapis.com/v4/spreadsheets/SPREADSHEET_ID/values:batchGet?\n ranges=Sheet1!B:B&ranges=Sheet1!D:D&valueRenderOption=UNFORMATTED_VALUE&majorDimension=COLUMNS\n```\n\nThe response to this method call consists of an object with the spreadsheet ID\nand an array of\n[`ValueRange`](/workspace/sheets/api/reference/rest/v4/spreadsheets.values#resource:-valuerange)\nobjects corresponding to each requested range, listed in the order they were\nrequested. The\n[`majorDimension`](/workspace/sheets/api/reference/rest/v4/spreadsheets.values) field\nindicates that the arrays are lists of values organized by columns. For example: \n\n```scdoc\n{\n \"spreadsheetId\": SPREADSHEET_ID,\n \"valueRanges\": [\n {\n \"range\": \"Sheet1!B1:B1000\",\n \"majorDimension\": \"COLUMNS\",\n \"values\": [\n [\"Cost\",20.5,15,100,135.5]\n ]\n },\n {\n \"range\": \"Sheet1!D1:D1000\",\n \"majorDimension\": \"COLUMNS\",\n \"values\": [\n [\"Ship Date\",42430,42444,42449,42449]\n ]s\n }\n ]\n}\n```\n\nRead multiple ranges across multiple sheets\n-------------------------------------------\n\nThe following\n[`spreadsheets.values.batchGet`](/workspace/sheets/api/reference/rest/v4/spreadsheets.values/batchGet)\ncode sample shows how to read values from ranges in sheets Sheet1!A1:D5,\nProducts!D1:D100, and Sales!E4:F6 and returns them in the response. The\n[`ValueRenderOption`](/workspace/sheets/api/reference/rest/v4/ValueRenderOption) setting\nof `UNFORMATTED_VALUE` indicates that values are calculated, but not formatted\nin the response. Empty trailing rows and columns are omitted.\n\nThe request protocol is shown here. \n\n```\nGET https://sheets.googleapis.com/v4/spreadsheets/SPREADSHEET_ID/values:batchGet?\n ranges=Sheet1!A1:D5&ranges=Products!D1:D100&ranges=Sales!E4:F6&valueRenderOption=UNFORMATTED_VALUE&majorDimension=COLUMNS\n```\n\nThe response to this method call consists of an object with the spreadsheet ID\nand an array of\n[`ValueRange`](/workspace/sheets/api/reference/rest/v4/spreadsheets.values#resource:-valuerange)\nobjects corresponding to each requested range, listed in the order they were\nrequested. The\n[`majorDimension`](/workspace/sheets/api/reference/rest/v4/spreadsheets.values) field\nindicates that the arrays are lists of values organized by columns. For example: \n\n```scdoc\n{\n \"spreadsheetId\": SPREADSHEET_ID,\n \"valueRanges\": [\n {\n \"range\": \"Sheet1!A1:D5\",\n \"majorDimension\": \"COLUMNS\",\n \"values\": [\n [...],\n [...]\n ]\n },\n {\n \"range\": \"Products!D1:D100\",\n \"majorDimension\": \"COLUMNS\",\n \"values\": [\n [...]\n ]\n },\n {\n \"range\": \"Sales!E4:F6\",\n \"majorDimension\": \"COLUMNS\",\n \"values\": [\n [...],\n [...]\n ]\n }\n ]\n}\n```"]]