How to pull Instagram posts for a public account for certain account?
Sending a GET
request to https://www.instagram.com/katyperry/?__a=1 returns a JSON packed with account information including user id, recent media, feed, etc.
user_id = responseAsJSON.graphql.user.id
You can replace katyperry
with any public username.
Why can't I get all Instagram posts without using API in NodeJS
Since I needed to get posts from a concrete profile, I opened the profile in chrome browser, opened the console and runned the following code to get all posts:
//LOOPING ALL (credit www.hamzadiaz.com)
let posts = []
setInterval(()=>{
var inputs = document.getElementsByClassName('v1Nh3 kIKUG _bz0w');
for(var i=0; i<inputs.length;i++) {
if(!posts.includes(inputs[i].getElementsByTagName("a")[0].href)){
posts.push(inputs[i].getElementsByTagName("a")[0].href)
}
}
},500);
Instagram API view public user photo without access_token
Because your requested URL is wrong, it will work only after correcting the 'client_id' instead of 'clent_id'.
Retrieve username by userid without instagram api
Just found out that If I use the post code in the following URL it will return a JSON with the owner:username.
https://www.instagram.com/p/BVs_bQtjmov/?__a=1
"owner":{
"id":"-------",
"profile_pic_url":"-",
"username":"neymarjr",
Instagram user page parsing (with proxy, without API)
Instagram made a changes lately. They are most likely have some special AI or use some service which review your IP address, which ISP you use, is it belonging to organization like Digitalocean, OVH, etc or residential, how many requests are you making to which endpoints, how are you making them, how many accounts you use on it, and how quickly you change them etc.
Right now if you hit the limits of scraping instagram you will be redirected to LoginAndSignupPage
(you can find it in source code). Be aware that login on this point won't work - instagram will just return 429 error code
, meaning too many requests. Also after every such block most likely your IP address is even less reliable, so if you will start scraping again after block it will get blocked even faster.
I guess the easiest way will be just use residential ip with enough high delay between requests - like 3-5 seconds, and even better if you can use somehow real accounts, and don't overuse them, as well try to make any other requests in meantime, like getting some posts, opening single post or something.
You can ignore pretty much any free IP proxy list available on google, 99% of those ips on it are banned, almost same with ips from Digitalocean, OVH etc, many of them are blocked as well.
Related Topics
Angular 4: How to Read Content of Text File With Httpclient
How to Set Image to Fit Width of the Page Using Jspdf
Changing the Value of Json Object's Key, Changes Other Values Also
How to Vertically and Horizontally Center a Component in React
How to Find Object in a List of Items by Index Using Es6 (Reactjs)
How to Programmatically Clear/Reset React-Select
Disable Chrome Strict Mime Type Checking
How to Check If Input Field Is in Focus or Not
Keep Selected Dropdown Result After Refreshing Page, Jquery
How to Hide Select Options With Javascript (Cross Browser)
How to Change Colour of Text Based on Its Value When a Page Initially Loads
How to Add Class on Specific Div When Scroll
Expected to Return a Value At the End of Arrow Function Array-Callback-Return on Filter Function
How Could I Get the Latest Date from an Array of Dates - Javascript/Typescript
How to Download Pdf Automatically Using Js
Most Efficient Method to Groupby on an Array of Objects