To JSON

Convert an HTML document into a structured JSON object.

NodeJS

const html = await getHTML("http://www.cloudbrowser.ai");
if (!html) return;

const json = await ai.toJSON({
  html: html,
});

console.log("JSON:", json.response);

.NET

var html = await GetHTML("http://www.cloudbrowser.ai").ConfigureAwait(false);

if (html == null) return;

var json = await ai.ToJSON(new() {
  Html = html
}).ConfigureAwait(false);

/api/v1/ai/ToJSON – Convert HTML to a Structured JSON Object

Method: POST

Parameters:

  • html: (string) – The HTML document to convert.

  • responseFormat: (string) – The format of the response, typically json.

Request Example:

curl -X POST https://production.cloudbrowser.ai/api/v1/ai/ToJSON \
-H "Content-Type: application/json" \
-d '{
  "html": "<html>...</html>",
  "responseFormat": "json"
}'

Last updated