Short Links API

Create branded short links with aliases, expiry, passwords, click limits, and analytics.

Popular use-cases
Campaign tracking

Short, branded links for UTM-tagged campaigns you can rotate later.

QR codes

Print-friendly QR links for menus, events and offline media.

Password-protected

Gate sensitive docs with a simple password — no account required.

99.9 % Uptime
Response
25 req/s
0.002 Credits / request

Create Short Link (Basic)


POST https://api.yeb.to/v1/short-links/create-basic
ParameterTypeReq.Description
api_key string yes Your API key
original_url string yes Target URL (scheme auto-added if missing)
alias string opt Human alias (1–100, [A-Za-z0-9\-_])
short_code string opt Custom short code (else auto 7 chars)
password string opt Optional access password
expires_at ISO 8601 opt Expiry timestamp
click_limit int opt Max total clicks
one_time bool opt Allow only a single click
settings array<{key,value}> opt Custom metadata

Example

curl -X POST https://api.yeb.to/v1/short-links/create-basic \
  -H "Content-Type: application/json" \
  -d '{
  "api_key": "YOUR_KEY",
  "original_url": "https://example.com/pricing",
  "alias": "docs-demo"
}'

Response Example

Response Codes

CodeDescription
200 SuccessRequest processed OK.
400 Bad RequestInput validation failed.
401 UnauthorizedMissing / wrong API key.
403 ForbiddenKey inactive or not allowed.
429 Rate LimitToo many requests.
500 Server ErrorUnexpected failure.

Create Short Link (Advanced)


POST https://api.yeb.to/v1/short-links/create-advanced
ParameterTypeReq.Description
api_key string yes Your API key
original_url string yes Target URL (scheme auto-added if missing)
alias string opt Human alias (1–100, [A-Za-z0-9\-_])
short_code string opt Custom short code (else auto 7 chars)
password string opt Optional access password
expires_at ISO 8601 opt Expiry timestamp
click_limit int opt Max total clicks
one_time bool opt Allow only a single click
settings array<{key,value}> opt Custom metadata

Example

curl -X POST https://api.yeb.to/v1/short-links/create-advanced \
  -H "Content-Type: application/json" \
  -d '{
  "api_key": "YOUR_KEY",
  "original_url": "https://example.com/pricing",
  "alias": "docs-demo",
  "click_limit": 100,
  "expires_at": "2025-12-31T23:59:00Z"
}'

Response Example

Response Codes

CodeDescription
200 SuccessRequest processed OK.
400 Bad RequestInput validation failed.
401 UnauthorizedMissing / wrong API key.
403 ForbiddenKey inactive or not allowed.
429 Rate LimitToo many requests.
500 Server ErrorUnexpected failure.

Get Short Link


POST https://api.yeb.to/v1/short-links/get
ParameterTypeReq.Description
api_key string yes Your API key
code string yes Alias or short_code

Example

curl -X POST https://api.yeb.to/v1/short-links/get \
  -H "Content-Type: application/json" \
  -d '{
  "api_key": "YOUR_KEY",
  "code": "docs-demo"
}'

Response Example

Response Codes

CodeDescription
200 SuccessRequest processed OK.
400 Bad RequestInput validation failed.
401 UnauthorizedMissing / wrong API key.
403 ForbiddenKey inactive or not allowed.
429 Rate LimitToo many requests.
500 Server ErrorUnexpected failure.

Update Short Link


POST https://api.yeb.to/v1/short-links/update
ParameterTypeReq.Description
api_key string yes Your API key
code string yes Alias or short_code to update
original_url string opt New target URL
alias string opt New alias
short_code string opt New short code
password string opt Set password (empty string to clear)
expires_at ISO 8601 opt New expiry
click_limit int opt New limit
one_time bool opt Enable/disable single-use
advanced_analytics bool opt Enable/disable advanced analytics
settings array<{key,value}> opt Replace settings

Example

curl -X POST https://api.yeb.to/v1/short-links/update \
  -H "Content-Type: application/json" \
  -d '{
  "api_key": "YOUR_KEY",
  "code": "docs-demo",
  "click_limit": 100,
  "expires_at": "2025-12-31T23:59:00Z"
}'

Response Example

Response Codes

CodeDescription
200 SuccessRequest processed OK.
400 Bad RequestInput validation failed.
401 UnauthorizedMissing / wrong API key.
403 ForbiddenKey inactive or not allowed.
429 Rate LimitToo many requests.
500 Server ErrorUnexpected failure.

Delete Short Link


POST https://api.yeb.to/v1/short-links/delete
ParameterTypeReq.Description
api_key string yes Your API key
code string yes Alias or short_code

Example

curl -X POST https://api.yeb.to/v1/short-links/delete \
  -H "Content-Type: application/json" \
  -d '{
  "api_key": "YOUR_KEY",
  "code": "docs-demo"
}'

Response Example

Response Codes

CodeDescription
200 SuccessRequest processed OK.
400 Bad RequestInput validation failed.
401 UnauthorizedMissing / wrong API key.
403 ForbiddenKey inactive or not allowed.
429 Rate LimitToo many requests.
500 Server ErrorUnexpected failure.

Short Link Stats


POST https://api.yeb.to/v1/short-links/stats
ParameterTypeReq.Description
api_key string yes Your API key
code string yes Alias or short_code
period enum opt `7d` | `30d` | `90d` (default: `30d`)
tz string opt Timezone label (informational)
limit_recent int opt Recent clicks to return (0–200, default 20)

Example

curl -X POST https://api.yeb.to/v1/short-links/stats \
  -H "Content-Type: application/json" \
  -d '{
  "api_key": "YOUR_KEY",
  "code": "docs-demo",
  "period": "30d",
  "limit_recent": 10
}'

Response Example

Response Codes

CodeDescription
200 SuccessRequest processed OK.
400 Bad RequestInput validation failed.
401 UnauthorizedMissing / wrong API key.
403 ForbiddenKey inactive or not allowed.
429 Rate LimitToo many requests.
500 Server ErrorUnexpected failure.

Frequently Asked Questions

MaxMind GeoLite2 data is typically accurate to city level for 65–70% of IPv4 addresses worldwide.

For privacy and simplicity we normalize all “not available” states (expired, consumed, disabled, click limit reached) to 404.

Yes, if the new alias/short_code is unique across both columns. The API enforces global uniqueness.

Default burst is 20 req/s per API key (may vary by plan). Daily and monthly quotas can also apply.

Creating a link consumes credits. Viewing stats does as well. Password views/attempts themselves are recorded but do not individually bill.

Uniques are approximated by distinct IP addresses observed before the current event.

Only you. Access checks match your user_id (web) or any API key you own (API). Requests from others resolve as 404.

Yes. Every request, even those resulting in errors, consumes credits. This is because your credits are strictly tied to the number of requests, regardless of success or failure. However, if the error is clearly due to a platform problem on our end, we’ll recover those credits for you.

Contact us at [email protected]. We take feedback seriously—if your bug report or feature request is meaningful, we can fix or improve the API quickly and grant you 50 free credits as a thank you.

It depends on the API and sometimes even on the endpoint. Some endpoints use data from external sources, which may have stricter limits. We also enforce limits to prevent abuse and keep our platform stable. Check the docs for the specific rate limit for each endpoint.

We operate on a credit system. Buy once—credits never expire. They’re non-refundable units for making API calls (requests). Simple, fair, and you top up only when you need more.

Every HTTP call is one request. Each request consumes a number of credits depending on the endpoint. In most cases, you can make thousands of requests with just one credit—but always check each endpoint for its cost.

Yes. Your credits never expire until you use them, but they are non-refundable.

Credits are non-refundable. Only buy what you need—you can always top-up later. If we screw up and it costs you, we’ll fix it.

Prices are set in credits, not dollars. Each endpoint lists its own cost—see the “Credits / request” badge above. You’ll always know exactly what you’re spending.
← Back to APIs