AI web search inside Google Sheets formulas (AI_WEB)
Google Sheets has =IMPORTHTML, =IMPORTXML, and =IMPORTDATA — all for pulling structured data from a known URL. None of them answer the question "what's the current CEO of Acme?" or "what's the latest Stripe API rate limit?" You need a model with web access. =AI_WEB is that.
The one-line version
=AI_WEB("current CEO of Acme Inc")
Returns: "As of 2026, the CEO of Acme Inc is John Doe (sourced from acme.com/leadership)."
Under the hood, the formula calls OpenAI's Responses API with the web_search_preview tool. The model decides whether to issue a search, picks credible sources, and returns a synthesized answer. Citations are included in the prose.
Real-world examples
Competitor pricing watch
=AI_WEB("Current monthly price of " & A2 & "'s Pro plan")
Column A is competitor names. The formula returns the live price for each. Refresh weekly to catch pricing changes.
Customer enrichment
=AI_WEB("Industry and approximate employee count of " & A2)
Cheap alternative to Clearbit / Apollo enrichment for small lead lists.
News + sentiment
=AI_WEB("Most recent major news story about " & A2 & " in 2026")
Daily watchlist of accounts you sell to. Combine with =AI_CLASSIFY to bucket as positive/negative/neutral.
Fact-check + cite
=AI_WEB("Is it true that " & A2 & "? Cite a source.")
Cheap fact-check pass on a column of claims. Cite forces the model to ground answers, not hallucinate.
When to use AI_WEB vs =IMPORTHTML
| Use | Formula |
|---|---|
| Scrape a specific table from a known URL | =IMPORTHTML |
| Scrape an XPath from a known URL | =IMPORTXML |
| Ask a question that requires picking sources | =AI_WEB |
| Answer in natural language with citations | =AI_WEB |
| Need 1-second response | =IMPORTHTML (AI_WEB takes 3–10s) |
Cost
=AI_WEB uses OpenAI's Responses API with web search. Each call costs roughly:
- Per-call: ~$0.04 (model + search tool overhead)
- 1,000 calls: ~$40
~80× more expensive than a regular =AI call. Use it for high-value rows (top 100 accounts, daily competitor watchlist), not for blanket 10,000-row jobs.
Pitfalls
Cell timeout
Google Sheets has a 30-second cap on cell formulas. Web-search calls usually finish in 3–10 seconds, but slow searches can time out. For batch jobs, use the sidebar's Bulk runner (no cell-level timeout).
Citation hallucination
Even with web search, the model occasionally invents a URL. Mitigation: ask it to quote the exact sentence from the source, not just cite the URL. Easier to spot-check.
Provider lock
Today, only OpenAI exposes a web_search tool over its API. Anthropic and Gemini will likely follow. For now, =AI_WEB requires an OpenAI key even if your default provider is Claude.
Stale cache
Search results are cached by the provider for ~5 minutes. If you re-run the same query immediately, you may get an identical answer even if reality changed. Wait 5 minutes for a refresh.
Tier note
=AI_WEB is in the Premium tier ($99 lifetime). Same tier includes =AI_VISION (analyze an image at a URL) and =AI_IMAGE (generate an image into a cell). All three are wrappers around OpenAI's specialized endpoints — they need an OpenAI key.