AI agents are notoriously wasteful. They pull in massive payloads of full-length files, logs, and comment blocks just to answer simple questions. A basic query like “look up coffee shops” can balloon into a complex nest of tracking links and metadata that the model never actually uses. You pay for every single token in that bloat. SerpApi has introduced a fix that targets this inefficiency directly: Markdown output. The results are stark. A standard JSON search for “coffee” consumed 24,723 tokens. Switching to Markdown dropped that figure to 6,435 tokens. That is a 74 percent reduction. With further filtering, you can push it down to just 1,298 tokens.
The magic lies in what gets stripped. JSON responses are built for code parsers and user interfaces, not language models. They carry internal routing noise like serpapi_link fields, thumbnail URLs, and nested pagination objects. An LLM doesn’t need an icon URL to reason about a search result. Markdown removes these UI-centric elements. It flattens complex structures into readable tables and merges separate title and link keys into single inline links. This reshaping preserves the informational signal while discarding the structural overhead. It is a fundamental shift in how we think about data delivery for agentic workflows.
This isn’t a one-size-fits-all solution, though. If your pipeline requires precise numeric types for downstream analytics—like float ratings or integer prices for a pricing engine—stick with JSON. Markdown is optimized for reasoning and summarization, not strict data processing. SerpApi makes the switch effortless. You can add output=md to your query, use the /search.md endpoint, or set the Accept: text/markdown header. This feature spans all 100+ of their APIs at no extra cost. For even tighter control, their json_restrictor allows server-side field selection.
The broader implication here is about payload hygiene. Most developers treat API responses as black boxes, ignoring the token tax embedded in unused fields. In agentic systems, where recursive loops are common, this bloat compounds rapidly. Reshaping your data to match the consumer’s needs—whether that is a machine parser or a language model—is no longer optional. It is a cost-control imperative. Try running your own queries with the new parameter. The delta in your bill will likely speak for itself.