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

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. 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
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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