Skip to content
Microus API系统
返回首页

随机笑话

公开接口 免费

获取随机笑话内容,支持纯文本和图片类型

请求信息

请求方式 GET
返回格式 JSON
请求地址
https://api.microku.cn/api/joke.php
示例地址
/api/joke.php?key=YOUR_API_KEY

请求参数

参数名 类型 必填 说明
type string 笑话类型:text(纯文本)/image(图片),默认text

返回参数

字段名 类型 说明
code integer 状态码
msg string 状态消息
data.content string 笑话内容
data.type string 笑话类型
timestamp integer 时间戳

状态码说明

状态码 状态信息 说明
200 OK 请求成功
400 Bad Request 请求参数错误

在线测试

type
点击"发送请求"按钮查看返回结果...

调用示例

PHP (cURL)
<?php
$url = 'https://api.microku.cn/api/joke.php';
$params = [
    'type' => 'value',
];

$url .= '?' . http_build_query($params);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

$response = curl_exec($ch);
curl_close($ch);

$data = json_decode($response, true);
print_r($data);