REST API

Base URL: https://urlik.xyz/api/. Responses are JSON of the form:

{ "status": "success", "message": "...", "return": { ... } }

Authentication (optional for basic shortening) — the X-Api-Key header. Your key is in your account. Links created with a key are attached to your account.

Endpoints

POST /api/getLink.json

Create a short link.

ParameterRequiredDescription
urlrequiredtarget URL (http/https)
aliasoptionalcustom code, 2–32 chars [a-zA-Z0-9_-]
modeoptionalredirect (default), preview, frame
expireoptionallifetime in seconds (0 = never)
passwordoptionalpassword to follow the link
curl -X POST https://urlik.xyz/api/getLink.json \
 -H "X-Api-Key: YOUR_KEY" \
 -d "url=https://example.com/very/long/path" \
 -d "mode=redirect"
{ "status":"success", "return":{
 "hex":"a1b2c3", "url":"https://urlik.xyz/a1b2c3",
 "qr":"https://urlik.xyz/qr/a1b2c3.png",
 "stats":"https://urlik.xyz/a1b2c3+", "mode":"redirect" } }

POST /api/stats.json

Stats for a link. The code parameter is the short code. Returns the click count, a daily series, sources, devices and browsers.

POST /api/links.json

List your links. Requires X-Api-Key.

POST /api/update.json

Update a link (code + fields url, mode, expire, password). Requires a key/session.

POST /api/delete.json

Delete a link (code). Requires X-Api-Key or the owner's session.

Media downloader, QR codes and temporary email

These methods require the X-Api-Key header (your key is in your account) or a call through RapidAPI.

MethodParametersDescription
GET /api/download.jsonurl*download video/photo from 1000+ sites (TikTok, YouTube, Instagram…): returns formats with ready signed download links (MP4/MP3/image)
GET /api/qr.jsondata*, format, fg, bg, ecc, sizeQR code: format = png/svg, colors fg/bg
GET /api/mailbox.jsonaddress or usernameget or create a temporary address
GET /api/messages.jsonaddresslist messages in a temporary inbox
GET /api/message.jsonaddress, idread a single message

在线试用

直接在此浏览并调用每个接口。通过 Authorize 按钮粘贴你的 API 密钥即可发起已认证请求。

嵌入短链接工具

将此代码片段放到任何页面,即可添加一个可用的短链接工具,并附带指向 urlik.xyz 的链接:

<iframe src="https://urlik.xyz/embed" style="width:100%;max-width:520px;height:150px;border:0" title="URL shortener by urlik.xyz" loading="lazy"></iframe>

/embed ↗

简单易用的短链接 REST API

Urlik REST API 让你在自己的代码中创建、读取、更新和删除短链接,并以 JSON 形式拉取点击统计。它是一个简洁的 HTTPS API——发送 POST 请求,得到可预期的 JSON 响应——因此适用于任何语言和平台。

基础缩短无需任何凭据。若要把链接绑定到你的账户并在之后管理,请在 X-Api-Key 标头中传入你的密钥(可在账户页找到)。响应始终遵循下方所示的 status、message 和 return 结构。

需要 API 密钥吗?

基础缩短不需要——你可以匿名创建链接。密钥(在你的账户页中)会把链接绑定到你名下,列出、更新或删除链接时必须使用。

响应是什么格式?

每个端点都返回 JSON,包含 status、人类可读的 message 和承载数据的 return 对象,因此各接口的解析方式完全一致。

有速率限制吗?

有,请求会按调用方限速,以保证服务快速且公平。经过认证的密钥比匿名流量拥有更高的配额。

可以在任何语言中使用吗?

可以。它是标准的 HTTPS JSON API,任何能发送 POST 请求的工具——curl、Python、PHP、JavaScript 或 Go——都能使用。

本页回答哪些搜索问题