I am trying to use apify to get a websites title but when I run the code I get error 403, anyone know a fix?
My Code:
currentLink = "https://medium.com/vice/scientists-monitored-631-people-as-they-died-this-is-what-they-found-2de48ad9ed96";
const postUrl = "https://api.apify.com/v2/actor-tasks/LdLPzP6nopWgexrqX/run-sync-get-dataset-items?token=" + token;
var values = {
contentType: "application/json",
"startUrls": [{
"url": currentLink,
}]
};
$.ajax({
url: postUrl,
method: 'POST',
dataType: 'json',
data: JSON.stringify(values),
success: function(response) {
console.log(response.data); // Actor run object
getItemsFromDataset(response.data.defaultDatasetId);
}
});
I get this as my error: Failed to load resource: the server responded with a status of 403 () attached with a link that shows me the correct results.