Paint by Numbers
Login

API Documentation

Endpoints

/api/size

Method: GET

Description: Get the size of the grid.

Parameters:

  • GET: Requires `api_key` as a query parameter.

Response:

{
    "width": int,
    "height": int,
    "area": int
}
                

Python Sample Code:

response = requests.get('https://pbn.minsky.co/api/size', params={'api_key': 'your_api_key'})
print(response.text)

/api/colors

Method: GET

Description: Get the colors of the grid.

Parameters:

  • GET: Requires `api_key` as a query parameter.

Response:

[
    "ff00ff",
    "0000ff",
    ...
]
                

Python Sample Code:

response = requests.get('https://pbn.minsky.co/api/colors', params={'api_key': 'your_api_key'})
print(response.text)

/api/set

Method: PUT

Description: Set specific colors in the grid.

Parameters:

  • PUT: Requires `api_key` as a query parameter and a JSON body with index-color pairs.

Response:

"OK"
                

Python Sample Code:

data = {
    '3': 'ff00ff',
    '7': '00ff00'
}
response = requests.put('https://pbn.minsky.co/api/set', params={'api_key': 'your_api_key'}, json=data)
print(response.text)