Reputation: 35
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);
});
});
Upvotes: 0
Views: 2296
Reputation: 271
They might not have an API, but they do publish the results in CSV format.
CSV_EXPORT = "https://www.national-lottery.co.uk/results/euromillions/draw-history/csv"
CSV_FILE = "euromillions-draw-history.csv"
I've been scraping results since 2021.
Upvotes: 0
Reputation: 39
But you can use this API on RapidAPI: https://rapidapi.com/jribeiro19/api/euro-millions/ There is a free access to get results and paid access to get some more features.
disclaimer: I'm the developer/owner.
Upvotes: 1
Reputation: 35
The EuroMillions does not have a free public-facing official API so this would be unable to be completed.
Upvotes: 0