Website moderation

Send the URL of a public web page and CalmLens loads it in a browser, extracts the text and images, and moderates each one. The page becomes a website asset, and what it contains becomes child assets. You get one decision for the page and a report for every piece of extracted content.

Website moderationPreview

Submit a page

Website uploads require active billing on the project's organisation. This applies to both URLs that return HTML and uploaded HTML files. When the API refuses a website upload for this reason, it returns HTTP 409 Conflict with 409 payment/billing-required.

Upload the page with a remote URL upload. A URL that returns text/html is stored as a website asset.

const response = await client.assets.create({
  "name": "landing-page",
  "url": "https://example.com"
});

The URL must use HTTP or HTTPS and be reachable from the public internet. While the page loads, the browser also refuses its requests to private addresses.

Submitted URLResult
A private IP address, a localhost name or URL credentialsRejected with 400 remote-url/invalid
Answers with an error statusRefused with 422 remote-url/unavailable

Loading and moderating a page takes longer than a single image. Use wait=false to get an asset ID straight away, with classification.status processing, then read the decision from a webhook:

EventSent when
asset.allowed, asset.limited, asset.age-restricted, asset.blocked, asset.purgedThe page has a decision.
asset.failedThe page can't be processed.

See Waiting for the decision.

What CalmLens extracts

CalmLens moderates the page as rendered in a desktop browser 1280 pixels wide, including content added by JavaScript. It can trigger scroll-dependent content within the first 50,000 vertical pixels and loads images and frames marked for lazy loading anywhere on the page. Page loading has a 30-second limit.

ExtractedStored as
The rendered HTMLThe website asset's content
A screenshot of the top of the page, 1280 × 720 pixelsAn image child, also the asset's rendered image and preview (content.rendered and content.preview)
All visible text, with scripts and styles removedA plaintext-document child named after the page title
Images the page loaded, inline (data: and blob:) images, the other images a <picture> offers, inline or embedded SVG graphics, and images CSS shows (backgrounds, borders, masks, list markers and generated content, with the other images an image-set() offers)image children
Content drawn on the page: each <canvas>, the frame each <video> shows, and what each <iframe>, <embed> and <object> showsimage children. A canvas is exported whole; one that drew another site's images is captured as it appears on the page, as the others are

The text, the images and the drawn content are moderated wherever they are on the page, however long it is. Images are moderated as the browser received them, with the page's cookies and referrer, so an image a site only serves to its own pages is still checked. An image that appears more than once is moderated once, and tracking pixels and elements 2 × 2 pixels or smaller are left out, as are elements that are hidden.

A page is moderated whole or not at all. It ends with classification.status failed and no children, rather than being moderated in part, when:

The pageclassification.failureReason
Shows more than 200 MiB of images and drawn content in all, besides its screenshottoo-many-items
Shows an image, or drawn content, over 20 MiBfile-too-large
Has an image that failed to load, returned an error or wasn't an image, or drawn content that couldn't be capturedprocessing-error

Split large galleries, or submit their images directly.

Children inherit the page's processing options, folder and visibility, so a feature such as OCR that you enable on the upload also runs on the page's images. They are moderated with the same policy as the page.

Reading the result

The website asset has no report of its own. Its status comes from its children, as described in Child assets: a blocked child blocks the page, and a child that failed processing fails it.

  1. Read the page's classification.moderation.decision for the overall decision.
  2. List its children, found by parentId, to see which text or image caused it.
  3. Read each child's classification.moderation as described in Reading classification results.

The page's content is the HTML as it rendered when it was submitted. Later changes to the live page aren't picked up; submit the URL again to moderate it again.

Limits and coverage

  • The screenshot shows the top of the page as it is laid out. Further down, the text, each image and each drawn element are moderated on their own, not as they combine on the page.
  • Image moderation considers readable text directly. Optional OCR extracts that text onto each image asset and adds a separate text moderation pass.
  • If the first download succeeds but the browser then gets an HTTP error instead of the page's content (including when blocked by bot protection), the page ends with classification.status failed, failureReason website-unavailable and no children, rather than being allowed. A server error (5xx), a timeout (408) or a rate limit (429) is retried first. Content behind a login or paywall is moderated as the page CalmLens receives. See Crawler.
  • The page is moderated as it rendered for one visitor, in a desktop browser with the default light colour scheme. Content a script adds only as the visitor scrolls further than 50,000 pixels down, such as the rest of an endless feed, is not captured. Content a site shows only on other screen sizes, to signed-in visitors or after an interaction such as a click is not captured, apart from the other images a <picture> offers.
  • A site can still tell some automated browsers apart and show them a different page from what visitors see. Treat a website decision as covering the page CalmLens received when it was submitted.
  • Links are not followed. Submit each page you want moderated.

Restricting domains

This setting is in Project settings in the portal, and applies to the whole project.

  • Accepted domains: allow or block submissions from specified domains, such as example.com. A domain also covers its subdomains. The rule applies to every file and website submitted by URL, to each redirect the download follows, and to every page the browser is sent to while loading a website. The rule decides which pages are loaded, not what a page shows: the browser still loads images and scripts a page pulls in from refused domains, and those images are moderated as children like any other. A refused URL returns 403 remote-url/not-allowed, and a website that redirects to a refused domain ends with classification.status failed and no children.

Websites count towards your organisation's upload rate, like any other upload.

Crawler

CalmLens doesn't identify itself when it loads a page. The first download, which checks that the submitted URL is reachable, the browser that renders the page, and the images and files it loads all use the user agent of an ordinary desktop Chrome. A site that recognised CalmLens could show it a harmless page and its visitors something else, so nothing it sends announces it.

  • Bot protection: sites behind a firewall or bot manager may block CalmLens, and a blocked page ends with classification.status failed. CalmLens can't be told apart from other Chrome visitors by its user agent, so a site can't allow it in by name, and a page that only lets known crawlers through can't be moderated.
  • No fixed IP addresses: pages are loaded from a shared cloud network, so there is no IP range to allow.
  • What it loads: only the URL that was submitted, the files that page requests, and the images on it. It doesn't follow links or sign in.

Your own users' links are usually on sites you don't control, so some will be blocked. Treat classification.status failed on a website asset as "couldn't be checked", and decide whether to show the link without a decision.

Last updated

Cookies on CalmLens

We use essential cookies for sign-in and security. With your permission, functional cookies remember your preferences and Google Analytics measures website use and signups. Optional ad measurement cookies link Google ad clicks to signups. Personalised advertising stays off. Manage cookies