API Documentation
/generate/:number
- @number numeric value to generate a segment.
- output JSON
Generate allows you view a generated segment based on the number you enter. Segments are the endings of the shortened url (IE: okij.in/a). Each segment is *always* the same, unless the number causes an overflow. If an overflow occurs it will randomly select a character from the dictionary.
- Example: http://okij.in/api/generate/25
{"segment":"z"}
/latest
- output JSON
Shows the latest (25) links shortened via okij.in.
- Example: http://okij.in/api/latest
[
{ "segment":"e","url":"http://forums.bukkit.org" },
{ "segment":"d","url":"http://ultimateminecraft.net/apply" },
{ "segment":"c","url":"http://ultimateminecraft.net/" },
{ "segment":"a","url":"http://ci.bukkit.org/" }
]
/current
- output JSON
Shows the current segment and id generated by okij.in.
- Example: http://okij.in/api/current
{
"latest_id":"907",
"segment":"oN"
}
/info/:segment
- output JSON
Shows segment details including id, title, segment, url, and hits.
- Example: http://okij.in/api/info/ol
{
"id":"879",
"segment":"ol",
"url":"http://yaml-online-parser.appspot.com/","title":"Online YAML Parser",
"hits":"6"
}
/exists/:url
- output JSON
Returns whether url exists in database already. If so, returns same details as information.
- Example: http://okij.in/api/exists/reddit.com
{
"id":"904",
"segment":"oK",
"url":"http://reddit.com",
"title":"http://reddit.com",
"hits":"0",
"exists":true
}