# Using api from custom component

**URL:** <https://meta.discourse.org/t/using-api-from-custom-component/304641>\
**Category:** Development\
**Tags:** plugin-api\
**Created:** [April 19, 2024, 4:39pm UTC](https://meta.discourse.org/t/using-api-from-custom-component/304641 "2024-04-19T16:39:33Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![gar1t](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gar1t/32/380142_2.png) [@gar1t](https://meta.discourse.org/u/gar1t)\
**Post date:** [April 19, 2024, 4:58pm UTC](https://meta.discourse.org/t/using-api-from-custom-component/304641/3 "2024-04-19T16:58:27Z")

</div>

Thank you. I had placed this code in the body section.

It’s surprising to me that the head behavior here is different. It looks like Discourse is removing these api snippets from the body section. Other script elements are retained there.

---

_[View the full topic](https://meta.discourse.org/t/using-api-from-custom-component/304641)._
