Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
CLaudia2_silva
Frequent Visitor

Integrate Google Search Console API into Power BI

I'm using the Google Search Console API to retrieve the information and insert it into Power BI.
I already have OAuth 2.0 client ID credentials with application type "WEB"

In Power BI I selected the option Get data -> Blank query and I have the following query:

 

let
request = Web.Contents("https://www.googleapis.com/webmasters/v3/sites/mywebsite.com/searchAnalytics/query?startDate=2022-01...", [Headers=[ #"auth_method"="OAuth 2.0", #"client_id"="xxx", #"client_secret"="xxx", #"auth_uri"="https://accounts.google.com/o/oauth2/auth" , #"token_uri"="https://oauth2.googleapis.com/token", #"redirect_uris"="http://localhost"]])
in
request


I tested it in postman with the same url and with the same access data and it works correctly but here in Power BI it gives me the following error:

DataSource.Error: Web.Contents could not get content from 'https://www.googleapis.com/webmasters/v3/sites/mywebiste.com/searchAnalytics/query?startDate=2022-01... 01' (404): Not Found
Details:
DataSourceKind=Web
DataSourcePath=https://www.googleapis.com/webmasters/v3/sites/mywebiste.com/searchAnalytics/query
Url=https://www.googleapis.com/webmasters/v3/sites/mywebiste.com/searchAnalytics/query?startDate=2022-01...

 

Can you help me?

Thanks!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @CLaudia2_silva ,

 

There is a similar thread here, please check Pat's reply if it helps:

Solved: Error getting token for external web API (RingCent... - Microsoft Power BI Community

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

 

 

View solution in original post

3 REPLIES 3
CLaudia2_silva
Frequent Visitor

Thank you for the help. Really the link you suggested managed to unlock the problem. Here's my code, hoping it might help someone else.

 

let
// Basic auth
authKey = "Bearer xxxxxx",
url = "https://www.googleapis.com/webmasters/v3/sites/mywebsite.com/searchAnalytics/query?startDate=2022-11...",
// bearer token
GetJson = Json.Document(Web.Contents(url, [Headers=[Authorization=authKey, #"Content-Type"="application/x-www-form-urlencoded;charset=UTF-8"], Content=Text.ToBinary("grant_type=client_credentials")])),
#"Convertido em Tabela" = Record.ToTable(GetJson)
in
#"Convertido em Tabela"

 

Thanks!

Hi @CLaudia2_silva , I am trying to do the same but haven't been succsessful, two questions

 

1) is the bearer auth key the onhe to get from API centre called developer token

2) what type of "access web content" is to be selected (Annonymous, Basic, Web API, etc)

 

Thanks,

 

Moiz

Thanks,

Moiz
Was I able to answer your question? Mark my post as a solution to help others. Kudos if you liked the solution.
Anonymous
Not applicable

Hi @CLaudia2_silva ,

 

There is a similar thread here, please check Pat's reply if it helps:

Solved: Error getting token for external web API (RingCent... - Microsoft Power BI Community

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

 

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.