Typed Google Search Console searchanalytics.query client (read-only)
| Tier | infrastructure |
| Role | unclassified (baselined) |
| Path | crates/infrastructure/search-console |
| Edition | 2021 |
| Targets | infrastructure_search_console, search_console |
| Public items | 0 across 0 modules |
| Tests | 5 |
What it is for
Typed Google Search Console client.
A read-only client for the searchanalytics.query endpoint — the caller supplies a property, a date range, and dimensions and gets typed rows back (clicks, impressions, CTR, average position). Authentication is delegated to infrastructure_google_auth; the scope is fixed to webmasters.readonly (least privilege — no write operations).
# Example
use infrastructure_search_console::{Client, Dimension, QueryRequest, ServiceAccountKey};
use chrono::NaiveDate;
let key = ServiceAccountKey::from_file("/path/to/service-account.json")?;
let mut sc = Client::new(key);
let req = QueryRequest::new(
"sc-domain:example.com",
NaiveDate::from_ymd_opt(2026, 5, 14).unwrap_or_default(),
NaiveDate::from_ymd_opt(2026, 5, 20).unwrap_or_default(),
)
.dimensions(&Dimension::Date, Dimension::Query);
let rows = sc.query(&req).await?;
# Ok::<(), infrastructure_search_console::SearchConsoleError>(())
Capabilities
No public items.
How to use it
From this crate's own rustdoc:
use infrastructure_search_console::{Client, Dimension, QueryRequest, ServiceAccountKey};
use chrono::NaiveDate;
let key = ServiceAccountKey::from_file("/path/to/service-account.json")?;
let mut sc = Client::new(key);
let req = QueryRequest::new(
"sc-domain:example.com",
NaiveDate::from_ymd_opt(2026, 5, 14).unwrap_or_default(),
NaiveDate::from_ymd_opt(2026, 5, 20).unwrap_or_default(),
)
.dimensions(&[Dimension::Date, Dimension::Query]);
let rows = sc.query(&req).await?;
# Ok::<(), infrastructure_search_console::SearchConsoleError>(())
Module structure
No public modules: the crate root is its whole surface.
Public surface
No public items.
Re-exports. Exported here, defined elsewhere.
| Export | Defined in |
|---|---|
SearchConsoleError | error::SearchConsoleError |
{Client,SCOPE} | client::{Client,SCOPE} |
{Dimension,QueryRequest,QueryRow,MAX_ROW_LIMIT} | models::{Dimension,QueryRequest,QueryRow,MAX_ROW_LIMIT} |
{GoogleAuthError,OAuthCredentials,ServiceAccountKey} | infrastructure_google_auth::{GoogleAuthError,OAuthCredentials,ServiceAccountKey} |
Boundary
Depends on no other workspace tier.
Shares tier infrastructure with 82 other crates: infrastructure-acquire, infrastructure-adapters-google-calendar, infrastructure-adapters-google-gmail, infrastructure-adapters-google-places, infrastructure-adapters-google-trends, infrastructure-adapters-shodan, infrastructure-adapters-yelp, infrastructure-agent, … (82 total).
_What this crate deliberately does NOT own is a judgment. No committed registry records one for it, so none is stated here._
Where it sits
| Tier (ontology) | infrastructure |
| Architectural role (taxonomy) | unclassified (baselined) |
| Location | crates/infrastructure/search-console |
| Vocabulary in force (lexicon) | current |
Dependencies
Runtime, in this workspace.
| Crate | Tier | Optional | Only on |
|---|---|---|---|
| `infrastructure-google-auth` | infrastructure | no | always |
Runtime, from outside the workspace.
| Crate | Requirement | Features | Optional | Only on |
|---|---|---|---|---|
chrono | ^0.4 | serde | no | always |
reqwest | ^0.12 | json, rustls-tls | no | always |
serde | ^1 | derive | no | always |
serde_json | ^1 | — | no | always |
thiserror | ^2 | — | no | always |
tracing | ^0.1 | — | no | always |
Development, from outside the workspace.
| Crate | Requirement | Features | Optional | Only on |
|---|---|---|---|---|
tokio | ^1 | full | no | always |
wiremock | ^0.6 | — | no | always |
Build. None.
Depended on by. 1 workspace crate.
Signal flow — what reaches this crate, and what it reaches.
flowchart LR n_application_search_console["application-search-console"] -->|uses| SELF SELF["infrastructure-search-console"] SELF -->|runtime| n_infrastructure_google_auth["infrastructure-google-auth"] classDef self fill:#1f883d,stroke:#1f883d,color:#fff; class SELF self;
Feature flags
No Cargo features are defined: every capability is unconditional, so no consumer can receive a half-wired crate.
Targets
| Kind | Name | Source |
|---|---|---|
| lib | infrastructure_search_console | `src/lib.rs` |
| test | search_console | `tests/search_console.rs` |
Error model
No public error type was detected: no public item declares a type named *Error, and no public signature returns one.
Operational characteristics
| Property | Evidence |
|---|---|
| async public surface | none detected |
| async runtime | none detected |
| database access | none detected |
| network I/O | yes |
| unsafe code | none detected |
| environment variables | none detected |
No unsafe block, unsafe fn, unsafe impl or unsafe trait was found by the parser anywhere in this crate's source.
Configuration
No environment variable is read with a literal name anywhere in this crate. A variable whose key is computed at run time cannot be listed here, and is not claimed to be absent.
Related capabilities
1 workspace crate depends on this one: application-search-console.
Verification
| Kind | Count |
|---|---|
| Unit tests | 0 |
| Integration tests | 5 |
| Examples | 0 |
| Doctests | 1 |
What the tests establish, by name:
dimension_api_strings_match_google—tests/search_console.rsquery_handles_an_empty_response—tests/search_console.rsquery_request_builder_defaults_and_setters—tests/search_console.rsquery_returns_typed_rows_and_encodes_the_property—tests/search_console.rsquery_surfaces_api_errors—tests/search_console.rs
Documentation coverage
| Measure | Documented | Total |
|---|---|---|
| Public items with rustdoc | 0 | 0 |
Public modules with a //! block | 0 | 0 |
Metrics
| Metric | Value |
|---|---|
| Rust source files | 4 |
| Source lines | 380 |
| Code lines | 207 |
| Public API items | 0 |
| Public modules | 0 |
| Tests | 5 |
| Examples | 0 |
| Cargo features | 0 |
| Direct runtime dependencies | 7 |
| Workspace reverse dependencies | 1 |
pie showData
title Rust source composition
"Code" : 207
"Blank or comment" : 173
Generation
Rendered by tools-corpus corpus readme from repository evidence alone, renderer schema 2, lexicon current. No model, network service or database was consulted. Regenerate with tools-corpus corpus readme --write; verify with --check.