···11---
22name: web-search
33-description: Use when you need fast, headless web search.
33+description: Generic web search. Use when you need fast, headless web search.
44---
5566-# Jina AI Search
66+# Web Search
77+88+Search the web in a headless and fast way.
7988-Use Jina AIโs public endpoints to search the web
1010+## Search Workflow
9111010-## When to Use
1212+1. Run the codex exec search
1313+2. Open or fetch the most relevant pages
1414+3. Merge, deduplicate, and use the findings accordingly
1515+4. Repeat if needed
11161212-- You need quick web search results without an API key or browser
1313-- You need readable page content from a URL for summarization or analysis
1414-- You need to access X/Twitter content
1717+## Codex exec Search
15181616-## Reference
1919+Use `codex exec` non-interactively and capture only the final assistant message:
17201818-### Search (s.jina.ai)
2121+```bash
2222+tmp="$(mktemp)"
2323+err="$(mktemp)"
2424+trap 'rm -f "$tmp" "$err"' EXIT
19252020-```
2121-https://s.jina.ai/YOUR_SEARCH_QUERY
2626+if codex -m gpt-5.3-codex-spark exec --skip-git-repo-check --ephemeral \
2727+ --output-last-message "$tmp" \
2828+ "Search the web for: <QUERY>" \
2929+ >/dev/null 2>"$err"
3030+then
3131+ cat "$tmp"
3232+else
3333+ cat "$err" >&2
3434+ exit 1
3535+fi
2236```
23372424-1. Search for pages
3838+- Do not use `--json` here. It emits the full event stream and pollutes context
3939+- `--output-last-message` writes the final assistant message to a file
4040+- Codex still writes run metadata and logs to stderr
4141+- Redirect stderr to a temp file and replay it only on failure
4242+- Use `-C <DIR>` when search needs repo context
4343+4444+Example:
25452646```bash
2727-curl "https://s.jina.ai/jina%20ai%20reader%20usage"
4747+tmp="$(mktemp)"
4848+err="$(mktemp)"
4949+trap 'rm -f "$tmp" "$err"' EXIT
5050+5151+if codex -m gpt-5.3-codex-spark exec --skip-git-repo-check --ephemeral \
5252+ --output-last-message "$tmp" \
5353+ "Search the web for the latest stable Rust release and cite the best sources" \
5454+ >/dev/null 2>"$err"
5555+then
5656+ cat "$tmp"
5757+else
5858+ cat "$err" >&2
5959+ exit 1
6060+fi
2861```
29623030-- URL-encode spaces and special characters in the query.
3131-- Output returns search results with titles/snippets/links (plain text).
6363+## Readable page fetch
32643333-2. Fetch readable page content
6565+Use `r.jina.ai` to fetch readable text or markdown for specific pages.
34663567```bash
3636-curl "https://r.jina.ai/https://example.com/article"
6868+curl -fsSL "https://r.jina.ai/https://example.com/article"
3769```
38703939-- Prepend `https://r.jina.ai/` to any HTTP/HTTPS URL.
4040-- Output is readable text/markdown for the target page.
7171+Notes:
41724242-Typical workflow is to:
7373+- Prepend `https://r.jina.ai/` to any HTTP or HTTPS URL
7474+- Output is readable text or markdown for the target page
43754444-1. Use `s.jina.ai` to discover relevant links.
4545-2. Use `r.jina.ai` to fetch readable content from those links.
7676+## Default Behavior
7777+7878+When asked to search the web:
7979+8080+- run codex exec search
8181+- fetch the most relevant pages as needed
8282+- use `r.jina.ai` when a readable page view helps
8383+- provide an answer with the best results