如何通过API获取1080px Instagram个人资料图片?

时间:2019-05-24 15:33:27

标签: javascript facebook-graph-api instagram instagram-api instagram-graph-api

我一直在网络上忙于寻找答案,但由于弃用的解决方案,我似乎一直处于死胡同。我正在尝试通过HTML和JavaScript制作我自己的完整instagram DP工具,但是使用该API我只能设法获得320px,但是有些网站仍然提供1080px,无法弄清楚他们如何进行管理。这是我当前的JavaScript函数:

window.onload = function getUsername() {
    var username = prompt('Enter Instagram Username:');
    fetch(`https://www.instagram.com/` + username + `/?__a=1`)
        .then(function(response) {
            return response.json();
        })
        .then(function(json) {
            var picture = json.graphql.user.profile_pic_url_hd;
            document.getElementById('dp').innerHTML = '<img src="' + picture + '">';
        });

    }

任何帮助将不胜感激,谢谢!

0 个答案:

没有答案