[{"data":1,"prerenderedAt":622},["ShallowReactive",2],{"sdk-docs-navigation":3,"sdk-docs-page:\u002Fgscdump-sdk\u002Fguides\u002Fstart\u002Fhosted-first-result":112},[4],{"path":5,"title":6,"children":7,"stem":111,"page":16},"\u002Fgscdump-sdk","gscdump SDK",[8,27],{"path":9,"title":10,"children":11,"stem":25,"page":26},"\u002Fgscdump-sdk\u002Fapi","Api",[12,17,21],{"path":13,"title":14,"stem":15,"page":16},"\u002Fgscdump-sdk\u002Fapi\u002Fdirect-client","Direct client exports","api\u002F1.direct-client",true,{"path":18,"title":19,"stem":20,"page":16},"\u002Fgscdump-sdk\u002Fapi\u002Fhosted-http","Hosted HTTP","api\u002F2.hosted-http",{"path":22,"title":23,"stem":24,"page":16},"\u002Fgscdump-sdk\u002Fapi\u002Frealtime","Realtime","api\u002F3.realtime","gscdump-sdk\u002Fapi",false,{"path":28,"title":29,"children":30,"stem":110,"page":26},"\u002Fgscdump-sdk\u002Fguides","Guides",[31,48,73,97],{"path":32,"title":33,"children":34,"stem":47,"page":16},"\u002Fgscdump-sdk\u002Fguides\u002Fstart","Start",[35,39,43],{"path":36,"title":37,"stem":38,"page":16},"\u002Fgscdump-sdk\u002Fguides\u002Fstart\u002Fchoose-access","Choose access","guides\u002F1.start\u002F1.choose-access",{"path":40,"title":41,"stem":42,"page":16},"\u002Fgscdump-sdk\u002Fguides\u002Fstart\u002Fhosted-first-result","Hosted first result","guides\u002F1.start\u002F2.hosted-first-result",{"path":44,"title":45,"stem":46,"page":16},"\u002Fgscdump-sdk\u002Fguides\u002Fstart\u002Fdirect-first-result","Direct first result","guides\u002F1.start\u002F3.direct-first-result","guides\u002F1.start\u002Findex",{"path":49,"title":50,"children":51,"stem":72,"page":16},"\u002Fgscdump-sdk\u002Fguides\u002Fread-data","Read data",[52,56,60,64,68],{"path":53,"title":54,"stem":55,"page":16},"\u002Fgscdump-sdk\u002Fguides\u002Fread-data\u002Fdirect-search-analytics","Direct Search Analytics","guides\u002F2.read-data\u002F1.direct-search-analytics",{"path":57,"title":58,"stem":59,"page":16},"\u002Fgscdump-sdk\u002Fguides\u002Fread-data\u002Fhosted-analytics","Hosted analytics","guides\u002F2.read-data\u002F2.hosted-analytics",{"path":61,"title":62,"stem":63,"page":16},"\u002Fgscdump-sdk\u002Fguides\u002Fread-data\u002Fhosted-indexing","Hosted indexing","guides\u002F2.read-data\u002F3.hosted-indexing",{"path":65,"title":66,"stem":67,"page":16},"\u002Fgscdump-sdk\u002Fguides\u002Fread-data\u002Fhosted-sitemaps","Hosted sitemaps","guides\u002F2.read-data\u002F4.hosted-sitemaps",{"path":69,"title":70,"stem":71,"page":16},"\u002Fgscdump-sdk\u002Fguides\u002Fread-data\u002Fdirect-bing","Direct Bing","guides\u002F2.read-data\u002F5.direct-bing","guides\u002F2.read-data\u002Findex",{"path":74,"title":75,"children":76,"stem":96,"page":16},"\u002Fgscdump-sdk\u002Fguides\u002Fbuild-integrations","Build integrations",[77,81,85,89,92],{"path":78,"title":79,"stem":80,"page":16},"\u002Fgscdump-sdk\u002Fguides\u002Fbuild-integrations\u002Fnuxt","Nuxt","guides\u002F3.build-integrations\u002F1.nuxt",{"path":82,"title":83,"stem":84,"page":16},"\u002Fgscdump-sdk\u002Fguides\u002Fbuild-integrations\u002Fnextjs","Next.js","guides\u002F3.build-integrations\u002F2.nextjs",{"path":86,"title":87,"stem":88,"page":16},"\u002Fgscdump-sdk\u002Fguides\u002Fbuild-integrations\u002Fhono-express","Hono \u002F Express","guides\u002F3.build-integrations\u002F3.hono-express",{"path":90,"title":23,"stem":91,"page":16},"\u002Fgscdump-sdk\u002Fguides\u002Fbuild-integrations\u002Frealtime","guides\u002F3.build-integrations\u002F4.realtime",{"path":93,"title":94,"stem":95,"page":16},"\u002Fgscdump-sdk\u002Fguides\u002Fbuild-integrations\u002Fwebhooks","Webhooks","guides\u002F3.build-integrations\u002F5.webhooks","guides\u002F3.build-integrations\u002Findex",{"path":98,"title":99,"children":100,"stem":109,"page":16},"\u002Fgscdump-sdk\u002Fguides\u002Foperate","Operate",[101,105],{"path":102,"title":103,"stem":104,"page":16},"\u002Fgscdump-sdk\u002Fguides\u002Foperate\u002Fkeys-and-scopes","Keys and scopes","guides\u002F4.operate\u002F1.keys-and-scopes",{"path":106,"title":107,"stem":108,"page":16},"\u002Fgscdump-sdk\u002Fguides\u002Foperate\u002Ferrors-and-retry","Errors and retry","guides\u002F4.operate\u002F2.errors-and-retry","guides\u002F4.operate\u002Findex","gscdump-sdk\u002Fguides","index",{"title":113,"description":114,"body":115,"id":613,"path":40,"stem":42,"extension":614,"navigation":615,"next":616,"related":617,"seo":619,"_source":620,"sitemap":621},"Fetch your first hosted analytics rows","Query an authorized Site with a server-held API key.",{"toc":116,"nodes":143,"frontmatter":595,"meta":602},{"links":117,"title":142,"searchDepth":125,"depth":125},[118,130,133,136,139],{"id":119,"text":120,"depth":121,"children":122},"before-you-start","Before you start",2,[123,127],{"id":124,"depth":125,"text":126},"before-you-start-create-a-user-api-key",3,"Create a user API key",{"id":128,"depth":125,"text":129},"before-you-start-find-a-site-id","Find a Site ID",{"id":131,"text":132,"depth":121},"make-the-request","Make the request",{"id":134,"text":135,"depth":121},"read-the-rows-and-metadata","Read the rows and metadata",{"id":137,"text":138,"depth":121},"if-access-fails","If access fails",{"id":140,"text":141,"depth":121},"build-on-the-result","Build on the result","",[144,148,152,155,158,175,177,193,208,210,217,488,495,505,507,564,571,573,583,585],[145,146,113],"h1",{"id":147},"fetch-your-first-hosted-analytics-rows",[149,150,151],"p",{},"This request returns rows from an authorized Site. It runs on your server, where the API key stays private.",[153,154,120],"h2",{"id":119},[156,157,126],"h3",{"id":124},[149,159,160,161,166,167,171,172,174],{},"Generate a user API key in ",[162,163,165],"a",{"href":164},"\u002Fapp\u002Fdevelopers#api-keys","Agent setup",". Copy it when shown and store it in ",[168,169,170],"code",{},"GSCDUMP_API_KEY",". User keys have a fixed scope set. ",[162,173,103],{"href":102}," explains access checks.",[156,176,129],{"id":128},[149,178,179,180,184,185,188,189,192],{},"In the app, select your Site. Open ",[181,182,183],"strong",{},"Settings → Site information"," and copy ",[181,186,187],{},"Site ID",". Set it in ",[168,190,191],{},"GSCDUMP_SITE_ID",".",[149,194,195,196,199,200,203,204,207],{},"The public ID starts with ",[168,197,198],{},"s_",". A Google ",[168,201,202],{},"sc-domain:"," or URL-prefix identifier is a different value. ",[168,205,206],{},"s_01"," in contract examples is a placeholder.",[153,209,132],{"id":131},[149,211,212,213,216],{},"Install with ",[168,214,215],{},"pnpm add @gscdump\u002Fsdk",". Run this on your server:",[218,219,223],"pre",{"language":220,"class":221,"tabindex":222},"ts","rangi shiki shj-lang-ts",0,[168,224,226,254,255,254,257,254,277,254,290,254,311,254,332,254,334,254,365,254,385,254,397,254,445,254,451,254,453,254,472],{"class":225},"language-ts",[227,228,231,236,237,242,243,236,246,236,249],"span",{"class":229,"style":230},"line","display: inline",[227,232,235],{"class":233,"style":234},"shj-syn-kwd shj-kwd","--shiki-light:#cf222e;--shiki-default:#cf222e;color:#cf222e;--shiki-dark:#ff7b72","import"," ",[227,238,241],{"class":239,"style":240},"shj-syn-bracket shj-bracket","--shiki-light:#57606a;--shiki-default:#57606a;color:#57606a;--shiki-dark:#8b949e","{"," createGscdumpV1Client ",[227,244,245],{"class":239,"style":240},"}",[227,247,248],{"class":233,"style":234},"from",[227,250,253],{"class":251,"style":252},"shj-syn-str shj-str","--shiki-light:#0a3069;--shiki-default:#0a3069;color:#0a3069;--shiki-dark:#a5d6ff","'@gscdump\u002Fsdk\u002Fv1'","\n",[227,256],{"class":229,"style":230},[227,258,259,262,263,267,268,270,271,273],{"class":229,"style":230},[227,260,261],{"class":233,"style":234},"const"," apiKey ",[227,264,266],{"class":265,"style":234},"shj-syn-oper shj-oper","="," process",[227,269,192],{"class":265,"style":234},"env",[227,272,192],{"class":265,"style":234},[227,274,170],{"class":275,"style":276},"shj-syn-num shj-num","--shiki-light:#0550ae;--shiki-default:#0550ae;color:#0550ae;--shiki-dark:#79c0ff",[227,278,279,281,282,267,284,270,286,288],{"class":229,"style":230},[227,280,261],{"class":233,"style":234}," siteId ",[227,283,266],{"class":265,"style":234},[227,285,192],{"class":265,"style":234},[227,287,192],{"class":265,"style":234},[227,289,191],{"class":275,"style":276},[227,291,292,236,295,298,301,302,236,305,307,308],{"class":229,"style":230},[227,293,294],{"class":233,"style":234},"if",[227,296,297],{"class":239,"style":240},"(",[227,299,300],{"class":265,"style":234},"!","apiKey ",[227,303,304],{"class":265,"style":234},"||",[227,306,300],{"class":265,"style":234},"siteId",[227,309,310],{"class":239,"style":240},")",[227,312,313,314,236,317,236,320,325,327,330],{"class":229,"style":230},"  ",[227,315,316],{"class":233,"style":234},"throw",[227,318,319],{"class":233,"style":234},"new",[227,321,324],{"class":322,"style":323},"shj-syn-class shj-class","--shiki-light:#953800;--shiki-default:#953800;color:#953800;--shiki-dark:#ffa657","Error",[227,326,297],{"class":239,"style":240},[227,328,329],{"class":251,"style":252},"'Set GSCDUMP_API_KEY and GSCDUMP_SITE_ID'",[227,331,310],{"class":239,"style":240},[227,333],{"class":229,"style":230},[227,335,336,338,339,236,341,346,348,350,351,236,354,356,236,358,262,361,363],{"class":229,"style":230},[227,337,261],{"class":233,"style":234}," client ",[227,340,266],{"class":265,"style":234},[227,342,345],{"class":343,"style":344},"shj-syn-func shj-func","--shiki-light:#8250df;--shiki-default:#8250df;color:#8250df;--shiki-dark:#d2a8ff","createGscdumpV1Client",[227,347,297],{"class":239,"style":240},[227,349,241],{"class":239,"style":240}," credential",[227,352,353],{"class":265,"style":234},":",[227,355,297],{"class":239,"style":240},[227,357,310],{"class":239,"style":240},[227,359,360],{"class":233,"style":234},"=>",[227,362,245],{"class":239,"style":240},[227,364,310],{"class":239,"style":240},[227,366,367,369,370,236,372,375,376,378,381,383],{"class":229,"style":230},[227,368,261],{"class":233,"style":234}," result ",[227,371,266],{"class":265,"style":234},[227,373,374],{"class":233,"style":234},"await"," client",[227,377,192],{"class":265,"style":234},[227,379,380],{"class":343,"style":344},"queryAnalyticsRows",[227,382,297],{"class":239,"style":240},[227,384,241],{"class":239,"style":240},[227,386,387,388,236,390,281,392,394],{"class":229,"style":230},"  params",[227,389,353],{"class":265,"style":234},[227,391,241],{"class":239,"style":240},[227,393,245],{"class":239,"style":240},[227,395,396],{"class":265,"style":234},",",[227,398,399,400,236,402,404,405,236,407,410,413,416,418,419,236,421,423,426,236,428,431,433,435,436,236,438,236,441,443],{"class":229,"style":230},"  body",[227,401,353],{"class":265,"style":234},[227,403,241],{"class":239,"style":240}," dimensions",[227,406,353],{"class":265,"style":234},[227,408,409],{"class":239,"style":240},"[",[227,411,412],{"class":251,"style":252},"'query'",[227,414,415],{"class":239,"style":240},"]",[227,417,396],{"class":265,"style":234}," metrics",[227,420,353],{"class":265,"style":234},[227,422,409],{"class":239,"style":240},[227,424,425],{"class":251,"style":252},"'clicks'",[227,427,396],{"class":265,"style":234},[227,429,430],{"class":251,"style":252},"'impressions'",[227,432,415],{"class":239,"style":240},[227,434,396],{"class":265,"style":234}," rowLimit",[227,437,353],{"class":265,"style":234},[227,439,440],{"class":275,"style":276},"100",[227,442,245],{"class":239,"style":240},[227,444,396],{"class":265,"style":234},[227,446,447,449],{"class":229,"style":230},[227,448,245],{"class":239,"style":240},[227,450,310],{"class":239,"style":240},[227,452],{"class":229,"style":230},[227,454,455,456,458,461,463,464,466,467,469,470],{"class":229,"style":230},"console",[227,457,192],{"class":265,"style":234},[227,459,460],{"class":343,"style":344},"log",[227,462,297],{"class":239,"style":240},"result",[227,465,192],{"class":265,"style":234},"data",[227,468,192],{"class":265,"style":234},"rows",[227,471,310],{"class":239,"style":240},[227,473,455,474,476,478,463,480,482,483,485,486],{"class":229,"style":230},[227,475,192],{"class":265,"style":234},[227,477,460],{"class":343,"style":344},[227,479,297],{"class":239,"style":240},[227,481,192],{"class":265,"style":234},"meta",[227,484,192],{"class":265,"style":234},"requestId",[227,487,310],{"class":239,"style":240},[149,489,490,491,494],{},"The ",[162,492,493],{"href":18},"hosted HTTP contract"," defines this request. The code logs returned data and does not assume any query exists.",[496,497],"docsexample",{"$":498,"title":500,"input":501,"result":502,"failure":503,"caption":504},{"html":499,"block":499},1,"Hosted row result","queryAnalyticsRows: query dimension; clicks and impressions metrics; 100 row limit","The contract returns data.rows as an array and meta.requestId as a string. An empty array is valid.","If access fails, check analytics:execute and authorization for the exact Site ID.","Source: analytics.rows.query v1 contract; Site and date window: your request; result: contract fields, not a recorded Site response.",[153,506,135],{"id":134},[508,509,510,523],"table",{"tabindex":222},[511,512,513],"thead",{},[514,515,516,520],"tr",{},[517,518,519],"th",{},"Field",[517,521,522],{},"Meaning",[524,525,526,537,547],"tbody",{},[514,527,528,534],{},[529,530,531],"td",{},[168,532,533],{},"data.rows",[529,535,536],{},"Matching rows. An empty array is valid.",[514,538,539,544],{},[529,540,541],{},[168,542,543],{},"meta.requestId",[529,545,546],{},"Identifier to include with a support request.",[514,548,549,561],{},[529,550,551,554,555,554,558],{},[168,552,553],{},"meta.sourceName",", ",[168,556,557],{},"meta.sourceKind",[168,559,560],{},"meta.queryMs",[529,562,563],{},"Query source and execution details.",[149,565,566,567,570],{},"Rows do not include Report totals or sync metadata. Use ",[162,568,569],{"href":57},"hosted analytics"," when you need those.",[153,572,138],{"id":137},[149,574,575,576,579,580,582],{},"Check the API key, Site ID, ",[168,577,578],{},"analytics:execute"," scope, and Site authorization. Catch typed errors with ",[162,581,107],{"href":106},". If rows are empty, confirm synced dates before widening the query.",[153,584,141],{"id":140},[149,586,587,588,554,590,592,593,192],{},"Add a server route with ",[162,589,79],{"href":78},[162,591,83],{"href":82},", or ",[162,594,87],{"href":86},{"title":113,"navigation":596,"description":114,"next":597,"related":599},{"title":41},{"title":598,"to":57},"Read hosted analytics and Reports",[600],{"title":601,"to":102},"Set up keys and scopes",{"title":113,"description":151,"toc":603},{"title":142,"searchDepth":125,"depth":125,"links":604},[605,609,610,611,612],{"id":119,"depth":121,"text":120,"children":606},[607,608],{"id":124,"depth":125,"text":126},{"id":128,"depth":125,"text":129},{"id":131,"depth":121,"text":132},{"id":134,"depth":121,"text":135},{"id":137,"depth":121,"text":138},{"id":140,"depth":121,"text":141},"sdkDocs\u002Fguides\u002F1.start\u002F2.hosted-first-result.md","md",{"title":41},{"title":598,"to":57},[618],{"title":601,"to":102},{"title":113,"description":114},"\u002Fopt\u002Factions-runner\u002F_work\u002Fgscdump.com\u002Fgscdump.com\u002Fnode_modules\u002F.cache\u002Fcomark-content\u002Fgit\u002Fd100867c457f148bef5f\u002Fdocs\u002Fgscdump-sdk\u002Fguides\u002F1.start\u002F2.hosted-first-result.md",{"loc":40},1794983848644]