美图秀秀

本文为美图秀秀部分实用接口描述,大家按需自取。

1 变清晰(AI画质修复)

1.1 执行图片变清晰

  • URL

    • https://webapi-pc.meitu.com/v3/mtlab/image_restoration_async
  • 原始请求

POST /v3/mtlab/image_restoration_async HTTP/1.1
Content-Type: application/json; charset=utf-8
Host: webapi-pc.meitu.com
Connection: close

{"parameter":{"rsp_media_type":"url","ir_mode":4,"save_photo_format":2},"media_info_list":[{"media_data":"https://xiuxiu-pro.meitudata.com/ai_quality/2911fda28649b17ba607685a552b3b4e.png","media_extra":{},"media_profiles":{"media_data_type":"url"}}],"extra":{}}
  • 请求参数
{
    "parameter": {
        "rsp_media_type": "url",
        "ir_mode": 4, #变清晰模式 高清0,超清4,其他效果自行测试
        "save_photo_format": 2
    },
    "media_info_list": [
        {
            "media_data": "https://example.com/example.png", # 被执行图片网址,不确定后续是否会限制域名
            "media_extra": {},
            "media_profiles": {
                "media_data_type": "url"
            }
        }
    ],
    "extra": {}
}
  • 返回参数
{
    "reqid": "48033d3f47ec64e646f69f0fa74118dd",
    "code": 0,
    "data": {
        "msg_id": "a87f422d-45e4-4f2d-a9d1-70dbd31a48cc" # 用于查询处理结果
    }
}

1.2 查询执行结果

  • URL
    • https://webapi-pc.meitu.com/v1/mtlab/query
  • 原始请求
GET /v1/mtlab/query?msg_id=a87f422d-45e4-4f2d-a9d1-70dbd31a48cc HTTP/1.1
Host: webapi-pc.meitu.com
Connection: close
User-Agent: RapidAPI/4.2.0 (Macintosh; OS X/12.7.3) GCDHTTPRequest

  • 请求参数
# 从执行变清晰请求返回体中获取
msg_id=a87f422d-45e4-4f2d-a9d1-70dbd31a48cc
  • 返回参数
{
  "reqid": "69219f101c6e7960ba4444e4ccf90825",
  "code": 0,
  "data": {
    "media_info_list": [
      {
        "media_data": "https://obs.mtlab.meitu.com/mtopen/5a6eaf7594a743bcbec38a87bb0ac056/MTcxOTczODAwMA==/181422fc-908e-438c-7817-f559e79dd1b6.png", # 变清晰之后的图片地址
        "media_extra": null,
        "media_profiles": { # 图片信息
          "media_data_height": 472,
          "media_data_size": 48496,
          "media_data_type": "url",
          "media_data_width": 560
        }
      }
    ],
    "msg_id": "a87f422d-45e4-4f2d-a9d1-70dbd31a48cc",
    "parameter": {
      "rsp_media_type": "url",
      "spend_time": "223.72 ms",
      "version": "1.1.1"
    }
  }
}

2 无损放大

2.1 执行无损放大

  • URL
    • https://webapi-pc.meitu.com/v1/mtlab/mtimagesr_async
  • 原始请求
POST /v1/mtlab/mtimagesr_async HTTP/1.1
Content-Type: application/json; charset=utf-8
Host: webapi-pc.meitu.com
Connection: close

{"parameter":{"ir_mode":4,"max_width":8000,"max_height":8000,"rsp_media_type":"url","save_photo_format":2,"sr_mode":1,"sr_num":2},"media_info_list":[{"media_data":"https://xiuxiu-pro.meitudata.com/magnification/fafeb7f534cbf851a723382f174c99f7.png","media_profiles":{"media_data_type":"url"}}],"sub_func":""}
  • 请求参数
{
  "parameter": {
    "ir_mode": 4,
    "max_width": 8000, # 限制最大宽度
    "max_height": 8000, # 限制最大高度
    "rsp_media_type": "url",
    "save_photo_format": 2,
    "sr_mode": 1,
    "sr_num": 2, # 放大倍数
    "sr_size_w":140, # 自定义宽,不用的时候去掉
    "sr_size_h":118  # 自定义高,不用的时候去掉
  },
  "media_info_list": [
    {
      "media_data": "https://xiuxiu-pro.meitudata.com/magnification/fafeb7f534cbf851a723382f174c99f7.png",
      "media_profiles": {
        "media_data_type": "url"
      }
    }
  ],
  "sub_func": ""
}
  • 返回参数
{
  "reqid": "bed3f47a5ded68497dfe487ba2ec103c",
  "code": 0,
  "data": {
    "msg_id": "0503255d-f3b0-4b62-868b-6c6138f3e7a6" # 用于查询,调用接口1.2
  }
}