You can now get Google search results as Markdown for your AI agent, with just one parameter
For example, if you have an agent that needs today's prices or this morning's news, it has to search the web. The usual problem is the payload: a clean JSON of one Google query is around 25,000 tokens, and the model pays for every one of them.
If you have not heard of SerpApi, it is a real-time Web Search API. You send a query to one endpoint and get Google, Bing, YouTube, Amazon, Maps and 100+ other search APIs back as structured JSON. Since 21 August you can also get the results as 𝗠𝗮𝗿𝗸𝗱𝗼𝘄𝗻, the format a language model reads best.
This is how it works:
1. Add output=md to any request.
2. You get the results back as Markdown: a table of organic results, plus the knowledge graph and related searches.
3. Add json_restrictor=organic_results to keep only the list of links.
On the coffee example in the image, the full JSON is 24,723 tokens and the Markdown is 6,435, a 74% cut. Organic results only: a 95% cut. Markdown costs the same as JSON.
One thing to note is that if a model reads the result, ask for Markdown. If your code extracts fields, stay with JSON.
The free plan gives you 250 searches a month, which is enough to test it on your own agent:
serpapi.com/techworldwithmil…
--
I want to thank @serp_api for collaborating with me on this post.