Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
make a shorter url
Branch: master
Pull request Compare This branch is even with netgen-inc:master.

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
README.md
app.js

README.md

url 缩短服务

REST API

/v1/shorten

For a long URL, /v3/shorten encodes a URL and returns a short one.

Parameters

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.
  • Long URLs must have a slash between the domain and the path component. For example, http://example.com?query=parameter is invalid, and instead should be formatted as http://example.com/?query=parameter

Output

  • url is the actual link that should be used
  • hash is a identifier for long_url which is unique to the given account.
  • long_url is an echo back of the longUrl request parameter. This may not always be equal to the URL requested. That's because some URL normalization may occur (e.g., due to encoding differences, or case differences in the domain). This long_url will always be functionally identical the the request parameter.

Examples

Something went wrong with that request. Please try again.