pythonpowerbipowerbi-api

Power BI REST API: Import data from power bi 'Dataset dataset is not Push API dataset'


Is it possible to import data from Power BI dataset? As JSON, CSV etc.

I tried to send HTTP GET to https://api.powerbi.com/beta/myorg/datasets/{dataset_id}/table/{table_name}/rows

but server returned 404 error code

I use python and this is my code :

endpoint='https://api.powerbi.com/v1.0/myorg/groups/datasets/dataset_id/tables/Table_name/rows'
headers = {
              "Authorization": f"Bearer {result['access_token']}",
               "Content-Type": "application/json"
              } 
           
response = requests.get(endpoint, headers=headers)
           
print(f" response  :  {response.status_code}")
           
if response.status_code == 200:
  print(response.json())
else:
  print(f"Erreur lors de la récupération des données de la table IPE: {response.text}")

Solution

  • The API to get data from a semantic model (aka a dataset) is ExecuteQueries.