1

I am currently trying to set up ParseHub's API in order to feed data from the web scraping software into a MongoDB database. I am currently attempting to take the last ready scraping run and write it to a JSON file. However, I receive the following error. view error

Here is the code I am currently attempting. I'm not very familiar with request and it seems to be depreciated (ignore the "insert key here" sections).

request({
  uri: 'https://www.parsehub.com/api/v2/runs/KEYGOESHERE/data',
  method: 'GET',
  gzip: true,
  qs: {
    api_key: "INSERTED KEY",
    format: "json"
  }
}, function(err, resp, body) {
  console.log(body);
  fs.writeFile('APIsample.json', body);
});

Any help would be much appreciated, or even a way to run this without request. Thanks!

0 Answers0