Sheets Data API에서 JSON 피드를 가져오는 간단한 예시
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
경고: 이 페이지는 Google의 이전 API인 Google Data API에 관한 것으로, Google Data API 디렉터리에 표시된 API 중 상당수가 최신 API로 대체된 API입니다. 특정 새 API에 대한 자세한 내용은 새 API 문서를 참조하세요. 최신 API를 사용하여 요청을 승인하는 방법은 Google 계정 인증 및 승인을 참고하세요.
소개
이 샘플은 Sheets Data API에서 제공하는 JSON 출력 형식을 사용하여 스프레드시트에서 특정 워크시트의 목록 또는 셀 피드를 표시하는 방법을 보여줍니다. 이를 통해 스프레드시트의 공개 목록 또는 셀 피드를 쿼리하고 결과 항목을 JSON 객체로 반환할 수 있습니다. 새 JSON 피드를 사용하려면 src
값이 다음과 같은 스크립트 요소를 만듭니다.
http://spreadsheets.google.com/feeds/feed/key/worksheet/public/basic?alt=json-in-script&callback=myFunc
여기서 feed
은 피드 유형, key
는 검색하려는 스프레드시트의 키, worksheet
는 워크시트의 위치 또는 고유 식별자, myFunc
는 JSON 객체를 전달하는 콜백 함수의 이름입니다. Google Data API의 JSON 출력 지원에 관한 자세한 내용은 JSON 출력 지원 문서를 참고하세요.
참고: 인증 없이 피드를 가져오는 기능은 게시된 스프레드시트에만 지원됩니다.
참고: JSON 출력 지원과 함께 다른 피드 유형과 공개 상태 및 프로젝션 값을 사용할 수 있습니다. 다른 피드 유형 및 공개 상태 및 프로젝션 값에 대한 자세한 내용은 Sheets Data API 문서를 참고하세요.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2023-03-01(UTC)
[null,null,["최종 업데이트: 2023-03-01(UTC)"],[],[],null,["# Simple example of retrieving JSON feeds from Spreadsheets Data API\n\n**Warning** : This page is about Google's older APIs, the Google Data APIs; it's relevant only to the APIs that are listed in the [Google Data APIs directory](/gdata/docs/directory), many of which have been replaced with newer APIs. For information about a specific new API, see the new API's documentation. For information about authorizing requests with a newer API, see [Google Accounts Authentication and Authorization](/accounts).\n| Version v4 of the [Google Sheets API](/sheets) is now available! This [migration guide](/sheets/guides/migration) shows how to update applications to use v4.\n\n### Introduction\n\nThis sample demonstrates displaying a list or cells feed for a particular worksheet in a spreadsheet using the JSON output format provided by the Spreadsheets Data API. This allows you to query a spreadsheet's public list or cell feed and get the resulting entries returned as JSON objects. To use the new JSON feed, create a script element whose `src` value is\n\u003e `http://spreadsheets.google.com/feeds/`**feed** `/`**key** `/`**worksheet** `/public/basic?alt=json-in-script&callback=`**myFunc**\n\nwhere **`feed`** is the type of feed, **`key`** is the key of the spreadsheet you want to retrieve, the **`worksheet`** is the positional or unique identifier of the worksheet, and **`myFunc`** is the name of your callback function that is passed the JSON object. For more information on JSON output support for Google Data APIs please see our [JSON output support documentation](/gdata/json).\n\n**Note:** Retrieving a feed without authentication is only supported for published spreadsheets.\n\n**Note:** Other feed types and visibility and projection values may be used with JSON output support. For more information on other feed types, and visibility and projection values please see the [Spreadsheets Data API](/google-apps/spreadsheets) documentation.\n\n### Demo\n\nSpreadsheet: http://spreadsheets.google.com/feeds/ list cells / / /public/values OK"]]