403 from a http request to a Cloudflare hosted website

Viewed 1221

I use axios to parse a website and I get this error:

Error: Request failed with status code 403

I tried to set a custom user-agent but no luck

module.exports.get_output = function (url) {
axios({
    method: 'get',
    url: url,
    headers: {User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.192 Safari/537.36'}
})
    .then(function (res) {
        console.log(res)
    })
}

I know it's a Cloudflare website but I couldn't find a way to bypass this - most recommendations suggest pretending to be a browser but I tried that too.

1 Answers
Related