Webpage to Markdown API

Convert public webpages into Markdown for documentation, knowledge bases, search indexing, and content review workflows with a simple JSON request.

Try the live demoView API details →

Webpage to Markdown API

Convert a public webpage into Markdown for your documentation or content workflow. The API returns the converted text in data.result, ready to save, review, or split into smaller sections.

View API details or try the Demo.

What you can build

  • Import public documentation into a knowledge base.
  • Prepare articles for indexing, classification, or summarization.
  • Review webpage content in a text-based editorial workflow.
  • Keep Markdown copies alongside source URLs for later reference.

Markdown can retain useful structure such as headings, lists, and links, but results depend on the source page. Review representative pages before relying on a specific layout, table structure, or main-article-only extraction. This is not a guarantee that every page element or access-restricted page can be converted.

Request

Send POST https://api.gugudata.io/v1/websitetools/url2markdown. Place appkey in the query string and url in the JSON body.

Parameter Location Required Description
appkey Query Yes Your application key. Keep it in server-side configuration.
url JSON body Yes Complete public HTTP or HTTPS URL, up to 2,048 characters.

URLs containing credentials, IP addresses, or non-standard ports are not accepted. Use the source URL including any query parameters needed to select its content.

curl --request POST \
  'https://api.gugudata.io/v1/websitetools/url2markdown?appkey=YOUR_APPKEY' \
  --header 'Content-Type: application/json' \
  --data '{"url":"https://gugudata.io/"}'

Response

A successful response contains one Markdown string. The following example is illustrative; the homepage text changes over time.

{
  "dataStatus": {
    "requestParameter": "url_host=gugudata.io&url_path=/",
    "statusCode": 200,
    "status": "SUCCESS",
    "statusDescription": "successfully",
    "responseDateTime": "2026-09-08 00:00:00+0000",
    "dataTotalCount": 1
  },
  "data": {
    "result": "# GuGuData\n\nExplore APIs for your applications.\n"
  }
}
Field Type Meaning
data.result String Non-empty Markdown text. Whitespace is preserved.
dataStatus.statusCode Integer Business status; 200 means conversion succeeded.
dataStatus.requestParameter String Source host and path, without query parameters or the AppKey.
dataStatus.responseDateTime String Response time in yyyy-MM-dd HH:mm:ssZ format.

Failed conversions do not return a substitute article or a successful empty string. Check the HTTP status and business status before using the result.

Node.js example

async function toMarkdown(sourceUrl) {
  const endpoint = new URL(
    "https://api.gugudata.io/v1/websitetools/url2markdown",
  );
  endpoint.searchParams.set("appkey", process.env.GUGUDATA_APPKEY);

  const response = await fetch(endpoint, {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({ url: sourceUrl }),
  });
  if (!response.ok) {
    throw new Error(`Conversion failed: HTTP ${response.status}`);
  }
  const body = await response.json();
  if (body.dataStatus?.statusCode !== 200 ||
      typeof body.data?.result !== "string" ||
      !body.data.result.trim()) {
    throw new Error("No usable Markdown was returned");
  }
  return body.data.result;
}

Store the source URL and retrieval date with the Markdown when you need provenance. Avoid logging credentials or sensitive URL parameters. Treat converted content as untrusted input, including when rendering it as HTML or passing it to an AI model.

Demo and caching

The Demo converts the GuGuData homepage. Successful Demo results are cached for 15 minutes. The X-GuGuData-Demo-Mode header reports live or cached, and X-GuGuData-Generated-At records when the sample was generated. Failures are not cached. Use the authenticated endpoint for your own URLs.

Errors

HTTP status Meaning
400 Missing or invalid URL, or invalid JSON request.
401 / 403 Missing, invalid, or unauthorized application key.
429 Request limit reached.
500 Unexpected service error.
503 Conversion could not be completed; business status is 500.

Keep retries bounded and do not repeatedly submit unchanged invalid input. Blocked pages, unavailable sources, and unusually large results may fail. Do not interpret conversion success as proof that all source content was captured.