EngineerMark / nayuta-bot

Discord anime bot
MIT License
0 stars 0 forks source link

Waifu Module #4

Open EngineerMark opened 3 years ago

EngineerMark commented 3 years ago

Implement new commands and API system for waifu data (Website)

Web API will be specifically designed to be handled by Nayuta, but is usable for any keyholder once ready.

API will be simple REST API, done through PHP. Result value will be in JSON format.

EngineerMark commented 3 years ago

Since MyWaifu is closed-source (at the moment), I will track progress of the API here.

EngineerMark commented 3 years ago

For API reference later

URL: https://www.mywaifu.net/api.php

Parameters (Get Params): apikey type

q

Example: https://www.mywaifu.net/api.php?type=waifudata&q=82 When fetched with a valid api key, it returns all stored data of waifu id 82 (Aqua from KonoSuba in this case)

Error codes: 200: Valid request, returned requested data 400: Bad Request, Invalid parameter values 401: Invalid or no api key provided

Returned content: code - HTML error code (see above) message - In case code is not 200, a error message will be provided data - Array of requested data