{
  "openapi": "3.0.0",
  "info": {
    "title": "二次元API",
    "description": "提供多种实用API服务",
    "version": "1.0.0",
    "contact": {
      "url": "https://docs.api.ecylt.top"
    }
  },
  "servers": [
    {
      "url": "https://api-re.ecylt.com",
      "description": "主要API服务器"
    }
  ],
  "paths": {
    "/v1/bing_img": {
      "get": {
        "summary": "获取Bing每日壁纸",
        "description": "获取Bing搜索首页的每日壁纸",
        "parameters": [
          {
            "name": "output",
            "in": "query",
            "description": "输出格式,设置为json时返回JSON格式,否则直接重定向到图片",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "json"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功返回数据",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "image_url": {
                      "type": "string",
                      "description": "图片URL"
                    },
                    "二次元API": {
                      "type": "string",
                      "description": "API文档地址"
                    }
                  }
                }
              }
            }
          },
          "302": {
            "description": "重定向到图片URL"
          },
          "500": {
            "description": "服务器错误"
          }
        }
      }
    },
    "/v1/ip_get": {
      "get": {
        "summary": "IP地址查询",
        "description": "查询IP地址的详细信息",
        "parameters": [
          {
            "name": "ip",
            "in": "query",
            "description": "要查询的IP地址",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功返回IP信息",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ip": {
                      "type": "string"
                    },
                    "city": {
                      "type": "string"
                    },
                    "region": {
                      "type": "string"
                    },
                    "country": {
                      "type": "string"
                    },
                    "api_by": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "参数错误"
          },
          "500": {
            "description": "服务器错误"
          }
        }
      }
    },
    "/v1/ip_get_v2": {
      "get": {
        "summary": "IP地址查询(V2版本)",
        "description": "需要API密钥的IP地址查询服务",
        "parameters": [
          {
            "name": "ip",
            "in": "query",
            "description": "要查询的IP地址",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "API-Key-V2",
            "in": "header",
            "description": "API访问密钥",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功返回IP信息",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "参数错误"
          },
          "401": {
            "description": "鉴权失败"
          },
          "500": {
            "description": "服务器错误"
          }
        }
      }
    },
    "/v1/lanzou_link": {
      "get": {
        "summary": "蓝奏云链接解析",
        "description": "解析蓝奏云分享链接获取直接下载地址",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "description": "蓝奏云分享链接",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pwd",
            "in": "query",
            "description": "提取密码(如果有)",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "description": "输出类型,设置为down时直接重定向到下载链接",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "down"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功解析",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "msg": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "filesize": {
                      "type": "string"
                    },
                    "downUrl": {
                      "type": "string"
                    },
                    "二次元API": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "302": {
            "description": "重定向到下载链接"
          },
          "400": {
            "description": "参数错误或解析失败"
          }
        }
      }
    },
    "/v1/no_img": {
      "get": {
        "summary": "随机二次元图片",
        "description": "获取随机二次元图片",
        "parameters": [
          {
            "name": "num",
            "in": "query",
            "description": "返回图片数量",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "r18",
            "in": "query",
            "description": "是否包含R18内容",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 0,
              "enum": [
                0,
                1
              ]
            }
          },
          {
            "name": "keyword",
            "in": "query",
            "description": "搜索关键词",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "size",
            "in": "query",
            "description": "图片尺寸",
            "required": false,
            "schema": {
              "type": "string",
              "default": "original"
            }
          },
          {
            "name": "output",
            "in": "query",
            "description": "输出格式",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "json"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功返回数据",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "images": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "pid": {
                            "type": "string"
                          },
                          "uid": {
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          },
                          "user": {
                            "type": "string"
                          },
                          "tags": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "url": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "302": {
            "description": "重定向到图片URL"
          },
          "500": {
            "description": "服务器错误"
          }
        }
      }
    },
    "/v1/world_60s": {
      "get": {
        "summary": "60秒读懂世界",
        "description": "获取每日新闻简报",
        "responses": {
          "200": {
            "description": "成功返回数据",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "msg": {
                      "type": "string"
                    },
                    "二次元API": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "服务器错误"
          }
        }
      }
    }
  }
}