LinkShort 是一款高效、安全、免费的短链接服务。支持 302/301 重定向与 iframe 内嵌,提供密码保护、有效期控制和访问次数限制,并提供 RESTful API 便于业务集成。
简洁设计,强大功能,为个人和企业提供专业的链接管理方案
毫秒级响应,通过 API 一键生成短链,便于业务系统直接集成。
为敏感链接设置访问密码,只有授权用户才能查看目标页面。
灵活设置链接过期时间,活动结束后自动失效,安全可靠。
自动追踪点击量、访客来源、设备类型和地域分布,数据一目了然。
设置最大访问次数,达到上限自动失效,适合限量分享和邀请制场景。
支持 302 临时重定向、301 永久重定向和 iframe 内嵌三种跳转模式。
通过 RESTful API 集成 LinkShort 短链接能力
https://lxkjgf.cn
application/json
application/json
UTF-8
/api/ShortLink
批量创建短链接,请求体为 JSON 数组,支持自动去重
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
originalUrl |
string | 是 | 目标长链接 URL,需为 http/https 协议 |
linkType |
int | 是 | 链接类型:1=302重定向,2=301永久重定向,3=iframe内嵌 |
title |
string | 否 | 页面自定义标题,用于内嵌展示 |
password |
string | 否 | 访问密码,留空表示不限制 |
expiredTime |
datetime | 否 | 过期时间,留空表示永久有效 |
maxClicks |
int | 否 | 最大访问次数,留空表示无限制 |
isAntiRed |
bool | 否 | 是否开启防红,开启后微信/QQ内置浏览器访问时显示引导页 |
findIfExists |
bool | 否 | 是否自动去重,开启后原始链接已存在则直接返回已有短链 |
# cURL curl -X PUT https://lxkjgf.cn/api/ShortLink \n -H "Content-Type: application/json" \n -d '[ { "originalUrl": "https://example.com/very/long/path", "linkType": 1, "title": "示例链接", "maxClicks": 100, "findIfExists": true }, { "originalUrl": "https://example.com/another", "linkType": 3, "title": "内嵌示例" } ]'
// JavaScript const res = await fetch('https://lxkjgf.cn/api/ShortLink', { method: 'PUT', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify([ { originalUrl: 'https://example.com/very/long/path', linkType: 1, title: '示例链接', maxClicks: 100, findIfExists: true }, { originalUrl: 'https://example.com/another', linkType: 3, title: '内嵌示例' } ]) }); const data = await res.json();
# Python import requests res = requests.put( 'https://lxkjgf.cn/api/ShortLink', json=[ { 'originalUrl': 'https://example.com/very/long/path', 'linkType': 1, 'title': '示例链接', 'maxClicks': 100, 'findIfExists': True }, { 'originalUrl': 'https://example.com/another', 'linkType': 3, 'title': '内嵌示例' } ] ) data = res.json()
// C# using System.Net.Http; using System.Text; using Newtonsoft.Json; using var http = new HttpClient(); var body = JsonConvert.SerializeObject(new object[] { new { originalUrl = "https://lxkjgf.cn/very/long/path", linkType = 1, title = "示例链接", maxClicks = 100, findIfExists = true }, new { originalUrl = "https://lxkjgf.cn/another", linkType = 3, title = "内嵌示例" } }); var content = new StringContent(body, Encoding.UTF8, "application/json"); var res = await http.PutAsync("https://lxkjgf.cn/api/ShortLink", content); var data = await res.Content.ReadAsStringAsync();
{
"data": [
{
"shortCode": "abc12",
"shortUrl": "https://lxkjgf.cn/s/abc12",
"originalUrl": "https://example.com/very/long/path",
"title": "示例链接",
"password": "",
"expiredTime": null,
"maxClicks": 100,
"exist": false,
"createTime": "2026-08-21T10:00:00"
}
],
"code": 0,
"errorMsg": ""
}
/api/ShortLink
分页查询短链接列表
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
page |
int | 否 | 页码,默认 1,最小 1 |
pageSize |
int | 否 | 每页条数,默认不限,最小 1 |
sortName |
string | 否 | 排序字段名 |
order |
string | 否 | 排序方向:asc 升序 / desc 降序 |
keyword |
string | 否 | 搜索关键词,用于模糊过滤 |
# cURL curl "https://lxkjgf.cn/api/ShortLink?page=1&pageSize=20&sortName=createTime&order=desc&keyword=example"
// JavaScript const params = new URLSearchParams({ page: '1', pageSize: '20', sortName: 'createTime', order: 'desc', keyword: 'example' }); const res = await fetch('https://lxkjgf.cn/api/ShortLink?' + params); const data = await res.json();
# Python import requests res = requests.get( 'https://lxkjgf.cn/api/ShortLink', params={'page': 1, 'pageSize': 20, 'sortName': 'createTime', 'order': 'desc'} ) data = res.json()
// C# using System.Net.Http; using System.Web; using var http = new HttpClient(); var query = HttpUtility.ParseQueryString(); query["page"] = "1"; query["pageSize"] = "20"; query["sortName"] = "createTime"; query["order"] = "desc"; query["keyword"] = "example"; var data = await http.GetStringAsync("https://lxkjgf.cn/api/ShortLink?{query}");
{
"data": {
"total": 128,
"rows": [
{
"shortCode": "abc12",
"linkType": 1,
"originalUrl": "https://example.com/very/long/path",
"hasPassword": false,
"expiredTime": null,
"canClick": true,
"isAntiRed": false,
"createTime": "2026-08-21T10:00:00"
}
]
},
"code": 0,
"errorMsg": ""
}
/api/ShortLink/{shortCode}
获取指定短链接详情
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
shortCode |
string | 是 | 短链接码 |
# cURL curl https://lxkjgf.cn/api/ShortLink/abc12
// JavaScript const res = await fetch('https://lxkjgf.cn/api/ShortLink/abc12'); const data = await res.json();
# Python import requests data = requests.get('https://lxkjgf.cn/api/ShortLink/abc12').json()
// C# using System.Net.Http; using var http = new HttpClient(); var data = await http.GetStringAsync("https://lxkjgf.cn/api/ShortLink/abc12");
{
"data": {
"shortCode": "abc12",
"linkType": 1,
"originalUrl": "https://example.com/very/long/path",
"password": "",
"expiredTime": null,
"maxClicks": 100,
"isAntiRed": false,
"createTime": "2026-08-21T10:00:00"
},
"code": 0,
"errorMsg": ""
}
/api/ShortLink
批量删除短链接,同时清理对应的点击统计数据,请求体为短链接码 JSON 数组
# cURL curl -X DELETE https://lxkjgf.cn/api/ShortLink \n -H "Content-Type: application/json" \n -d '["abc12", "abc34"]'
// JavaScript const res = await fetch('https://lxkjgf.cn/api/ShortLink', { method: 'DELETE', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(['abc12', 'abc34']) });
# Python import requests requests.delete( 'https://lxkjgf.cn/api/ShortLink', json=['abc12', 'abc34'] )
// C# using System.Net.Http; using System.Text; using Newtonsoft.Json; using var http = new HttpClient(); var body = JsonConvert.SerializeObject(new[] { "abc12", "abc34" }); var content = new StringContent(body, Encoding.UTF8, "application/json"); var req = new HttpRequestMessage(HttpMethod.Delete, "https://lxkjgf.cn/api/ShortLink") { Content = content }; var res = await http.SendAsync(req);
{
"data": null,
"code": 0,
"errorMsg": ""
}