I want to create my API

I want to use Glitch as an Image API— but how?

I use superagent to fetch links, e.g. ({ link: “image-link-here”}) but when I use superagent, is says Error: Forbidden. Is it really like this?

Can you show your full logs/error message?

(node:636) UnhandledPromiseRejectionWarning: Error: Forbidden
    at Request.callback (/rbd/pnpm-volume/a5f383e3-ff00-4d16-bdc2-a0ad47bc90cf/node_modules/.registry.npmjs.org/superagent/5.3.1/node_modules/superagent/lib/node/index.js:883:15)
    at IncomingMessage.<anonymous> (/rbd/pnpm-volume/a5f383e3-ff00-4d16-bdc2-a0ad47bc90cf/node_modules/.registry.npmjs.org/superagent/5.3.1/node_modules/superagent/lib/node/index.js:1126:20)
    at IncomingMessage.emit (events.js:201:15)
    at endReadableNT (_stream_readable.js:1130:12)
    at processTicksAndRejections (internal/process/task_queues.js:83:17)
(node:636) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:636) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Hmm… Could you try this on your local machine? That could tell us if this is a Glitch error or not.

I think it’s because pinging services are banned, I can’t fetch a simple JSON string.

That might not be the case as this is an outbound command. I created an image proxy similar to this in PHP and had no problems.

I tried doing this on Repl.it (sorry lo), and it works, but I really wanna use Glitch because most of my projects are here.

Did you get an error on replit?

No errors. It gave me the data I needed like any other image API.

I suppose you could contact support@glitch.com and ask them to make an acception to the rule for your app. A few similar cases to this have been made such as IFTTT.