JxInsta icon indicating copy to clipboard operation
JxInsta copied to clipboard

PublicAPIs.getPosts got an Rate limited error

Open laboratorys opened this issue 1 year ago • 3 comments

Hello, Is there a way to get all posts of a user without logging in? Rate limited error is always returned when I call PublicAPIs.getPosts(pk, next_cursor) method.

laboratorys avatar Apr 26 '24 01:04 laboratorys

can you please share the actual stack trace of the error?

ErrorxCode avatar Apr 26 '24 14:04 ErrorxCode

can you please share the actual stack trace of the error?

com.errorxcode.jxinsta.InstagramException: Rate limited
	at com.errorxcode.jxinsta.Utils.call(Utils.java:54)
	at com.errorxcode.jxinsta.Utils.graphql(Utils.java:115)
	at com.errorxcode.jxinsta.endpoints.profile.Profile._getPosts(Profile.java:129)
	at com.errorxcode.jxinsta.endpoints.PublicAPIs.getPosts(PublicAPIs.java:55)
	at com.libsgh.ins.Test.main(Test.java:28)

laboratorys avatar Apr 27 '24 00:04 laboratorys

The only way to overcome it is to change your IP or use a good proxy (good bcz, many nonresidential proxies get you blocked by Instagram).

if your ISP doesn't give you a static IP then disconnecting & re-connecting (toggling airplane/flight mode) will change the IP. Also don't hit the API too frequently, sources says that it has limit of 200 requests per hour.

PS: Setting proxy is not currently supported by the library, you need to proxy at system level

ErrorxCode avatar Apr 27 '24 13:04 ErrorxCode