I have been trying to create a google assistant interaction for checking to see if the most recently drawn lottery results match the user’s
I have tried an API created by ‘CreativeSolutions’ however the API does not seem to be responding to requests and I cannot find any other alternatives.
'use strict'; const { dialogflow } = require('actions-on-google'); const functions = require('firebase-functions'); const app = dialogflow({ debug:true }); app.intent('wednesdays number', (conv, {number}) => { var lottoNumber = number; if (lottoNumber == '01') { return conv.ask('Thats correct, want to try again?'); } var unirest = require("unirest"); var req = unirest("GET", "https://euromillions.p.rapidapi.com/ResultsService/FindLast"); req.headers({ "x-rapidapi-host": "euromillions.p.rapidapi.com", "x-rapidapi-key": "6176bf0ce5mshda3ef945e5d809fp156f41jsnd333104ff8d2" }); req.end(function (res) { if (res.error) throw new Error(res.error); console.log(res.body); }); });
Advertisement
Answer
The EuroMillions does not have a free public-facing official API so this would be unable to be completed.