AI SEO analysis pipelines usually run into two problems quickly.

First, the more data you analyze, the more input tokens you send to the model. Adding more keywords, markets, competitors, pages, or result rows makes every prompt longer. That may not matter for a one-off analysis, but it matters when a pipeline runs thousands of times a day.

Second, cutting the input down can make the analysis less useful. When the full dataset does not fit into the model context, you might often split it into batches, summarize each batch, or rely on agent memory. Those techniques help, but they can not replace the original data. If positions 1-10 and positions 21-30 land in different batches, the model may never compare them side by side.

The core question is simple: Can we help the model see more SEO evidence in the same token budget?

In this post, I will compare JSON and Markdown as API response formats. I will first reproduce a token benchmark for Google Shopping results. Then I will run a practical SEO analysis demo to see whether the larger sample changes the model's recommendation. The demo code is available here.

Why build an AI SEO analysis pipeline?

Existing SEO tools already provide rich datasets, dashboards, reports, and AI features. For many workflows, that is enough.

But internal SEO questions often depend on business context that a general-purpose SEO platform does not have. For example:

  • Why did a competitor's product enter the top results for this query?
  • Which ranking changes should the team handle today?
  • Does this search result change matter for revenue, conversion rate, inventory, or a product launch?

When you build your own AI SEO analysis pipeline, you can choose the market, device, timestamp, query set, and data source. You can also combine search data with internal business data before asking the model to reason over it.

The goal is not to rebuild a full SEO platform. The goal is to add a decision layer that matches your company's workflow.

The hidden cost of API response format

Most APIs return JSON by default. JSON is excellent for code. It gives programs exact fields, predictable structure, and a reliable contract. But when the next consumer is an AI model, the response format also affects context usage. Consider a simplified Google Shopping result in JSON:

{
  "shopping_results": [
    {
      "position": 1,
      "title": "Trail Runner X",
      "price": "$89",
      "rating": 4.7
    },
    {
      "position": 2,
      "title": "Aero Sprint",
      "price": "$74",
      "rating": 4.5
    }
  ]
}

The same information can be represented as a Markdown table:

## Shopping Results

| Position | Title | Price | Rating |
|---:|---|---:|---:|
| 1 | Trail Runner X | $89 | 4.7 |
| 2 | Aero Sprint | $74 | 4.5 |

The JSON response repeats keys such as position, title, price, and rating for every item. It also includes quotes, commas, braces, and nesting. The Markdown table keeps the field names in the header and uses rows for the values. Both formats describe the same result set, but Markdown often uses fewer tokens. That means the same model context can fit more search results before batching becomes necessary.

This is why Markdown is moving beyond documentation. In April 2025, Cloudflare added a Browser Rendering API endpoint that converts webpages into Markdown. In February 2026, Notion documents page content access as Markdown in its data APIs. In August 2026, SerpApi supports Markdown output for search results by using output=md.

The shared pattern is clear: API responses are no longer consumed only by programs. They may go directly into an AI agent's context.

Benchmark: How many input tokens can Markdown save?

SerpApi published a Markdown output benchmark comparing JSON and Markdown responses across several APIs. The result depends on the API, query, returned fields, and tokenizer, but the largest savings appear in more complex result sets.
In that benchmark:

These numbers compare input tokens only. If a model provider charges the same price per input token, reducing input tokens reduces that part of the cost. The total cost of a full AI pipeline will still depend on model choice, output length, orchestration, retries, caching, and other API calls. I wanted to reproduce the Google Shopping result with my own code.

Reproducing the Google Shopping token benchmark

The reproduction changes only one variable: response format. I prepared 12 Google Shopping queries. For each query, I used the same location, language, and device settings. Then I requested the same Google Shopping results twice through SerpApi: once as JSON and once as Markdown.

I sent the raw API responses to the same DeepSeek model and read usage.prompt_tokens from the DeepSeek API response. That value reports the actual number of input tokens the model received. I disabled thinking mode because this experiment measures input representation, not reasoning quality. I did not ask DeepSeek to solve an SEO problem in this benchmark. I used it as the token accounting endpoint.

The calculation was:

saving = 100 * (1 - markdown_tokens / json_tokens)

Let's execute it:

0:00
/0:18

Across the 12 queries, Markdown reduced input tokens by an average of 89.55%. Individual queries ranged from 86.59% to 91.20%. That closely matches the published Google Shopping benchmark of about 90%.

The run saves intermediate evidence so the result can be checked later:

Output Purpose
raw/*.json and raw/*.md Original API responses
deepseek-usage/*.json DeepSeek token usage receipts
results.csv and results.json Per-query comparison data
summary.md Final summary table

For this sample, Markdown compressed the Google Shopping inputs to roughly one-tenth of the JSON token usage.

The next question is more important for AI SEO: if Markdown lets the model see more results in the same budget, can that change the analysis?

A practical SEO demo: Trail running shoes

For the second experiment, I used a practical Google Shopping question: I sell trail running shoes. To show up higher in Google Shopping, should I optimize titles, lower prices, or get more reviews?

I fixed the search setup:

Setting Value
Query trail running shoes
Market New York, United States
Language English
Device Desktop
Fields kept position, title, price, rating, reviews, source
Input budget 1,550 prompt tokens
Model Same DeepSeek model and prompt for both formats

SerpApi returned the same Google Shopping snapshot with 30 products. Python then measured how many products could fit into the 1550-token budget for each format.

Let's run it:

0:00
/0:15

The result:

Format Products that fit Prompt tokens used Position coverage
JSON 16 1,548 1-16
Markdown 30 1,515 1-30

With the same token budget, Markdown let DeepSeek see 1.88x more products.

The larger sample changed the recommendation

The JSON sample only covered positions 1-16. In that sample, the average query-term coverage in product titles was:

Sample Query-term coverage
Top positions 1-5 27%
Lower positions 12-16 20%

That difference was small. DeepSeek treated the title signal as weak and did not see titles as a clear explanation for position.
The Markdown sample covered all 30 products. With the full sample, the title pattern became clearer:

Sample Query-term coverage
Top positions 1-10 47%
Lower positions 21-30 17%

With the additional 14 products, DeepSeek gave a more specific recommendation: test title changes for lower-position products by adding terms such as "trail running" and gender-specific modifiers. Price and review count did not show meaningful rank relationships in this snapshot:

Metric JSON sample Markdown sample
Spearman position vs. price 0.001 0.155
Spearman position vs. reviews 0.118 -0.031

So the supported next step was not to cut prices or chase more reviews for ranking. The better next step was to run a title A/B test.

This does not prove that title changes cause higher Google Shopping positions. A single search snapshot can only generate hypotheses. But it does show how a compact response format can expose a signal that a smaller sample hides.

Markdown did not make the model smarter. It gave the model more original evidence to compare in the same context budget.

JSON and Markdown both have a role

This is not a case for replacing JSON everywhere. JSON remains the better format when code needs a strict contract: tool arguments, IDs, status fields, saved state, validation, and orchestration logic. Markdown is useful when the next step is model understanding. If an AI agent needs to read, compare, summarize, or reason over search results, Markdown can preserve a clear structure while reducing token overhead.

A practical agent workflow can use both:

Role Better fit
Control data JSON
Tool arguments JSON
IDs and state JSON
Search result context for the model Markdown
Documents, citations, and comparison tables Markdown

What I learned

This experiment led to three takeaways.

First, building an AI SEO pipeline gives teams control over what the model sees and how recommendations get tested. The value comes from connecting search data with the business question, not from rebuilding a full SEO platform.

Second, Markdown can reduce input token usage substantially for search result payloads. In our Google Shopping benchmark reproduction, Markdown reduced input tokens by 89.55% on average.

Third, a more compact input format can change the model's answer by increasing evidence coverage. In the Shopping demo, JSON fit 16 products while Markdown fit all 30. The larger sample changed the title signal and led DeepSeek to recommend testing title relevance first.

If you are building an AI agent or AI SEO pipeline, test both formats in one real workflow. Compare:

  • Actual input tokens reported by the model API
  • How much source data fits into the prompt
  • Whether the larger context changes the final recommendation

File size alone is not enough. What matters is how much useful evidence the model can see when it makes the decision.

Try Markdown output with SerpApi

SerpApi supports Markdown responses for search APIs with output=md. If your workflow sends search results into an LLM or AI agent, this can reduce formatting overhead and help the model analyze more results in one context.
You can try SerpApi with a free account, which includes 250 searches per month. If you have questions or feedback about Markdown responses, contact us at contact@serpapi.com.

#AI #SEO #markdown