Instagram ?__a=1 url not working anymore & problems with graphql/query to get data

后端 未结 7 1215
难免孤独
难免孤独 2020-11-30 18:23

Update 19 April

After a few days using cookie ig_pr two days ago is block. Looks like the only way to get the data now is use sessionid w

7条回答
  •  囚心锁ツ
    2020-11-30 18:48

    The main problem with using graph/query is that I only have the username, to extract the userId & the last post like we use to do with ?__a=1 we have to get the instagram's user page & extract _sharedData

    Javascript

    let url = "https://www.instagram.com/"+username;
    $.ajax({
        type: 'GET',
        url: url,
        error: function () {
            //..
        },
        success: function (data) {
            data = JSON.parse(data.split("window._sharedData = ")[1].split(";")[0]).entry_data.ProfilePage[0].graphql;
            console.log(data);
        }
    })
    

    After get all this data we can call graph/query (not in client side)

提交回复
热议问题