APIThe sqwi.sh API is here and available now. It is still in BETA, but I've been hammering it for a while now, so it should be pretty solid. I've had a few 3rd-party apps pointing at it too, and they seem happy...
http://api.sqwi.sh/{method}.{format}?{params}
At this stage there are three methods: which do exactly what their names indicate, just as they perform on the site itself. There are two response formats available (JSON and XML), the structure of these is clarified for each method below. At this stage there will not be enforcement of the requirement for an API key (developer key) while in BETA, however this will change in the future, so please request one now and use it so that you are prepared. There will be an email to all registered key holders prior to enforcement beginning so that you can ensure your usage is compliant. shorten[return to top]This is the base method that every user of the API will need access to. The parameters for this are:
Usage is: http://api.sqwi.sh/shorten.{xml | json}?api_key={APIKEY}&url={LONGURL}[&custom={CUSTOMCODE}][&password={PASSWORD}]
eg. for XML: http://api.sqwi.sh/shorten.xml?api_key=APIKEY&url=http://www.example.com
returns: <?xml version="1.0" encoding="UTF-8"?> <sqwish> <error>false</error> <original>http://www.example.com</original> <shortURL>http://sqwi.sh/kFZ</shortURL> <code>kFZ</code> <custom>false</custom> <password>false</password> </sqwish> and for JSON: http://api.sqwi.sh/shorten.json?api_key=APIKEY&url=http://www.example.com
returns: { "error":"false", "original":"http:\/\/www.example.com", "shortURL":"http:\/\/sqwi.sh\/kFZ", "code":"kFZ", "custom":"false", "password":"false" } stats[return to top]This method retrieves the hit count statistics for the URL. The parameters for this are:
Usage is: http://api.sqwi.sh/stats.{xml | json}?api_key={APIKEY}&code={CODE}[&password={PASSWORD}]
eg. for XML: http://api.sqwi.sh/stats.xml?api_key=APIKEY&code=kFZ
returns: <?xml version="1.0" encoding="UTF-8"?> <sqwish> <error>false</error> <original>http://www.example.com</original> <shortURL>http://sqwi.sh/kFZ</shortURL> <code>kFZ</code> <hits>16</hits> </sqwish> and for JSON: http://api.sqwi.sh/stats.json?api_key=APIKEY&code=kFZ
returns: { "error":"false", "original":"http:\/\/www.example.com", "shortURL":"http:\/\/sqwi.sh\/kFZ", "code":"kFZ", "hits":"16" } ips[return to top]This method retrieves all, or some, of the IP addresses which have accessed the URL. The parameters for this are:
Usage is: http://api.sqwi.sh/ips.{xml | json}?api_key={APIKEY}&code={CODE}[&limit={LIMIT}][&password={PASSWORD}]
eg. for XML: http://api.sqwi.sh/ips.xml?api_key=APIKEY&code=kFZ
returns: <?xml version="1.0" encoding="UTF-8"?> <sqwish> <error>false</error> <original>http://www.example.com</original> <shortURL>http://sqwi.sh/kFZ</shortURL> <code>kFZ</code> <hits>16</hits> <limit>false</limit> <iplist> <ipdata><ip>65.52.22.174</ip><date>2011-07-17 18:22:49</date></ipdata> <ipdata><ip>74.112.131.128</ip><date>2011-07-17 18:19:06</date></ipdata> <ipdata><ip>75.101.180.85</ip><date>2011-07-17 18:18:07</date></ipdata> <ipdata><ip>204.236.254.109</ip><date>2011-07-17 18:17:07</date></ipdata> <ipdata><ip>65.52.6.105</ip><date>2011-07-17 18:16:47</date></ipdata> <ipdata><ip>75.101.173.99</ip><date>2011-07-17 18:16:43</date></ipdata> <ipdata><ip>89.151.116.52</ip><date>2011-07-17 18:16:43</date></ipdata> <ipdata><ip>67.195.115.50</ip><date>2011-07-17 18:16:42</date></ipdata> <ipdata><ip>72.30.161.232</ip><date>2011-07-17 18:16:42</date></ipdata> <ipdata><ip>50.18.121.34</ip><date>2011-07-17 18:16:41</date></ipdata> <ipdata><ip>184.72.47.46</ip><date>2011-07-17 18:16:41</date></ipdata> <ipdata><ip>184.72.25.232</ip><date>2011-07-17 18:16:40</date></ipdata> <ipdata><ip>72.30.161.232</ip><date>2011-07-17 18:16:40</date></ipdata> <ipdata><ip>199.59.149.31</ip><date>2011-07-17 18:16:40</date></ipdata> <ipdata><ip>199.59.149.165</ip><date>2011-07-17 18:16:39</date></ipdata> <ipdata><ip>38.113.234.180</ip><date>2011-07-17 18:16:39</date></ipdata> </iplist> </sqwish> and for JSON: http://api.sqwi.sh/ips.json?api_key=APIKEY&code=kFZ
returns: { "error":"false", "original":"http:\/\/www.example.com", "shortURL":"http:\/\/sqwi.sh\/kFZ", "code":"kFZ","hits":"16", "iplist":{ "ipdata":{"ip":"65.52.22.174","date":"2011-07-17 18:22:49"}, "ipdata":{"ip":"74.112.131.128","date":"2011-07-17 18:19:06"}, "ipdata":{"ip":"75.101.180.85","date":"2011-07-17 18:18:07"}, "ipdata":{"ip":"204.236.254.109","date":"2011-07-17 18:17:07"}, "ipdata":{"ip":"65.52.6.105","date":"2011-07-17 18:16:47"}, "ipdata":{"ip":"75.101.173.99","date":"2011-07-17 18:16:43"}, "ipdata":{"ip":"89.151.116.52","date":"2011-07-17 18:16:43"}, "ipdata":{"ip":"67.195.115.50","date":"2011-07-17 18:16:42"}, "ipdata":{"ip":"72.30.161.232","date":"2011-07-17 18:16:42"}, "ipdata":{"ip":"50.18.121.34","date":"2011-07-17 18:16:41"}, "ipdata":{"ip":"184.72.47.46","date":"2011-07-17 18:16:41"}, "ipdata":{"ip":"184.72.25.232","date":"2011-07-17 18:16:40"}, "ipdata":{"ip":"72.30.161.232","date":"2011-07-17 18:16:40"}, "ipdata":{"ip":"199.59.149.31","date":"2011-07-17 18:16:40"}, "ipdata":{"ip":"199.59.149.165","date":"2011-07-17 18:16:39"}, "ipdata":{"ip":"38.113.234.180","date":"2011-07-17 18:16:39"} } } | ||





