0

I am trying to call this API endpoint https://core-api.prod.blur.io/v1/collections/doodles-official/tokens?filters=%7B%22traits%22%3A%5B%5D%2C%22hasAsks%22%3Atrue%7D in a backed environment.

It work in google chrome, but when I try to make a request through node.js or postman, I get a status 403 'Forbidden'.

Fetch error

I added all the Chrome request headers in my options object but it still doesn't work.

    const getListings = async function() {
        const options = {
           /* Add whatever Chrome display in the Network settings tab of the request */ 
        };

        const res = await fetch(`https://core-api.prod.blur.io/v1/collections/mutant-ape-yacht-club/tokens?filters=%7B%22traits%22%3A%5B%5D%2C%22hasAsks%22%3Atrue%7D`, options)
        .then(res => {
            console.log(res);
            return res.json();
        })
        .catch(err => console.log(err));
        return res;
    }

I simply would like to use this URL that works in the browser in my backend application. I don't understand how this can work in my browser and not in a backed environment.

Cizia
  • 428
  • 5
  • 11
  • Is it working in incognito chrome window. If not then you are having some authorization header or cookie which is being used and you need to check and use the same one for the code/postman. You can check the network tab in the browser to check for the cookies or headers you are using. – VinodA Feb 05 '23 at 21:46
  • Yeah it's not working in an incognito chrome window. But there is a `cookie` field in the request header which I'm also using in my backend and it still doesn't work – Cizia Feb 05 '23 at 22:16
  • Did you try adding the cookie in postman to make it work. Also did you refer this link https://stackoverflow.com/questions/34558264/fetch-api-with-cookie – VinodA Feb 06 '23 at 01:22
  • Yes I tried it of course, but the problem is that I needed to simulate a browser. So now I'm using puppeteer ... – Cizia Feb 07 '23 at 19:57

0 Answers0