Docs
Search docs...⌘K

Metrics by country

API + MCP
GET/v3/gsc/metrics-by-country

Requests to this endpoint are free and do not consume any API units.

Query parameters

project_idinteger

Project ID. Required when portfolio_id is not provided.

portfolio_idinteger

Portfolio ID. When provided, aggregates data across all GSC-connected projects in the portfolio.

date_fromstring (date)Required

The start date of the historical period in YYYY-MM-DD format.

date_tostring (date)

The end date of the historical period in YYYY-MM-DD format.

history_groupingstring

The time interval used to group historical data.

Allowed values:dailyweeklymonthly
Default:monthly
search_typestring

The type of search results to return (web, image, video, news).

Allowed values:webimagevideonews
Default:web
devicestring

Filter by device type (DESKTOP, MOBILE, TABLET). If not specified, all devices are included.

Allowed values:desktopmobiletablet
wherestring

Supported fields:

outputstring

The output format.

Allowed values:jsoncsvxmlphp

Responses

metricsarray<object>
clicksinteger
countrystring