actualNoteContentPart: # Calling an external service from a plugin
  In general, you can use the fetch method to retrieve data from any external URL, as seen in the "Calling an LLM" example, below. The main caveat is that some APIs implement CORS restrictions that prevent the plugin's iframe from receiving the response. If you receive a CORS error, we recommend considering signing up for Cloudflare, to set up a Cloudflare Worker that can proxy requests from your plugin users to the target site & back. [Here is the Cloudflare worker implementation that Amplenote uses to proxy requests for services with CORS restrictions]() .
  
  If you are writing an agent, or a long-running plugin that should not prevent the user from working concurrently, consider using the [app.openEmbed()](https://www.amplenote.com/help/developing_amplenote_plugins/app_interface#app.openEmbed)  call to write your progress to an ephemeral section available to users on desktop or mobile. [Here are additional details on updating the contents of your embed as incremental progress occurs](https://www.amplenote.com/help/developing_amplenote_plugins/actions#renderEmbed) .
processedNoteContent: ---
  title: Plugin API Examples
  headers: # Calling an external service from a plugin
  ---
  Calling an external service from a plugin
  In general, you can use the fetch method to retrieve data from any external URL, as seen in the "Calling an LLM" example, below. The main caveat is that some APIs implement CORS restrictions that prevent the plugin's iframe from receiving the response. If you receive a CORS error, we recommend considering signing up for Cloudflare, to set up a Cloudflare Worker that can proxy requests from your plugin users to the target site & back. [Here is the Cloudflare worker implementation that Amplenote uses to proxy requests for services with CORS restrictions]()
   . If you are writing an agent, or a long-running plugin that should not prevent the user from working concurrently, consider using the [app.openEmbed()](https://www.amplenote.com)`
    call to write your progress to an ephemeral section available to users on desktop or mobile. [Here are additional details on updating the contents of your embed as incremental progress occurs](https://www.amplenote.com)`
   .
noteTitle: Plugin API Examples