Prerequisites

This document describes the things you should do before writing your first client application.

Get a Google Account

You need a Google Account to use this API. Your account must have the appropriate Search Console permission on a given property in order to call that method on that property. For example, in order to run searchAnalytics.query you need read permissions on that property.

Try out Google Search Console

This API documentation assumes that you've used Google Search Console, and that you're familiar with web programming concepts and web data formats.

If you haven't used Google Search Console, then try out the user interface before starting to code. Each API represents the functionality of a report in Search Console. You should read the documentation for the equivalent report before using an API in order to understand the data you receive.

Create a project and credentials for your client

Before you can send requests to Google Search Console, you need to tell Google about your client and activate access to the API. You do this by using the Google API Console to create a project, which is a named collection of settings and API access information, and register your application.

All Search Console APIs except the Testing Tools API require OAuth2 credentials. The Python and Java quickstart guides provide details on how to create a project and get credentials for your client.

Understand REST basics

There are two ways to invoke the API:

If you decide not to use client libraries, you'll need to understand the basics of REST.

REST basics

REST is a style of software architecture that provides a convenient and consistent approach to requesting and modifying data.

The term REST is short for "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.

In 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.

In 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:

https://www.googleapis.com/apiName/apiVersion/resourcePath?parameters

Because all API resources have unique HTTP-accessible URIs, REST enables data caching and is optimized to work with the web's distributed infrastructure.

You may find the method definitions in the HTTP 1.1 standards documentation useful; they include specifications for GET, POST, PUT, and DELETE.

REST in the Google Search Console API

The Google Search Console API operations map directly to REST HTTP verbs.

The format for most Google Search Console API URIs are something like this:

VERB https://www.googleapis.com/webmasters/v3/resourcePath?parameters

The full set of URIs and verbs used for each method are given in the Google Search Console API Reference overview.

Understand JSON basics

The Google Search Console API returns data in JSON format.

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.