Host Requires Authentication
The host_requires_authentication error uses HTTP status 400 and means that the site asks for credentials, such as a username and password, and the request didn’t include valid ones.
{ "is_successful": false, "error_code": "host_requires_authentication", "error_message": "The site requires authentication, such as a username and password, and the page can't be opened without valid credentials. Pass them in the `authorization` option, or remove the protection for the screenshot.", "documentation_url": "https://screenshotone.com/docs/errors/host-requires-authentication/"}Why this happens
Section titled “Why this happens”The site is protected by HTTP authentication, which is common on staging sites. A browser would show a login prompt, but the API can’t answer one, so the page doesn’t open. The ignore_host_errors option doesn’t change this, because there is no page to capture.
If you use a custom proxy, a failed authentication can come from the proxy, so the API returns network_error instead.
How to fix
Section titled “How to fix”Pass the credentials in the authorization option, or remove the protection for the screenshot. Repeating the same request won’t help.
Reach out to support
Section titled “Reach out to support”If the site doesn’t ask for credentials in your browser but the API returns this error, email support@screenshotone.com or use the support chat on our website.