提示
欢迎使用小路网络提供的api
我们为用户开设了deepseek满血版本,无需注册即可体验
请求演示
https://api.xiaolu.icu/deepseek.php?question=你的问题
ximport requests
question = "你的问题"
encoded_question = requests.utils.quote(question)
url = f"https://api.xiaolu.icu/deepseek.php?question={encoded_question}"
response = requests.get(url)
print(response.text)
xxxxxxxxxx
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String question = "你的问题";
String encodedQuestion = java.net.URLEncoder.encode(question, StandardCharsets.UTF_8);
String url = "https://api.xiaolu.icu/deepseek.php?question=" + encodedQuestion;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.build();
client.sendAsync(request, HttpResponse.BodyHandlers.ofString())
.thenApply(HttpResponse::body)
.thenAccept(System.out::println)
.join();
}
}
xxxxxxxxxx
<?php
$question = "你的问题";
$encodedQuestion = rawurlencode($question);
$url = "https://api.xiaolu.icu/deepseek.php?question={$encodedQuestion}";
// 使用cURL发送请求
$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);
if(curl_errno($ch)) {
echo 'Curl Error: ' . curl_error($ch);
} else {
echo 'Response: ' . $response;
}
curl_close($ch);
?>
使用说明:直接访问url
演示
xxxxxxxxxx
<body>
<!-- 用于显示随机一言的容器 -->
<div id="one-word-container"></div>
<script>
// 定义 API 的 URL
const apiUrl = '这里替换为你的随机一言 API 地址';
// 创建一个 XMLHttpRequest 对象来发送 HTTP 请求
const xhr = new XMLHttpRequest();
// 初始化请求,使用 GET 方法请求 API
xhr.open('GET', apiUrl, true);
// 监听请求状态变化
xhr.onreadystatechange = function () {
// 当请求完成且状态码为 200 时,表示请求成功
if (xhr.readyState === 4 && xhr.status === 200) {
// 获取 API 返回的数据
const response = xhr.responseText;
// 提取 document.write 中的内容
const regex = /document\.write\("(.*)"\);/;
const match = response.match(regex);
if (match && match[1]) {
// 获取用于显示随机一言的容器元素
const container = document.getElementById('one-word-container');
// 将提取的内容插入到容器中
container.textContent = match[1];
}
}
};
// 发送请求
xhr.send();
</script>
Caution
本 API 服务仅适用于中华人民共和国法律管辖范围内的合法使用场景。用户不得利用本 API 从事任何违法活动,包括但不限于网络攻击、数据滥用、传播非法信息等。用户需自行承担因不当使用本 API 所引发的一切法律后果,由此产生的纠纷与本 API 及其运营方无关。