[{"data":1,"prerenderedAt":1706},["ShallowReactive",2],{"navigation_docs":3,"-guide":104,"-guide-surround":1703},[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":103},"Providers","\u002Fproviders","2.providers\u002F0.index",[49,51,55,59,63,67,71,75,79,83,87,91,95,99],{"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",{"title":100,"path":101,"stem":102},"Marginalia","\u002Fproviders\u002Fmarginalia","2.providers\u002F13.marginalia","i-lucide-library",{"id":105,"title":10,"body":106,"description":1697,"extension":1698,"links":1699,"meta":1700,"navigation":284,"path":6,"seo":1701,"stem":7,"__hash__":1702},"docs\u002F1.guide\u002F1.index.md",{"type":107,"value":108,"toc":1686},"minimark",[109,117,124,129,142,173,177,202,216,233,237,442,467,546,550,747,755,761,765,995,1001,1005,1158,1173,1177,1366,1380,1384,1582,1649,1653,1682],[110,111,112,116],"warning",{},[113,114,115],"strong",{},"Pre-1.0."," The public API, the provider list and the CLI flags can still change. Pin exact versions if you build on it now.",[118,119,120,123],"caution",{},[113,121,122],{},"Search results and page content are data, never instructions."," Titles, snippets, highlights and Markdown come from sites anyone can publish. Show them, index them, summarize them. Do not let an agent read them as a message to itself, seriously.",[125,126,128],"h2",{"id":127},"why-this-exists","Why this exists",[130,131,132,133,137,138,141],"p",{},"Every search API has its own idea of a request. Exa wants a POST with ",[134,135,136],"code",{},"x-api-key",", Brave a GET with ",[134,139,140],{},"X-Subscription-Token",", Jina a Bearer token, Tavily puts the key in the request body. They all give back roughly the same thing, a list of URLs with titles and snippets, just wrapped thirteen different ways. Pull one client per engine into an agent and you have thirteen response shapes and thirteen ways to misread a date.",[130,143,144,145,148,149,152,153,156,157,160,161,164,165,168,169,172],{},"So ",[134,146,147],{},"@agntn\u002Fweb"," puts thirteen providers behind one class shape and three capabilities: ",[113,150,151],{},"search"," (query → results), ",[113,154,155],{},"search image"," (public image URL → matching pages) and ",[113,158,159],{},"read"," (URL → normalized page content). Same calls, same ",[134,162,163],{},"SearchResult",", ",[134,166,167],{},"ImageSearchResult"," and ",[134,170,171],{},"ReadResult"," everywhere. The adapter decides how to ask, you decide what to ask for.",[125,174,176],{"id":175},"install","Install",[178,179,184],"pre",{"className":180,"code":181,"language":182,"meta":183,"style":183},"language-bash shiki shiki-themes github-light github-light poimandres","pnpm add @agntn\u002Fweb\n","bash","",[134,185,186],{"__ignoreMap":183},[187,188,191,195,199],"span",{"class":189,"line":190},"line",1,[187,192,194],{"class":193},"sseY5","pnpm",[187,196,198],{"class":197},"sX7Zv"," add",[187,200,201],{"class":197}," @agntn\u002Fweb\n",[130,203,204,205,208,209,168,212,215],{},"The AI SDK tools on the ",[134,206,207],{},"\u002Fai"," subpath need ",[134,210,211],{},"ai",[134,213,214],{},"zod"," next to them:",[178,217,219],{"className":180,"code":218,"language":182,"meta":183,"style":183},"pnpm add ai zod\n",[134,220,221],{"__ignoreMap":183},[187,222,223,225,227,230],{"class":189,"line":190},[187,224,194],{"class":193},[187,226,198],{"class":197},[187,228,229],{"class":197}," ai",[187,231,232],{"class":197}," zod\n",[125,234,236],{"id":235},"first-search","First search",[178,238,243],{"className":239,"code":240,"filename":241,"language":242,"meta":183,"style":183},"language-ts shiki shiki-themes github-light github-light poimandres","import { create } from \"@agntn\u002Fweb\";\n\n\u002F\u002F Reads EXA_API_KEY from process.env and imports the Exa adapter\nconst exa = await create(\"exa\");\n\nconst results = await exa.search(\"typescript runtime benchmarks\", { maxResults: 5 });\n\nfor (const result of results) {\n  console.log(result.title, result.url);\n}\n","search.ts","ts",[134,244,245,279,286,293,327,332,377,382,404,436],{"__ignoreMap":183},[187,246,247,251,255,259,262,266,270,273,276],{"class":189,"line":190},[187,248,250],{"class":249},"sP0CR","import",[187,252,254],{"class":253},"sKlNE"," {",[187,256,258],{"class":257},"snHMy"," create",[187,260,261],{"class":253}," }",[187,263,265],{"class":264},"stCPd"," from",[187,267,269],{"class":268},"scVjq"," \"",[187,271,147],{"class":272},"sQ7BG",[187,274,275],{"class":268},"\"",[187,277,278],{"class":253},";\n",[187,280,282],{"class":189,"line":281},2,[187,283,285],{"emptyLinePlaceholder":284},true,"\n",[187,287,289],{"class":189,"line":288},3,[187,290,292],{"class":291},"sjhu3","\u002F\u002F Reads EXA_API_KEY from process.env and imports the Exa adapter\n",[187,294,296,300,304,307,311,314,317,319,322,324],{"class":189,"line":295},4,[187,297,299],{"class":298},"s1TYA","const",[187,301,303],{"class":302},"saoiD"," exa",[187,305,306],{"class":298}," =",[187,308,310],{"class":309},"sZW6a"," await",[187,312,258],{"class":313},"sULi6",[187,315,316],{"class":253},"(",[187,318,275],{"class":268},[187,320,321],{"class":272},"exa",[187,323,275],{"class":268},[187,325,326],{"class":253},");\n",[187,328,330],{"class":189,"line":329},5,[187,331,285],{"emptyLinePlaceholder":284},[187,333,335,337,340,342,344,347,350,352,354,356,359,361,364,367,370,374],{"class":189,"line":334},6,[187,336,299],{"class":298},[187,338,339],{"class":302}," results",[187,341,306],{"class":298},[187,343,310],{"class":309},[187,345,303],{"class":346},"spVlQ",[187,348,349],{"class":253},".",[187,351,151],{"class":313},[187,353,316],{"class":253},[187,355,275],{"class":268},[187,357,358],{"class":272},"typescript runtime benchmarks",[187,360,275],{"class":268},[187,362,363],{"class":253},", {",[187,365,366],{"class":257}," maxResults",[187,368,369],{"class":253},":",[187,371,373],{"class":372},"siHFe"," 5",[187,375,376],{"class":253}," });\n",[187,378,380],{"class":189,"line":379},7,[187,381,285],{"emptyLinePlaceholder":284},[187,383,385,388,391,393,396,399,401],{"class":189,"line":384},8,[187,386,387],{"class":264},"for",[187,389,390],{"class":253}," (",[187,392,299],{"class":298},[187,394,395],{"class":302}," result",[187,397,398],{"class":298}," of",[187,400,339],{"class":346},[187,402,403],{"class":253},") {\n",[187,405,407,410,412,415,417,420,422,425,427,429,431,434],{"class":189,"line":406},9,[187,408,409],{"class":346},"  console",[187,411,349],{"class":253},[187,413,414],{"class":313},"log",[187,416,316],{"class":253},[187,418,419],{"class":346},"result",[187,421,349],{"class":253},[187,423,424],{"class":346},"title",[187,426,164],{"class":253},[187,428,419],{"class":346},[187,430,349],{"class":253},[187,432,433],{"class":346},"url",[187,435,326],{"class":253},[187,437,439],{"class":189,"line":438},10,[187,440,441],{"class":253},"}\n",[130,443,444,445,447,448,164,451,454,455,458,459,462,463,466],{},"Importing ",[134,446,147],{}," loads none of the thirteen built-in providers. ",[134,449,450],{},"create(\"brave\")",[134,452,453],{},"create(\"tavily\")"," or ",[134,456,457],{},"create(\"searxng\")"," imports that one adapter on the first call and resolves the class, no switch statement anywhere, which is why ",[134,460,461],{},"create()"," is async. The key comes from the provider's env var unless you pass ",[134,464,465],{},"apiKey"," yourself:",[178,468,470],{"className":239,"code":469,"language":242,"meta":183,"style":183},"const exa = await create(\"exa\", { apiKey: \"your-key-here\" });\nconst searx = await create(\"searxng\", { baseURL: \"https:\u002F\u002Fsearx.example.com\" });\n",[134,471,472,508],{"__ignoreMap":183},[187,473,474,476,478,480,482,484,486,488,490,492,494,497,499,501,504,506],{"class":189,"line":190},[187,475,299],{"class":298},[187,477,303],{"class":302},[187,479,306],{"class":298},[187,481,310],{"class":309},[187,483,258],{"class":313},[187,485,316],{"class":253},[187,487,275],{"class":268},[187,489,321],{"class":272},[187,491,275],{"class":268},[187,493,363],{"class":253},[187,495,496],{"class":257}," apiKey",[187,498,369],{"class":253},[187,500,269],{"class":268},[187,502,503],{"class":272},"your-key-here",[187,505,275],{"class":268},[187,507,376],{"class":253},[187,509,510,512,515,517,519,521,523,525,528,530,532,535,537,539,542,544],{"class":189,"line":281},[187,511,299],{"class":298},[187,513,514],{"class":302}," searx",[187,516,306],{"class":298},[187,518,310],{"class":309},[187,520,258],{"class":313},[187,522,316],{"class":253},[187,524,275],{"class":268},[187,526,527],{"class":272},"searxng",[187,529,275],{"class":268},[187,531,363],{"class":253},[187,533,534],{"class":257}," baseURL",[187,536,369],{"class":253},[187,538,269],{"class":268},[187,540,541],{"class":272},"https:\u002F\u002Fsearx.example.com",[187,543,275],{"class":268},[187,545,376],{"class":253},[125,547,549],{"id":548},"same-call-any-provider","Same call, any provider",[178,551,553],{"className":239,"code":552,"language":242,"meta":183,"style":183},"const brave = await create(\"brave\"); \u002F\u002F BRAVE_API_KEY\nconst context = await create(\"context\"); \u002F\u002F CONTEXT_DEV_API_KEY\nconst jina = await create(\"jina\"); \u002F\u002F JINA_API_KEY\nconst mojeek = await create(\"mojeek\"); \u002F\u002F MOJEEK_API_KEY\nconst tavily = await create(\"tavily\"); \u002F\u002F TAVILY_API_KEY\nconst tinyfish = await create(\"tinyfish\"); \u002F\u002F TINYFISH_API_KEY\n\nawait brave.search(\"query\"); \u002F\u002F the same call on every one of them\n",[134,554,555,583,610,637,664,691,718,722],{"__ignoreMap":183},[187,556,557,559,562,564,566,568,570,572,575,577,580],{"class":189,"line":190},[187,558,299],{"class":298},[187,560,561],{"class":302}," brave",[187,563,306],{"class":298},[187,565,310],{"class":309},[187,567,258],{"class":313},[187,569,316],{"class":253},[187,571,275],{"class":268},[187,573,574],{"class":272},"brave",[187,576,275],{"class":268},[187,578,579],{"class":253},"); ",[187,581,582],{"class":291},"\u002F\u002F BRAVE_API_KEY\n",[187,584,585,587,590,592,594,596,598,600,603,605,607],{"class":189,"line":281},[187,586,299],{"class":298},[187,588,589],{"class":302}," context",[187,591,306],{"class":298},[187,593,310],{"class":309},[187,595,258],{"class":313},[187,597,316],{"class":253},[187,599,275],{"class":268},[187,601,602],{"class":272},"context",[187,604,275],{"class":268},[187,606,579],{"class":253},[187,608,609],{"class":291},"\u002F\u002F CONTEXT_DEV_API_KEY\n",[187,611,612,614,617,619,621,623,625,627,630,632,634],{"class":189,"line":288},[187,613,299],{"class":298},[187,615,616],{"class":302}," jina",[187,618,306],{"class":298},[187,620,310],{"class":309},[187,622,258],{"class":313},[187,624,316],{"class":253},[187,626,275],{"class":268},[187,628,629],{"class":272},"jina",[187,631,275],{"class":268},[187,633,579],{"class":253},[187,635,636],{"class":291},"\u002F\u002F JINA_API_KEY\n",[187,638,639,641,644,646,648,650,652,654,657,659,661],{"class":189,"line":295},[187,640,299],{"class":298},[187,642,643],{"class":302}," mojeek",[187,645,306],{"class":298},[187,647,310],{"class":309},[187,649,258],{"class":313},[187,651,316],{"class":253},[187,653,275],{"class":268},[187,655,656],{"class":272},"mojeek",[187,658,275],{"class":268},[187,660,579],{"class":253},[187,662,663],{"class":291},"\u002F\u002F MOJEEK_API_KEY\n",[187,665,666,668,671,673,675,677,679,681,684,686,688],{"class":189,"line":329},[187,667,299],{"class":298},[187,669,670],{"class":302}," tavily",[187,672,306],{"class":298},[187,674,310],{"class":309},[187,676,258],{"class":313},[187,678,316],{"class":253},[187,680,275],{"class":268},[187,682,683],{"class":272},"tavily",[187,685,275],{"class":268},[187,687,579],{"class":253},[187,689,690],{"class":291},"\u002F\u002F TAVILY_API_KEY\n",[187,692,693,695,698,700,702,704,706,708,711,713,715],{"class":189,"line":334},[187,694,299],{"class":298},[187,696,697],{"class":302}," tinyfish",[187,699,306],{"class":298},[187,701,310],{"class":309},[187,703,258],{"class":313},[187,705,316],{"class":253},[187,707,275],{"class":268},[187,709,710],{"class":272},"tinyfish",[187,712,275],{"class":268},[187,714,579],{"class":253},[187,716,717],{"class":291},"\u002F\u002F TINYFISH_API_KEY\n",[187,719,720],{"class":189,"line":379},[187,721,285],{"emptyLinePlaceholder":284},[187,723,724,727,729,731,733,735,737,740,742,744],{"class":189,"line":384},[187,725,726],{"class":309},"await",[187,728,561],{"class":346},[187,730,349],{"class":253},[187,732,151],{"class":313},[187,734,316],{"class":253},[187,736,275],{"class":268},[187,738,739],{"class":272},"query",[187,741,275],{"class":268},[187,743,579],{"class":253},[187,745,746],{"class":291},"\u002F\u002F the same call on every one of them\n",[130,748,749,750,754],{},"The ",[751,752,40],"a",{"href":753},"\u002Fexplorer"," runs exactly these calls against the docs worker, so you can see what comes back before you write a line.",[130,756,757,758,760],{},"Codex search reuses existing Pi, OMP, Codex and OpenCode OAuth logins rather than an API key. See ",[751,759,96],{"href":97}," for login discovery, refresh ownership and explicit overrides.",[125,762,764],{"id":763},"what-ships","What ships",[766,767,768,790],"table",{},[769,770,771],"thead",{},[772,773,774,778,781,784,787],"tr",{},[775,776,777],"th",{},"Provider",[775,779,780],{},"Env var",[775,782,783],{},"Search",[775,785,786],{},"Image",[775,788,789],{},"Read",[791,792,793,810,825,840,855,871,891,906,922,935,950,965,980],"tbody",{},[772,794,795,798,803,806,808],{},[796,797,52],"td",{},[796,799,800],{},[134,801,802],{},"BRAVE_API_KEY",[796,804,805],{},"yes",[796,807],{},[796,809],{},[772,811,812,814,819,821,823],{},[796,813,56],{},[796,815,816],{},[134,817,818],{},"CONTEXT_DEV_API_KEY",[796,820,805],{},[796,822],{},[796,824,805],{},[772,826,827,829,834,836,838],{},[796,828,60],{},[796,830,831],{},[134,832,833],{},"EXA_API_KEY",[796,835,805],{},[796,837],{},[796,839,805],{},[772,841,842,844,849,851,853],{},[796,843,64],{},[796,845,846],{},[134,847,848],{},"FIRECRAWL_API_KEY",[796,850,805],{},[796,852],{},[796,854,805],{},[772,856,857,859,864,866,868],{},[796,858,68],{},[796,860,861],{},[134,862,863],{},"JINA_API_KEY",[796,865,805],{},[796,867],{},[796,869,870],{},"yes, key optional",[772,872,873,875,885,887,889],{},[796,874,100],{},[796,876,877,880,881,884],{},[134,878,879],{},"MARGINALIA_API_KEY",", or the shared ",[134,882,883],{},"public"," key when named",[796,886,805],{},[796,888],{},[796,890],{},[772,892,893,895,900,902,904],{},[796,894,72],{},[796,896,897],{},[134,898,899],{},"MOJEEK_API_KEY",[796,901,805],{},[796,903],{},[796,905],{},[772,907,908,910,916,918,920],{},[796,909,96],{},[796,911,912,913],{},"Existing login; optional ",[134,914,915],{},"OPENAI_CODEX_ACCESS_TOKEN",[796,917,805],{},[796,919],{},[796,921],{},[772,923,924,926,929,931,933],{},[796,925,76],{},[796,927,928],{},"none, self-hosted",[796,930,805],{},[796,932],{},[796,934],{},[772,936,937,939,944,946,948],{},[796,938,80],{},[796,940,941],{},[134,942,943],{},"SERPAPI_API_KEY",[796,945,805],{},[796,947,805],{},[796,949],{},[772,951,952,954,959,961,963],{},[796,953,84],{},[796,955,956],{},[134,957,958],{},"SERPBASE_API_KEY",[796,960,805],{},[796,962],{},[796,964],{},[772,966,967,969,974,976,978],{},[796,968,88],{},[796,970,971],{},[134,972,973],{},"TAVILY_API_KEY",[796,975,805],{},[796,977],{},[796,979,805],{},[772,981,982,984,989,991,993],{},[796,983,92],{},[796,985,986],{},[134,987,988],{},"TINYFISH_API_KEY",[796,990,805],{},[796,992],{},[796,994,805],{},[130,996,997,998,1000],{},"Each one has a page under ",[751,999,45],{"href":46}," with the endpoints, the filters it honours, the fields it fills and the traps. The traps are the useful part.",[125,1002,1004],{"id":1003},"the-three-capabilities","The three capabilities",[178,1006,1008],{"className":239,"code":1007,"language":242,"meta":183,"style":183},"import { readUrl, searchAll, searchByImage } from \"@agntn\u002Fweb\";\n\nconst results = await searchAll(\"latest node.js release\"); \u002F\u002F every configured provider, deduplicated\nconst matches = await searchByImage(\"https:\u002F\u002Fexample.com\u002Fimage.jpg\", { provider: \"serpapi\" });\nconst page = await readUrl(\"https:\u002F\u002Fexample.com\u002Farticle\", { format: \"markdown\", maxChars: 20_000 });\n",[134,1009,1010,1042,1046,1072,1110],{"__ignoreMap":183},[187,1011,1012,1014,1016,1019,1022,1025,1027,1030,1032,1034,1036,1038,1040],{"class":189,"line":190},[187,1013,250],{"class":249},[187,1015,254],{"class":253},[187,1017,1018],{"class":257}," readUrl",[187,1020,1021],{"class":253},",",[187,1023,1024],{"class":257}," searchAll",[187,1026,1021],{"class":253},[187,1028,1029],{"class":257}," searchByImage",[187,1031,261],{"class":253},[187,1033,265],{"class":264},[187,1035,269],{"class":268},[187,1037,147],{"class":272},[187,1039,275],{"class":268},[187,1041,278],{"class":253},[187,1043,1044],{"class":189,"line":281},[187,1045,285],{"emptyLinePlaceholder":284},[187,1047,1048,1050,1052,1054,1056,1058,1060,1062,1065,1067,1069],{"class":189,"line":288},[187,1049,299],{"class":298},[187,1051,339],{"class":302},[187,1053,306],{"class":298},[187,1055,310],{"class":309},[187,1057,1024],{"class":313},[187,1059,316],{"class":253},[187,1061,275],{"class":268},[187,1063,1064],{"class":272},"latest node.js release",[187,1066,275],{"class":268},[187,1068,579],{"class":253},[187,1070,1071],{"class":291},"\u002F\u002F every configured provider, deduplicated\n",[187,1073,1074,1076,1079,1081,1083,1085,1087,1089,1092,1094,1096,1099,1101,1103,1106,1108],{"class":189,"line":295},[187,1075,299],{"class":298},[187,1077,1078],{"class":302}," matches",[187,1080,306],{"class":298},[187,1082,310],{"class":309},[187,1084,1029],{"class":313},[187,1086,316],{"class":253},[187,1088,275],{"class":268},[187,1090,1091],{"class":272},"https:\u002F\u002Fexample.com\u002Fimage.jpg",[187,1093,275],{"class":268},[187,1095,363],{"class":253},[187,1097,1098],{"class":257}," provider",[187,1100,369],{"class":253},[187,1102,269],{"class":268},[187,1104,1105],{"class":272},"serpapi",[187,1107,275],{"class":268},[187,1109,376],{"class":253},[187,1111,1112,1114,1117,1119,1121,1123,1125,1127,1130,1132,1134,1137,1139,1141,1144,1146,1148,1151,1153,1156],{"class":189,"line":329},[187,1113,299],{"class":298},[187,1115,1116],{"class":302}," page",[187,1118,306],{"class":298},[187,1120,310],{"class":309},[187,1122,1018],{"class":313},[187,1124,316],{"class":253},[187,1126,275],{"class":268},[187,1128,1129],{"class":272},"https:\u002F\u002Fexample.com\u002Farticle",[187,1131,275],{"class":268},[187,1133,363],{"class":253},[187,1135,1136],{"class":257}," format",[187,1138,369],{"class":253},[187,1140,269],{"class":268},[187,1142,1143],{"class":272},"markdown",[187,1145,275],{"class":268},[187,1147,1021],{"class":253},[187,1149,1150],{"class":257}," maxChars",[187,1152,369],{"class":253},[187,1154,1155],{"class":372}," 20_000",[187,1157,376],{"class":253},[130,1159,1160,1162,1163,1165,1166,1168,1169,1172],{},[751,1161,12],{"href":13}," covers the call to one provider and its options. ",[751,1164,16],{"href":17}," is the parallel query, fallback and pagination. ",[751,1167,20],{"href":21}," is URL to content. ",[751,1170,1171],{"href":25},"Reverse image search"," is the image lookup.",[125,1174,1176],{"id":1175},"one-result-shape","One result shape",[178,1178,1180],{"className":239,"code":1179,"language":242,"meta":183,"style":183},"interface SearchResult {\n  url: string;\n  title: string;\n  snippet: string;\n  score?: number;\n  publishedDate?: string;\n  author?: string;\n  image?: string;\n  favicon?: string;\n  text?: string; \u002F\u002F full page text when requested or provided\n  highlights?: string[]; \u002F\u002F passages relevant to the query\n  summary?: string; \u002F\u002F generated summary when requested\n  metadata?: Record\u003Cstring, unknown>; \u002F\u002F whatever else the provider knew\n}\n",[134,1181,1182,1194,1208,1219,1230,1243,1254,1265,1276,1287,1302,1318,1333,1361],{"__ignoreMap":183},[187,1183,1184,1187,1191],{"class":189,"line":190},[187,1185,1186],{"class":298},"interface",[187,1188,1190],{"class":1189},"sCrqT"," SearchResult",[187,1192,1193],{"class":253}," {\n",[187,1195,1196,1200,1202,1206],{"class":189,"line":281},[187,1197,1199],{"class":1198},"s0VbO","  url",[187,1201,369],{"class":298},[187,1203,1205],{"class":1204},"s8yaW"," string",[187,1207,278],{"class":253},[187,1209,1210,1213,1215,1217],{"class":189,"line":288},[187,1211,1212],{"class":1198},"  title",[187,1214,369],{"class":298},[187,1216,1205],{"class":1204},[187,1218,278],{"class":253},[187,1220,1221,1224,1226,1228],{"class":189,"line":295},[187,1222,1223],{"class":1198},"  snippet",[187,1225,369],{"class":298},[187,1227,1205],{"class":1204},[187,1229,278],{"class":253},[187,1231,1232,1235,1238,1241],{"class":189,"line":329},[187,1233,1234],{"class":1198},"  score",[187,1236,1237],{"class":298},"?:",[187,1239,1240],{"class":1204}," number",[187,1242,278],{"class":253},[187,1244,1245,1248,1250,1252],{"class":189,"line":334},[187,1246,1247],{"class":1198},"  publishedDate",[187,1249,1237],{"class":298},[187,1251,1205],{"class":1204},[187,1253,278],{"class":253},[187,1255,1256,1259,1261,1263],{"class":189,"line":379},[187,1257,1258],{"class":1198},"  author",[187,1260,1237],{"class":298},[187,1262,1205],{"class":1204},[187,1264,278],{"class":253},[187,1266,1267,1270,1272,1274],{"class":189,"line":384},[187,1268,1269],{"class":1198},"  image",[187,1271,1237],{"class":298},[187,1273,1205],{"class":1204},[187,1275,278],{"class":253},[187,1277,1278,1281,1283,1285],{"class":189,"line":406},[187,1279,1280],{"class":1198},"  favicon",[187,1282,1237],{"class":298},[187,1284,1205],{"class":1204},[187,1286,278],{"class":253},[187,1288,1289,1292,1294,1296,1299],{"class":189,"line":438},[187,1290,1291],{"class":1198},"  text",[187,1293,1237],{"class":298},[187,1295,1205],{"class":1204},[187,1297,1298],{"class":253},"; ",[187,1300,1301],{"class":291},"\u002F\u002F full page text when requested or provided\n",[187,1303,1305,1308,1310,1312,1315],{"class":189,"line":1304},11,[187,1306,1307],{"class":1198},"  highlights",[187,1309,1237],{"class":298},[187,1311,1205],{"class":1204},[187,1313,1314],{"class":253},"[]; ",[187,1316,1317],{"class":291},"\u002F\u002F passages relevant to the query\n",[187,1319,1321,1324,1326,1328,1330],{"class":189,"line":1320},12,[187,1322,1323],{"class":1198},"  summary",[187,1325,1237],{"class":298},[187,1327,1205],{"class":1204},[187,1329,1298],{"class":253},[187,1331,1332],{"class":291},"\u002F\u002F generated summary when requested\n",[187,1334,1336,1339,1341,1344,1347,1350,1352,1355,1358],{"class":189,"line":1335},13,[187,1337,1338],{"class":1198},"  metadata",[187,1340,1237],{"class":298},[187,1342,1343],{"class":1189}," Record",[187,1345,1346],{"class":253},"\u003C",[187,1348,1349],{"class":1204},"string",[187,1351,164],{"class":253},[187,1353,1354],{"class":1204},"unknown",[187,1356,1357],{"class":253},">; ",[187,1359,1360],{"class":291},"\u002F\u002F whatever else the provider knew\n",[187,1362,1364],{"class":189,"line":1363},14,[187,1365,441],{"class":253},[130,1367,1368,164,1370,168,1372,1375,1376,1379],{},[134,1369,433],{},[134,1371,424],{},[134,1373,1374],{},"snippet"," are always there. The optional fields depend on what the engine exposes, each provider page says which ones it fills. ",[134,1377,1378],{},"metadata"," is the escape hatch for the rest, and yes, it is a bag.",[125,1381,1383],{"id":1382},"errors","Errors",[178,1385,1387],{"className":239,"code":1386,"language":242,"meta":183,"style":183},"import { AuthError, HTTPError, RateLimitError, UnknownProviderError } from \"@agntn\u002Fweb\";\n\ntry {\n  await provider.search(\"query\");\n} catch (error) {\n  if (error instanceof AuthError) {\n    \u002F\u002F missing or invalid API key, error.provider says which\n  }\n  if (error instanceof RateLimitError) {\n    console.log(`Retry after ${error.retryAfter}s`);\n  }\n  if (error instanceof UnknownProviderError) {\n    \u002F\u002F provider name not registered\n  }\n}\n",[134,1388,1389,1425,1429,1437,1458,1473,1489,1494,1499,1513,1550,1554,1568,1573,1577],{"__ignoreMap":183},[187,1390,1391,1393,1395,1398,1400,1403,1405,1408,1410,1413,1415,1417,1419,1421,1423],{"class":189,"line":190},[187,1392,250],{"class":249},[187,1394,254],{"class":253},[187,1396,1397],{"class":257}," AuthError",[187,1399,1021],{"class":253},[187,1401,1402],{"class":257}," HTTPError",[187,1404,1021],{"class":253},[187,1406,1407],{"class":257}," RateLimitError",[187,1409,1021],{"class":253},[187,1411,1412],{"class":257}," UnknownProviderError",[187,1414,261],{"class":253},[187,1416,265],{"class":264},[187,1418,269],{"class":268},[187,1420,147],{"class":272},[187,1422,275],{"class":268},[187,1424,278],{"class":253},[187,1426,1427],{"class":189,"line":281},[187,1428,285],{"emptyLinePlaceholder":284},[187,1430,1431,1435],{"class":189,"line":288},[187,1432,1434],{"class":1433},"szlwh","try",[187,1436,1193],{"class":253},[187,1438,1439,1442,1444,1446,1448,1450,1452,1454,1456],{"class":189,"line":295},[187,1440,1441],{"class":309},"  await",[187,1443,1098],{"class":346},[187,1445,349],{"class":253},[187,1447,151],{"class":313},[187,1449,316],{"class":253},[187,1451,275],{"class":268},[187,1453,739],{"class":272},[187,1455,275],{"class":268},[187,1457,326],{"class":253},[187,1459,1460,1463,1466,1468,1471],{"class":189,"line":329},[187,1461,1462],{"class":253},"} ",[187,1464,1465],{"class":1433},"catch",[187,1467,390],{"class":253},[187,1469,1470],{"class":346},"error",[187,1472,403],{"class":253},[187,1474,1475,1478,1480,1482,1485,1487],{"class":189,"line":334},[187,1476,1477],{"class":264},"  if",[187,1479,390],{"class":253},[187,1481,1470],{"class":346},[187,1483,1484],{"class":298}," instanceof",[187,1486,1397],{"class":1189},[187,1488,403],{"class":253},[187,1490,1491],{"class":189,"line":379},[187,1492,1493],{"class":291},"    \u002F\u002F missing or invalid API key, error.provider says which\n",[187,1495,1496],{"class":189,"line":384},[187,1497,1498],{"class":253},"  }\n",[187,1500,1501,1503,1505,1507,1509,1511],{"class":189,"line":406},[187,1502,1477],{"class":264},[187,1504,390],{"class":253},[187,1506,1470],{"class":346},[187,1508,1484],{"class":298},[187,1510,1407],{"class":1189},[187,1512,403],{"class":253},[187,1514,1515,1518,1520,1522,1524,1527,1530,1533,1535,1537,1540,1543,1546,1548],{"class":189,"line":438},[187,1516,1517],{"class":346},"    console",[187,1519,349],{"class":253},[187,1521,414],{"class":313},[187,1523,316],{"class":253},[187,1525,1526],{"class":268},"`",[187,1528,1529],{"class":272},"Retry after ",[187,1531,1532],{"class":268},"${",[187,1534,1470],{"class":346},[187,1536,349],{"class":268},[187,1538,1539],{"class":346},"retryAfter",[187,1541,1542],{"class":268},"}",[187,1544,1545],{"class":272},"s",[187,1547,1526],{"class":268},[187,1549,326],{"class":253},[187,1551,1552],{"class":189,"line":1304},[187,1553,1498],{"class":253},[187,1555,1556,1558,1560,1562,1564,1566],{"class":189,"line":1320},[187,1557,1477],{"class":264},[187,1559,390],{"class":253},[187,1561,1470],{"class":346},[187,1563,1484],{"class":298},[187,1565,1412],{"class":1189},[187,1567,403],{"class":253},[187,1569,1570],{"class":189,"line":1335},[187,1571,1572],{"class":291},"    \u002F\u002F provider name not registered\n",[187,1574,1575],{"class":189,"line":1363},[187,1576,1498],{"class":253},[187,1578,1580],{"class":189,"line":1579},15,[187,1581,441],{"class":253},[130,1583,1584,1585,1588,1589,1592,1593,1596,1597,1600,1601,1604,1605,1608,1609,168,1611,1614,1615,454,1617,1620,1621,1608,1623,1626,1627,1630,1631,1634,1635,1637,1638,1641,1642,1644,1645,1648],{},"A 401 normally becomes ",[134,1586,1587],{},"AuthError",", and its message names the provider, since with automatic selection an agent sees nothing else that says which key was rejected. Spent credits are the exception, and every provider spells them differently: Context.dev's ",[134,1590,1591],{},"USAGE_EXCEEDED"," on a 401, Tavily's 432 and 433 usage limits, SerpBase's ",[134,1594,1595],{},"status: 1020"," inside a 200. All of them become ",[134,1598,1599],{},"PaymentError",", an ",[134,1602,1603],{},"HTTPError"," subclass that preserves the original status, redacted URL and body and allows automatic fallback. A 429 becomes ",[134,1606,1607],{},"RateLimitError"," with ",[134,1610,1539],{},[134,1612,1613],{},"provider",", and its message names the provider the same way; other failures use ",[134,1616,1603],{},[134,1618,1619],{},"WebError",". No response at all, DNS failure, refused connection or a timeout, is ",[134,1622,1603],{},[134,1624,1625],{},"statusCode"," 0. ",[134,1628,1629],{},"body"," names the transport cause and ",[134,1632,1633],{},"cause"," keeps the original error. The message quotes at most a thousand characters of ",[134,1636,1629],{},", so a proxy's HTML error page never lands whole in ",[134,1639,1640],{},"failures"," or in what an agent reads. All of them extend ",[134,1643,1619],{},", one ",[134,1646,1647],{},"instanceof"," catches the lot.",[125,1650,1652],{"id":1651},"next","Next",[1654,1655,1656,1662,1667,1672,1677],"ul",{},[1657,1658,1659,1661],"li",{},[751,1660,12],{"href":13},": options, filters, content controls and pagination.",[1657,1663,1664,1666],{},[751,1665,16],{"href":17},": every provider at once, and automatic fallback.",[1657,1668,1669,1671],{},[751,1670,20],{"href":21},": pages into Markdown with an exact output bound.",[1657,1673,1674,1676],{},[751,1675,28],{"href":29},": the same calls from a shell.",[1657,1678,1679,1681],{},[751,1680,32],{"href":33},": AI SDK tools, the MCP server, Pi and OMP.",[1683,1684,1685],"style",{},"html pre.shiki code .sseY5, html code.shiki .sseY5{--shiki-light:#6F42C1;--shiki-default:#6F42C1;--shiki-dark:#91B4D5}html pre.shiki code .sX7Zv, html code.shiki .sX7Zv{--shiki-light:#032F62;--shiki-default:#032F62;--shiki-dark:#ADD7FF}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);}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 .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 .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 .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 pre.shiki code .sCrqT, html code.shiki .sCrqT{--shiki-light:#6F42C1;--shiki-default:#6F42C1;--shiki-dark:#A6ACCDC0}html pre.shiki code .s0VbO, html code.shiki .s0VbO{--shiki-light:#E36209;--shiki-default:#E36209;--shiki-dark:#A6ACCD}html pre.shiki code .s8yaW, html code.shiki .s8yaW{--shiki-light:#005CC5;--shiki-default:#005CC5;--shiki-dark:#A6ACCDC0}html pre.shiki code .szlwh, html code.shiki .szlwh{--shiki-light:#D73A49;--shiki-default:#D73A49;--shiki-dark:#D0679D}",{"title":183,"searchDepth":281,"depth":281,"links":1687},[1688,1689,1690,1691,1692,1693,1694,1695,1696],{"id":127,"depth":281,"text":128},{"id":175,"depth":281,"text":176},{"id":235,"depth":281,"text":236},{"id":548,"depth":281,"text":549},{"id":763,"depth":281,"text":764},{"id":1003,"depth":281,"text":1004},{"id":1175,"depth":281,"text":1176},{"id":1382,"depth":281,"text":1383},{"id":1651,"depth":281,"text":1652},"Install the package, run one search, and get the same result shape from thirteen providers.","md",null,{"icon":43},{"title":10,"description":1697},"Gt4mkaLAI4En_PJXaAVrUjw_VYJnRdZZGc0JuUoand8",[1699,1704],{"title":12,"path":13,"stem":14,"description":1705,"children":-1},"One provider, one query, the options every adapter takes, the filters each one honours, and the diagnostics that come back.",1790380569971]