API Documentation
cleanuri.com exposes its data via an Application Programming Interface (API), so developers can interact in a programmatic way with application.
This document is the official reference for that functionality.
POST /api/v1/shorten
Given a long URL, returns a short link.
Parameters
- url - a long URL to be shortened (example: http://google.com/).
Notes
- Long URLs should be URL-encoded. You can not include a longUrl in the request that has &, ?, #, or other reserved parameters without first encoding it.
- Long URLs should not contain spaces: any longUrl with spaces will be rejected. All spaces should be either percent encoded %20 or plus encoded +. Note that tabs, newlines and trailing spaces are all indications of errors. Please remember to strip leading and trailing whitespace from any user input before shortening.
Return Values
Format: json.
- result_url - short link
- error - information about the error, if it occurred
Example
Request:
curl -XPOST -d 'url=https%3A%2F%2Fgoogle.com%2F' 'https://cleanuri.com/api/v1/shorten'
Response:
{"result_url":"https:\/\/cleanuri.com\/pEqXje"}
Limits
2 requests per second (per IP).