Skip to main content
Extensy-generated extensions can call any public REST API directly from the browser. You write the prompt, Extensy generates the fetch() calls — but understanding where those calls live and how to handle API keys gives you full control over the result.
Extensy handles client-side API calls only. There is no server-side backend — all requests originate from the user’s browser.

Choose where to make the API call

Place your fetch() call in the right file depending on what triggers it:
Direct fetch() calls from content.js may be blocked by a website’s Content Security Policy (CSP). If a site sets a strict CSP, move the request to background.js and use message passing to send the result back to the content script.

Call an API from a content script

Use this pattern when the request is triggered by something the user does on a page:

Call an API from the background service worker

Use this pattern for cross-origin requests or calls that run independently of any tab:
Then send the message from your content script or popup:

Store API keys securely

Never hardcode sensitive API keys into your extension if you plan to distribute it — anyone can unpack a .crx file and read them.

Prompt Extensy to add an API call

When generating your extension, describe the API call in your prompt:
“When the user clicks the toolbar icon, fetch the current Bitcoin price from https://api.coingecko.com/api/v3/simple/price?ids=bitcoin&vs_currencies=usd and display it in the popup.”
Extensy will generate the fetch() call in the appropriate file and wire up the response to the UI. If the API requires a key, specify where you want it stored:
“Store the API key in chrome.storage.local and let users enter it on the options page.”

Handle errors gracefully

Always check response.ok and handle network failures: