I'm iterating over 2 arrays in order to construct google searches that return true if any search results contain content from both arrays. Using Node.js, what's the best way to get consumable json results?
module.exports = function(context, cb) {
var google = require('googleapis');
var request = require('request');
var url = 'https://www.googleapis.com/customsearch/v1?key='+context.data.key+'&cx='+context.data.cx+'&q=lectures';
console.log(url);
request(url,function(error, response, result){
if(!error){
console.log(result);
cb(null, result);
}
});
};
which gives the following error:
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "accessNotConfigured",
"message": "Access Not Configured. The API (CustomSearch API) is not enabled for your project. Please use the Google Developers Console to update your configuration.",
"extendedHelp": "https://console.developers.google.com"
}
],
"code": 403,
"message": "Access Not Configured. The API (CustomSearch API) is not enabled for your project. Please use the Google Developers Console to update your configuration."
}
This is close but not a duplicate of Getting Error 403: Access Not Configured. Please use Google Developers Console to activate the API for your project