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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

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 and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.