Categories: Data Analytics
Tags:

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:

  1. Open Power BI Desktop:
    • Open Power BI Desktop and click on Home > Get Data > Web.
  2. 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.
  3. Choose Authentication Method:
    • After you click OK, Power BI will prompt you to select an authentication method.
    • Choose Web API as the authentication method.
  4. 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
  5. 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:
  6. 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.
  7. 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.