# \[Minecraft API\] How should I execute commands ingame?

**URL:** https://forum.makecode.com/t/minecraft-api-how-should-i-execute-commands-ingame/6639
**Category:** Minecraft
**Created:** [March 8, 2021, 10:35pm UTC](https://forum.makecode.com/t/minecraft-api-how-should-i-execute-commands-ingame/6639 "2021-03-08T22:35:28Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![UCYT5040](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/ucyt5040/32/3542_2.png) [@UCYT5040](https://forum.makecode.com/u/UCYT5040)
#### Post date: [March 8, 2021, 10:35pm UTC](https://forum.makecode.com/t/minecraft-api-how-should-i-execute-commands-ingame/6639/1 "2021-03-08T22:35:28Z")

</div>

I’m using the [Minecraft API](https://education.minecraft.net/wp-content/uploads/Code_Connection_API.pdf) to try and make a modloader.

How should I go about executing a command? The docs are very vague.  
Current code:

```auto
def execute(target, position, *, command):
    return(request(f"/executeasother?").text)

```

What parameters do I need to add? And is there a better documentation than [this one](https://education.minecraft.net/wp-content/uploads/Code_Connection_API.pdf)?
