Add additional headers to retrieve Public data from an Instagram account using wp_remote_get()

I tried to retrieve JSON data from a public instagram account using: wp_remote_get ().

But the problem I have is that with the url: $url = https://www.instagram.com/USER/?__a=1 .

If, I am connected to my Instagram account, the url returns the data correctly by entering the url in my browser.

But, trying to send a request with the wp_remote_get ( $url) function , the response to the request returns the Login page - Instagram .

do i need to add some Headers to the function : wp_remote_get ( $url , array ( ) ) ?

Topic wp-remote-get plugin-json-api Wordpress

Category Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.