Skip to content
Search API · Use case

SERP to Markdown: the whole Google results page from a query

SERP to Markdown means reading the whole results page, not only the ten links: the snippets, the questions and the order everything appears in. SEO teams archive it, analysts watch search features come and go, and models summarize what a query looks like today. The Search API takes a query, not a URL, and returns the results page as Markdown or HTML next to the structured results.

The problem

Structured results drop the page, raw scraping drops the reliability

Structured search results are the right input for most code, but they flatten the page: they tell you which links ranked, not what else the page showed around them. Questions about SERP features, how crowded a query is, or what a searcher saw on a given day need the page itself.

Fetching the results page yourself means building the search URL, getting blocked from the first requests, and running an HTML to Markdown converter on whatever comes back. URL to Markdown tools cannot help either: they expect a URL you already have, not a query and a country.

Every search returns a page object with page.markdown() and page.html(). They fetch the Google results page for the same query and options, as Markdown for models and text pipelines or as HTML for your own selectors. Pass markdown: true or html: true to fetch the page and every result up front.

How it works

How to convert Google results to Markdown with the SDK

Search once for the structured results, then ask the same page object for its Markdown or HTML. The content expansion guide covers both the page and the result level.

1 · Get the results page as Markdown
import createClient from 'microlink.io'

const microlink = createClient({
  apiKey: process.env.MICROLINK_API_KEY
})

const page = await microlink.search('technical seo checklist', {
  location: 'gb'
})

const serpMarkdown = await page.markdown()

page.results holds the structured results; page.markdown() fetches the results page itself, for the same query and location, as Markdown.

2 · Archive the HTML per country
import createClient from 'microlink.io'

const microlink = createClient({
  apiKey: process.env.MICROLINK_API_KEY
})

const snapshots = await Promise.all(
  ['us', 'gb', 'de'].map(async location => {
    const page = await microlink.search('technical seo checklist', { location })
    return {
      location,
      takenAt: new Date().toISOString(),
      links: page.results.map(({ title, url }) => ({ title, url })),
      html: await page.html()
    }
  })
)

Each snapshot stores the ranked links and the raw HTML side by side, so you can re-parse search features later with selectors you have not written yet.

3 · Fetch everything up front
import createClient from 'microlink.io'

const microlink = createClient({
  apiKey: process.env.MICROLINK_API_KEY
})

const page = await microlink.search('technical seo checklist', {
  limit: 3,
  markdown: true
})

const serp = await page.markdown()
const sources = await Promise.all(page.results.map(result => result.markdown()))

markdown: true prefetches the results page and every URL-backed result, so these calls resolve immediately with content already fetched. Keep limit small: every result is read whether you use it or not.

Parameters used
  • page.markdown() The Google results page for the query, as Markdown.
  • page.html() The results page as HTML, for selectors and archives.
  • markdown true fetches the Markdown of the results page and of every result up front.
  • html true does the same with HTML.
  • location Two-letter country code; the page you get is the one for that country.

Converting a page whose URL you already have is a different job: website to Markdown for LLM context and the Markdown API take a URL instead of a query. You can also try that conversion in the browser with URL to Markdown.

Why it works

Why SERP to Markdown beats saving raw Google HTML yourself

The results page is data about the query. Getting it next to the structured results means you never choose between the two.

01 · Two views, one query
Structured results and the page itself.
page.results gives your code the ranked links; page.markdown() gives you the page as a model reads it, with the same query, location and period. No second pipeline has to build the search URL.

Compute positions from the structured side with rank tracking by country, and keep the HTML as evidence of what the page showed.

02 · Markdown for models
Fewer tokens than HTML for the same page.
A model asked to describe what a query looks like reads Markdown more cheaply than markup. HTML stays available for when your own code needs the DOM, such as detecting a feature by its element.

For the questions and follow-up queries on the page as JSON, keyword research with People Also Ask reads them without any parsing.

03 · Only when you ask
The page is fetched on demand.
The search itself is one request. page.markdown() and page.html() fetch the results page through Microlink only when called, and the markdown and html options prefetch everything when you know you will use it.

When not to: if you only need titles, URLs and snippets, the structured results already have them and the page fetch is wasted. And this starts from a query; for a URL you already know, use the Markdown API.

FAQ

How do I convert a Google SERP to Markdown?

Run microlink.search with your query and options, then call page.markdown() on the result. It fetches the Google results page for that same query and returns it as Markdown, next to the structured page.results.

Can I get the raw HTML of Google search results?

Yes. page.html() returns the results page as HTML, useful for archiving and for detecting search features with your own selectors. Pass html: true to fetch it, and the HTML of every result, up front.

What is the difference between SERP to Markdown and URL to Markdown?

SERP to Markdown starts from a query and returns the Google results page for it. URL to Markdown starts from a page address and converts that page. Use the Markdown API when you already have the URL.

How many requests does fetching a SERP as Markdown use?

The search is one request, and each page or result you expand is fetched through the Microlink API as well. markdown: true expands the results page and every result, so pair it with a small limit. Search has no free tier; Pro plans start at €39/month for 46,000 requests.

Is the SERP to Markdown API affiliated with Google?

No. Microlink Search is an independent product that queries public Google surfaces. It is not affiliated with or endorsed by Google, and Google is a trademark of Google LLC.
Related use cases

Solve the next problem with the same API

Google rank tracking by country

Compute where a domain ranks for each keyword in each country from ordered results, and keep the history in your own database.

Live search to ground LLM answers

Retrieve fresh results for a question, read the best sources as Markdown and pass them to the model with citations.

Keyword research with Google Autocomplete

Expand a seed into the queries people type, plus related searches and People Also Ask questions, per country.

LLM context from any URL

Compose Markdown, links, emails, metadata and tech stack from one URL into a context object for your agent.

Clean Markdown, no boilerplate

Convert only the article body: one selector keeps navigation, ads and widgets out of the Markdown.

Bulk Markdown conversion with caching

Convert thousands of URLs in parallel, cached per URL and refreshed in the background for cheap re-indexing.

Ready to read the whole SERP?

Structured results plus the full results page as Markdown or HTML, from one query. Get a Pro key and take your first snapshot today.