GSC Insights

Pages

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

get/gsc/pages

Request

  • Base URL
    https://api.ahrefs.com/v3
  • URL
    https://api.ahrefs.com/v3/gsc/pages
  • Auth
    HTTP bearer

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.

search_type'web' | 'image' | 'video' | 'news'

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

country'ad' | 'ae' | 'af' | 'ag' | 'ai' | 'al' | 'am' | 'ao' | 'ar' | 'as' | 'at' | 'au' | 'aw' | 'az' | 'ba' | 'bb' | 'bd' | 'be' | 'bf' | 'bg' | 'bh' | 'bi' | 'bj' | 'bn' | 'bo' | 'br' | 'bs' | 'bt' | 'bw' | 'by' | 'bz' | 'ca' | 'cd' | 'cf' | 'cg' | 'ch' | 'ci' | 'ck' | 'cl' | 'cm' | 'cn' | 'co' | 'cr' | 'cu' | 'cv' | 'cy' | 'cz' | 'de' | 'dj' | 'dk' | 'dm' | 'do' | 'dz' | 'ec' | 'ee' | 'eg' | 'es' | 'et' | 'fi' | 'fj' | 'fm' | 'fo' | 'fr' | 'ga' | 'gb' | 'gd' | 'ge' | 'gf' | 'gg' | 'gh' | 'gi' | 'gl' | 'gm' | 'gn' | 'gp' | 'gq' | 'gr' | 'gt' | 'gu' | 'gy' | 'hk' | 'hn' | 'hr' | 'ht' | 'hu' | 'id' | 'ie' | 'il' | 'im' | 'in' | 'iq' | 'is' | 'it' | 'je' | 'jm' | 'jo' | 'jp' | 'ke' | 'kg' | 'kh' | 'ki' | 'kn' | 'kr' | 'kw' | 'ky' | 'kz' | 'la' | 'lb' | 'lc' | 'li' | 'lk' | 'ls' | 'lt' | 'lu' | 'lv' | 'ly' | 'ma' | 'mc' | 'md' | 'me' | 'mg' | 'mk' | 'ml' | 'mm' | 'mn' | 'mq' | 'mr' | 'ms' | 'mt' | 'mu' | 'mv' | 'mw' | 'mx' | 'my' | 'mz' | 'na' | 'nc' | 'ne' | 'ng' | 'ni' | 'nl' | 'no' | 'np' | 'nr' | 'nu' | 'nz' | 'om' | 'pa' | 'pe' | 'pf' | 'pg' | 'ph' | 'pk' | 'pl' | 'pn' | 'pr' | 'ps' | 'pt' | 'py' | 'qa' | 're' | 'ro' | 'rs' | 'ru' | 'rw' | 'sa' | 'sb' | 'sc' | 'se' | 'sg' | 'sh' | 'si' | 'sk' | 'sl' | 'sm' | 'sn' | 'so' | 'sr' | 'st' | 'sv' | 'td' | 'tg' | 'th' | 'tj' | 'tk' | 'tl' | 'tm' | 'tn' | 'to' | 'tr' | 'tt' | 'tw' | 'tz' | 'ua' | 'ug' | 'us' | 'uy' | 'uz' | 'vc' | 've' | 'vg' | 'vi' | 'vn' | 'vu' | 'ws' | 'ye' | 'yt' | 'za' | 'zm' | 'zw'

A two-letter country code (ISO 3166-1 alpha-2).

device'desktop' | 'mobile' | 'tablet'

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

limitinteger

The number of results to return.

wherestring

Supported fields:

url
type: url

clicks
type: integer

impressions
type: integer

ctr
type: float

position
type: float

Filter is a JSON string that represents a boolean expression, it should follow the following structure:

<bool_filter> ::= { "and" : <bool_filter>+ }
              |   { "or" : <bool_filter>+ }
              |   { "not" : <bool_filter> }
              |   <expr>

<expr> ::= {
             "field" : <dimension|metric>,
             ? "is": <condition>,
           }

<condition> ::= [ "eq", <value> ]
            |   [ "neq", <value> ]
            |   [ "gt", <value> ]
            |   [ "gte", <value> ]
            |   [ "lt", <value> ]
            |   [ "lte", <value> ]
            |   [ "substring", <value> ]
            |   [ "isubstring", <value> ]
            |   [ "phrase_match", <value> ]
            |   [ "iphrase_match", <value> ]
            |   [ "prefix", <value> ]
            |   [ "suffix", <value> ]
output'json' | 'csv' | 'xml' | 'php'

The output format.

Response

OK

Changes

No recorded changes to this operation across all 26 revisions of this API.