Overview
The Save API (running on port 3001 by default) serves as a proxy to fetch HTML content from a user-provided URL. It then forwards this HTML content to the Scan API for accessibility analysis.
The Save API (running on port 3001 by default) serves as a proxy to fetch HTML content from a user-provided URL. It then forwards this HTML content to the Scan API for accessibility analysis.
POST /This is the primary endpoint for the Save API. It fetches content from the specified URL and sends it for scanning.
POSTapplication/json{
"url": "string (The URL of the website to fetch and scan)"
}
http:// or https://) is present, https:// is prepended to the URL.URL constructor. This step ensures the URL has a valid hostname and that the protocol is either http or https.If the URL is fetched successfully and the Scan API processes the content, this endpoint will return a JSON response. This response includes all fields from the Scan API's successful scan result, and additionally includes the fetched HTML content of the target URL under the htmlContent key. The HTTP status code will match the Scan API's response status (typically 200 OK for a successful scan).
Example Success Response Structure:
{
// Fields from the Scan API response (e.g., scan summary, issues found)
"originalScanField1": "value1",
"originalScanField2": { /* ... */ },
// ... other fields from Scan API ...
// Added by the Save API
"htmlContent": "<!DOCTYPE html><html><head>...</head><body>...</body></html>"
}
For details on the fields returned by the Scan API part of the response, please refer to the Scan API Documentation.
| Status Code | Condition | Response Body Example |
|---|---|---|
400 Bad Request |
URL is missing in the request body. | |
400 Bad Request |
Invalid URL format (fails initial regex check). | |
400 Bad Request |
Invalid URL structure or protocol (fails advanced parsing, e.g., missing hostname, non-http/https protocol after normalization). | |
Dynamic (e.g., 404, 500) |
Failed to fetch the external URL. Status code matches the external server's response. | |
Dynamic (e.g., 400, 500) |
The Scan API service returned an error. Status code matches the Scan API's response. | |
500 Internal Server Error |
A general error occurred while processing the URL. | |
GET /statusProvides the operational status of the Save API.
GET200 OK){
"status": "active",
"service": "save-api",
"timestamp": "ISO_Date_String (e.g., 2023-10-27T10:00:00.000Z)"
}
POST /set-internal-scan-modeThis endpoint is primarily for internal/development use. It allows dynamic configuration of the internal Scan API service URL that this Save API instance will communicate with.
POSTtarget
local: Configures the Save API to use a local Scan API (e.g., http://localhost:3002).server: Configures the Save API to use the production/server Scan API (e.g., https://accessscan.sumfall.gay/api/scan)./set-internal-scan-mode?target=localapplication/json{}) should be sent. The server does not currently process this body content.200 OK)When target is local:
{
"success": true,
"message": "Save service scan target set to local."
}
When target is server:
{
"success": true,
"message": "Save service scan target set to server."
}
400 Bad Request)If the target parameter is invalid or missing:
{
"success": false,
"message": "Invalid target parameter. Use \"local\" or \"server\"."
}