How to Fetch 1000 records data from Rest API connect dynamically with Parameters

Kumari, Shweta 41 Reputation points


I am trying to fetch 1000 using the rest API connector link services in ADF and storing in ADLS but I am not able to set pagination for the URL.

Example of my URL :

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,154 questions
0 comments No comments
{count} votes

Accepted answer
  1. svijay-MSFT 5,226 Reputation points Microsoft Employee

    Hello @KumariShwetha-1759

    I am assuming that you are making use of the Copy Data activity to move data from REST API to ADLS. If this is not case. Please feel free to provide some context on the activity.

    The copy data by default supports the pagination for the below scenarios :



    Reference :

    Now, coming back to your scenario

    For fetching 1000 records, I am guessing that you would like recursively hit the page like below  

    if the response header/response body have the url for the next page ( for instance, , you could configure it in the below way.


    If the next page link or query parameter doesn't come as response headers/body then you're less likely to be able to use the feature.

    The alternative would be to make use of loop logic & Perform the Copy Activity

    In the Rest Connector create two parameters :


    Now populate the relative URL for the RestConnector with the parameters.



    This is to form the Relative URL dynamically. In your case "?page=1&size=10"

    Now, In the Copy Activity :


    You could set the page number as a Variable.


    This variable value would be incremented in a loop by making use of the Set Variable activity. for each iteration --> ?page=1, ?page=2,?page=3

    The URL for the Copy Activity is dynamically set for each iteration.

    To Loop / iterate - You could either make use of Until activity

    Condition : Until the variable is less than 100 or so.

    After the page 1 is executed - the variable is updated 2.

    The request is made with the variable value 2 i.e. the page 2 is queried.  


    FOREACH Loop (The implementation is discussed here :

    Note : if needed you could then merge the data for all the files (generated for each page)

    Hope this will help. Please let us know if any further queries.


    • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification
    • If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators
    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful