Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to Google Search Console

Scalekit connector
Open markdown

The Google Search Console connector lets your AI agent act in each user's Google Search Console account. Each user signs in to Google Search Console once, and Scalekit stores and refreshes their tokens, so your agent never handles credentials. It comes with 10 tools.

Tools
10
What they doRead · write · destructive
6 · 2 · 26 read2 write2 destructive
Users sign in with
OAuth app
Your own Google app

Setup

  1. Install the SDK

    Terminal window
    npm install @scalekit-sdk/node dotenv
  2. Set your credentials

    Add your Scalekit credentials to your .env file. Find values in app.scalekit.com > Developers > API Credentials.

    .env
    SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
    SCALEKIT_CLIENT_ID=<your-client-id>
    SCALEKIT_CLIENT_SECRET=<your-client-secret>
  3. Create the Google Search Console connection

    In AgentKit > Connections, create a Google Search Console connection and copy its redirect URI. The name you give it is the connection_name your code passes. See Configure connections.

  4. Register a Google OAuth app

    Google Search Console connections use your own OAuth app. Register one with Google and add the redirect URI you copied.

    Then enter the app's Client ID and Client Secret on the Google Search Console connection.

    Console steps with screenshots

    Register your Scalekit environment with the Google Search Console connector so Scalekit handles the OAuth flow and token lifecycle for you. The connection name you create will be used to identify and invoke the connection programmatically. Then complete the configuration in your application as follows:

    1. Set up auth redirects

      • In Scalekit dashboard, go to AgentKit > Connections > Create Connection. Find Google Search Console and click Create. Click Use your own credentials and copy the redirect URI. It looks like https://<SCALEKIT_ENVIRONMENT_URL>/sso/v1/oauth/<CONNECTION_ID>/callback.

      • Navigate to Google Cloud Console → APIs & Services → Credentials.

        Google Cloud Console Credentials page listing API keys, OAuth 2.0 client IDs, and service accounts

      • Click + Create Credentials, then OAuth client ID.

        Create credentials menu showing API key, OAuth client ID, and Service account options

      • Choose Web application from the Application type menu and give the client a name, for example Agent Auth.

        Application type dropdown with Web application, Android, Chrome Extension, iOS, TVs, and Desktop app options

      • Under Authorized redirect URIs, click + Add URI, paste the redirect URI you copied from Scalekit, and click Create.

        Create OAuth client ID form with Web application type and Authorized redirect URIs section

    2. Enable the Google Search Console API

      • In Google Cloud Console, go to APIs & Services → Library. Search for “Google Search Console API” and click Enable.

        Google Search Console API product page showing the Enable button and API Enabled status

    3. Get client credentials

      • Open the OAuth client you created in step 1. Google shows the Client ID under Additional information, and lets you generate a Client secret from the same page.

        OAuth client detail page showing Client ID and Authorized redirect URIs

    4. Add credentials in Scalekit

      • In Scalekit dashboard, go to AgentKit > Connections and open the connection you created.
      • Copy the Connection name shown on that connection and use that exact value in your code as connection_name or connectionName.
      • Enter your credentials:
      • Click Save.
  5. Authorize a user and make your first call

    quickstart.mts
    import { ScalekitClient } from '@scalekit-sdk/node'
    import 'dotenv/config'
    import { createInterface } from 'node:readline/promises'
    const scalekit = new ScalekitClient(
    process.env.SCALEKIT_ENVIRONMENT_URL,
    process.env.SCALEKIT_CLIENT_ID,
    process.env.SCALEKIT_CLIENT_SECRET,
    )
    const actions = scalekit.actions
    const connector = 'googlesearchconsole'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize Google Search Console:', link)
    const rl = createInterface({ input: process.stdin, output: process.stdout })
    await rl.question('Press Enter after authorizing...')
    rl.close()
    // Make your first call
    const result = await actions.executeTool({
    connector,
    identifier,
    toolName: 'googlesearchconsole_list_sites',
    toolInput: {},
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user signs in once. See Authorize a user for the full flow and statuses.

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • googlesearchconsole_get_siteRetrieves the caller's permission level (SITE_OWNER, SITE_FULL_USER, SITE_RESTRICTED_USER, or SITE_UNVERIFIED_USER) for one specific Search Console property.Read-only

    Get Site

    Retrieves the caller's permission level (SITE_OWNER, SITE_FULL_USER, SITE_RESTRICTED_USER, or SITE_UNVERIFIED_USER) for one specific Search Console property. Requires the webmasters or webmasters.readonly scope. NOTE: this API requires siteUrl as a single percent-encoded path segment — Scalekit does not auto-encode path values, so you must pass siteUrl already percent-encoded (replace ':' with %3A and every '/' with %2F).

    Inputs

    siteUrlstringrequired
    Required. The percent-encoded URI of the property as defined in Search Console. Get the raw value from the List Sites tool, then percent-encode it: 'https://www.example.com/' becomes 'https%3A%2F%2Fwww.example.com%2F'; 'sc-domain:example.com' becomes 'sc-domain%3Aexample.com'.
  • googlesearchconsole_get_sitemapRetrieves information about one specific sitemap submitted for a site — its type, whether it is a sitemap index, processing status (pending/downloaded), and error/warning counts.Read-only

    Get Sitemap

    Retrieves information about one specific sitemap submitted for a site — its type, whether it is a sitemap index, processing status (pending/downloaded), and error/warning counts. Requires the webmasters or webmasters.readonly scope. NOTE: both siteUrl and feedpath must be single percent-encoded path segments — Scalekit does not auto-encode path values, so pass both already percent-encoded (replace ':' with %3A and every '/' with %2F).

    Inputs

    feedpathstringrequired
    Required. The percent-encoded URL of the sitemap, e.g. 'http://www.example.com/sitemap.xml' percent-encoded to 'http%3A%2F%2Fwww.example.com%2Fsitemap.xml'. Get the raw value from the List Sitemaps tool's `path` field, then percent-encode it the same way as siteUrl.
    siteUrlstringrequired
    Required. The percent-encoded URI of the property as defined in Search Console. Get the raw value from the List Sites tool, then percent-encode it: 'https://www.example.com/' becomes 'https%3A%2F%2Fwww.example.com%2F'; 'sc-domain:example.com' becomes 'sc-domain%3Aexample.com'.
  • googlesearchconsole_inspect_urlRuns a Google index inspection for a single URL and reports its Google Search index status — whether and when it was last crawled and indexed, the canonical URL Google selected, mobile-usability/rich-result summary info, and any indexing issues.Read-only

    Inspect URL

    Runs a Google index inspection for a single URL and reports its Google Search index status — whether and when it was last crawled and indexed, the canonical URL Google selected, mobile-usability/rich-result summary info, and any indexing issues. This is the API equivalent of the URL Inspection tool in the Search Console UI. The inspectionUrl must belong to the property identified by siteUrl. Requires the webmasters or webmasters.readonly scope.

    Inputs

    inspectionUrlstringrequired
    Required. The URL to inspect. Must be under the property specified in siteUrl.
    siteUrlstringrequired
    Required. The URL of the property as defined in Search Console that owns inspectionUrl. Examples: `https://www.example.com/` for a URL-prefix property, or `sc-domain:example.com` for a Domain property.
    languageCodestring
    Optional. An IETF BCP-47 language code for translated issue messages, e.g. "en-US" or "de-CH". Defaults to "en-US" if not specified.default en-US
  • googlesearchconsole_list_sitemapsLists the sitemap entries submitted for a site, or the entries included in a specific sitemap index file when sitemapIndex is provided.Read-only

    List Sitemaps

    Lists the sitemap entries submitted for a site, or the entries included in a specific sitemap index file when sitemapIndex is provided. Returns each sitemap's path, type, processing status, and error/warning counts. Requires the webmasters or webmasters.readonly scope. NOTE: siteUrl must be a single percent-encoded path segment — Scalekit does not auto-encode path values, so pass siteUrl already percent-encoded (replace ':' with %3A and every '/' with %2F). sitemapIndex, in contrast, is a query parameter and should be passed as a normal (non-encoded) URL — Scalekit encodes query values automatically.

    Inputs

    siteUrlstringrequired
    Required. The percent-encoded URI of the property as defined in Search Console. Get the raw value from the List Sites tool, then percent-encode it: 'https://www.example.com/' becomes 'https%3A%2F%2Fwww.example.com%2F'; 'sc-domain:example.com' becomes 'sc-domain%3Aexample.com'.
    sitemapIndexstring
    Optional. A URL of a site's sitemap index file, e.g. 'http://www.example.com/sitemapindex.xml'. When set, lists the sitemaps contained in that index instead of the site's top-level submitted sitemaps. Pass the plain (not percent-encoded) URL — this is a query parameter and is encoded automatically.
  • googlesearchconsole_list_sitesLists the user's Search Console sites (properties) along with the caller's permission level for each — SITE_OWNER, SITE_FULL_USER, SITE_RESTRICTED_USER, or SITE_UNVERIFIED_USER.Read-only

    List Sites

    Lists the user's Search Console sites (properties) along with the caller's permission level for each — SITE_OWNER, SITE_FULL_USER, SITE_RESTRICTED_USER, or SITE_UNVERIFIED_USER. Use this to discover the exact siteUrl values (e.g. `https://www.example.com/` or `sc-domain:example.com`) needed by every other tool in this connector. Requires the webmasters or webmasters.readonly scope.

    Inputs

    This tool takes no inputs.

  • googlesearchconsole_query_search_analyticsQueries Google Search performance data (clicks, impressions, CTR, position) for a site, filtered and grouped by the dimensions you define.Read-only

    Query Search Analytics

    Queries Google Search performance data (clicks, impressions, CTR, position) for a site, filtered and grouped by the dimensions you define. Returns zero or more rows grouped by the row keys you specify via `dimensions`. You must supply a date range (startDate/endDate) of one or more days. When `DATE` is one of the group-by dimensions, days without data are omitted from the results. Requires the webmasters or webmasters.readonly scope. NOTE: siteUrl must be a single percent-encoded path segment — Scalekit does not auto-encode path values, so pass siteUrl already percent-encoded (replace ':' with %3A and every '/' with %2F).

    Inputs

    endDatestringrequired
    Required. End date of the requested date range, in YYYY-MM-DD format, in PST time (UTC-8:00). Must be >= startDate. Inclusive.
    siteUrlstringrequired
    Required. The percent-encoded URI of the property as defined in Search Console. Get the raw value from the List Sites tool, then percent-encode it: 'https://www.example.com/' becomes 'https%3A%2F%2Fwww.example.com%2F'; 'sc-domain:example.com' becomes 'sc-domain%3Aexample.com'.
    startDatestringrequired
    Required. Start date of the requested date range, in YYYY-MM-DD format, in PST time (UTC-8:00). Must be <= endDate. Inclusive.
    aggregationTypestring
    Optional; default AUTO. How data is aggregated — AUTO, BY_PROPERTY, or BY_PAGE (BY_NEWS_SHOWCASE_PANEL for News Showcase reporting). If you filter or group by PAGE, you must use AUTO. An invalid combination returns an API error rather than silently changing your request.
    dataStatestring
    Optional. The data freshness to include — FINAL (final data only, the default behavior when omitted), ALL (final + partial/fresh data), or HOURLY_ALL (hourly partial + full data; required when dimensions includes HOUR).
    dimensionFilterGroupsarray
    Optional. Zero or more filter groups to apply to the dimension values, e.g. 'query contains "buy"'. You can filter by a dimension without grouping by it. All filter groups are AND'ed together; filters within a group follow the group's groupType.
    dimensionsarray
    Optional. Zero or more dimensions to group results by — DATE, QUERY, PAGE, COUNTRY, DEVICE, SEARCH_APPEARANCE, or HOUR (HOUR requires dataState=HOURLY_ALL and data is only available for the last 10 days). Results are grouped in the order supplied.
    rowLimitinteger
    Optional; default 1000. The maximum number of rows to return. Must be from 1 to 25000 (inclusive).default 1000
    startRowinteger
    Optional; default 0. Zero-based index of the first row to return, for paging through results beyond rowLimit.default 0
    typestring
    Optional; default WEB. The Search type to report on — WEB, IMAGE, VIDEO, NEWS, DISCOVER, or GOOGLE_NEWS.
  • googlesearchconsole_add_siteAdds a site (property) to the set of the authorized user's sites in Search Console.Write

    Add Site

    Adds a site (property) to the set of the authorized user's sites in Search Console. The site is added with the caller as owner if verification is already established, otherwise it is added as an unverified site pending verification. Requires the webmasters (full-access) scope. NOTE: this API requires siteUrl as a single percent-encoded path segment — Scalekit does not auto-encode path values, so you must pass siteUrl already percent-encoded (replace ':' with %3A and every '/' with %2F). Returns an empty response on success.

    • Idempotent

    Inputs

    siteUrlstringrequired
    Required. The percent-encoded URL of the site to add, e.g. 'https://www.example.com/' percent-encoded to 'https%3A%2F%2Fwww.example.com%2F', or 'sc-domain:example.com' percent-encoded to 'sc-domain%3Aexample.com'.
  • googlesearchconsole_submit_sitemapSubmits a sitemap for a site so Google will fetch and process it.Write

    Submit Sitemap

    Submits a sitemap for a site so Google will fetch and process it. Requires the webmasters (full-access) scope. NOTE: both siteUrl and feedpath must be single percent-encoded path segments — Scalekit does not auto-encode path values, so pass both already percent-encoded (replace ':' with %3A and every '/' with %2F). Returns an empty response on success.

    • Idempotent

    Inputs

    feedpathstringrequired
    Required. The percent-encoded URL of the sitemap to submit, e.g. 'http://www.example.com/sitemap.xml' percent-encoded to 'http%3A%2F%2Fwww.example.com%2Fsitemap.xml'.
    siteUrlstringrequired
    Required. The percent-encoded URI of the property as defined in Search Console. Get the raw value from the List Sites tool, then percent-encode it: 'https://www.example.com/' becomes 'https%3A%2F%2Fwww.example.com%2F'; 'sc-domain:example.com' becomes 'sc-domain%3Aexample.com'.