Safe.mn bit.ly compatible API
It is now easier than ever to switch from bit.ly to safe.mn, clic.gs, go2.gs, cliks.fr or 888.hn. We have released a new API 100% compatible with bit.ly.
The bit.ly APi is described in details here. Replace bit.ly by safe.mn, clic.gs, go2.gs, cliks.fr or 888.hn to with URL shortnener. For example:
http://api.bit.ly/v3/shorten?login=bitlyapidemo&apiKey=R_0da49e0a9118ff35f52f629d2d71bf07
&longUrl=http%3A%2F%2Fbetaworks.com%2F&format=json
Becomes:
http://api.safe.mn/v3/shorten?login=bitlyapidemo&apiKey=R_0da49e0a9118ff35f52f629d2d71bf07
&longUrl=http%3A%2F%2Fbetaworks.com%2F&format=json
or
http://api.safe.mn/v3/shorten?longUrl=http%3A%2F%2Fbetaworks.com%2F&format=json
There is no need for an API key or login with Safe.mn. The login and apiKey arguments can be skipped, or they can have any value.
A few secondary bit.ly API calls are unsupported. The sections below highlights the different behavior between Safe.mn and bit.ly API.
If you do not need the bi.ly compatibility, check our more powerful API.
Supported calls
Unsupported calls
- /v3/bitly_pro_domain
- /v3/authenticate
- /v3/info
Supported calls
Please refer to the official bit.ly API for all details.
/v3/shorten
http://api.safe.mn/v3/shorten?login=bitlyapidemo&apiKey=R_0da49e0a9118ff35f52f629d2d71bf07
&longUrl=http%3A%2F%2Fbetaworks.com%2F&format=json
or
http://api.safe.mn/v3/shorten?longUrl=http%3A%2F%2Fbetaworks.com%2F&format=json
| Parameter | Required |
|---|---|
| login | ignored |
| apiKey | ignored |
| longUrl | required |
| format | optional |
Response
{
"status_code": 200,
"data": {
"url": "http://safe.mn/sLH",
"hash": "sLH",
"global_hash": "sLH",
"long_url": "http://betaworks.com/",
"new_hash": 1
},
"status_txt": "OK"
}
hash and global_hash always hold the same value. new_hash is currently always equal to 1.
Top ↑
Supported calls
Please refer to the official bit.ly API for all details.
/v3/expand
http://api.safe.mn/v3/expand?shortUrl=http%3A%2F%2Fsafe.mn%2FsLK&shortUrl=http%3A%2F%2Fsafe.mn%2FsLH
&login=bitlyapidemo&apiKey=R_0da49e0a9118ff35f52f629d2d71bf07&hash=sMe&hash=zzzzzzzzz&format=xml
or
http://api.safe.mn/v3/expand?shortUrl=http%3A%2F%2Fsafe.mn%2FsLK&shortUrl=http%3A%2F%2Fsafe.mn%2FsLH
&hash=sMe&hash=zzzzzzzzz&format=xml
| Parameter | Required |
|---|---|
| login | ignored |
| apiKey | ignored |
| shortUrl or hash | required |
| format | optional |
Response
<?xml version="1.0" encoding="UTF-8"?>
<response>
<status_code>200</status_code>
<status_txt>OK</status_txt>
<data>
<entry>
<short_url>http://safe.mn/sLK</short_url>
<long_url>http://www.techcrunch.com/2010/01/29/windows-mobile-foursquare/</long_url>
<user_hash></user_hash>
<global_hash>sLK</global_hash>
</entry>
<entry>
<short_url>http://safe.mn/sLH</short_url>
<long_url>http://betaworks.com/</long_url>
<user_hash></user_hash>
<global_hash>sLH</global_hash>
</entry>
<entry>
<hash>sMe</hash>
<long_url>http://www.scotster.com/qf/?1152</long_url>
<user_hash></user_hash>
<global_hash>sMe</global_hash>
</entry>
<entry>
<error>NOT_FOUND</error>
<hash>a35.</hash>
</entry>
</data>
</response>
hash and global_hash always hold the same value. user_hash is always empty.
Top ↑
Supported calls
Please refer to the official bit.ly API for all details.
/v3/validate
http://api.safe.mn/v3/validate?x_login=notbilytapi&x_apiKey=not_apikey&apiKey=R_0da49e0a9118ff35f52f629d2d71bf07
&login=bitlyapidemo&format=json
or
http://api.safe.mn/v3/validate
This call always return 1. All parameters are optional
Top ↑
Supported calls
Please refer to the official bit.ly API for all details.
/v3/clicks
http://api.safe.mn/v3/clicks?shortUrl=http%3A%2F%2Fsafe.mn%2FsLK&shortUrl=http%3A%2F%2Fsafe.mn%2FsLH
&login=bitlyapidemo&apiKey=R_0da49e0a9118ff35f52f629d2d71bf07&hash=j3&hash=a35.&format=json
or
http://api.safe.mn/v3/clicks?shortUrl=http%3A%2F%2Fsafe.mn%2FsLK&shortUrl=http%3A%2F%2Fsafe.mn%2FsLH
&hash=j3&hash=a35.&format=json
Response
{
"status_code": 200,
"data": {
"clicks": [
{
"short_url": "http://safe.mn/sLK",
"global_hash": "sLK",
"user_clicks": 1105,
"user_hash": "",
"global_clicks": 1105
},
{
"short_url": "http://safe.mn/sLH",
"global_hash": "sLH",
"user_clicks": 2218,
"user_hash": "",
"global_clicks": 2218
},
{
"hash": "j3",
"global_hash": "j3",
"user_clicks": 106,
"user_hash": "",
"global_clicks": 106
},
{
"hash": "a35.",
"error": "NOT_FOUND"
}
]
},
"status_txt": "OK"
}
hash and global_hash always hold the same value. user_clicks and global_clicks are always the same. user_hash is always empty.
Top ↑
Supported calls
Please refer to the official bit.ly API for all details.
/v3/lookup
http://api.safe.mn/v3/lookup?url=http%3A%2F%2Fbetaworks.com%2F&url=http%3A%2F%2Fcode.google.com%2Fp%2Fbitly-api%2F
&login=bitlyapidemo&apiKey=R_0da49e0a9118ff35f52f629d2d71bf07&format=json
or
http://api.safe.mn/v3/lookup?url=http%3A%2F%2Fbetaworks.com%2F&url=http%3A%2F%2Fcode.google.com%2Fp%2Fbitly-api%2F
&format=json
Response
{
"data": {
"lookup": [
{
"global_hash": "sLH",
"short_url": "http://safe.mn/sLH",
"url": "http://betaworks.com/"
},
{
"global_hash": "tto",
"short_url": "http://safe.mn/tto",
"url": "http://code.google.com/p/bitly-api/"
}
]
},
"status_code": 200,
"status_txt": "OK"
}
Top ↑
