Open API Documentation
Version
- v1
Creation
- API
- http://tiny-url.info/api/v1/create
- Parameter
- apikey : Your development API Key. (Request API Key)
- provider : Shorting URL Service Provider. See Provider String List.
- format : "xml","json" or "text", default value is "text".
- url : Long URL
- callback : parameter for jsonp(Optional).
- HTTP Method
- Get
- Post
- Example
- php
<?php $lurl = $_POST['long_url']; $curl = curl_init(); $post_data = array('format' => 'json', 'apikey' => 'YOUR_API_KEY', 'provider' => 'PROVIDER_STRING', 'url' => $lurl ); $api_url = 'http://tiny-url.info/api/v1/create'; curl_setopt($curl, CURLOPT_URL, $api_url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data); $result = curl_exec($curl); curl_close($curl); echo $result; ?>
- Return values
- xml
- state : "ok" or "error"
- longurl : Original URL
- shorturl : Short URL
- Example
<?xml version="1.0" encoding="UTF-8"?>
ok http://www.google.com/fp=1&cad=b http://Selected_provider/random_string - json
- state : "ok" or "error"
- longurl : Original URL
- shorturl : Short URL
- Example
{ "state":"ok", "longurl":"http://www.google.com/fp=1&cad=b", "shorturl":"http://Selected_provider/random_string" }
- jsonp
- state : "ok" or "error"
- longurl : Original URL
- shorturl : Short URL
- Example
callback({ "state":"ok", "longurl":"http://www.google.com/fp=1&cad=b", "shorturl":"http://Selected_provider/random_string" })
- text
- Returns Provider Url and short url
- Example
http://Selected_provider/random_string
Random Creation
- API
- http://tiny-url.info/api/v1/random
- Parameter
- format : "xml","json" or "text", default value is "text"
- url : Long URL
- callback : parameter for jsonp(Optional).
- don't need API Key
- HTTP Method
- Get
- Post
- Example
- php
<?php $lurl = $_POST['long_url']; $curl = curl_init(); $post_data = array('format' => 'json', 'url' => $lurl ); $api_url = 'http://tiny-url.info/api/v1/random'; curl_setopt($curl, CURLOPT_URL, $api_url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data); $result = curl_exec($curl); curl_close($curl); echo $result; ?>
- Return values
- See Creation Return values.
Provider String List
-
Provider Provider String 0.mk 0_mk 0l.ro 0l_ro 2u.lc 2u_lc 3le.ru 3le_ru 888.hn 888_hn 9mp.com 9mp_com ad.vu ad_vu b54.in b54_in bb-h.me bb-h_me bim.im bim_im bit.ly bit_ly chilp.it chilp_it clicky.me clicky_me cmprs.me cmprs_me cort.as cort_as crum.bs crum_bs curt.cc curt_cc cut.by cut_by dfly.pk dfly_pk dft.ba dft_ba di.gd di_gd dlvr.it dlvr_it dok.do dok_do doo.ly doo_ly dssurl.com dssurl_com du.cx du_cx durl.me durl_me fi.gd fi_gd flx.im flx_im fon.gs fon_gs fun.ly fun_ly fwd4.me fwd4_me gho.co gho_co go.ly go_ly goo.gl goo_gl gri.bz gri_bz hanga.me hanga_me hop.me hop_me is.gd is_gd ityb.it ityb_it ixr.be ixr_be j.mp j_mp jewi.sh jewi_sh jmb.tw jmb_tw joi.nu joi_nu kcy.me kcy_me l2s.cc l2s_cc lic.bz lic_bz linkee.com linkee_com ln-s.net ln-s_net lnk.co lnk_co lnq.me lnq_me lxcurl.com lxcurl_com mcaf.ee mcaf_ee merky.de merky_de minlnk.at minlnk_at mrte.ch mrte_ch murl.kz murl_kz mwur.in mwur_in nxy.in nxy_in ovr.me ovr_me p.tl p_tl pro.ps pro_ps qlnk.net qlnk_net qr.cx qr_cx qurl.com qurl_com redir.ec redir_ec rod.gs rod_gs s.coop s_coop saf.li saf_li shortr.info shortr_info shr.tn shr_tn shx.in shx_in siteo.us siteo_us smll.fr smll_fr smsh.me smsh_me snipr.com snipr_com so.ee so_ee srs.li srs_li stnx.at stnx_at stos.me stos_me su.pr su_pr surl.me surl_me surl.wo.tc surl_wo_tc t0.tv t0_tv tiny.cc tiny_cc tinyurl.com tinyurl_com tny.tc tny_tc to.ly to_ly toma.ai toma_ai tvsl.eu tvsl_eu tw.gs tw_gs twi.im twi_im twt.fi twt_fi twurl.nl twurl_nl ub0.cc ub0_cc ulo.me ulo_me unfake.it unfake_it uoid.me uoid_me us7.kr us7_kr ux.nu ux_nu v.gd v_gd v3g.es v3g_es va.mu va_mu vai.la vai_la x.co x_co x.nu x_nu xav.cc xav_cc xc.io xc_io xcs.me xcs_me xr.com xr_com xrl.us xrl_us yvy.me yvy_me yy7.com yy7_com zoom.it zoom_it zxc9.com zxc9_com