Showing results for 
Show  only  | Search instead for 
Did you mean: 
Community Champion

Postman Paging

I've seen the posts from several years ago about this topic, but I've yet to actually find an answer yet, so I thought I'd ask here again.

Has anyone found a way in Postman to automatically follow Next links in order to get a complete list in one output?  For example, using /api/v1/accounts/:account_id/terms, has anyone found a way to grab a complete list of all their terms without sending separate GETs manually to request page 2 or page 3 of results?  If so, I'd LOVE to see an example or get a brief walk-through on how you did it.  I hate having to write a custom script just to get beyond the API paging limitations or running a bunch of manual updates to copy/pasting output into another application for simple things that apps like Postman could do quickly and easily for us.

Labels (2)
0 Kudos
2 Replies
Community Champion

Just for clarification, I know that many requests can send a "per_page" parameter to increase the default number of results returned, but even in the List Terms example above, we have 102 active terms and the max per page is 100. So we are stuck in pagination just to get the last 2 results.  So ANY help finding a way to do automatic pagination via Postman for simple queries would be much appreciated.

Community Contributor

The following code is from plain old javascript, but it extracts the link from the headers.

function getNextLink(xhr){
	var links = xhr.getResponseHeader("link"); 
	var linksArr =links.split(',');
	var nextlink = '';
	var thislink = '';
	for (var x=0; x<linksArr.length; x++){
		thislink = linksArr[x];
		if (thislink.indexOf('rel="next"')>-1){
			nextlink = thislink.split('>')[0].substring(1);
	return nextlink;

I don't work in Postman much, but you're looking at a Test that looks for the Next link and if it exists, then call the same script again, so something like:

pm.test("Links header is present", function () {"Links");
// do stuff with pm.response.headers.get("Links") I think.