# Google Search Console on boxd

> Google Search Console provides tools to monitor, maintain, and troubleshoot your site's presence in Google Search results.

- Page: https://boxd.sh/integrations/google-search-console/
- CLI: `run google-search-console` (9 commands, 2 marked common)
- SDK: `import { googleSearchConsole } from "@boxd/run"`; every parameter and response type is at `@boxd/run/google-search-console`
- Triggers: none
- Connect: `run auth google-search-console` (Sign in with Google Search Console), or https://app.boxd.sh/integrations/detail/google_search_console
- All integrations: https://boxd.sh/integrations/ (Markdown: https://boxd.sh/integrations/index.md)

## From the shell

```sh
run auth google-search-console      # once: prints a link to connect your account
run google-search-console           # list its commands
run google-search-console get-site --help
```

Parameters are flags (`--flag value`); object and array parameters take a JSON string. Output is YAML, or JSON with `--json`. Calls use your own connection; `--scope <name>` uses a connection shared with your team.

## From a script

```ts
import { every, googleSearchConsole } from "@boxd/run";

every("1 hour", async () => {
  const result = await googleSearchConsole.getSite({ site_url: "…" });
  console.log(result);
});
```

Run it with `run google-search-console.run.ts`. Google Search Console has no triggers; `every()` polls on a schedule, keeps the script running as a job, and wakes the machine when it is due.

## Commands

Required flags are listed; `run google-search-console <command> --help` lists the optional ones. "common" marks what `run google-search-console` shows without `--all`.

| Command | SDK method | Required flags | Optional | Description |
|---|---|---|---|---|
| `add-site` ·common | `googleSearchConsole.addSite()` | `--site-url` | 0 | Adds a site to the set of the user's sites in Google Search Console |
| `delete-site` | `googleSearchConsole.deleteSite()` | `--site-url` | 0 | Removes a site from the user's Google Search Console sites |
| `get-site` ·common | `googleSearchConsole.getSite()` | `--site-url` | 0 | Retrieves information about a specific Search Console site |
| `get-sitemap` | `googleSearchConsole.getSitemap()` | `--feedpath` `--site-url` | 0 | Retrieves sitemap metadata (submitted/indexed counts, errors, warnings, last-submission timestamps) for a specific sitemap in Search Console |
| `inspect-url` | `googleSearchConsole.inspectUrl()` | `--inspection-url` `--site-url` | 1 | Inspects a URL for indexing issues and status in Google Search Console |
| `list-sitemaps` | `googleSearchConsole.listSitemaps()` | `--site-url` | 1 | Lists all sitemaps for a site in Google Search Console |
| `list-sites` | `googleSearchConsole.listSites()` | — | 0 | Lists all verified sites (properties) owned by the authenticated user in Google Search Console |
| `search-analytics-query` | `googleSearchConsole.searchAnalyticsQuery()` | `--end-date` `--site-url` `--start-date` | 7 | Queries Google Search Console for search analytics data including clicks, impressions, CTR, and position metrics |
| `submit-sitemap` | `googleSearchConsole.submitSitemap()` | `--feedpath` `--site-url` | 0 | Submits a sitemap to Google Search Console for indexing |

## Docs

- [run CLI](https://docs.boxd.sh/cli/run): Call connected integrations from the shell, connect new ones, and run automations.
- [Quickstart](https://docs.boxd.sh/guides/integrations/quickstart): Connect an integration, call it from the shell, and turn a script into an automation.
- [Connections](https://docs.boxd.sh/guides/integrations/connections): Connect an account once, for yourself or for your whole organization.
- [Scripts](https://docs.boxd.sh/guides/automations/scripts): Typed integrations, triggers, schedules and state in a .run.ts file.
- [Jobs](https://docs.boxd.sh/guides/automations/jobs): How a script becomes a background job: states, retries, sleep and wake.
- [Beyond the catalog](https://docs.boxd.sh/guides/automations/beyond-the-catalog): Reach your own APIs, databases and cloud accounts from a script.
