> ## Content Index
> Fetch the complete content index at: https://serpapi.com/blog/llms.txt
> Use this file to discover other available public pages before exploring further.

# Markdown vs. JSON: Which Response Format Should You Use?
- URL: https://serpapi.com/blog/markdown-vs-json-which-response-format-should-you-use/
- Published: 2026-11-04T22:48:10.000Z
- Updated: 2026-11-04T22:48:10.000Z
- Description: Not sure whether to use Markdown or JSON for your SerpApi results? Learn which format works best for AI agents, LLMs, data pipelines, applications, and more.
- Author: Sonika Arora
- Tags: markdown, json

When using APIs to get search results, the format you choose can impact how easily your application uses that data. Markdown and JSON both let you work with search results, but they're designed for different needs. JSON organizes information into structured fields that your code can access directly. Markdown presents information in a readable, text-based format that's easy for people and language models to interpret.

The right choice depends on what happens *after* you retrieve your search results.

## Markdown vs. JSON at a glance

|                          | Markdown                                                                   | JSON                                                                                                          |
| ------------------------ | -------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
| Best for                 | Reading, summarizing, and reasoning over search results                    | Extracting, filtering, and processing structured data                                                         |
| AI agents and LLMs       | Excellent for providing readable context                                   | Excellent when the model or application needs specific fields                                                 |
| Traditional applications | Useful for displaying formatted content                                    | Ideal for application logic and data processing                                                               |
| Data pipelines           | Possible, but often requires parsing                                       | Ideal for validation, transformation, and storage                                                             |
| Human readability        | High                                                                       | Moderate; depends on the structure and complexity                                                             |
| Data access              | Based on text and formatting                                               | Direct access to named fields and nested objects                                                              |
| Output structure         | Readable text with headings, lists, and links                              | Objects, arrays, strings, numbers, and other typed values                                                     |
| Token usage              | Lower; minimal syntax overhead, so more content fits in the context window | Higher; repeated field names, quotes, braces, and brackets add tokens, especially with nested or verbose data |

💡

****The short answer**  
➡️ Choose Markdown when the next step is primarily reading, displaying, or reasoning, especially when the output feeds an LLM and token cost matters.  
➡️ Choose JSON when the next step is primarily processing or manipulating data, such as extracting fields, validating, or storing.

SerpApi's APIs offer responses in both formats so you can pick the best one that fits into your workflow. Let’s dive into how Markdown and JSON compare across real-world SerpApi integration scenarios.

## Example use cases that benefit from markdown 

Markdown is a lightweight text format that supports headings, lists, links, and other simple formatting. For search results, this makes Markdown particularly useful when you want to give an AI model or agent information it can understand and use to complete a task.

You can read more about the benefit of Markdown output from our APIs here:

[SerpApi: Markdown Output for AI AgentsGet search results as clean, token-efficient markdown instead of JSON. Built for LLMs, AI agents, and agentic workflows.![](https://storage.ghost.io/c/a5/00/a5004977-0dd2-4bcd-9292-dd0e05d4c59e/content/images/icon/favicon-2058c515-4498-4171-b36a-adc5a4f46da2.png)SerpApi![](https://storage.ghost.io/c/a5/00/a5004977-0dd2-4bcd-9292-dd0e05d4c59e/content/images/thumbnail/card-ad1a4c3af31f8cf3b19d0efbabdccb58cae6e167c2dcc5fc3bc4275599513b6f-36e6b80e-f035-40f3-9458-68f778af373b.png)](https://serpapi.com/markdown-output)

Markdown output page on serpapi.com

### Use case 1: Building AI agents that research and answer questions

Imagine you're building an AI research agent that answers questions using live web search.

A user asks: "What are the latest developments in the electric vehicle market, and how are the leading manufacturers responding?"

Your agent needs to search the web, gather relevant results, compare sources, identify trends, and generate a coherent answer.

Markdown is a natural fit for this workflow. Search results can be presented as readable text with titles, snippets, links, and other available information.

Markdown works well here because the model can focus on understanding the information rather than interpreting a complex data structure, and search results can be passed into summarization, comparison, and question-answering workflows.

Here’s an example of the Markdown output for the query `latest developments in the electric vehicle market` using Google News API that gets the latest news on that: 

![](https://storage.ghost.io/c/a5/00/a5004977-0dd2-4bcd-9292-dd0e05d4c59e/content/images/2026/10/Screenshot-2026-10-27-at-4.17.04---PM.png)

Try it in the playground:

[SerpApi Playground - SerpApiTest SerpApi's Google Search, Google Maps, YouTube, Bing, Walmart, eBay, Baidu, Yandex and more APIs for free in the interactive playground!![](https://storage.ghost.io/c/a5/00/a5004977-0dd2-4bcd-9292-dd0e05d4c59e/content/images/icon/favicon-336f329d-1b4b-495d-9777-15f68279c51b.png)SerpApiSerpApi![](https://storage.ghost.io/c/a5/00/a5004977-0dd2-4bcd-9292-dd0e05d4c59e/content/images/thumbnail/serpapi-social-image-2a4087f2-7769-4193-bdb1-74c3a07a72ec.png)](https://serpapi.com/playground?engine=google%5Fnews&q=latest+developments+in+the+electric+vehicle+market&gl=us&hl=en)

💡

If you see the JSON output in the playground and want to switch to Markdown, head over to the tools button in the top right of the output window and toggle over to Markdown 👇

![](https://storage.ghost.io/c/a5/00/a5004977-0dd2-4bcd-9292-dd0e05d4c59e/content/images/2026/10/Screenshot-2026-10-27-at-4.29.35---PM-3.png)

### Use case 2: Retrieval-augmented generation (RAG)

Retrieval-augmented generation, or RAG, combines information retrieved from external sources with an LLM's ability to generate answers.

For example, you might build an assistant that retrieves current web information before answering questions about competitors, industry trends, or product specifications - Markdown works well in this workflow. 

This is because the retrieved information is intended to be read and interpreted by a language model. Choose Markdown when search is one step in a larger reasoning workflow and the agent needs to interpret the results before taking action.

Here’s an example of the Markdown output for the query `iPhone` using Google Shopping API that gets all the shopping results in a simple, easy-to-analyze format: 

![](https://storage.ghost.io/c/a5/00/a5004977-0dd2-4bcd-9292-dd0e05d4c59e/content/images/2026/10/Screenshot-2026-10-27-at-4.21.48---PM.png)

Try it in the playground:

[SerpApi Playground - SerpApiTest SerpApi's Google Search, Google Maps, YouTube, Bing, Walmart, eBay, Baidu, Yandex and more APIs for free in the interactive playground!![](https://storage.ghost.io/c/a5/00/a5004977-0dd2-4bcd-9292-dd0e05d4c59e/content/images/icon/favicon-454d69f7-fa88-4f30-a284-607d0ab407c8.png)SerpApiSerpApi![](https://storage.ghost.io/c/a5/00/a5004977-0dd2-4bcd-9292-dd0e05d4c59e/content/images/thumbnail/serpapi-social-image-56f05d97-c2dd-4f40-af04-f35328aecdf3.png)](https://serpapi.com/playground?engine=google%5Fshopping&q=iPhone)

### Use case 3: Creating readable research summaries and reports

You might be building a tool that generates:

- Competitor research reports
- Market research summaries
- News briefings
- Product comparisons
- Research notes for analysts
- Summaries of relevant web sources

If the end product is primarily readable text, Markdown is a practical intermediate format.

Here’s an example of the Markdown output for the query `coffee` using Google Maps API that gets all the coffee shops in a particular area. This can easily be compiled into a report by any AI agent.

![](https://storage.ghost.io/c/a5/00/a5004977-0dd2-4bcd-9292-dd0e05d4c59e/content/images/2026/10/Screenshot-2026-10-27-at-5.00.34---PM.png)

Try it in the playground:

[SerpApi Playground - SerpApiTest SerpApi's Google Search, Google Maps, YouTube, Bing, Walmart, eBay, Baidu, Yandex and more APIs for free in the interactive playground!![](https://storage.ghost.io/c/a5/00/a5004977-0dd2-4bcd-9292-dd0e05d4c59e/content/images/icon/favicon-69195b47-8a4b-419b-b991-15e1787bf797.png)SerpApiSerpApi![](https://storage.ghost.io/c/a5/00/a5004977-0dd2-4bcd-9292-dd0e05d4c59e/content/images/thumbnail/serpapi-social-image-051b088e-d8c4-4a99-8c2d-be22c2d9881d.png)](https://serpapi.com/playground?engine=google%5Fmaps&q=Coffee&ll=%4040.7455096%2C-74.0083012%2C14z&hl=en&type=search)

## Example use cases that benefit from JSON 

JSON, or JavaScript Object Notation, is a structured data format. It organizes information into objects and arrays containing named fields and values.

This works great when your application needs to identify specific pieces of information and do something with them programmatically. 

### Use case 1: Building applications that display search results

Say you're building a search interface that displays Google Shopping product comparisons inside your own application. You'll ideally want to display each result in a consistent layout with a title, link, snippet, image, or price, depending on the search engine and result type. JSON makes this straightforward.

Your application can read the relevant fields and use them to populate UI components. Each result can become a card, row, or other interface element without having to extract information from formatted text.

Here's an example of what the JSON output looks like from SerpApi's Google Shopping API for the query "laptop":

![](https://storage.ghost.io/c/a5/00/a5004977-0dd2-4bcd-9292-dd0e05d4c59e/content/images/2026/10/Screenshot-2026-10-29-at-3.44.32---PM.png)

Your application can access `title`, `price`, and `source` directly and render them wherever needed. 

Try it in the playground:

[SerpApi Playground - SerpApiTest SerpApi's Google Search, Google Maps, YouTube, Bing, Walmart, eBay, Baidu, Yandex and more APIs for free in the interactive playground!![](https://storage.ghost.io/c/a5/00/a5004977-0dd2-4bcd-9292-dd0e05d4c59e/content/images/icon/favicon-ab031ef9-5eba-4fda-bed3-c3f46db8b58e.png)SerpApiSerpApi![](https://storage.ghost.io/c/a5/00/a5004977-0dd2-4bcd-9292-dd0e05d4c59e/content/images/thumbnail/serpapi-social-image-da38eefb-2c1e-46f2-ab61-c25e4bd575b8.png)](https://serpapi.com/playground?device=desktop&engine=google%5Fshopping&google%5Fdomain=google.com&location=Austin%2C+Texas%2C+United+States&q=laptop)

### Use case 2: Using data in automated pipelines

Consider an application that tracks flight prices across multiple airlines. The app needs to retrieve flight information, extract prices, compare them over time, and store the results for further analysis, all of which is set up in a series of steps. 

The results need to enter a repeatable data-processing pipeline, so JSON is well suited to this process. The application can access fields directly rather than trying to recover individual values from formatted text.

Here's an example of what the JSON output looks like from SerpApi's Google Flights API for flights from CDG to AUS:

![](https://storage.ghost.io/c/a5/00/a5004977-0dd2-4bcd-9292-dd0e05d4c59e/content/images/2026/10/Screenshot-2026-10-29-at-4.06.35---PM.png)

Try it in the playground:

[SerpApi Playground - SerpApiTest SerpApi's Google Search, Google Maps, YouTube, Bing, Walmart, eBay, Baidu, Yandex and more APIs for free in the interactive playground!![](https://storage.ghost.io/c/a5/00/a5004977-0dd2-4bcd-9292-dd0e05d4c59e/content/images/icon/favicon-34fd2687-a1b6-4b53-a2eb-c87007793c47.png)SerpApiSerpApi![](https://storage.ghost.io/c/a5/00/a5004977-0dd2-4bcd-9292-dd0e05d4c59e/content/images/thumbnail/serpapi-social-image-aad899fa-f2de-4085-b064-376db4a3bfd6.png)](https://serpapi.com/playground?engine=google%5Fflights&departure%5Fid=CDG&arrival%5Fid=AUS&gl=us&hl=en&currency=USD&outbound%5Fdate=2026-10-30&return%5Fdate=2026-11-05)

### Use case 3: Monitoring, filtering, and triggering actions

Say you're building an application that needs to compare specific values across requests. In this case, JSON makes it easier to access the fields required for that comparison, apply business rules, and trigger the next action.

For example, if you're building a system that monitors Google Search rankings for a list of keywords, and you want to detect when a particular website enters the top five results, record its position, and send a Slack notification when its ranking changes. This logic is more straightforward when the application can access structured fields rather than interpret formatted text.

The same approach works for monitoring job listings, tracking product availability, identifying new search results, or detecting changes in other supported search-engine data.

Here's an example of the JSON output from SerpApi's Google Jobs API that you can use to track open jobs over time:

![](https://storage.ghost.io/c/a5/00/a5004977-0dd2-4bcd-9292-dd0e05d4c59e/content/images/2026/10/Screenshot-2026-10-29-at-4.10.08---PM.png)

Try it in the playground:

[SerpApi Playground - SerpApiTest SerpApi's Google Search, Google Maps, YouTube, Bing, Walmart, eBay, Baidu, Yandex and more APIs for free in the interactive playground!![](https://storage.ghost.io/c/a5/00/a5004977-0dd2-4bcd-9292-dd0e05d4c59e/content/images/icon/favicon-0bd262c2-354c-48e9-88f6-bf6426290859.png)SerpApiSerpApi![](https://storage.ghost.io/c/a5/00/a5004977-0dd2-4bcd-9292-dd0e05d4c59e/content/images/thumbnail/serpapi-social-image-9e6651fb-81c4-4674-8fdd-05ff6b5a121a.png)](https://serpapi.com/playground?engine=google%5Fjobs&q=Barista)

## Common Questions

### Can you use JSON with LLMs?

JSON is not limited to traditional software applications. LLMs can interpret JSON, extract information from it, compare fields, and use it as context. In fact, JSON can be preferable when you need the model to reason about specific attributes, such as product prices, publication dates, or search positions.

For example, if an LLM needs to compare three products by price and rating, a structured JSON representation makes those attributes explicit. Markdown may be more convenient and less token-intensive if the task involves reading several articles and synthesizing their arguments.The distinction is about the shape of the information and the task being performed.

JSON doesn't guarantee that an LLM will produce correct answers, and Markdown doesn't guarantee better reasoning. Both formats still require appropriate context management and validation. 

Our APIs provide an option to receive the results in either JSON or Markdown format, so you can use the one that works best for your use case.

### Does Markdown use fewer tokens than JSON?

Generally, yes - if you use it for the right tasks. Markdown can avoid a lot of the structural overhead associated with nested JSON objects and repeated field names. 

We've observed that using the Markdown version of the response from our APIs consumes \~50% fewer LLM tokens on average. All informational content is preserved: titles, snippets, links, ratings, prices, etc. Internal tracking fields (opaque tokens, redirect URLs, duplicate numeric extractions) are stripped to save tokens. 

![](https://storage.ghost.io/c/a5/00/a5004977-0dd2-4bcd-9292-dd0e05d4c59e/content/images/2026/10/Screenshot-2026-10-20-at-3.00.15---PM.png)

That means lower LLM costs, faster inference, and more of the context window free for your actual task. 

### Can you switch between Markdown and JSON in the same application?

Yes, you can switch between using JSON and Markdown for any SerpApi endpoint. 

JSON is the default output, so no additional parameters or settings are needed. Any search can return the Markdown output in three ways:

![](https://storage.ghost.io/c/a5/00/a5004977-0dd2-4bcd-9292-dd0e05d4c59e/content/images/2026/10/Screenshot-2026-10-27-at-4.27.42---PM.png)

If you're using code, this looks like:

```bash
# All three produce the same Markdown output:

curl "https://serpapi.com/search?engine=google&q=coffee&api_key=YOUR_KEY&output=md"
curl "https://serpapi.com/search.md?engine=google&q=coffee&api_key=YOUR_KEY"
curl -H "Accept: text/markdown" "https://serpapi.com/search?engine=google&q=coffee&api_key=YOUR_KEY"
```

An application can use different response formats for different tasks. For example, a research agent could consume Markdown for a broad search-and-summarize step, while a separate data collection service uses JSON for structured extraction.

Markdown output works across all 100+ SerpApi APIs — Google, Bing, YouTube, Amazon, Walmart, DuckDuckGo, and every other API we support.

## Conclusion

With SerpApi, you can retrieve search-engine data to support a wide range of applications. Choosing the right response format helps you integrate that data into your workflow with less token consumption and processing time.

**Ready to build?** Explore the [API documentation](https://serpapi.com/) to find the relevant engine, supported parameters, and response fields for your application.

If you have any questions, feel free to reach out to us at [contact@serpapi.com](mailto:contact@serpapi.com).

## Related Posts

[Introducing SerpApi's New Markdown OutputSerpApi now returns any search as clean Markdown. Same data as JSON, roughly half the tokens on average, and zero configuration across all 100+ APIs.![](https://storage.ghost.io/c/a5/00/a5004977-0dd2-4bcd-9292-dd0e05d4c59e/content/images/icon/serpapi-favicon-7e489791-da39-4256-abcc-21d9c1b02107.png)SerpApiTomás Murúa![](https://storage.ghost.io/c/a5/00/a5004977-0dd2-4bcd-9292-dd0e05d4c59e/content/images/thumbnail/header-markdown-output-1-2a4906e3-106b-484e-ab68-be0501d6ea40.png)](https://serpapi.com/blog/introducing-serpapi-markdown-output/)

[Markdown Search Results: SerpApi vs. Exa, Tavily, FirecrawlWe ran the same three queries through SerpApi, Tavily, Exa, and Firecrawl and compared where the markdown lives, what it costs in tokens, and what a model can answer from it.![](https://storage.ghost.io/c/a5/00/a5004977-0dd2-4bcd-9292-dd0e05d4c59e/content/images/icon/serpapi-favicon-be6458bd-a923-4ae9-9d3e-57f2dee91adc.png)SerpApiTomás Murúa![](https://storage.ghost.io/c/a5/00/a5004977-0dd2-4bcd-9292-dd0e05d4c59e/content/images/thumbnail/blog-image--26--6c744e01-437d-4454-9c44-69f14d964f6d.png)](https://serpapi.com/blog/markdown-search-results-serpapi-vs-exa-tavily-firecrawl/)

[How to Fit More Web Search Data into a Local LLMUse SerpApi's Markdown output and the JSON Restrictor to give a local LLM more web search data in the same context window, tested on four models in LM Studio.![](https://storage.ghost.io/c/a5/00/a5004977-0dd2-4bcd-9292-dd0e05d4c59e/content/images/icon/serpapi-favicon-05566757-a294-422a-907d-3461c4c4dcb6.png)SerpApiTomás Murúa![](https://storage.ghost.io/c/a5/00/a5004977-0dd2-4bcd-9292-dd0e05d4c59e/content/images/thumbnail/blog-image--40--b3fc7783-8657-4e51-8786-2b19d0c7a60c.png)](https://serpapi.com/blog/local-llm-web-search-markdown-output/)