const fetch = require('isomorphic-fetch');

module.exports = (packageNames, startDate, endDate) => {
  const packageNamesParam = packageNames.join(',');
  const url = `/api/downloads/range/${startDate}:${endDate}/${packageNamesParam}`;
  return fetch(url).then(response => response.json());
};

@@ -159,16 +159,124 @@
 st url =
+ %60https://api.npmjs.org/downloads/range/$%7BstartDate%7D:$%7BendDate%7D/$%7BpackageNamesParam%7D%60;%0A  const fallbackUrl =
  %60/api/d
@@ -356,16 +356,21 @@
 tch(url)
+%0A    
 .then(re
@@ -395,13 +395,57 @@
 .json())
+%0A    .catch(exception =%3E fetch(fallbackUrl))
 ;%0A%7D;%0A

Use proxied downloads as fallback