Skip to main content

Main causes

  • Incorrect or missing credentials provided by the client.

  • The authentication method required by the server is not supported by the client.

  • The authentication data provided by the client has expired or is no longer valid.

  • The client did not provide any authentication data.

Scrollable code block. Use arrow keys to scroll.
# Request example 
curl -X PUT https://sandbox.oxylabs.io/ -H 'Accept: application/xml;q=0.9' -H 'Accept-Encoding: compress' -H 'User-Agent: Mozilla/5.0'

Try Scraper API with 5K results

Common fixes

  • Ensure that the correct authentication credentials (username and password) are used for the request.

  • Check if the authentication method (e.g., Basic, OAuth, Bearer Token) required by the API or resource is correctly implemented in the request header.

  • Verify that the account associated with the credentials has sufficient permissions to access the requested resource.

  • Confirm that the authentication credentials have not expired or been revoked, and renew or update them if necessary.

Scrollable code block. Use arrow keys to scroll.
# Response example 
HTTP/1.1 401 Unauthorized
Content-Type: text/xml
WWW-Authenticate: Basic realm="Access to the staging site"

<?xml version="1.0" encoding="UTF-8"?>
<error>
<code>401</code>
<message>Unauthorized: Access is denied due to invalid credentials.</message>
</error>

Forget HTTP errors with Scraper API

Web scraper API

Self-Service

Public data delivery from a majority of websites

From

49

Useful resources

Python request library
Python Requests Library: 2026 Guide
Authors avatar

Adomas Sulcas

2025-01-02

Laptop and books on table
What are HTTP Headers: Examples and Most Common Types
Mantas Miksenas avatar

Mantas Miksenas

2024-07-10

Python Syntax Errors: Common Mistakes and How to Fix Them
Python Syntax Errors: Common Mistakes and How to Fix Them
vytenis kaubre avatar

Vytenis Kaubrė

2023-05-08

Get the latest news from data gathering world

Scale up your business with Oxylabs®