# How to Call 3D Slicer API Methods in My Code?

**URL:** <https://discourse.slicer.org/t/how-to-call-3d-slicer-api-methods-in-my-code/41871>\
**Category:** Development\
**Tags:** python\
**Created:** [February 25, 2025, 12:09pm UTC](https://discourse.slicer.org/t/how-to-call-3d-slicer-api-methods-in-my-code/41871 "2025-02-25T12:09:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Djonathan\_Souza](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/djonathan_souza/32/79307_2.png) [@Djonathan\_Souza](https://discourse.slicer.org/u/Djonathan_Souza)\
**Post date:** [February 25, 2025, 12:09pm UTC](https://discourse.slicer.org/t/how-to-call-3d-slicer-api-methods-in-my-code/41871/1 "2025-02-25T12:09:12Z")

</div>

Hello,

Is there a way to call 3D Slicer API methods directly from my code? If so, what are the recommended approaches or best practices for interacting with the API?

Thanks!

---

<div class="post-metadata">

**Author:** ![Djonathan\_Souza](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/djonathan_souza/32/79307_2.png) [@Djonathan\_Souza](https://discourse.slicer.org/u/Djonathan_Souza)\
**Post date:** [February 25, 2025, 3:05pm UTC](https://discourse.slicer.org/t/how-to-call-3d-slicer-api-methods-in-my-code/41871/2 "2025-02-25T15:05:50Z")

</div>

“I just found the WebServer module, but I’m not sure how to start the module and the server in the script.py.”

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [February 25, 2025, 4:17pm UTC](https://discourse.slicer.org/t/how-to-call-3d-slicer-api-methods-in-my-code/41871/3 "2025-02-25T16:17:19Z")

</div>

These instructions should help:

[https://slicer.readthedocs.io/en/5.0/user\_guide/modules/webserver.html](https://slicer.readthedocs.io/en/5.0/user_guide/modules/webserver.html)

> **[GitHub - lassoan/slicerio: Utilities for reading and writing files created by...](https://github.com/lassoan/slicerio?tab=readme-ov-file#view-files-in-3d-slicer)**
>
> Utilities for reading and writing files created by 3D Slicer
