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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Dynamic API scrapping (Python script)?

Hello all,

I'm starting PBI and Python.

Requirements: 

I would like to scrap all json data coming for API url:

 

https://udex1z31.eu.****.corp/1z31/api/subscriptions/{subscriptionId}/exports/{launchDate}/logs

 

where  {subscriptionId} = text

where {launchDate} = number

 

=> for each "SubscriptionId" and "launchDate", I would like to get json:

[
{
"utcdate": "2020-06-10T15:21:26.147Z",
"beat.hostname": "string",
"username": "string",
"message": "string",
"loglevel": "Debug",
"errortype": "Functional",
"subscriptionId": "string",
"reminderkey": "string",
"data": "string",
"idExport": 0,
"idContext": "string"
}
]

 

The goal is to avoid entering these two parameters.

I would like to fill a table with all these data to be used into PBI report.

I was thinking about Python script. If anyone as an idea, it would 

 

 

2 REPLIES 2
mahoneypat
Microsoft Employee
Microsoft Employee

You don't need Python to do this one in Power BI.  YOu can pass parameters into a web API call.  You can start with a table of your id and date values and concatentate them into the web call, and then expand/append all the results together.  Here are a couple example.

 

https://community.powerbi.com/t5/Desktop/Passing-dynamic-date-parameters-to-Web-query/td-p/221349

https://community.powerbi.com/t5/Power-Query/Create-google-API-to-lookup-latitude-and-longitute-of-z...

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


lbendlin
Super User
Super User

Do you want to run this just on your PC or are you planning to publish it to the Power BI service at some point?  I am asking because there are some limitations for Python script on the service that might prevent you from running dynamic web calls.

 

You will want to look into pulling the data via Power Query instead. It has web connectors, and JSON parsing.

 

Assuming you have a table with subscription id and launch date columns as your data source, you can then iterate through that table, call a custom function to retrieve the data, and then parse the result into additional columns as needed.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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 Solution Authors