ErrorxCode / JxInsta

An object-oriented reverse engineered instagram web API made in Java. Now build bots, scrap data, create instagram apps, and a lot more in your favourite language
Apache License 2.0
17 stars 5 forks source link

PublicAPIs.getPosts got an Rate limited error #15

Open laboratorys opened 4 months ago

laboratorys commented 4 months ago

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.

ErrorxCode commented 4 months ago

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

laboratorys commented 4 months ago

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)
ErrorxCode commented 4 months ago

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