API Reference

API Endpoint

All URIs below are relative to https://mng.waifu2x.me/api/


API Key

Your API key: Login


Methods

Methods
instance/list GET /api/instance/list
Returns a list of instances.
instance/status GET /api/instance/status
Gets the latest state of instance.
instance/start POST /api/instance/start
Start the specified instance.
instance/stop POST /api/instance/stop
Stops the specified instance.
instance/reset POST /api/instance/reset
Resets the specified instance.
file/convert POST /api/file/convert
Converts the specified file.
file/list GET /api/file/list
Returns a list of convert files.
file/status GET /api/file/status
Gets the latest state of convert file.

Method: instance/list

HTTP request

GET https://mng.waifu2x.me/api/instance/list

Query parameters

Parameters
apikey

string

Required
A valid API key to handle requests for this API.

CURL

curl "https://mng.waifu2x.me/api/instance/list?apikey=$apikey"

Response

JSON representation
{
    "state": 1,
    "total": "1",
    "instances": [
        {
            "id": "0",
            "name": "GRID K520 x 1",
            "type": "GRID K520 x 1 (Require $0.03 credit / 1 minute)",
            "num": "1",
            "status": "stopped",
            "run_datetime": "2018-04-01 00:00:00",
            "expire_datetime": "2018-04-02 00:00:00",
            "reg_datetime": "2018-04-01 00:00:00",
            "up_datetime": "2018-04-01 00:00:00"
        }
    ]
}
                                            

Method: instance/status

HTTP request

GET https://mng.waifu2x.me/api/instance/status

Query parameters

Parameters
id

integer

Required
The instance id.

apikey

string

Required
A valid API key to handle requests for this API.

CURL

curl "https://mng.waifu2x.me/api/instance/status?id=$id&apikey=$apikey"

Response

JSON representation
{
    "state": 1,
    "instance": {
        "id": "0",
        "name": "GRID K520 x 1",
        "type": "GRID K520 x 1 (Require $0.03 credit / 1 minute)",
        "num": "1",
        "status": "stopped",
        "run_datetime": "2018-04-01 00:00:00",
        "expire_datetime": "2018-04-02 00:00:00",
        "reg_datetime": "2018-04-01 00:00:00",
        "up_datetime": "2018-04-01 00:00:00"
    },
    "enabledRunning": true
}
                                            

Method: instance/start

HTTP request

POST https://mng.waifu2x.me/api/instance/start

Query parameters

Parameters
id

integer

Required
The instance id.

apikey

string

Required
A valid API key to handle requests for this API.

CURL

curl -X POST -F id=$id -F apikey=$apikey "https://mng.waifu2x.me/api/instance/start"

Response

JSON representation
{
    "state": 1,
    "status": "standby"
}
                                            

Method: instance/reset

HTTP request

POST https://mng.waifu2x.me/api/instance/reset

Query parameters

Parameters
id

integer

Required
The instance id.

apikey

string

Required
A valid API key to handle requests for this API.

CURL

curl -X POST -F id=$id -F apikey=$apikey "https://mng.waifu2x.me/api/instance/reset"

Response

JSON representation
{
    "state": 1,
    "status": "standby"
}
                                            

Method: instance/stop

HTTP request

POST https://mng.waifu2x.me/api/instance/stop

Query parameters

Parameters
id

integer

Required
The instance id.

apikey

string

Required
A valid API key to handle requests for this API.

CURL

curl -X POST -F id=$id -F apikey=$apikey "https://mng.waifu2x.me/api/instance/stop"

Response

JSON representation
{
    "state": 1,
    "status": "stopped"
}
                                            

Method: file/convert

HTTP request

POST https://mng.waifu2x.me/api/file/convert

Query parameters

Parameters
id

integer

Required
The instance id.

file

binary

Required
The convert file (jpg, png)

style

string

Required
The convert option: Style

  • Artwork: "art"
  • Photo: "photo"
noise

integer

Required
The convert option: Noise Reduction (expect JPEG Artifact)

  • None: "-1"
  • Low: "0"
  • Medium: "1"
  • High: "2"
  • Highest: "3"
scale

integer

Required
The convert option: Upscaling (0 - 10)

comp

integer

Required
The convert option: Compression (0 - 10)

apikey

string

Required
A valid API key to handle requests for this API.

CURL

curl -X POST -F id=$id -F apikey=$apikey -F style=$style -F noise=$noise -F scale=$scale -F comp=$comp -F "file=@$filepath" "https://mng.waifu2x.me/api/file/convert"

Response

JSON representation
{
    "state": 1,
    "id": "0",
    "src": "https://mng.waifu2x.me/fixtures/0/1/2/sample.png"
}
                                            

Method: file/list

HTTP request

GET https://mng.waifu2x.me/api/file/list

Query parameters

Parameters
id

integer

Required
The instance id.

apikey

string

Required
A valid API key to handle requests for this API.

CURL

curl "https://mng.waifu2x.me/api/file/list?id=$id&apikey=$apikey"

Response

JSON representation
{
    "state": 1,
    "total": 1,
    "files": [
        {
            "id": "0",
            "name": "sample.png",
            "status": "waiting",
            "size": 123456,
            "type": "image/png",
            "src": "https://mng.waifu2x.me/fixtures/0/1/2/sample.png",
            "params": {
                "id": "0",
                "fpath": "0/1/2/sample.png",
                "method": "convert",
                "style": "art",
                "noise": "0",
                "scale": "2",
                "comp": "0",
                "mail": null
            },
            "reg_datetime": "2018-04-01 00:00:00",
            "up_datetime": "2018-04-01 00:00:00"
        }
    ]
}
                                            

Method: file/status

HTTP request

GET https://mng.waifu2x.me/api/file/status

Query parameters

Parameters
id

integer

Required
The file id.

apikey

string

Required
A valid API key to handle requests for this API.

CURL

curl "https://mng.waifu2x.me/api/file/status?id=$id&apikey=$apikey"

Response

JSON representation
{
    "state": 1,
    "file": {
        "id": "0",
        "name": "sample.png",
        "status": "running",
        "size": 123456,
        "type": "image/png",
        "src": "https://mng.waifu2x.me/fixtures/0/1/2/sample.png",
        "params": {
            "id": "74",
            "fpath": "0/1/2/sample.png",
            "method": "convert",
            "style": "art",
            "noise": "0",
            "scale": "2",
            "comp": "0",
            "mail": null
        },
        "reg_datetime": "2018-04-01 00:00:00",
        "up_datetime": "2018-04-01 00:00:00"
    }
}