FlowiseAI/Flowise · error · Error

Oxylabs: Failed to call Oxylabs API: ${response.status}

Error message

Oxylabs: Failed to call Oxylabs API: ${response.status}

What it means

Thrown by OxylabsLoader.sendAPIRequest when the axios POST to https://realtime.oxylabs.io/v1/queries returns a status >= 400. IMPORTANT caveat: axios's default validateStatus rejects for statuses outside 2xx-399, so with default config axios itself throws an AxiosError BEFORE this branch runs — making this message effectively dead code unless a custom validateStatus or a 3xx-with-error body is in play. The error you normally see is an AxiosError (ECONN*, 401, 402, etc.).

Source

Thrown at packages/components/nodes/documentloaders/Oxylabs/Oxylabs.ts:91

        super()
        this.params = loaderParams
    }

    private async sendAPIRequest<R>(params: any): Promise<AxiosResponse<R, any>> {
        params = Object.fromEntries(Object.entries(params).filter(([_, value]) => value !== null && value !== '' && value !== undefined))

        const auth = Buffer.from(`${this.params.username}:${this.params.password}`).toString('base64')

        const response = await axios.post<R>('https://realtime.oxylabs.io/v1/queries', params, {
            headers: {
                'Content-Type': 'application/json',
                'x-oxylabs-sdk': 'oxylabs-integration-flowise/1.0.0 (1.0.0; 64bit)',
                Authorization: `Basic ${auth}`
            }
        })

        if (response.status >= 400) {
            throw new Error(`Oxylabs: Failed to call Oxylabs API: ${response.status}`)
        }

        return response
    }

    public async load(): Promise<DocumentInterface[]> {
        let isUrlSource = this.params.source == 'universal'

        const params = {
            source: this.params.source,
            geo_location: this.params.geo_location,
            render: this.params.render ? 'html' : null,
            parse: this.params.parse,
            user_agent_type: this.params.user_agent_type,
            markdown: !this.params.parse,
            url: isUrlSource ? this.params.query : null,
            query: !isUrlSource ? this.params.query : null
        }

View on GitHub (pinned to abe4a8601a)

Solutions

  1. Verify the Oxylabs credential username and password are correct (test with curl -u user:pass).
  2. Confirm the source and geo_location values are valid for your Oxylabs plan.
  3. Check account credits/balance in the Oxylabs dashboard for 402/429.
  4. Note: with default axios config you will get an AxiosError, not this message — wrap the call and inspect err.response?.status from the AxiosError.
  5. Set a custom validateStatus only if you intentionally want to handle >= 400 in this branch.

Example fix

// before - branch unreachable with default axios
if (response.status >= 400) {
  throw new Error(`Oxylabs: Failed to call Oxylabs API: ${response.status}`)
}
// after - handle the AxiosError that axios actually throws, with body detail
} catch (err) {
  if (axios.isAxiosError(err) && err.response) {
    throw new Error(`Oxylabs API ${err.response.status}: ${JSON.stringify(err.response.data)}`)
  }
  throw err
}
Defensive patterns

Strategy: try-catch

Validate before calling

// Validate credentials and params shape before sending
function validateOxylabsParams(p) {
  if (!p.username || !p.password) throw new Error('Oxylabs username and password are required')
  if (!p.source) throw new Error('Oxylabs source is required')
  if (p.source === 'universal' && !p.query) throw new Error('query (URL) required for universal source')
}

Type guard

import axios from 'axios'
function isAxiosError(e) { return axios.isAxiosError(e) }

Try / catch

try {
  return await oxylabsLoader.load()
} catch (err) {
  if (axios.isAxiosError(err) && err.response) {
    throw new Error(`Oxylabs API ${err.response.status}: ${JSON.stringify(err.response.data)}`, { cause: err })
  }
  throw err
}

Prevention

When it happens

Trigger: 401/403 when the Oxylabs username/password (Basic auth) are wrong; 400 when params are malformed or source/geo_location invalid; 402/429 when account credits are exhausted or rate limits hit; network errors throw as AxiosError before reaching the check.

Common situations: Credential fields username/password swapped or not set; source value not matching a valid Oxylabs source (e.g. 'google' vs 'google_search'); geo_location code invalid; subscription out of credits.

Related errors


AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12). Data as JSON: /api/errors/e9a38b8c6dde9935. Report an issue: GitHub.