Call the free URL Shortener API endpoint
Put the target address straight after /url_shortener/. Quote the whole request in a shell so that characters like ? and & reach the API instead of being swallowed by your terminal.
curl "https://aisenseapi.com/services/v1/url_shortener/https://developer.mozilla.org/en-US/docs/Web/HTTP"{
"short_url": "https://307.fi/4xtb5RaV",
"expire_timestamp": 1787266284,
"expire_datetime": "2026-08-20T22:51:24+00:00"
}That is the entire exchange. There is no token to fetch first, no account to register and no request body to assemble. The response arrives as application/json.
Response fields
| Field | Type | Description |
|---|---|---|
| short_url | string | The temporary redirect address on 307.fi. |
| expire_timestamp | integer | Unix time in seconds at which the link stops resolving. |
| expire_datetime | string | The same instant written as an ISO 8601 string in UTC. |
Keep expire_datetime when a person will read the value later. Keep expire_timestamp when a scheduler or a cache has to compare it against the clock.
The link dies after 24 hours
Every short link stops resolving 24 hours after it was created. Never print one on a poster, a flyer, a business card or a conference badge. A dead link is worse than a long one, because the reader is left with no way to recover the address it used to point at.
The countdown starts the moment the API answers, not the moment somebody opens the link. Two calls made in the same second carry the same expiry value, so the window belongs to the request rather than to the visitor.
Handle the deadline in code. Read expire_timestamp, compare it against the current time before reusing a stored link, and request a new one once the window has closed. Shortening the same target again costs a single request and returns a fresh code.
Treat the free URL Shortener API endpoint as a courier rather than an archive. It carries an address to somebody today and then forgets it.
Anything that needs to outlive a day belongs on a permanent shortener. This endpoint is deliberately temporary, and the rest of the free public REST APIs follow the same 24-hour philosophy.
How the redirect works
- Send the target
The endpoint accepts http and https addresses and passes the target to the 307.fi short-link service.
- Receive the code
The JSON response carries the short URL plus two representations of the moment it expires.
- Follow the short link
A request to the short URL answers with HTTP 307 and a
Locationheader holding the original address.
Query strings survive the round trip. A target ending in ?tab=web&sort=name came back out of the redirect with both parameters intact.
The 307 status matters to machines. It tells a client to repeat the original method against the new address instead of quietly downgrading a POST to a GET, and it marks the redirect as temporary so nothing caches it forever.
What the endpoint rejects
Two failures are worth handling in a client. Both arrive as JSON with an error string.
| Status | When | Body |
|---|---|---|
| 400 | The path segment is not an http or https address | No valid URL provided to shorten. Must be HTTP or HTTPS. |
| 404 | The path segment is missing entirely | Unknown endpoint. See https://www.aisense.no/free-public-apis for the reference. |
Check the status code rather than searching the body for text. Validate user input before you send it, or let the Validation API endpoint confirm the shape of an address first.
When a temporary short link fits
Chat and alerts
Keep a long dashboard or approval URL readable inside a notification.
One-day handoffs
Share access to something that only matters today.
On-screen QR codes
Shrink an address before encoding it, so the pattern stays coarse and scans quickly.
Agent replies
Let a model hand a person a link short enough to read aloud.
Notice what these share. Each one is consumed within hours by somebody who is already looking at a screen. That is the shape of problem the free URL Shortener API endpoint solves well, and print is the shape it solves badly.
Privacy and limits
The target address travels in the request path. Never shorten a URL carrying a password, a session token, a signed download link or personal data, because full paths routinely land in access logs.
Responses set Access-Control-Allow-Origin to a wildcard, so browser code can call the endpoint directly. They also set no-store cache headers, so no proxy will hand a stale short code to the next caller.
The service-wide ceiling is 5000 requests per IP per 24 hours across every endpoint. Watch that budget with the Client IP API endpoint when several machines share an outbound address.