# Web search API for LLMs: Markdown vs JSON trade-offs

A search API call returns one of three things: JSON, Markdown, or the raw page. Teams usually pick theirs by looking at what the model reads nicely. Then the pipeline grows a citation column, a dedupe step and a re-rank, and the format chosen in week one starts deciding what is possible in week twelve.

This is worth deciding on purpose, because all three formats cost the same here. Same credits, same request, same result underneath. The price does not tell you which to pick, so the cost that does is the one in your own code. Every credit figure below comes from the output-format and billing docs, checked 2026-11-24.

The billing shape removes the last excuse for choosing by sticker price. Requests are priced per call, not per result: a Google search costs one credit whether the page comes back with three results or ten, and page two is a second request. Choosing Markdown does not make a search cheaper, and choosing JSON does not make it richer. You are choosing what your code has to do afterwards, and that is where the difference compounds — one of these formats gets parsed, the other gets pasted.

## Two jobs, two formats

Before the format, the job. Most search calls in an LLM pipeline are doing one of two things.

The first is reading to answer. A question comes in, ten results come back, the model writes a paragraph with a few links. The output is prose. Nothing downstream stores the result rows, nothing reorders them, nothing joins them against other data.

The second is ranking and citing. The results are rows in a table, each with a position, a URL, a domain, a date. Something sorts them, something filters by domain, something has to answer "which source was third" a week later when the answer is challenged.

These want different formats, and mixing them is the most common mistake. Prose jobs get handed JSON and spend tokens on braces and repeated keys. Ranking jobs get handed Markdown and lose the numbers they needed to sort on.

## What Markdown actually removes

The Markdown output is the same result, rendered as text with a text/markdown content type. Three things are gone, and each one was doing a job in JSON.

The envelope. No status , request_id , elapsed_ms , credits_charged wrapper around the payload. In a chat pipeline that is fine — you already checked the status before handing the body to the model, and the model has no use for a request id. In a system where the response is logged and audited, that envelope is the audit trail, and dropping it means reconstructing it from your own logs.

The duplicate fields. A JSON result carries both link and url , both rank and position , display_link alongside the domain you can parse from the URL. Those aliases exist so that clients written against different parsers can read the same response. A model only needs one of each. Markdown keeps one, which is most of the token saving.

The inline images. Image strips and thumbnails come back as URLs or as data: blobs. The blobs are the expensive ones — a single inline image can be far larger than the text of every result beside it.

What Markdown does not remove is the content: titles, snippets, source names, and the links themselves. It is the same page, minus the bookkeeping.

There is a useful signal in how newer endpoints are built. Google AI Mode, for instance, returns its answer as plain text and as Markdown with its headings, lists and tables, plus the pages it cites with their real URLs, all in one response. When the product ships both shapes at once, the format question moves into your code, which is where it was all along.

## What JSON keeps that you will miss

The fields that disappear are not random. Between link and position , the second one is the one teams regret losing.

Position and rank are two different numbers here.

rank is the place within a module: the third organic result has rank: 3 . position is where the module sits on the page, counting blocks from the top. Every organic result is one block and every other module is one block, so all items of a module share a position . A plain list of titles in prose order cannot express that, and any metric you compute later — average rank, share of top three, movement week over week — needs the number, not the order it was printed in.

Links need to be machine-readable. Markdown preserves URLs, but as text inside a syntax. Pulling them back out is parsing, and parsing Markdown to recover a link is strictly worse than reading a field. If the pipeline stores citations and later re-checks that the cited page still exists, it needs the URL as a value.

Module identity is lost. JSON tells you whether a result came from organic , people_also_ask , top_stories , discussions or local_results . In Markdown it is a heading, and headings drift. A filter that says "drop forum threads from the answer" is three lines against JSON and a heuristic against rendered text.

Nothing can be stored as a row. JSON maps onto a table. Markdown maps onto a TEXT column, and everything you want to query later becomes a parse.

The honest version: Markdown is better for what the model reads, JSON is better for what the system remembers. If both matter, the cheap answer is to request JSON and render the Markdown yourself for the one call that needs prose. You pay the same either way.

## The failure path is always JSON

Here is the one that produces silent bugs rather than loud ones. Whatever format you ask for, a failure comes back as the JSON error envelope. Ask for Markdown, get a failure, and the body is not Markdown.

A client written as "if the body starts with { , it failed" works. A client written as "if it is not Markdown, something went wrong — retry" retries a bad API key forever. A client that hands response.text straight to the model without looking gets an error object pasted into a prompt, and the model answers the error message.

Check the status before the format, every time. The success path is status: 0 ; anything else is the envelope, whatever format said.

## A default that survives contact with production

The rule I would write down for a new pipeline:

- Answering a question in a chat turn — markdown . Fewer tokens, nothing downstream needs the fields.

Rank tracking, position changes over time — json . rank and position are values, not reading order.

Citations that get stored and re-checked — json . The URL is a field, not Markdown syntax.

Multi-module filtering (drop forums, keep news) — json . Module identity stays explicit.

Retrieval feeding a re-ranker — json . Every candidate needs its own row.

Reading one page deeply — raw . The page itself, scripts and tracking stripped.

raw deserves a note because it is easy to overreach with. It is available on Google web search only, it returns text/html with tracking scripts removed and result links already resolved to their real addresses, and the URL that answered is in an X-Search-URL header rather than in a JSON body. It is for reading a page, not for building a dataset. Everything else in the table is a choice between two shapes of the same data.

A practical default for a mixed pipeline: request JSON at the client boundary, keep the parsed result, and convert to Markdown at the point where the text goes into a prompt. That way the stored record keeps its fields, and the model still gets prose. The conversion is a few lines against the fields you already have, and it stays correct when the result shape changes — a Markdown template you wrote once does not.

Whichever way you go, the format is a query parameter, so it is also changeable per call. Two request paths in one service, one for prose and one for storage, is a normal outcome and not a sign the design went wrong.

Running the table above against real responses costs very little. One balance covers every callable endpoint, a new account starts with 500 free credits and no card, and the format is a parameter on the same request you were going to send anyway. A failed request is refunded automatically; a result that comes back as "not found" is a correct answer and is charged, which is the one billing detail worth knowing before you size a batch job. The platform also publishes an MCP server, an agent skill and an openapi.json , so an agent can read the surface without a human transcribing it.

The formats, the envelope and per-endpoint prices are documented at <https://serpbase.dev/?utm_campaign=ops-222e35a2a81a&utm_medium=outreach&utm_source=opsbot>
