API documentation

April 12, 2024 · View on GitHub

简体中文

Short links can be generated in a programmable way by calling the API interface

API call address

Self-deployed CloudFlare Worker address, for example: https://url.dem0.workers.dev or a self-bound domain name

Calling method: HTTP POST Request format: JSON

Example:

{
	"url": "https://example.com"
}

Request parameters:

Parameter nameTypeDescriptionRequiredExample
urlstringURL (must include http:// or https://)musthttps://example.com

Example response (JSON):

{
    "status": 200,
    "key": "/demo"
}

Response parameters:

Parameter nameTypeDescriptionExample
statusintStatus code: 200 is a successful call200
keystringShort link suffix: you need to add the domain name prefix/xxxxxx

Note: The interface will only return the key value corresponding to the short link. In actual use, the corresponding domain name prefix needs to be added. For example, if the key parameter returned in the example is "/demo", we need to add "https://url.dem0.workers.dev" as a prefix, it can be used by completing it as a complete url, namely: https://url.dem0.workers.dev/demo