Google Script External API Access 403s "rate limit"
The difference between your code and curl (+browser) request is the useragent string. From your code I can't see any user string you are passing. Although I didn't use UrlFetchApp
before, but it sounds like it doesn't support useragent string.
Here is the response I got when I try to fetch the link without any useragent.
Request forbidden by administrative rules. Please make sure your request has a User-Agent header ...
Please note you need exclusive IP. Since google app script uses shared IP addresses, so your problem persists.