How to get data from web API

Stephane Joseph 20 Reputation points
2023-12-08T15:16:22.4966667+00:00

How to properly setup data source access using web API as a source in Power BI? I have a API key and API URL but I keep getting an error message " A web API key can only be specified when a web API key name is provided "

Community Center | Not monitored
0 comments No comments
{count} votes

Accepted answer
  1. Sedat SALMAN 14,180 Reputation points MVP
    2023-12-08T15:51:45.03+00:00

    The error you're encountering typically arises when Power BI does not receive the API key name. Ensure that you correctly include both the API key and the API key name in your request. For Azure API Management, the header name for the API key is often "Ocp-Apim-Subscription-Key", but you should verify the exact name required by your specific API.

    In some cases, users create a Power Query function to authenticate and call the authentication URL. This function retrieves the bearer token, which is then used in subsequent queries. An example of such a function includes creating a token combining the API key and making a web request to the authentication URL​​.

    If you're still encountering errors, double-check the accuracy of your API key and key name. Additionally, make sure that the API endpoint URL is correct and that the API is accessible.

    for further details

    you can check the following discussion:

    https://community.fabric.microsoft.com/t5/Power-Query/Web-API-Key-Authentication/td-p/2389219

    https://community.fabric.microsoft.com/t5/Desktop/Get-Data-through-API/m-p/369917


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.