[{"data":1,"prerenderedAt":793},["ShallowReactive",2],{"cli-docs-navigation":3,"cli-docs-page:\u002Fgscdump-cli\u002Fguides\u002Fstart\u002Fchoose-access":129},[4],{"path":5,"title":6,"children":7,"stem":128,"page":16},"\u002Fgscdump-cli","gscdump CLI",[8,43],{"path":9,"title":10,"children":11,"stem":41,"page":42},"\u002Fgscdump-cli\u002Fapi","Api",[12,17,21,25,29,33,37],{"path":13,"title":14,"stem":15,"page":16},"\u002Fgscdump-cli\u002Fapi\u002Fcommands","Commands","api\u002F1.commands",true,{"path":18,"title":19,"stem":20,"page":16},"\u002Fgscdump-cli\u002Fapi\u002Fquery","Query","api\u002F2.query",{"path":22,"title":23,"stem":24,"page":16},"\u002Fgscdump-cli\u002Fapi\u002Fexport","Export","api\u002F3.export",{"path":26,"title":27,"stem":28,"page":16},"\u002Fgscdump-cli\u002Fapi\u002Fsync","Sync","api\u002F4.sync",{"path":30,"title":31,"stem":32,"page":16},"\u002Fgscdump-cli\u002Fapi\u002Fbing","Bing","api\u002F5.bing",{"path":34,"title":35,"stem":36,"page":16},"\u002Fgscdump-cli\u002Fapi\u002Fanalyzers","Analyzers","api\u002F6.analyzers",{"path":38,"title":39,"stem":40,"page":16},"\u002Fgscdump-cli\u002Fapi\u002Freports","Reports","api\u002F7.reports","gscdump-cli\u002Fapi",false,{"path":44,"title":45,"children":46,"stem":127,"page":42},"\u002Fgscdump-cli\u002Fguides","Guides",[47,64,77,110],{"path":48,"title":49,"children":50,"stem":63,"page":16},"\u002Fgscdump-cli\u002Fguides\u002Fstart","Start",[51,55,59],{"path":52,"title":53,"stem":54,"page":16},"\u002Fgscdump-cli\u002Fguides\u002Fstart\u002Ffirst-result","First result","guides\u002F1.start\u002F1.first-result",{"path":56,"title":57,"stem":58,"page":16},"\u002Fgscdump-cli\u002Fguides\u002Fstart\u002Fchoose-access","Choose access","guides\u002F1.start\u002F2.choose-access",{"path":60,"title":61,"stem":62,"page":16},"\u002Fgscdump-cli\u002Fguides\u002Fstart\u002Fconnect-an-agent","Connect an agent","guides\u002F1.start\u002F3.connect-an-agent","guides\u002F1.start\u002Findex",{"path":65,"title":66,"children":67,"stem":76,"page":16},"\u002Fgscdump-cli\u002Fguides\u002Fuse-data","Use data",[68,72],{"path":69,"title":70,"stem":71,"page":16},"\u002Fgscdump-cli\u002Fguides\u002Fuse-data\u002Fbuild-history","Build history","guides\u002F2.use-data\u002F1.build-history",{"path":73,"title":74,"stem":75,"page":16},"\u002Fgscdump-cli\u002Fguides\u002Fuse-data\u002Fquery-and-export","Query and export","guides\u002F2.use-data\u002F2.query-and-export","guides\u002F2.use-data\u002Findex",{"path":78,"title":79,"children":80,"stem":109,"page":16},"\u002Fgscdump-cli\u002Fguides\u002Finvestigate-traffic","Investigate traffic",[81,85,89,93,97,101,105],{"path":82,"title":83,"stem":84,"page":16},"\u002Fgscdump-cli\u002Fguides\u002Finvestigate-traffic\u002Fweekly-triage","Weekly triage","guides\u002F3.investigate-traffic\u002F1.weekly-triage",{"path":86,"title":87,"stem":88,"page":16},"\u002Fgscdump-cli\u002Fguides\u002Finvestigate-traffic\u002Ftraffic-drop","Traffic drop","guides\u002F3.investigate-traffic\u002F2.traffic-drop",{"path":90,"title":91,"stem":92,"page":16},"\u002Fgscdump-cli\u002Fguides\u002Finvestigate-traffic\u002Flow-ctr","Low CTR","guides\u002F3.investigate-traffic\u002F3.low-ctr",{"path":94,"title":95,"stem":96,"page":16},"\u002Fgscdump-cli\u002Fguides\u002Finvestigate-traffic\u002Fbrand-traffic","Brand traffic","guides\u002F3.investigate-traffic\u002F4.brand-traffic",{"path":98,"title":99,"stem":100,"page":16},"\u002Fgscdump-cli\u002Fguides\u002Finvestigate-traffic\u002Fimpressions-no-clicks","Impressions, no clicks","guides\u002F3.investigate-traffic\u002F5.impressions-no-clicks",{"path":102,"title":103,"stem":104,"page":16},"\u002Fgscdump-cli\u002Fguides\u002Finvestigate-traffic\u002Fgrowth-trends","Growth trends","guides\u002F3.investigate-traffic\u002F6.growth-trends",{"path":106,"title":107,"stem":108,"page":16},"\u002Fgscdump-cli\u002Fguides\u002Finvestigate-traffic\u002Fdevice-gaps","Device gaps","guides\u002F3.investigate-traffic\u002F7.device-gaps","guides\u002F3.investigate-traffic\u002Findex",{"path":111,"title":112,"children":113,"stem":126,"page":16},"\u002Fgscdump-cli\u002Fguides\u002Fcheck-visibility","Check visibility",[114,118,122],{"path":115,"title":116,"stem":117,"page":16},"\u002Fgscdump-cli\u002Fguides\u002Fcheck-visibility\u002Fpage-overlap","Page overlap","guides\u002F4.check-visibility\u002F1.page-overlap",{"path":119,"title":120,"stem":121,"page":16},"\u002Fgscdump-cli\u002Fguides\u002Fcheck-visibility\u002Findexing-evidence","Indexing Evidence","guides\u002F4.check-visibility\u002F2.indexing-evidence",{"path":123,"title":124,"stem":125,"page":16},"\u002Fgscdump-cli\u002Fguides\u002Fcheck-visibility\u002Fgoogle-and-bing","Google and Bing","guides\u002F4.check-visibility\u002F3.google-and-bing","guides\u002F4.check-visibility\u002Findex","gscdump-cli\u002Fguides","index",{"title":130,"description":131,"body":132,"id":784,"path":56,"stem":58,"extension":785,"navigation":786,"next":787,"related":788,"seo":790,"_source":791,"sitemap":792},"Choose CLI access","Compare the Local and Hosted access modes, then set up one of them.",{"toc":133,"nodes":157,"frontmatter":768,"meta":774},{"links":134,"title":156,"searchDepth":142,"depth":142},[135,147,150,153],{"id":136,"text":137,"depth":138,"children":139},"local-mode","Local mode",2,[140,144],{"id":141,"depth":142,"text":143},"local-mode-service-account-recommended",3,"Service account (recommended)",{"id":145,"depth":142,"text":146},"local-mode-oauth-client","OAuth client",{"id":148,"text":149,"depth":138},"hosted-mode","Hosted mode",{"id":151,"text":152,"depth":138},"fix-access-errors","Fix access errors",{"id":154,"text":155,"depth":138},"continue-with-a-result","Continue with a result","",[158,162,166,232,265,279,282,288,291,294,310,349,359,361,364,386,425,449,468,470,487,516,542,563,566,572,650,677,704,720,722,753,755],[159,160,130],"h1",{"id":161},"choose-cli-access",[163,164,165],"p",{},"The CLI has 2 access modes. Pick one before your first command.",[167,168,170,186],"table",{"tabindex":169},0,[171,172,173],"thead",{},[174,175,176,180,183],"tr",{},[177,178,179],"th",{},"Mode",[177,181,182],{},"Credentials",[177,184,185],{},"What the CLI reads",[187,188,189,204],"tbody",{},[174,190,191,198,201],{},[192,193,194],"td",{},[195,196,197],"strong",{},"Local",[192,199,200],{},"Your own Google credentials: a service account or an OAuth client",[192,202,203],{},"Google directly. Data stays in a local Store on your disk",[174,205,206,211,220],{},[192,207,208],{},[195,209,210],{},"Hosted",[192,212,213,214,219],{},"Your ",[215,216,218],"a",{"href":217},"http:\u002F\u002Fgscdump.com","gscdump.com"," account",[192,221,222,223,227,228,231],{},"Your hosted record. ",[224,225,226],"code",{},"indexing inspect --yes"," spends URL Inspections. ",[224,229,230],{},"sitemaps inspect --engine google"," reads one Sitemap live",[163,233,234,237,238,241,242,237,245,248,249,252,253,256,257,260,261,264],{},[224,235,236],{},"auth login --mode local"," or ",[224,239,240],{},"auth login --mode hosted"," saves the mode for later commands.\n",[224,243,244],{},"--mode local",[224,246,247],{},"--mode hosted"," overrides it for one command. ",[224,250,251],{},"GSCDUMP_AUTH_MODE"," also overrides the saved mode.\nIf no mode is saved and ",[224,254,255],{},"GSCDUMP_API_KEY"," is set, the CLI uses Hosted mode. Otherwise it uses Local mode.\nRun ",[224,258,259],{},"gscdump auth status --json"," to see the active mode. The ",[215,262,263],{"href":13},"commands reference"," lists profile options.",[163,266,267,268,271,272,274,275,278],{},"The CLI reads credentials from its configuration directory and from exported environment variables. It never reads a ",[224,269,270],{},".env"," file, so a project's credentials stay with that project. To use a ",[224,273,270],{}," file, export its variables before you run ",[224,276,277],{},"gscdump",".",[280,281,137],"h2",{"id":136},[163,283,284,285,287],{},"Local mode calls Google with your own credentials. ",[215,286,218],{"href":217}," is not involved.",[289,290,143],"h3",{"id":141},[163,292,293],{},"A service account key never expires, and it works on servers and in CI.",[295,296,297,301,304,307],"ol",{},[298,299,300],"li",{},"In Google Cloud, create a project and enable the Google Search Console API.",[298,302,303],{},"Create a service account, then create a JSON key for it.",[298,305,306],{},"In Search Console, open the Site, then Settings > Users and permissions. Add the service account email as a user.",[298,308,309],{},"Check the key and save its path:",[311,312,315],"pre",{"language":313,"class":314,"tabindex":169},"bash","rangi shiki shj-lang-bash",[224,316,318,338,339,338,344],{"class":317},"language-bash",[319,320,323,327,328,333,334],"span",{"class":321,"style":322},"line","display: inline",[319,324,277],{"class":325,"style":326},"shj-syn-func shj-func","--shiki-light:#8250df;--shiki-default:#8250df;color:#8250df;--shiki-dark:#d2a8ff"," auth login --mode ",[319,329,332],{"class":330,"style":331},"shj-syn-kwd shj-kwd","--shiki-light:#cf222e;--shiki-default:#cf222e;color:#cf222e;--shiki-dark:#ff7b72","local"," --service-account ",[319,335,337],{"class":336,"style":331},"shj-syn-oper shj-oper",".\u002Fgsc-sa.json","\n",[319,340,341,343],{"class":321,"style":322},[319,342,277],{"class":325,"style":326}," auth status --json",[319,345,346,348],{"class":321,"style":322},[319,347,277],{"class":325,"style":326}," sites --json",[163,350,351,352,237,355,358],{},"For scheduled runs, set ",[224,353,354],{},"GOOGLE_APPLICATION_CREDENTIALS",[224,356,357],{},"GSC_SERVICE_ACCOUNT_JSON"," to the key path instead.",[289,360,146],{"id":145},[163,362,363],{},"Use an OAuth client when you want to sign in as yourself.",[295,365,366,369,372,383],{},[298,367,368],{},"In Google Cloud, enable the Google Search Console API.",[298,370,371],{},"Create an OAuth client ID of type Desktop application.",[298,373,374,375,378,379,382],{},"On the OAuth consent screen, set the publishing status to ",[195,376,377],{},"In production",".\nIn ",[195,380,381],{},"Testing"," status, Google expires refresh tokens after 7 days, and you must log in again each week.",[298,384,385],{},"Set the client credentials, then log in:",[311,387,388],{"language":313,"class":314,"tabindex":169},[224,389,390,338,405,338,415,338,421],{"class":317},[319,391,392,395,396,401,404],{"class":321,"style":322},[319,393,394],{"class":330,"style":331},"export"," ",[319,397,400],{"class":398,"style":399},"shj-syn-var shj-var","--shiki-light:#0550ae;--shiki-default:#0550ae;color:#0550ae;--shiki-dark:#79c0ff","GSC_CLIENT_ID",[319,402,403],{"class":336,"style":331},"=","your-client-id",[319,406,407,395,409,412,414],{"class":321,"style":322},[319,408,394],{"class":330,"style":331},[319,410,411],{"class":398,"style":399},"GSC_CLIENT_SECRET",[319,413,403],{"class":336,"style":331},"your-client-secret",[319,416,417,327,419],{"class":321,"style":322},[319,418,277],{"class":325,"style":326},[319,420,332],{"class":330,"style":331},[319,422,423,343],{"class":321,"style":322},[319,424,277],{"class":325,"style":326},[163,426,427,428,431,432,434,435,437,438,441,442,444,445,448],{},"For an existing access token, set ",[224,429,430],{},"GSC_ACCESS_TOKEN",". For renewable credentials, set ",[224,433,400],{},", ",[224,436,411],{},", and ",[224,439,440],{},"GSC_REFRESH_TOKEN"," together. ",[224,443,259],{}," identifies the active source.\nFor a remote terminal, ",[224,446,447],{},"gscdump auth login --mode local --no-browser"," prints an authorization URL. The loopback flow may need port forwarding.",[163,450,451,452,455,456,459,460,463,464,467],{},"Google login does not connect Bing. Run ",[224,453,454],{},"gscdump bing login --mode local"," and ",[224,457,458],{},"gscdump bing sites --mode local --json"," separately. Use the exact Bing Site URL printed by ",[224,461,462],{},"bing sites"," for local Bing commands. See the ",[215,465,466],{"href":30},"Bing reference"," for OAuth and API key options.",[280,469,149],{"id":148},[163,471,472,473,475,476,478,479,482,483,486],{},"Hosted mode reads the record that ",[215,474,218],{"href":217}," keeps for your Sites. ",[215,477,218],{"href":217}," runs the sync. ",[224,480,481],{},"gscdump indexing inspect --yes"," requests new Google URL Inspections through the platform. ",[224,484,485],{},"gscdump sitemaps inspect --engine google"," reads one Sitemap live through the platform. It uses Google's API quota, without spending URL Inspections. Bing Sitemap inspection reads dated stored evidence.",[163,488,489,490,492,493,497,498,501,502,505,506,510,511,237,514,278],{},"Hosted login opens ",[215,491,218],{"href":217},". Sign in, approve the CLI, then ",[215,494,496],{"href":495},"\u002Fapp\u002Fonboarding?step=connect-sites","connect a Site",". The CLI saves a session. You do not need to copy an API key. The session ends 90 days after you approve it. Then the CLI prints ",[224,499,500],{},"Your gscdump.com session expired."," Run ",[224,503,504],{},"gscdump auth login --mode hosted"," to sign in again. SDK integrations and CI can use a user API key from ",[215,507,509],{"href":508},"\u002Fapp\u002Fdevelopers#api-keys","Agent setup"," with ",[224,512,513],{},"--api-key",[224,515,255],{},[311,517,518],{"language":313,"class":314,"tabindex":169},[224,519,520,338,525,338,529],{"class":317},[319,521,522,524],{"class":321,"style":322},[319,523,277],{"class":325,"style":326}," auth login --mode hosted",[319,526,527,348],{"class":321,"style":322},[319,528,277],{"class":325,"style":326},[319,530,531,533,534,537,538,541],{"class":321,"style":322},[319,532,277],{"class":325,"style":326}," query --site example.com",[319,535,536],{"class":330,"style":331}," -d"," page",[319,539,540],{"class":330,"style":331}," -f"," json",[163,543,544,545,548,549,551,552,555,556,558,559,562],{},"After login, the CLI prints one next step. If your hosted record has no Sites, the step is the connect link:\n",[224,546,547],{},"Next: connect a Site at https:\u002F\u002Fgscdump.com\u002Fapp\u002Fonboarding?step=connect-sites.","\nIf Hosted access is not active, ",[215,550,218],{"href":217}," asks you to activate it first. ",[224,553,554],{},"gscdump auth status"," prints the same step while the record has no Sites.\nIf you select Cancel on the ",[215,557,218],{"href":217}," login page, the CLI prints ",[224,560,561],{},"Login cancelled in the browser."," and exits 1.",[163,564,565],{},"Hosted mode runs these commands:",[163,567,568,571],{},[224,569,570],{},"gscdump indexing inspect \u003Curl...> --yes"," requests new Google URL Inspections through the platform.\nPass up to 10 unique URLs. The platform enforces its shared quota. The CLI never retries these requests automatically.",[573,574,575,581,587,604,610,616,628],"ul",{},[298,576,577,580],{},[224,578,579],{},"sites"," lists your hosted Sites and their sync state.",[298,582,583,586],{},[224,584,585],{},"query"," reads rows from the hosted record.",[298,588,589,434,592,434,595,434,598,437,601,603],{},[224,590,591],{},"sitemaps current",[224,593,594],{},"history",[224,596,597],{},"membership",[224,599,600],{},"lastmod",[224,602,394],{}," read saved sitemap evidence.",[298,605,606,609],{},[224,607,608],{},"indexing urls"," lists saved URL Inspection results.",[298,611,612,615],{},[224,613,614],{},"indexing summary"," shows the coverage ladder per day from saved URL Inspection results, with the time gscdump counted them.",[298,617,618,434,621,437,624,627],{},[224,619,620],{},"indexing watch list",[224,622,623],{},"add",[224,625,626],{},"remove"," manage Watched URLs. gscdump inspects each Watched URL every 7 days.",[298,629,630,434,633,434,635,434,638,434,641,437,644,647,648,278],{},[224,631,632],{},"bing login --site",[224,634,579],{},[224,636,637],{},"status",[224,639,640],{},"dump",[224,642,643],{},"inspect",[224,645,646],{},"verify"," use the Bing connection saved on ",[215,649,218],{"href":217},[163,651,652,653,656,657,660,661,664,665,667,668,670,671,673,674],{},"If ",[224,654,655],{},"gscdump sites --json"," prints ",[224,658,659],{},"[]",", your hosted record has no Sites. Commands that need a Site stop with the code ",[224,662,663],{},"NO_SITES",".\nIf you logged in with the browser, connect a Site on ",[215,666,218],{"href":217},". If an app gave you an API key, connect a Site in that app.\nThe ",[224,669,663],{}," message names that app when ",[215,672,218],{"href":217}," reports it, for example ",[224,675,676],{},"Connect a Site in Request Indexing.",[163,678,679,680,434,683,434,685,434,688,434,691,434,694,437,697,700,701,278],{},"Commands that need your own Google credentials require Local mode.\nExamples: ",[224,681,682],{},"sync",[224,684,643],{},[224,686,687],{},"query --live",[224,689,690],{},"sites add",[224,692,693],{},"sitemaps submit",[224,695,696],{},"indexing submit",[224,698,699],{},"mcp",".\nIn Hosted mode these commands stop and print the Local mode setup command.\nFor an MCP client in Hosted mode, connect it to ",[224,702,703],{},"https:\u002F\u002Fgscdump.com\u002Fmcp",[163,705,706,707,709,710,455,713,716,717,719],{},"For Bing, connect the Site in ",[215,708,218],{"href":217},", then run ",[224,711,712],{},"gscdump bing sites --json",[224,714,715],{},"gscdump bing status --site s_SITE_ID --json",". Use the hosted Site ID printed by ",[224,718,462],{}," for Bing commands.",[280,721,152],{"id":151},[163,723,724,725,728,729,732,733,735,736,738,739,741,742,744,745,748,749,752],{},"If a command prints ",[224,726,727],{},"Google credentials are missing",", set up Local mode or Hosted mode as shown above.\nIf a command prints ",[224,730,731],{},"This command calls Google, so it needs Local mode",", the command has no Hosted equivalent. Set up Local mode, or pass ",[224,734,244],{}," if Local credentials exist.\nIf ",[224,737,579],{}," is empty in Local mode, check the Google identity and the Site's Users and permissions.\nIf Hosted mode rejects the session, run ",[224,740,504],{}," again.\nIf an OAuth refresh token expires after 7 days, set the OAuth consent screen to ",[195,743,377],{}," and run ",[224,746,747],{},"gscdump auth login --mode local --force",".\n",[224,750,751],{},"gscdump doctor"," can check configuration. Do not paste credentials into an issue or agent prompt.",[280,754,155],{"id":154},[163,756,757,758,761,762,765,766,278],{},"Run the ",[215,759,760],{"href":52},"first query",", or ",[215,763,764],{"href":123},"compare Google and Bing evidence"," after connecting both Search Engines. More setup: ",[215,767,49],{"href":48},{"title":130,"description":131,"navigation":769,"next":770,"related":772},{"title":57},{"title":771,"to":69},"Save Search Console history",[773],{"title":61,"to":60},{"title":130,"description":165,"toc":775},{"title":156,"searchDepth":142,"depth":142,"links":776},[777,781,782,783],{"id":136,"depth":138,"text":137,"children":778},[779,780],{"id":141,"depth":142,"text":143},{"id":145,"depth":142,"text":146},{"id":148,"depth":138,"text":149},{"id":151,"depth":138,"text":152},{"id":154,"depth":138,"text":155},"cliDocs\u002Fguides\u002F1.start\u002F2.choose-access.md","md",{"title":57},{"title":771,"to":69},[789],{"title":61,"to":60},{"title":130,"description":131},"\u002Fopt\u002Factions-runner\u002F_work\u002Fgscdump.com\u002Fgscdump.com\u002Fnode_modules\u002F.cache\u002Fcomark-content\u002Fgit\u002Fd100867c457f148bef5f\u002Fdocs\u002Fgscdump-cli\u002Fguides\u002F1.start\u002F2.choose-access.md",{"loc":56},1794983848643]