Host
https://cricket-live-line1.p.rapidapi.com/match/5307/scorecard
header value
‘x-rapidapi-key’: “yourkeyvaluehere”,
Live Matches Endpoint
https://cricket-live-line1.p.rapidapi.com/liveMatches
In Power BI, you do not directly enter the “API Key Name” in a specific field. Instead, the key name is handled through the Advanced Options section when you access the Web API data.
Here’s how to correctly configure the API request with headers in Power BI:
Detailed Steps to Add API Key and Headers in Power BI:
- Open Power BI Desktop:
- Open Power BI Desktop and click on Home > Get Data > Web.
- Enter the URL:
- In the dialog box that appears, enter the URL of the API endpoint. In your case, it’s:
https://cricket-live-line1.p.rapidapi.com/match/5307/scorecard
- Click OK.
- In the dialog box that appears, enter the URL of the API endpoint. In your case, it’s:
- Choose Authentication Method:
- After you click OK, Power BI will prompt you to select an authentication method.
- Choose Web API as the authentication method.
- Set API Key in Power BI:
- For API Key:
- API Key Name: Here, you input
x-rapidapi-key
(this is the header name your API requires for the key). - API Key Value: This will be the value of your API key, which is yourapikey
- API Key Name: Here, you input
- For API Key:
- Add Custom Headers (Advanced Options):
- To include additional headers, such as
x-rapidapi-host
, follow these steps:- In the dialog where you entered the API Key, click on Advanced Options.
- In HTTP request header parameters, add a new entry:
- To include additional headers, such as
- Load Data:
- After configuring the headers and the authentication key, click OK.
- Power BI will make the request to the API, and you’ll be able to see the response data.
- Transform Data:
- The data will load into the Power Query Editor, where you can shape the data further if necessary.
- Click Close & Load to load the data into Power BI for reporting.
By following these steps, you can authenticate using your API key and add the necessary headers, including x-rapidapi-host
, to successfully connect to the API in Power BI.