Skip to content

Commit c076f6f

Browse files
committed
doc: readme updates for output=md
1 parent d87eb8a commit c076f6f

1 file changed

Lines changed: 5 additions & 9 deletions

File tree

README.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -79,25 +79,21 @@ Documentation is [available on Read the Docs](https://serpapi-python.readthedocs
7979

8080
Change history is [available on GitHub](https://github.com/serpapi/serpapi-python/blob/master/HISTORY.md).
8181

82-
### HTML and Markdown output formats
82+
### Markdown output for AI agents
8383

84-
Searches return JSON as a `SerpResults` object by default. To receive HTML, set `output` to `html`. To receive Markdown, set `output` to `md`:
84+
For AI agents and LLM workflows, use `output="md"`. It returns search results with clean headings, links, and tables while using roughly half the tokens of JSON on average.
8585

8686
```python
87-
html = client.search({
88-
"engine": "google",
89-
"q": "coffee",
90-
"output": "html",
91-
})
92-
9387
markdown = client.search({
9488
"engine": "google",
9589
"q": "coffee",
9690
"output": "md",
9791
})
9892
```
9993

100-
HTML and Markdown responses are returned as plain Python strings.
94+
Markdown works across SerpApi APIs and is returned as a plain Python string. See [Markdown Output for AI Agents](https://serpapi.com/markdown-output.md) for details.
95+
96+
Raw HTML is also available with `output="html"` and is returned as a plain Python string.
10197

10298
## Basic Examples in Python
10399

0 commit comments

Comments
 (0)