기본 요건
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
이 문서에서는 첫 번째 클라이언트 애플리케이션을 작성하기 전에 수행해야 하는 작업을 설명합니다.
Google 계정 만들기
이 API를 사용하려면 Google 계정이 필요합니다.
특정 속성에 대해 해당 메서드를 호출하려면 해당 속성에 대한 적절한 Search Console 권한이 계정에 있어야 합니다. 예를 들어 searchAnalytics.query를 실행하려면 해당 속성에 대한 읽기 권한이 필요합니다.
Google Search Console 사용해 보기
이 API 문서에서는 사용자가 Google Search Console을 사용해 본 경험이 있고 웹 프로그래밍 개념 및 웹 데이터 형식에 익숙하다고 가정합니다.
Google Search Console을 사용해 본 적이 없다면 코딩을 시작하기 전에 사용자 인터페이스를 사용해 보세요.
각 API는 Search Console 보고서의 기능을 나타냅니다. 수신되는 데이터를 이해하려면 API를 사용하기 전에
동등한 보고서의 문서를 참조해야 합니다.
클라이언트의 프로젝트 및 사용자 인증 정보 만들기
Google Search Console에 요청을 보내려면 먼저 Google에 클라이언트에 관해 알리고 API에 대한 액세스를 활성화해야 합니다. Google API 콘솔을 사용하여 설정과 API 액세스 정보를 모아 이름을 붙인 프로젝트를 만들고 애플리케이션을 등록하면 됩니다.
Testing Tools API를 제외한 모든 Search Console API에는 OAuth2 사용자 인증 정보가 필요합니다.
Python 및 Java 빠른 시작 가이드에서는 프로젝트를 만들고 클라이언트의 사용자 인증 정보를 얻는 방법을 자세히 설명합니다.
REST 기본사항 이해
API를 호출하는 방법에는 2가지가 있습니다.
클라이언트 라이브러리를 사용하지 않으려는 경우에는 REST의 기본사항을 이해해야 합니다.
REST 기본사항
REST는 데이터 요청 및 수정에 대한 간편하고 일관성 있는 접근 방식을 제공하는 소프트웨어 아키텍처 스타일입니다.
REST는 'Representational State Transfer'의 줄임말로, Google API의 맥락에서 REST는 HTTP 동사를 사용하여 Google이 저장한 데이터 표현을 검색 및 수정하는 방법을 의미합니다.
RESTful 시스템에서는 리소스가 데이터 스토어에 저장되고, 클라이언트는 서버에서 특정 작업(리소스 생성, 검색, 업데이트, 삭제 등)을 수행하라는 요청을 전송하며, 서버는 작업을 수행하고 응답을 전송합니다. 이 응답은 지정된 리소스 표현의 형식을 취하는 경우가 많습니다.
Google의 RESTful API에서 클라이언트는 POST
, GET
, PUT
또는 DELETE
같은 HTTP 동사를 사용하여 작업을 지정합니다. 리소스는 다음 형식의 전역적으로 고유한 URI로 지정됩니다.
https://www.googleapis.com/apiName/apiVersion/resourcePath?parameters
모든 API 리소스에는 HTTP에서 액세스할 수 있는 고유 URI가 있으므로 REST는 데이터 캐싱을 지원하며 웹의 분산형 인프라와의 연동성이 뛰어납니다.
HTTP 1.1 표준 문서의 메서드 정의를 확인하면 유용합니다. 문서에 GET
, POST
, PUT
, DELETE
의 사양이 포함되어 있습니다.
Google Search Console API의 REST
Google Search Console API 작업은 REST HTTP 동사에 직접 매핑됩니다.
대부분의 Google Search Console API URI 형식은 다음과 같습니다.
VERB https://www.googleapis.com/webmasters/v3/resourcePath?parameters
각 메서드에 사용되는 URI와 동사의 전체 집합은 Google Search Console API 참조 개요에서 확인할 수 있습니다.
JSON 기본사항 이해
Google Search Console API는 JSON 형식으로 데이터를 반환합니다.
JSON(JavaScript Object Notation)은 특정 언어에 의존하지 않는 일반적인 데이터 형식으로, 임의의 데이터 구조를 간단한 텍스트로 표현할 수 있습니다. 자세한 내용은 json.org를 참조하세요.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2024-07-23(UTC)
[null,null,["최종 업데이트: 2024-07-23(UTC)"],[[["\u003cp\u003eBefore using the Google Search Console API, you must have a Google Account with the necessary Search Console permissions.\u003c/p\u003e\n"],["\u003cp\u003eFamiliarize yourself with the Google Search Console user interface and its reports to understand the data the API provides.\u003c/p\u003e\n"],["\u003cp\u003eCreate a project in the Google API Console and obtain OAuth2 credentials to enable your client application's access to the API.\u003c/p\u003e\n"],["\u003cp\u003eUnderstand REST principles, particularly HTTP verbs and resource URIs, to interact with the API directly or choose to use client libraries.\u003c/p\u003e\n"],["\u003cp\u003eThe Google Search Console API uses JSON for data exchange, so understanding this format is essential for processing API responses.\u003c/p\u003e\n"]]],["Before creating a client application, obtain a Google Account with Search Console permissions. Familiarize yourself with Google Search Console's user interface and relevant report documentation. Create a Google API Console project to register your application and get OAuth2 credentials. If not using client libraries, understand REST basics, including HTTP verbs (GET, POST, PUT, DELETE) and URIs. Finally, learn JSON, the data format used by the Google Search Console API.\n"],null,["# Prerequisites\n\nThis document describes the things you should do before\nwriting your first client application.\n\nGet a Google Account\n--------------------\n\nYou need a [Google Account](https://www.google.com/accounts/NewAccount) to use this API.\nYour account must have the appropriate Search Console permission on a given property in order to\ncall that method on that property. For example, in order to run [searchAnalytics.query](/webmaster-tools/v1/searchanalytics/query)\nyou need read permissions on that property.\n\nTry out Google Search Console\n-----------------------------\n\nThis API documentation assumes that you've used [Google Search Console](https://search.google.com/search-console/), and that you're familiar with web programming concepts and web data formats.\n\nIf you haven't used Google Search Console, then try out the [user interface](https://search.google.com/search-console/) before starting to code.\nEach API represents the functionality of a report in Search Console. You should [read the documentation for the equivalent report](https://support.google.com/webmasters/topic/9456557) before using an API in order to understand the data you receive.\n\nCreate a project and credentials for your client\n------------------------------------------------\n\nBefore you can send requests to Google Search Console, you need to tell Google about your client and\nactivate access to the API. You do this by using the Google API Console to create a project,\nwhich is a named collection of settings and API access information, and register your application.\n\n\nAll Search Console APIs except the Testing Tools API require OAuth2 credentials.\nThe Python and Java quickstart guides provide details on how to create a project and get credentials for your client.\n\nUnderstand REST basics\n----------------------\n\nThere are two ways to invoke the API:\n\n- Sending HTTP requests and parsing the responses.\n- Using [client libraries](./libraries).\n\nIf you decide not to use client libraries, you'll need to understand the basics of REST.\n\n#### REST basics\n\nREST is a style of software architecture that provides a convenient and consistent approach to requesting and modifying data.\n\nThe term REST is short for \"[Representational State Transfer](https://en.wikipedia.org/wiki/Representational_state_transfer).\" In the context of Google APIs, it refers to using HTTP verbs to retrieve and modify representations of data stored by Google.\n\nIn a RESTful system, resources are stored in a data store; a client sends a request that the server perform a particular action (such as creating, retrieving, updating, or deleting a resource), and the server performs the action and sends a response, often in the form of a representation of the specified resource.\n\nIn Google's RESTful APIs, the client specifies an action using an HTTP verb such as `POST`, `GET`, `PUT`, or `DELETE`. It specifies a resource by a globally-unique URI of the following form: \n\n```\nhttps://www.googleapis.com/apiName/apiVersion/resourcePath?parameters\n```\n\nBecause all API resources have unique HTTP-accessible URIs, REST enables data caching and is optimized to work with the web's distributed infrastructure.\n\nYou may find the [method definitions](https://tools.ietf.org/html/rfc7231#section-4.3) in the HTTP 1.1 standards documentation useful; they include specifications for `GET`, `POST`, `PUT`, and `DELETE`.\n\n### REST in the Google Search Console API\n\nThe Google Search Console API operations map directly to REST HTTP verbs.\n\nThe format for most Google Search Console API URIs are something like this: \n\n```\nVERB https://www.googleapis.com/webmasters/v3/resourcePath?parameters\n```\n\nThe full set of URIs and verbs used for each method are given in the [Google Search Console API Reference](/webmaster-tools/v1/api_reference_index) overview.\n\nUnderstand JSON basics\n----------------------\n\nThe Google Search Console API returns data in JSON format.\n\n\n[JSON](http://en.wikipedia.org/wiki/JSON) (JavaScript Object Notation) is a common, language-independent data format that provides a simple text representation of arbitrary data structures. For more information, see [json.org](http://www.json.org/).\n\n\u003cbr /\u003e"]]