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
wkeicher
Helper III
Helper III

How to Get Data From Web API using list of parameters

I am new to getting datat from an API. There are a few challenges I am facing.

1) I can get the data using specific paramaters, but want to use a reference table to call the API for each parameter such as date. 

2) I am trying to get multiple dates and associated records into one table - Dont want to do this manually. Is there a function that can use a table as a list to replace the value and add each API call as a record in teh same table

 

pbiissue1.png

 

let
Source = Json.Document(Web.Contents("https://api.sportsdata.io/v3/nba/projections/json/DfsSlatesByDate/2020-MAR-08?key=###MYKEY###")),
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"SlateID", "Operator", "OperatorSlateID", "OperatorName", "OperatorDay", "OperatorStartTime", "NumberOfGames", "IsMultiDaySlate", "RemovedByOperator", "OperatorGameType", "SalaryCap", "SlateRosterSlots", "DfsSlateGames", "DfsSlatePlayers"}, {"Column1.SlateID", "Column1.Operator", "Column1.OperatorSlateID", "Column1.OperatorName", "Column1.OperatorDay", "Column1.OperatorStartTime", "Column1.NumberOfGames", "Column1.IsMultiDaySlate", "Column1.RemovedByOperator", "Column1.OperatorGameType", "Column1.SalaryCap", "Column1.SlateRosterSlots", "Column1.DfsSlateGames", "Column1.DfsSlatePlayers"})
in
#"Expanded Column1"

 

My Second Challenge is calling the API when there are two variables such as date and ID, Even when I do this for one manual API call the data table needs to be pivoted so the field names are columns.

1)Need to dynamically pass dates and ID's into the API Call basedon an existing tables as the list of values for each

2)Need to pivot the results as columns

pbiissue2.png

let
Source = Json.Document(Web.Contents("https://api.sportsdata.io/v3/nba/projections/json/PlayerGameProjectionStatsByPlayer/2020-MAR-08/20000877?key=###MYKEY###"))
in
Source

pbiissue.png

 

1 REPLY 1
amitchandak
Super User
Super User

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.