[{"data":1,"prerenderedAt":842},["ShallowReactive",2],{"cli-docs-navigation":3,"cli-docs-page:\u002Fgscdump-cli\u002Fapi\u002Fquery":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":19,"description":130,"body":131,"id":837,"path":18,"stem":20,"extension":838,"seo":839,"_source":840,"sitemap":841},"Filter Google search data and run SQL queries over the gscdump Store.",{"toc":132,"nodes":146,"frontmatter":830,"meta":831},{"links":133,"title":144,"searchDepth":145,"depth":145},[134,138,141],{"id":135,"text":136,"depth":137},"filter-expressions","Filter expressions",2,{"id":139,"text":140,"depth":137},"sql-over-the-store","SQL over the Store",{"id":142,"text":143,"depth":137},"routing","Routing","",3,[147,151,154,178,257,300,327,337,361,389,408,416,418,428,507,589,631,633,651,664,676,688,723,772,827],[148,149,19],"h1",{"id":150},"query",[152,153,136],"h2",{"id":135},[155,156,157,160,161,164,165,164,168,164,171,164,174,177],"p",{},[158,159,150],"code",{}," accepts prefix-encoded filter expressions for ",[158,162,163],{},"--query",", ",[158,166,167],{},"--page",[158,169,170],{},"--country",[158,172,173],{},"--device",[158,175,176],{},"--search-appearance",":",[179,180,182,195],"table",{"tabindex":181},0,[183,184,185],"thead",{},[186,187,188,192],"tr",{},[189,190,191],"th",{},"Prefix",[189,193,194],{},"Operator",[196,197,198,207,217,227,237,247],"tbody",{},[186,199,200,204],{},[201,202,203],"td",{},"(bare)",[201,205,206],{},"equals",[186,208,209,214],{},[201,210,211],{},[158,212,213],{},"~foo",[201,215,216],{},"contains",[186,218,219,224],{},[201,220,221],{},[158,222,223],{},"!~foo",[201,225,226],{},"not contains",[186,228,229,234],{},[201,230,231],{},[158,232,233],{},"re:foo",[201,235,236],{},"regex",[186,238,239,244],{},[201,240,241],{},[158,242,243],{},"!re:foo",[201,245,246],{},"not regex",[186,248,249,254],{},[201,250,251],{},[158,252,253],{},"!foo",[201,255,256],{},"not equals",[258,259,262],"pre",{"language":260,"class":261,"tabindex":181},"bash","rangi shiki shj-lang-bash",[158,263,265,275,276,275,284],{"class":264},"language-bash",[266,267,270],"span",{"class":268,"style":269},"line","display: inline",[266,271,274],{"class":272,"style":273},"shj-syn-cmnt shj-cmnt","--shiki-light:#57606a;--shiki-default:#57606a;color:#57606a;--shiki-dark:#8b949e","# pages under \u002Fblog\u002F with brand mentions in the query","\n",[266,277,278,283],{"class":268,"style":269},[266,279,282],{"class":280,"style":281},"shj-syn-func shj-func","--shiki-light:#8250df;--shiki-default:#8250df;color:#8250df;--shiki-dark:#d2a8ff","gscdump"," query --live --site example.com \\",[266,285,286,287,289,290,295,296,299],{"class":268,"style":269},"  ",[266,288,167],{"class":280,"style":281}," ",[266,291,294],{"class":292,"style":293},"shj-syn-str shj-str","--shiki-light:#0a3069;--shiki-default:#0a3069;color:#0a3069;--shiki-dark:#a5d6ff","'~\u002Fblog\u002F'"," --query ",[266,297,298],{"class":292,"style":293},"'~brand'"," --dimensions page,query",[155,301,302,305,306,309,310,305,313,316,317,164,319,322,323,326],{},[158,303,304],{},"--limit"," and ",[158,307,308],{},"--format"," override saved ",[158,311,312],{},"defaultLimit",[158,314,315],{},"defaultFormat"," values.\nWithout saved values, queries use 1000 rows and JSON.\nLimits must be positive integers. Formats must be ",[158,318,179],{},[158,320,321],{},"json",", or ",[158,324,325],{},"csv",".",[155,328,329,330,333,334,336],{},"Rows come in click order, most clicks first. If ",[158,331,332],{},"date"," is a dimension, rows come in date order, oldest first.\nStore queries, Hosted mode queries, and live queries use the same order, so ",[158,335,304],{}," keeps the same rows from each source.",[155,338,339,340,343,344,347,348,351,352,355,356,358,359,326],{},"Without dates, a query reads the last 28 days that end on the newest synced day of the table it reads.\nWith ",[158,341,342],{},"--live",", the window ends three days ago, Pacific time: the newest final GSC date.\n",[158,345,346],{},"--start"," alone runs to that end date. ",[158,349,350],{},"--end"," alone reads the 28 days that end on it.\nDates must use ",[158,353,354],{},"YYYY-MM-DD",", and ",[158,357,346],{}," cannot follow ",[158,360,350],{},[155,362,363,365,366,369,370,373,374,377,378,381,382,384,385,388],{},[158,364,167],{}," accepts a path or a full URL. The Store compares paths, so ",[158,367,368],{},"https:\u002F\u002Fexample.com\u002Fa"," matches ",[158,371,372],{},"\u002Fa",".\nLive queries expand a path to the Site's origin. For a domain property, a path matches that path on any host.\nFiltered dimensions choose the Store table too: ",[158,375,376],{},"-d query --page \u002Fa"," reads ",[158,379,380],{},"page_queries",".\nIf no Store table holds every dimension and filter, the query fails and names ",[158,383,342],{},".\nIf the matching table exists but has no synced rows, an authenticated query can answer live instead.\nCheck ",[158,386,387],{},"meta.source"," before describing a result as saved Store data.",[258,390,391],{"language":260,"class":261,"tabindex":181},[158,392,393,275,398,275,402],{"class":264},[266,394,395],{"class":268,"style":269},[266,396,397],{"class":272,"style":273},"# Export query rows with a CSV header.",[266,399,400,283],{"class":268,"style":269},[266,401,282],{"class":280,"style":281},[266,403,286,404,407],{"class":268,"style":269},[266,405,406],{"class":280,"style":281},"--dimensions"," page,query --format csv --output rows.csv",[155,409,410,411,326],{},"For API request examples, see ",[412,413,415],"a",{"href":414},"\u002Flearn-google-search-console\u002Fapi\u002Fquery-builder","the Search Analytics query guide",[152,417,140],{"id":139},[155,419,420,423,424,427],{},[158,421,422],{},"query --sql"," runs DuckDB SQL over one view per Store table.\nRun ",[158,425,426],{},"query --schema"," to list the views, their columns, and their date ranges.",[258,429,430],{"language":260,"class":261,"tabindex":181},[158,431,432,275,440,275,461,275,472,275,494],{"class":264},[266,433,434,436,437],{"class":268,"style":269},[266,435,282],{"class":280,"style":281}," query --format json --sql ",[266,438,439],{"class":292,"style":293},"\"",[266,441,286,442,445,446,450,451,454,455,457,458,460],{"class":268,"style":269},[266,443,444],{"class":280,"style":281},"SELECT"," p.page, SUM",[266,447,449],{"class":448,"style":273},"shj-syn-bracket shj-bracket","(","q.clicks",[266,452,453],{"class":448,"style":273},")"," AS clicks, gsc_position",[266,456,449],{"class":448,"style":273},"q.sum_position, q.impressions",[266,459,453],{"class":448,"style":273}," AS position",[266,462,286,463,466,467,469,470],{"class":268,"style":269},[266,464,465],{"class":280,"style":281},"FROM"," pages p JOIN page_queries q USING ",[266,468,449],{"class":448,"style":273},"site, search_type, url, date",[266,471,453],{"class":448,"style":273},[266,473,286,474,477,478,289,483,486,487,490,491],{"class":268,"style":269},[266,475,476],{"class":280,"style":281},"WHERE"," p.search_type ",[266,479,482],{"class":480,"style":481},"shj-syn-oper shj-oper","--shiki-light:#cf222e;--shiki-default:#cf222e;color:#cf222e;--shiki-dark:#ff7b72","=",[266,484,485],{"class":292,"style":293},"'web'"," AND p.date ",[266,488,489],{"class":480,"style":481},">="," DATE ",[266,492,493],{"class":292,"style":293},"'2026-08-01'",[266,495,286,496,499,500,505],{"class":268,"style":269},[266,497,498],{"class":280,"style":281},"GROUP"," BY p.page ORDER BY clicks DESC LIMIT ",[266,501,504],{"class":502,"style":503},"shj-syn-num shj-num","--shiki-light:#0550ae;--shiki-default:#0550ae;color:#0550ae;--shiki-dark:#79c0ff","20",[266,506,439],{"class":292,"style":293},[179,508,509,519],{"tabindex":181},[183,510,511],{},[186,512,513,516],{},[189,514,515],{},"Column",[189,517,518],{},"Meaning",[196,520,521,534,561,579],{},[186,522,523,528],{},[201,524,525],{},[158,526,527],{},"site",[201,529,530,531],{},"The Site URL, such as ",[158,532,533],{},"sc-domain:example.com",[186,535,536,541],{},[201,537,538],{},[158,539,540],{},"search_type",[201,542,543,164,546,164,549,164,552,164,555,322,558],{},[158,544,545],{},"web",[158,547,548],{},"image",[158,550,551],{},"video",[158,553,554],{},"news",[158,556,557],{},"discover",[158,559,560],{},"googleNews",[186,562,563,571],{},[201,564,565,164,568],{},[158,566,567],{},"url",[158,569,570],{},"page",[201,572,573,574,576,577],{},"The page path. ",[158,575,570],{}," is the same value as ",[158,578,567],{},[186,580,581,586],{},[201,582,583],{},[158,584,585],{},"sum_position",[201,587,588],{},"Zero-based position multiplied by impressions",[590,591,592,603,612,622,628],"ul",{},[593,594,595,596,598,599,602],"li",{},"The Store keeps every search type. Filter or group by ",[158,597,540],{},", or a ",[158,600,601],{},"SUM"," adds web, image, and Discover rows together.",[593,604,605,608,609,326],{},[158,606,607],{},"gsc_position(sum_position, impressions)"," returns the impression-weighted average position. Use it with ",[158,610,611],{},"GROUP BY",[593,613,614,615,305,618,621],{},"The views cover every Site in the Store. ",[158,616,617],{},"--site",[158,619,620],{},"--type"," narrow them.",[593,623,624,625,627],{},"Dates return as ",[158,626,354],{},". Integers return as numbers, and an integer past 2^53 returns as a string.",[593,629,630],{},"If the SQL names a table with no synced data, the CLI prints a warning.",[152,632,143],{"id":142},[155,634,635,636,638,639,643,644,647,648,650],{},"In Hosted mode, ",[158,637,150],{}," reads the hosted record on ",[412,640,642],{"href":641},"http:\u002F\u002Fgscdump.com","gscdump.com"," and never calls Google. JSON output has ",[158,645,646],{},"meta.source: \"hosted\"",".\nIf the hosted record cannot serve the dates yet, ",[158,649,150],{}," stops and exits 1. It says why and names the next step:",[258,652,655],{"language":653,"class":654,"tabindex":181},"txt","rangi shiki shj-lang-txt",[158,656,658,275,661],{"class":657},"language-txt",[266,659,660],{"class":268,"style":269},"Error: The Site's record is not readable yet.",[266,662,663],{"class":268,"style":269},"Sync finished at 2026-10-01 03:16 UTC. gscdump prepares the record for reads after Sync. Try again in a few minutes.",[155,665,666,668,669,305,672,675],{},[158,667,342],{}," needs Local mode. ",[158,670,671],{},"--sql",[158,673,674],{},"--schema"," read the local Store in either mode.",[155,677,678,679,164,681,355,684,687],{},"In Local mode, login is optional. Log in with your own Google credentials, or sync a local Store.\n",[158,680,150],{},[158,682,683],{},"analyze",[158,685,686],{},"report"," pick one source for each run:",[590,689,690,693,700,706,716],{},[593,691,692],{},"If the Store covers every date the run needs, the run reads the Store. This is also true while a sync runs.",[593,694,695,696,699],{},"If the Store has no data and Google is connected, a live-capable run asks Search Console.\nstderr names the live fallback. JSON output has ",[158,697,698],{},"meta.source: \"live\"",". Stored-only Analyzers and Reports still need a Store.",[593,701,702,703,326],{},"If the Store has no data and Google is not connected, the run stops and names ",[158,704,705],{},"gscdump init",[593,707,708,709,712,713,715],{},"If some dates are missing, the run stops and prints a ",[158,710,711],{},"gscdump sync"," command. Use ",[158,714,342],{}," only when that Analyzer or Report supports live rows.",[593,717,718,719,722],{},"If a sync for the Site is running and the dates are not covered yet, the run stops with ",[158,720,721],{},"Sync running: 41 of 90 days done.","\nA sync without a heartbeat in the last 2 minutes counts as stopped.",[155,724,725,726,728,729,732,733,164,736,739,740,742,743,746,747,750,751,164,754,164,757,355,760,763,764,767,768,771],{},"One run never mixes Store rows and live rows. Live results hold the top rows of each request, and synced data keeps more of the long tail.\n",[158,727,422],{}," reads the Store only.\nWith JSON output, every failure prints ",[158,730,731],{},"{ \"error\": { \"code\", \"message\", \"nextCommand\" } }"," on stdout and exits 1.\nJSON output means ",[158,734,735],{},"--format json",[158,737,738],{},"--json",", or the default format of ",[158,741,150],{},".\nA stop has its own code. Examples: ",[158,744,745],{},"USAGE"," for an invalid option value such as ",[158,748,749],{},"--limit 0",", and the Hosted mode codes ",[158,752,753],{},"NO_SITES",[158,755,756],{},"SITE_NOT_FOUND",[158,758,759],{},"RECORD_NOT_READY",[158,761,762],{},"RANGE_NOT_SYNCED",".\nAny other failure has the code ",[158,765,766],{},"FAILED",", such as a network or API error, or ",[158,769,770],{},"UNEXPECTED",", a defect in the CLI.",[258,773,775],{"language":321,"class":774,"tabindex":181},"rangi shiki shj-lang-json",[158,776,778,275,783,275,792,275,802,275,810,275,818,275,823],{"class":777},"language-json",[266,779,780],{"class":268,"style":269},[266,781,782],{"class":448,"style":273},"{",[266,784,286,785,789,790],{"class":268,"style":269},[266,786,788],{"class":787,"style":503},"shj-syn-var shj-var","\"error\"",": ",[266,791,782],{"class":448,"style":273},[266,793,794,795,789,798,801],{"class":268,"style":269},"    ",[266,796,797],{"class":787,"style":503},"\"code\"",[266,799,800],{"class":292,"style":293},"\"USAGE\"",",",[266,803,794,804,789,807,801],{"class":268,"style":269},[266,805,806],{"class":787,"style":503},"\"message\"",[266,808,809],{"class":292,"style":293},"\"Invalid --limit. Use a positive safe integer, such as --limit 1000.\"",[266,811,794,812,789,815],{"class":268,"style":269},[266,813,814],{"class":787,"style":503},"\"nextCommand\"",[266,816,817],{"class":502,"style":503},"null",[266,819,286,820],{"class":268,"style":269},[266,821,822],{"class":448,"style":273},"}",[266,824,825],{"class":268,"style":269},[266,826,822],{"class":448,"style":273},[155,828,829],{},"The Store’s quota ledger tracks Search Analytics, URL Inspection, and Indexing API publish calls.\nEach API has separate limits. Other applications can also spend your Google quota.\nWhen a limit is reached, the command stops and prints a retry time.",{"title":19,"description":130},{"title":19,"toc":832},{"title":144,"searchDepth":145,"depth":145,"links":833},[834,835,836],{"id":135,"depth":137,"text":136},{"id":139,"depth":137,"text":140},{"id":142,"depth":137,"text":143},"cliDocs\u002Fapi\u002F2.query.md","md",{"title":19,"description":130},"\u002Fopt\u002Factions-runner\u002F_work\u002Fgscdump.com\u002Fgscdump.com\u002Fnode_modules\u002F.cache\u002Fcomark-content\u002Fgit\u002Fd100867c457f148bef5f\u002Fdocs\u002Fgscdump-cli\u002Fapi\u002F2.query.md",{"loc":18},1794983848643]