API Code
API Code
let
// Define the API URL and headers
apiUrl = "https://cricbuzz-cricket.p.rapidapi.com/series/v1/7607",
headers = [
#"X-RapidAPI-Key" = "Paste your API Key ",
#"X-RapidAPI-Host" = "cricbuzz-cricket.p.rapidapi.com"
],
// Create a function to make the API request
getApiData = (url as text, headers as record) =>
let
// Make the request
response = Web.Contents(url, [Headers=headers]),
// Parse the JSON response
jsonResponse = Json.Document(response)
in
jsonResponse,
// Call the function to get the API data
apiData = getApiData(apiUrl, headers)
in
apiData
Live Score API Code :
let
// Define the API URL and headers
MatchID = Text.From(Live_Match_ID{0}[MatchID]),
// Make sure Live_MatchID is your table name and MatchID is your ID Column
name
LastRul="scard",
apiUrl = "https://cricbuzz-cricket.p.rapidapi.com/mcenter/v1/"& MatchID
&"/"&LastRul,
headers = [
#"X-RapidAPI-Key" = "Paste your key",
#"X-RapidAPI-Host" = "cricbuzz-cricket.p.rapidapi.com"
],
// Create a function to make the API request
getApiData = (url as text, headers as record) =>
let
// Make the request
response = Web.Contents(url, [Headers=headers]),
// Parse the JSON response
jsonResponse = Json.Document(response)
in
jsonResponse,
// Call the function to get the API data
apiData = getApiData(apiUrl, headers)
in
apiData