首页 »  API接口 »  图片API »  随机获取一张趣味图片

随机获取一张趣味图片

浏览次数:34 次
📖 API文档
🧪 在线测试
⚠️ 错误码
💻 示例代码
接口地址
https://yesno.wtf/api
请求方式
POST
返回格式
JSON
接口状态
异常 (HTTP 404) 上次检测:2026-04-20 16:15:30
更新时间
2026-04-11 11:58:34
📝 接口描述
随机获取一张趣味图片
📋 请求示例
POST https://yesno.wtf/api# 请求头
Content-Type: application/json

# 请求体示例
{
    "key": "value"
}
📤 真实返回示例
<!DOCTYPE html>
<html>
<head>
  <title>The page you were looking for doesn't exist (404)</title>
  <meta name="viewport" content="width=device-width,initial-scale=1">
  <style>
  body {
    background-color: #EFEFEF;
    color: #2E2F30;
    text-align: center;
    font-family: arial, sans-serif;
    margin: 0;
  }

  div.dialog {
    width: 95%;
    max-width: 33em;
    margin: 4em auto 0;
  }

  div.dialog > div {
    border: 1px solid #CCC;
    border-right-color: #999;
    border-left-color: #999;
    border-bottom-color: #BBB;
    border-top: #B00100 solid 4px;
    border-top-left-radius: 9px;
    border-top-right-radius: 9px;
    background-color: white;
    padding: 7px 12% 0;
    box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
  }

  h1 {
    font-size: 100%;
    color: #730E15;
    line-height: 1.5em;
  }

  div.dialog > p {
    margin: 0 0 1em;
    padding: 1em;
    background-color: #F7F7F7;
    border: 1px solid #CCC;
    border-right-color: #999;
    border-left-color: #999;
    border-bottom-color: #999;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
    border-top-color: #DADADA;
    color: #666;
    box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
  }
  </style>
</head>

<body>
  <!-- This file lives in public/404.html -->
  <div class="dialog">
    <div>
      <h1>The page you were looking for doesn't exist.</h1>
      <p>You may have mistyped the address or the page may have moved.</p>
    </div>
    <p>If you are the application owner check the logs for more information.</p>
  </div>
</body>
</html>
📌 请求参数 (键值对)
📊 返回结果
点击"发起请求"查看返回数据
错误码说明
200请求成功
400请求参数错误
401未授权访问
403禁止访问
404接口不存在
500服务器内部错误
🔧 JavaScript (Fetch)
fetch('/api/proxy.php?url=https%3A%2F%2Fyesno.wtf%2Fapi', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' }
})
.then(res => res.json())
.then(data => console.log(data))
.catch(err => console.error(err));
🐘 PHP (cURL)
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://yesno.wtf/api');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
📡 Python (requests)
import requests
url = 'https://yesno.wtf/api'
response = requests.request('POST', url)
print(response.json())

同类推荐

🔥 同分类下热门接口