I am developing an application for a client which uses the Instagram graph to search for a specific hashtag. For this I use the following JavaScript:
let rawData, resuData;
$.ajax({
url: 'https://www.instagram.com/explore/tags/dogs/?__a=1',
type: "GET",
dataType: "json",
success: function(data) {
//console.log(data);
},
complete: function(data_response) {
rawData = (data_response.responseText);
resuData = JSON.parse(rawData);
console.log(resuData);
},
error: function (error) {
console.log("Error!");
}
});
This gives me a JSON with the data I want.
The problem comes when I want to obtain the data from the "elbaresotracosa" hashtag (https://www.instagram.com/explore/tags/elbaresotracosa/?__a=1) which shows me the message error 404 as shown in the following image.
But when I enter that URL from the browser itself, it shows me the JSON that I'm looking for.
In the developer tools, from the Network tab, it says that the content-type is "application/json"
content-type: application/json
Do any of you have any idea how I can solve this problem?