[{"data":1,"prerenderedAt":418},["ShallowReactive",2],{"navigation_docs":3,"-providers-serpbase":100,"-providers-serpbase-surround":413},[4,44],{"title":5,"path":6,"stem":7,"children":8,"icon":43},"Guide","\u002Fguide","1.guide\u002F1.index",[9,11,15,19,23,27,31,35,39],{"title":10,"path":6,"stem":7},"Getting Started",{"title":12,"path":13,"stem":14},"Searching","\u002Fguide\u002Fsearch","1.guide\u002F2.search",{"title":16,"path":17,"stem":18},"Fan-out","\u002Fguide\u002Ffanout","1.guide\u002F3.fanout",{"title":20,"path":21,"stem":22},"Reading","\u002Fguide\u002Fread","1.guide\u002F4.read",{"title":24,"path":25,"stem":26},"Reverse Image Search","\u002Fguide\u002Fimage","1.guide\u002F5.image",{"title":28,"path":29,"stem":30},"CLI","\u002Fguide\u002Fcli","1.guide\u002F6.cli",{"title":32,"path":33,"stem":34},"Agents","\u002Fguide\u002Fagents","1.guide\u002F7.agents",{"title":36,"path":37,"stem":38},"Custom Providers","\u002Fguide\u002Fcustom","1.guide\u002F8.custom",{"title":40,"path":41,"stem":42},"Explorer","\u002Fguide\u002Fexplorer","1.guide\u002F9.explorer","i-lucide-book-open",{"title":45,"path":46,"stem":47,"children":48,"icon":99},"Providers","\u002Fproviders","2.providers\u002F0.index",[49,51,55,59,63,67,71,75,79,83,87,91,95],{"title":50,"path":46,"stem":47},"Overview",{"title":52,"path":53,"stem":54},"Brave","\u002Fproviders\u002Fbrave","2.providers\u002F01.brave",{"title":56,"path":57,"stem":58},"Context.dev","\u002Fproviders\u002Fcontext","2.providers\u002F02.context",{"title":60,"path":61,"stem":62},"Exa","\u002Fproviders\u002Fexa","2.providers\u002F03.exa",{"title":64,"path":65,"stem":66},"Firecrawl","\u002Fproviders\u002Ffirecrawl","2.providers\u002F04.firecrawl",{"title":68,"path":69,"stem":70},"Jina","\u002Fproviders\u002Fjina","2.providers\u002F05.jina",{"title":72,"path":73,"stem":74},"Mojeek","\u002Fproviders\u002Fmojeek","2.providers\u002F06.mojeek",{"title":76,"path":77,"stem":78},"SearXNG","\u002Fproviders\u002Fsearxng","2.providers\u002F07.searxng",{"title":80,"path":81,"stem":82},"SerpAPI","\u002Fproviders\u002Fserpapi","2.providers\u002F08.serpapi",{"title":84,"path":85,"stem":86},"SerpBase","\u002Fproviders\u002Fserpbase","2.providers\u002F09.serpbase",{"title":88,"path":89,"stem":90},"Tavily","\u002Fproviders\u002Ftavily","2.providers\u002F10.tavily",{"title":92,"path":93,"stem":94},"TinyFish","\u002Fproviders\u002Ftinyfish","2.providers\u002F11.tinyfish",{"title":96,"path":97,"stem":98},"OpenAI Codex","\u002Fproviders\u002Fopenai-codex","2.providers\u002F12.openai-codex","i-lucide-library",{"id":101,"title":84,"body":102,"description":406,"extension":407,"links":408,"meta":409,"navigation":167,"path":85,"seo":411,"stem":86,"__hash__":412},"docs\u002F2.providers\u002F09.serpbase.md",{"type":103,"value":104,"toc":399},"minimark",[105,109,114,267,278,282,330,334,357,361,386,390,395],[106,107],"provider-facts",{"provider":108},"serpbase",[110,111,113],"h2",{"id":112},"address-it","Address it",[115,116,121],"pre",{"className":117,"code":118,"language":119,"meta":120,"style":120},"language-ts shiki shiki-themes github-light github-light poimandres","import { create } from \"@agntn\u002Fweb\";\n\nconst serpbase = await create(\"serpbase\"); \u002F\u002F SERPBASE_API_KEY\nconst results = await serpbase.search(\"query\", { category: \"news\", maxResults: 10 });\n","ts","",[122,123,124,162,169,206],"code",{"__ignoreMap":120},[125,126,129,133,137,141,144,148,152,156,159],"span",{"class":127,"line":128},"line",1,[125,130,132],{"class":131},"sP0CR","import",[125,134,136],{"class":135},"sKlNE"," {",[125,138,140],{"class":139},"snHMy"," create",[125,142,143],{"class":135}," }",[125,145,147],{"class":146},"stCPd"," from",[125,149,151],{"class":150},"scVjq"," \"",[125,153,155],{"class":154},"sQ7BG","@agntn\u002Fweb",[125,157,158],{"class":150},"\"",[125,160,161],{"class":135},";\n",[125,163,165],{"class":127,"line":164},2,[125,166,168],{"emptyLinePlaceholder":167},true,"\n",[125,170,172,176,180,183,187,190,193,195,197,199,202],{"class":127,"line":171},3,[125,173,175],{"class":174},"s1TYA","const",[125,177,179],{"class":178},"saoiD"," serpbase",[125,181,182],{"class":174}," =",[125,184,186],{"class":185},"sZW6a"," await",[125,188,140],{"class":189},"sULi6",[125,191,192],{"class":135},"(",[125,194,158],{"class":150},[125,196,108],{"class":154},[125,198,158],{"class":150},[125,200,201],{"class":135},"); ",[125,203,205],{"class":204},"sjhu3","\u002F\u002F SERPBASE_API_KEY\n",[125,207,209,211,214,216,218,221,224,227,229,231,234,236,239,242,245,247,250,252,255,258,260,264],{"class":127,"line":208},4,[125,210,175],{"class":174},[125,212,213],{"class":178}," results",[125,215,182],{"class":174},[125,217,186],{"class":185},[125,219,179],{"class":220},"spVlQ",[125,222,223],{"class":135},".",[125,225,226],{"class":189},"search",[125,228,192],{"class":135},[125,230,158],{"class":150},[125,232,233],{"class":154},"query",[125,235,158],{"class":150},[125,237,238],{"class":135},", {",[125,240,241],{"class":139}," category",[125,243,244],{"class":135},":",[125,246,151],{"class":150},[125,248,249],{"class":154},"news",[125,251,158],{"class":150},[125,253,254],{"class":135},",",[125,256,257],{"class":139}," maxResults",[125,259,244],{"class":135},[125,261,263],{"class":262},"siHFe"," 10",[125,265,266],{"class":135}," });\n",[268,269,270,271,274,275,223],"p",{},"The key goes in the ",[122,272,273],{},"X-API-Key"," header against ",[122,276,277],{},"api.serpbase.dev",[110,279,281],{"id":280},"what-it-reads","What it reads",[283,284,285,298],"table",{},[286,287,288],"thead",{},[289,290,291,295],"tr",{},[292,293,294],"th",{},"Call",[292,296,297],{},"Endpoint",[299,300,301],"tbody",{},[289,302,303,308],{},[304,305,306],"td",{},[122,307,226],{},[304,309,310,313,314,317,318,321,322,321,324,317,327],{},[122,311,312],{},"POST"," to the endpoint the category picks: web by default, ",[122,315,316],{},"images","\u002F",[122,319,320],{},"image",", ",[122,323,249],{},[122,325,326],{},"videos",[122,328,329],{},"video",[110,331,333],{"id":332},"what-comes-back","What comes back",[268,335,336,321,339,321,341,344,345,348,349,352,353,356],{},[122,337,338],{},"publishedDate",[122,340,320],{},[122,342,343],{},"favicon"," and ",[122,346,347],{},"metadata.{position, rank, searchType, requestId, elapsedMs, creditsCharged}",". Only ",[122,350,351],{},"category"," is honoured. Paging works, but the next token stays ",[122,354,355],{},"unknown"," until a page comes back empty, SerpBase does not say when it is done.",[110,358,360],{"id":359},"gotchas","Gotchas",[362,363,364,371],"ul",{},[365,366,367,370],"li",{},[122,368,369],{},"maxResults"," is applied on our side to the returned page, the endpoint decides the page size.",[365,372,373,374,377,378,381,382,385],{},"Credits are charged per request and reported in ",[122,375,376],{},"metadata.creditsCharged",". An empty balance answers HTTP 200 with ",[122,379,380],{},"status: 1020",". That is ",[122,383,384],{},"PaymentError"," here, so automatic search tries the next configured provider instead of stopping.",[110,387,389],{"id":388},"where-it-lives","Where it lives",[268,391,392,223],{},[122,393,394],{},"src\u002Fproviders\u002Fserpbase.ts",[396,397,398],"style",{},"html pre.shiki code .sP0CR, html code.shiki .sP0CR{--shiki-light:#D73A49;--shiki-default:#D73A49;--shiki-dark:#5DE4C7}html pre.shiki code .sKlNE, html code.shiki .sKlNE{--shiki-light:#24292E;--shiki-default:#24292E;--shiki-dark:#A6ACCD}html pre.shiki code .snHMy, html code.shiki .snHMy{--shiki-light:#24292E;--shiki-default:#24292E;--shiki-dark:#ADD7FF}html pre.shiki code .stCPd, html code.shiki .stCPd{--shiki-light:#D73A49;--shiki-default:#D73A49;--shiki-dark:#A6ACCD}html pre.shiki code .scVjq, html code.shiki .scVjq{--shiki-light:#032F62;--shiki-default:#032F62;--shiki-dark:#A6ACCD}html pre.shiki code .sQ7BG, html code.shiki .sQ7BG{--shiki-light:#032F62;--shiki-default:#032F62;--shiki-dark:#5DE4C7}html pre.shiki code .s1TYA, html code.shiki .s1TYA{--shiki-light:#D73A49;--shiki-default:#D73A49;--shiki-dark:#91B4D5}html pre.shiki code .saoiD, html code.shiki .saoiD{--shiki-light:#005CC5;--shiki-default:#005CC5;--shiki-dark:#E4F0FB}html pre.shiki code .sZW6a, html code.shiki .sZW6a{--shiki-light:#D73A49;--shiki-default:#D73A49;--shiki-dark:#5DE4C7C0}html pre.shiki code .sULi6, html code.shiki .sULi6{--shiki-light:#6F42C1;--shiki-default:#6F42C1;--shiki-dark:#E4F0FBD0}html pre.shiki code .sjhu3, html code.shiki .sjhu3{--shiki-light:#6A737D;--shiki-light-font-style:inherit;--shiki-default:#6A737D;--shiki-default-font-style:inherit;--shiki-dark:#767C9DB0;--shiki-dark-font-style:italic}html pre.shiki code .spVlQ, html code.shiki .spVlQ{--shiki-light:#24292E;--shiki-default:#24292E;--shiki-dark:#E4F0FB}html pre.shiki code .siHFe, html code.shiki .siHFe{--shiki-light:#005CC5;--shiki-default:#005CC5;--shiki-dark:#5DE4C7}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":120,"searchDepth":164,"depth":164,"links":400},[401,402,403,404,405],{"id":112,"depth":164,"text":113},{"id":280,"depth":164,"text":281},{"id":332,"depth":164,"text":333},{"id":359,"depth":164,"text":360},{"id":388,"depth":164,"text":389},"SerpBase's Google SERP endpoints, with a category that picks the web, images, news or videos endpoint.","md",null,{"icon":410},"i-lucide-layers",{"title":84,"description":406},"vRy2aZM_BVpCWC-Xl5m8AyNUlm4tsWZnEN3IYOloe7Y",[414,416],{"title":80,"path":81,"stem":82,"description":415,"children":-1},"SerpAPI's Google endpoints for classic SERP results and Google Lens for reverse image search.",{"title":88,"path":89,"stem":90,"description":417,"children":-1},"The Tavily search API, with an optional generated answer in response metadata, and Tavily Extract for reading pages.",1790041408062]