Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Response code is 401: Unauthorized.Something went wrong. Please report issue. #1104

Open
Arish68 opened this issue Nov 10, 2022 · 12 comments
Open

Comments

@Arish68
Copy link

Arish68 commented Nov 10, 2022

Working fine on localhost but on Production level it return an error
Response code is 401: Unauthorized.Something went wrong. Please report issue.

Code Snippet:
$instagram->getAccountInfo('username');

@IrfanPatelDev
Copy link

The same issue please someone help with this issue.
Or please share more info about using a proxy server.
my proxy server is also throwing the same error.

@Arish68
Copy link
Author

Arish68 commented Nov 23, 2022

@IrfanPatelDev
use this code to fetch public userdata by username

$instagram = new \InstagramScraper\Instagram(new \GuzzleHttp\Client());
$nonPrivateAccountMedias = $instagram->getMedias('kevin');
echo $nonPrivateAccountMedias[0]->getLink();

kindly check example folder and i hope you will never use proxy server
https://github.com/postaddictme/instagram-php-scraper/tree/master/examples

@IrfanPatelDev
Copy link

@IrfanPatelDev use this code to fetch public userdata by username

$instagram = new \InstagramScraper\Instagram(new \GuzzleHttp\Client()); $nonPrivateAccountMedias = $instagram->getMedias('kevin'); echo $nonPrivateAccountMedias[0]->getLink();

kindly check example folder and i hope you will never use proxy server https://github.com/postaddictme/instagram-php-scraper/tree/master/examples
Thanks @Arish68 for your reply, I tried this but still no luck :(

@fverdicchio
Copy link

I have same problem. On localhost works but on production server i haven't authorization. I'm using proxy.

@beshoo
Copy link
Contributor

beshoo commented Nov 30, 2022

All these problems are related to the proxy, that is why it works on your local connection because you are using your telecom connection which is a residential connection.

You may buy a proxy but it is very expansive, each 1 GB of traffic = 25 UDS.
if any one is interested in this type of proxy you can contact me.

Regards

@brucekasinsky
Copy link

brucekasinsky commented Dec 5, 2022

im using proxy, using this library one year, in last 10 days, only getmedias showing error 401. I change the proxy to rotating, not sticky and all is ok now

@Arish68
Copy link
Author

Arish68 commented Dec 5, 2022

@brucekasinsky please explain your solution (proxy to rotating)

@brucekasinsky
Copy link

brucekasinsky commented Dec 5, 2022

@Arish68

First you have to get a good proxy, for me the only one i get working with facebook is smartproxy, residencial plan. I test like five and have the problem with 401 error. There are option to use sticky and rotating.

The main difference between sticky and rotating proxies is that a sticky proxy associates a single IP address per user request while a rotating proxy assigns various IP addresses for each new request.

@fabioselau077
Copy link

Same here... same using this rotating proxy

@MJRamon
Copy link

MJRamon commented Feb 19, 2023

Everything was working, and then I keep getting 401 Unauthorized. Is it some kind of ban by Instagram? How this can be fixed?

@jhob101
Copy link

jhob101 commented Feb 19, 2023 via email

@skmachine
Copy link

I am now using https://rapidapi.com/neotank/api/instagram130/ and they somehow manage to download account json info (I am using /account-info endpoint of this api and it returns basic account info and 12 latest posts in JSON) - and they do not require to supply any cookies or login info - but this is a paid API.. it's still cheaper than purchase very expensive proxies per GB tho

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants