Your snake receives JSON game data

{
  "game": {
    "id": "game-id-string"
  },
  "turn": 1,
  "board": {
    "height": 11,
    "width": 11,
    "food": [{
      "x": 1,
      "y": 3
    }],
    "snakes": [{
      "id": "snake-id-string",
      "name": "Sneky Snek",
      "health": 100,
      "body": [{
        "x": 1,
        "y": 3
      }]
    }]
  },
  "you": {
    "id": "snake-id-string",
    "name": "Sneky Snek",
    "health": 100,
    "body": [{
      "x": 1,
      "y": 3
    }]
  }
}
            

...and your code returns your move

import bottle
import json
import random
from bottle import HTTPResponse

@bottle.post('/move')
def move():
    data = bottle.request.json

    # Do some simple or complex processing here
    # of the data given the board state,
    # and return your snake direction!

    directions = ['up', 'down', 'left', 'right']
    move = random.choice(directions)

    return {"move": move}