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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. 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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors