Forum Discussion

StevenHarrison's avatar
StevenHarrison
Resolver I
3 years ago
Solved

API data Source connection - how to get all pages from URL request

Hi Guys - I have been given credentials to query an API connection to return data.

 

The URL they have given me brings back 100 items from the parameter at the end of the string &page=1, so therefore just the first page.

 

https://eu-app.rantandrave.com/RapideIntegration/feedback-details?from=2021-01-06%2000:00:00%20&to=%20%202022-11-08%2000:00:00&page=1

 

Can you advise if it's possible through Power BI desktop to increment the page number to request all the data, i.e. page 2, page 3 etc until all the data is returned?

 

Their API documentation is as below but their support desk does not know how to connect to Power BI

Any thoughts/feedback very welcome.

5 Replies

  • v-jingzhang's avatar
    v-jingzhang
    Community Support

    Hi StevenHarrison 

     

    Please refer to this article: Scrape Data from Multiple Web Pages with Power Query • My Online Training Hub. It provides detailed steps to solving a similar task. Currently if you don't know how many total pages it should query, you may pass a great enough page parameter to the URL to have a test.  

     

    Let me know if you have any questions when applying above solution.  

     

    Best Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as Solution to help other members find it.

    • StevenHarrison's avatar
      StevenHarrison
      Resolver I

      Thanks v-jingzhang this is brilliant, let me take a look at the solution and I will report back.

      Thank you for the prompt reply, much appreciated.

      • StevenHarrison's avatar
        StevenHarrison
        Resolver I

        Hi v-jingzhang  - getting the following error:

         

        Advanced editor text looks like this:

        let
        Source = {1..40000},
        #"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
        #"Changed Type" = Table.TransformColumnTypes(#"Converted to Table",{{"Column1", type text}}),
        #"Invoked Custom Function" = Table.AddColumn(#"Changed Type", "fxRR-DATASync", each #"fxRR-DATASync"([Column1])),
        #"Expanded fxRR-DATASync" = Table.ExpandTableColumn(#"Invoked Custom Function", "fxRR-DATASync", {"channel", "structured-fields", "categories", "insights", "notes", "Attribute:id", "message", "sentiment-score"}, {"channel", "structured-fields", "categories", "insights", "notes", "Attribute:id", "message", "sentiment-score"})
        in
        #"Expanded fxRR-DATASync"

         

        I have increased the upper value a few times. Any thoughts appreciated and thanks for your help.