短网址还原API
【基础请求】
GET https://www.llslw.cn//public/api/unshorten.php
【请求头】
Content-Type: application/json
Accept: application/json
【参数说明】
GET请求参数通过URL传递:
https://www.llslw.cn//public/api/unshorten.php?参数名1=参数值1&参数名2=参数值2
【调用示例】
# cURL
curl -X GET 'https://www.llslw.cn//public/api/unshorten.php' \
-H 'Content-Type: application/json'
# JavaScript (Fetch)
fetch('https://www.llslw.cn//public/api/unshorten.php', {
method: 'GET',
headers: { 'Content-Type': 'application/json' }
})
.then(res => res.json())
.then(data => console.log(data));
# PHP (cURL)
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://www.llslw.cn//public/api/unshorten.php');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
# Python (requests)
import requests
url = 'https://www.llslw.cn//public/api/unshorten.php'
response = requests.get(url)
print(response.json())
{
"success": false,
"error": "缺少参数: url",
"code": 400
}
点击"发起请求"查看返回数据
| 错误码 | 说明 |
|---|---|
| 200 | 请求成功 |
| 400 | 请求参数错误 |
| 401 | 未授权访问 |
| 403 | 禁止访问 |
| 404 | 接口不存在 |
| 500 | 服务器内部错误 |
fetch('/api/proxy.php?url=https%3A%2F%2Fwww.llslw.cn%2F%2Fpublic%2Fapi%2Funshorten.php', {
method: 'GET',
headers: { 'Content-Type': 'application/json' }
})
.then(res => res.json())
.then(data => console.log(data))
.catch(err => console.error(err));
<?php $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://www.llslw.cn//public/api/unshorten.php'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET'); $response = curl_exec($ch); curl_close($ch); echo $response; ?>
import requests
url = 'https://www.llslw.cn//public/api/unshorten.php'
response = requests.request('GET', url)
print(response.json())