Skill: justoneapi/justoneapi-web (version 1.0.6)

--- name: Web Page API description: Analyze Web Page workflows with JustOneAPI, including hTML Content, rendered HTML Content, and markdown Content. author: JustOneAPI homepage: https://api.justoneapi.com metadata: {"openclaw":{"homepage":"https://api.justoneapi.com","primaryEnv":"JUST_ONE_API_TOKEN","requires":{"bins":["node"],"env":["JUST_ONE_API_TOKEN"]},"skillKey":"justoneapi_web"}} --- # Web Page This skill wraps 3 Web Page operations exposed by JustOneAPI. It is strongest for hTML Content, rendered HTML Content, and markdown Content. Expect common inputs such as `url`. ## When To Use It - The user needs hTML Content or rendered HTML Content on Web Page. - The task lines up with markdown Content rather than a generic cross-platform workflow. - The user can provide identifiers or filters such as `url`. - The user wants an exact API-backed answer instead of a freeform summary. ## Representative Operations - `htmlV1`: HTML Content — Get the HTML content of a web page - `renderedHtmlV1`: Rendered HTML Content — Get the Rendered HTML content of a web page - `markdownV1`: Markdown Content — Get the Markdown content of a web page ## Request Pattern - 3 operations are available in this skill. - HTTP methods used here: `GET`. - The most common non-token parameters are `url`. - All operations in this skill are parameter-driven requests; none require a request body. ## How To Work 1. Read `generated/operations.md` before choosing an endpoint. 2. Start with one of these operations when it matches the user's request: `htmlV1`, `renderedHtmlV1`, `markdownV1`. 3. Pick the smallest matching operation instead of guessing. 4. Ask the user for any missing required parameter. Do not invent values. 5. Call the helper with: ```bash node {baseDir}/bin/run.mjs --operation "<operation-id>" --token "$JUST_ONE_API_TOKEN" --params-json '{"key":"value"}' ``` ## Environment - Required: `JUST_ONE_API_TOKEN` - This skill uses `JUST_ONE_API_TOKEN` only for authenticated Just One API requests. - Keep `JUST_ONE_API_TOKEN` private. Do not paste it into chat messages, screenshots, or logs. - Get a token from [Just One API Dashboard](https://dashboard.justoneapi.com/en/login?utm_source=clawhub.ai&utm_medium=referral&utm_campaign=justoneapi_web&utm_content=project_link). - Authentication details: [Just One API Usage Guide](https://docs.justoneapi.com/en/?utm_source=clawhub.ai&utm_medium=referral&utm_campaign=justoneapi_web&utm_content=project_link). ## Output Rules - Start with a plain-language answer tied to the Web Page task the user asked for. - Include the most decision-relevant fields from the selected endpoint before dumping raw JSON. - When using `htmlV1`, explain why the returned fields answer the user's question. - If the user gave filters such as `url`, echo those back so the scope is explicit. - If the backend errors, include the backend payload and the exact operation ID.

path: bin/run.mjs
content: #!/usr/bin/env node
const manifest = {
  "baseUrl": "https://api.justoneapi.com",
  "description": "Analyze Web Page workflows with JustOneAPI, including hTML Content, rendered HTML Content, and markdown Content.",
  "displayName": "Web Page",
  "openapi": "3.1.0",
  "platformKey": "web",
  "primaryTag": "Web Page",
  "skillName": "justoneapi_web",
  "slug": "justoneapi-web",
  "sourceTitle": "OpenAPI definition",
  "operations": [
    {
      "description": "Get the HTML content of a web page.",
      "method": "GET",
      "operationId": "htmlV1",
      "parameters": [
        {
          "defaultValue": null,
          "description": "Authentication token for this API service.",
          "enumValues": [],
          "location": "query",
          "name": "token",
          "required": true,
          "schemaType": "string"
        },
        {
          "defaultValue": null,
          "description": "The URL of the web page to fetch.",
          "enumValues": [],
          "location": "query",
          "name": "url",
          "required": true,
          "schemaType": "string"
        }
      ],
      "path": "/api/web/html/v1",
      "requestBody": null,
      "responses": [
        {
          "description": "OK",
          "statusCode": "200"
        }
      ],
      "summary": "HTML Content",
      "tags": [
        "Web Page"
      ]
    },
    {
      "description": "Get the Markdown content of a web page.",
      "method": "GET",
      "operationId": "markdownV1",
      "parameters": [
        {
          "defaultValue": null,
          "description": "Authentication token for this API service.",
          "enumValues": [],
          "location": "query",
          "name": "token",
          "required": true,
          "schemaType": "string"
        },
        {
          "defaultValue": null,
          "description": "The URL of the web page to fetch.",
          "enumValues": [],
          "location": "query",
          "name": "url",
          "required": true,
          "schemaType": "string"
        }
      ],
      "path": "/api/web/markdown/v1",
      "requestBody": null,
      "responses": [
        {
          "description": "OK",
          "statusCode": "200"
        }
      ],
      "summary": "Markdown Content",
      "tags": [
        "Web Page"
      ]
    },
    {
      "description": "Get the Rendered HTML content of a web page.",
      "method": "GET",
      "operationId": "renderedHtmlV1",
      "parameters": [
        {
          "defaultValue": null,
          "description": "Authentication token for this API service.",
          "enumValues": [],
          "location": "query",
          "name": "token",
          "required": true,
          "schemaType": "string"
        },
        {
          "defaultValue": null,
          "description": "The URL of the web page to fetch.",
          "enumValues": [],
          "location": "query",
          "name": "url",
          "required": true,
          "schemaType": "string"
        }
      ],
      "path": "/api/web/rendered-html/v1",
      "requestBody": null,
      "responses": [
        {
          "description": "OK",
          "statusCode": "200"
        }
      ],
      "summary": "Rendered HTML Content",
      "tags": [
        "Web Page"
      ]
    }
  ]
};
const args = parseArgs(process.argv.slice(2));

if (!args.operation) {
  fail("Missing required --operation argument.");
}

const operation = manifest.operations.find((item) => item.operationId === args.operation);
if (!operation) {
  fail(`Unknown operation "${args.operation}".`, { availableOperations: manifest.operations.map((item) => item.operationId) });
}

const params = parseParams(args.paramsJson);
applyDefaults(operation, params);
injectToken(operation, params, args.token);
validateRequired(operation, params);

const baseUrl = manifest.baseUrl;
const url = new URL(operation.path, ensureBaseUrl(baseUrl));
applyPathParams(operation, params, url);
applyQueryParams(operation, params, url);

const requestInit = {
  headers: {
    "accept": "application/json",
  },
  method: operation.method,
};

if (operation.requestBody && params.body !== undefined) {
  requestInit.body = JSON.stringify(params.body);
  requestInit.headers["content-type"] = operation.requestBody.contentType || "application/json";
}

let response;
try {
  response = await fetch(url, requestInit);
} catch (error) {
  fail("Network request failed.", {
    cause: error instanceof Error ? error.message : String(error),
    operationId: operation.operationId,
  });
}

const rawBody = await response.text();
let parsedBody;
try {
  parsedBody = rawBody ? JSON.parse(rawBody) : null;
} catch (error) {
  if (!response.ok) {
    fail("Backend returned a non-JSON error response.", {
      body: rawBody,
      operationId: operation.operationId,
      status: response.status,
      statusText: response.statusText,
    });
  }
  fail("Backend returned invalid JSON.", {
    body: rawBody,
    operationId: operation.operationId,
    status: response.status,
    statusText: response.statusText,
  });
}

if (!response.ok) {
  fail("Backend request failed.", {
    body: parsedBody,
    operationId: operation.operationId,
    status: response.status,
    statusText: response.statusText,
  });
}

process.stdout.write(`${JSON.stringify(parsedBody, null, 2)}\n`);

function parseArgs(argv) {
  const parsed = { operation: null, paramsJson: "{}", token: null };
  for (let index = 0; index < argv.length; index += 1) {
    const flag = argv[index];
    const value = argv[index + 1];
    if (flag === "--operation") {
      parsed.operation = value;
      index += 1;
      continue;
    }
    if (flag === "--params-json") {
      parsed.paramsJson = value;
      index += 1;
      continue;
    }
    if (flag === "--token") {
      parsed.token = value;
      index += 1;
      continue;
    }
    fail(`Unknown argument "${flag}".`);
  }
  return parsed;
}

function parseParams(input) {
  try {
    const parsed = JSON.parse(input || "{}");
    if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
      fail("--params-json must decode to a JSON object.");
    }
    return parsed;
  } catch (error) {
    fail("Failed to parse --params-json.", {
      cause: error instanceof Error ? error.message : String(error),
    });
  }
}

function applyDefaults(operation, params) {
  for (const parameter of operation.parameters) {
    if (params[parameter.name] === undefined && parameter.defaultValue !== null) {
      params[parameter.name] = parameter.defaultValue;
    }
  }
}

function injectToken(operation, params, cliToken) {
  const tokenParam = operation.parameters.find((parameter) => parameter.name === "token");
  if (!tokenParam || params.token !== undefined) {
    return;
  }
  if (!cliToken) {
    fail("--token is required for this operation.", {
      operationId: operation.operationId,
    });
  }
  params.[REDACTED_SECRET];
}

function validateRequired(operation, params) {
  const missing = [];
  for (const parameter of operation.parameters) {
    if (parameter.required && params[parameter.name] === undefined) {
      missing.push(parameter.name);
    }
  }
  if (operation.requestBody?.required && params.body === undefined) {
    missing.push("body");
  }
  if (missing.length) {
    fail("Missing required parameters.", {
      missing,
      operationId: operation.operationId,
    });
  }
}

function applyPathParams(operation, params, url) {
  let pathname = url.pathname;
  for (const parameter of operation.parameters.filter((item) => item.location === "path")) {
    const value = params[parameter.name];
    if (value === undefined) {
      continue;
    }
    pathname = pathname.replace(`{${parameter.name}}`, encodeURIComponent(String(value)));
  }
  url.pathname = pathname;
}

function applyQueryParams(operation, params, url) {
  for (const parameter of operation.parameters.filter((item) => item.location === "query")) {
    const value = params[parameter.name];
    if (value === undefined) {
      continue;
    }
    appendValue(url.searchParams, parameter.name, value);
  }
}

function appendValue(searchParams, name, value) {
  if (Array.isArray(value)) {
    for (const item of value) {
      appendValue(searchParams, name, item);
    }
    return;
  }
  if (value && typeof value === "object") {
    searchParams.append(name, JSON.stringify(value));
    return;
  }
  searchParams.append(name, String(value));
}

function ensureBaseUrl(value) {
  return value.endsWith("/") ? value : `${value}/`;
}

function fail(message, details = null) {
  const payload = { message };
  if (details) {
    payload.details = details;
  }
  process.stderr.write(`${JSON.stringify(payload, null, 2)}\n`);
  process.exit(1);
}


path: generated/operations.json
content: {
  "baseUrl": "https://api.justoneapi.com",
  "description": "Analyze Web Page workflows with JustOneAPI, including hTML Content, rendered HTML Content, and markdown Content.",
  "displayName": "Web Page",
  "openapi": "3.1.0",
  "operations": [
    {
      "description": "Get the HTML content of a web page.",
      "method": "GET",
      "operationId": "htmlV1",
      "parameters": [
        {
          "defaultValue": null,
          "description": "Authentication token for this API service.",
          "enumValues": [],
          "location": "query",
          "name": "token",
          "required": true,
          "schemaType": "string"
        },
        {
          "defaultValue": null,
          "description": "The URL of the web page to fetch.",
          "enumValues": [],
          "location": "query",
          "name": "url",
          "required": true,
          "schemaType": "string"
        }
      ],
      "path": "/api/web/html/v1",
      "requestBody": null,
      "responses": [
        {
          "description": "OK",
          "statusCode": "200"
        }
      ],
      "summary": "HTML Content",
      "tags": [
        "Web Page"
      ]
    },
    {
      "description": "Get the Markdown content of a web page.",
      "method": "GET",
      "operationId": "markdownV1",
      "parameters": [
        {
          "defaultValue": null,
          "description": "Authentication token for this API service.",
          "enumValues": [],
          "location": "query",
          "name": "token",
          "required": true,
          "schemaType": "string"
        },
        {
          "defaultValue": null,
          "description": "The URL of the web page to fetch.",
          "enumValues": [],
          "location": "query",
          "name": "url",
          "required": true,
          "schemaType": "string"
        }
      ],
      "path": "/api/web/markdown/v1",
      "requestBody": null,
      "responses": [
        {
          "description": "OK",
          "statusCode": "200"
        }
      ],
      "summary": "Markdown Content",
      "tags": [
        "Web Page"
      ]
    },
    {
      "description": "Get the Rendered HTML content of a web page.",
      "method": "GET",
      "operationId": "renderedHtmlV1",
      "parameters": [
        {
          "defaultValue": null,
          "description": "Authentication token for this API service.",
          "enumValues": [],
          "location": "query",
          "name": "token",
          "required": true,
          "schemaType": "string"
        },
        {
          "defaultValue": null,
          "description": "The URL of the web page to fetch.",
          "enumValues": [],
          "location": "query",
          "name": "url",
          "required": true,
          "schemaType": "string"
        }
      ],
      "path": "/api/web/rendered-html/v1",
      "requestBody": null,
      "responses": [
        {
          "description": "OK",
          "statusCode": "200"
        }
      ],
      "summary": "Rendered HTML Content",
      "tags": [
        "Web Page"
      ]
    }
  ],
  "platformKey": "web",
  "primaryTag": "Web Page",
  "skillName": "justoneapi_web",
  "slug": "justoneapi-web",
  "sourceTitle": "OpenAPI definition"
}


path: generated/operations.md
content: # Web Page operations

Generated from JustOneAPI OpenAPI for platform key `web`.

## `htmlV1`

- Method: `GET`
- Path: `/api/web/html/v1`
- Summary: HTML Content
- Description: Get the HTML content of a web page.
- Tags: `Web Page`

### Parameters

| Name | In | Required | Type | Default | Description |
| --- | --- | --- | --- | --- | --- |
| `token` | `query` | yes | `string` | n/a | Authentication token for this API service. |
| `url` | `query` | yes | `string` | n/a | The URL of the web page to fetch. |

### Request body

No request body.

### Responses

- `200`: OK

## `markdownV1`

- Method: `GET`
- Path: `/api/web/markdown/v1`
- Summary: Markdown Content
- Description: Get the Markdown content of a web page.
- Tags: `Web Page`

### Parameters

| Name | In | Required | Type | Default | Description |
| --- | --- | --- | --- | --- | --- |
| `token` | `query` | yes | `string` | n/a | Authentication token for this API service. |
| `url` | `query` | yes | `string` | n/a | The URL of the web page to fetch. |

### Request body

No request body.

### Responses

- `200`: OK

## `renderedHtmlV1`

- Method: `GET`
- Path: `/api/web/rendered-html/v1`
- Summary: Rendered HTML Content
- Description: Get the Rendered HTML content of a web page.
- Tags: `Web Page`

### Parameters

| Name | In | Required | Type | Default | Description |
| --- | --- | --- | --- | --- | --- |
| `token` | `query` | yes | `string` | n/a | Authentication token for this API service. |
| `url` | `query` | yes | `string` | n/a | The URL of the web page to fetch. |

### Request body

No request body.

### Responses

- `200`: OK


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: suspicious (MEDIUM)