接口大厅/随机一言
返回接口大厅
10
API Endpoint
GET
随机一言
正常聚合随机一言,有:安慰语录、QQ签名、趣味笑话、随机一言、英汉语录、毒鸡汤、爱情语录、文案温柔、伤感语录、舔狗日记、社会语录、诗词、骚话、经典语录、情话、人生话语、我在人间凑数的日子、网易语录
01
Request Info
请求信息
Endpoint
GET
http://cyapi.top/API/yiyan.php
Example
http://cyapi.top/API/yiyan.php?msg=随机一言&type=text
02
Parameters
2 params| Name | Type | Required | Description |
|---|---|---|---|
| msg | string | 否 | 一言的类型,可选的类型请看简介,默认随机一言 |
| type | string | 否 | json或text,默认text |
03
Status Codes
状态码| Code | Meaning |
|---|---|
| 200 | 请求成功 |
| 403 | 无权限或密钥无效 |
| 404 | 接口不存在或参数错误 |
| 429 | 请求过于频繁,已达限额 |
| 500 | 服务器内部错误 |
04
Online Test
在线测试请求参数
响应结果
点击「立即测试」查看接口返回结果
05
Code Examples
调用示例<?php $url = 'http://cyapi.top/API/yiyan.php?msg=' . urlencode($params['msg']) . '&type=' . urlencode($params['type'])'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); echo $response; ?>
import requests
url = 'http://cyapi.top/API/yiyan.php'
params = {
'msg': 'YOUR_VALUE',
'type': 'YOUR_VALUE'
}
response = requests.get(url, params=params)
print(response.text)
const url = new URL('http://cyapi.top/API/yiyan.php');
const params = new URLSearchParams();
params.append('msg', 'YOUR_VALUE');
params.append('type', 'YOUR_VALUE');
url.search = params.toString();
fetch(url)
.then(res => res.text())
.then(data => console.log(data));