Capture my own number of followers

0

I'm trying to get a get of my number of followers via the Instagram API.

I already have my clientId , my userID and my accessToken . Using instafeed.js is now able to access the feed. But whenever I try to do a get to any url:

https://api.instagram.com/v1/users/self/?access_token=[MY_ACCESS_TOKEN]
https://www.instagram.com/[MY_PROFILE]/?__a=1
https://www.instagram.com/web/search/topsearch/?query=[MY_QUERY]

I fall into the Same Origin Policy problem:

  

In 'Access-Control-Allow-Origin' header is present on the requested resource. Origin ' link ' is therefore not allowed access.

I have already set up the headers:

app.use(function(req, res, next) {
    res.header('Access-Control-Allow-Origin', "*");
    res.header('Access-Control-Allow-Methods','GET,PUT,POST,DELETE');
    res.header('Access-Control-Allow-Headers', 'Content-Type');
    next();
})

And I've already tried using cors .

Does anyone know any way?

Thanks in advance.

    
asked by anonymous 03.03.2017 / 01:45

1 answer

0

I was able to resolve the problem by doing the request via server using the request module with NPM instead of doing it for ajax . So it did not generate any errors.

    
03.03.2017 / 02:05