The best way to learn the API is to use the query explorer at http://ga-dev-tools.appspot.com/explorer/
For your analysis, add dimension=ga:pagePath and sort=ga:pageviews.
In addition, you could ask for pages which match a filter expression. For example filter=ga:pagePath=@linknum to only include pages with linknum.