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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare 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
v-cgao-msft
Community Support
Community Support

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.
v-cgao-msft
Community Support
Community Support

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
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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

Top Solution Authors