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.