Our Developer API
iliketext.com has an API (Application Programming Interface) as its foundation, and as such, we would like to extend that functionality to other developers as well. Whether you're building a killer web-application or for a private implementation of the functionality that is iliketext.com
Currently the API is under contruction, and so is only 'Passive'. Alowing only for requests of data, and as such, no authorization is needed, but as we add new Classes and methods, we will add an API Key request process. For now though you can request User, Text or Word data in either XML, JSON or JSONP format.
Quick example:
Syntax: http://alpha.iliketext.com/[Class]/[ID]/[Method].[Format]
Example: http://alpha.iliketext.com/word/design/meta.xml
Formats
Currently we offer 3 response formats, namely: .xml, .json or .jsonp; which you can set by changing the extention of your request call to the appropriate extention. If requested, each format will have roughly the following resposes:XML
Eample request:http://alpha.iliketext.com/word/girl/meta.xmlExample response:
<response status="ok" time="2010-06-04 11:42:08">
<word id="2893">girl</word>
<usecount>1</usecount>
<frequency>1</frequency>
<definitions>
<definition partofspeach="noun">A young person of either sex; a child.</definition>
<definition partofspeach="noun">A female child, from birth to the age of puberty; a young maiden.</definition>
... etc ...
</definitions>
<sdwa>
<word>girl</word>
<word>girls</word>
</sdwa>
<fwa>
<word>boy</word>
<word>friend</word>
<word>woman</word>
... etc ...
</fwa>
<cdwa>
<word>listening</word>
<word>constituent</word>
<word>experience</word>
<word>wearing</word>
... etc ...
</cdwa>
<sources>
<textid url ="http://www.goodreads.com/quotes/show/53179" >99</textid>
</sources>
<users>
<user>iamprogram</user>
</users>
<relatedtexts>
<textid url="99">99</textid>
<textid url="106">106</textid>
<textid url="105">105</textid>
</relatedtexts>
<relatedusers>
<user>iamprogram</user>
<user>barumunk</user>
<user>admin</user>
<user>guest</user>
</relatedusers>
</response>
In the event of an error, you'll get something like this:
<response status="fail" time="2010-06-04 12:12:40">
<error code="404" msg="Word not Found." />
</response>
JSON
JSON (JavaScript Object Notation) is a lightweight computer data interchange format. It is a text-based, human-readable format for representing objects and other data structures and is mainly used to transmit such structured data over a network connection (in a process called serialization). (Wikipedia)
Eample request:http://alpha.iliketext.com/word/design/meta.jsonExample response:
In the event of an error, you'll get something like this:
{
"status":"fail"
"time":"2010-06-04 12:39:00"
"error": {
"code":"501"
"msg":"Invalid API Class (fancy) requested."
}
}
JSONP
JSONP or "JSON with padding" is a complement to the base JSON data format, a usage pattern that allows a page (Client-side) to request and more meaningfully use JSON from a server other than the primary server.
Example request:http://alpha.iliketext.com/word/design/meta.jsonp
For JSONP you can also have the option of specifying a custom callback function, by appending &callback=[CustomFunction] where [CustomFunction] is the title of the callback function you'd like, if no custom callback is requested, then the API response defaults to iltCallback(); as seen in the example responses below.
http://alpha.iliketext.com/word/design/meta.jsonp&callback=CustomTag
Example response:
In the event of an error, you'll get something like this:
iltCallback({
"status":"fail"
"time":"2010-06-04 12:39:00"
"error": {
"code":"501"
"msg":"Invalid API Class (cloud) requested."
}
});
Classes & Methods
Below are the currently implemented classes and methods of our API, with syntax example as well as a description of their respective functions.
Word
-
Meta
Example:http://alpha.iliketext.com/word/support/meta.jsonThis method, returns most of the information regarding the word requested. The fields returned by this function are as follows:
Word "id":
Use Count:
Frequency:
Definition "Part Of Speach":
SDWA:
FWA:
CDWA:
Sources "URL":
Users:
Related Texts "URL":
Related Users:
-
Definitions
Example:http://alpha.iliketext.com/word/design/definitions.jsonReturns an array of definitions for the requested word, with the Part of Speach relevant for that definition.
Sources
Example:http://alpha.iliketext.com/word/design/sources.jsonReturns an array of text ID's of texts that the request word appears in (directly) as well as the URL that referenced text was quoted from.
-
Users
Example:http://alpha.iliketext.com/word/design/users.jsonReturns an array of users that have a text in thier collection that contains the request word (directly).
-
SDWA
Example:http://alpha.iliketext.com/word/design/sdwa.jsonReturns an array of SDWA (Stem Defined Word Assosiations) words for the requested word. For instance if the request was 'design' it might reply with 'designer', 'designs', 'designing', 'designers' etc.
-
CDWA
Example:http://alpha.iliketext.com/word/news/cdwa.jsonReturns an array of CDWA (Content Defined Word Assosiations) words for the requested word. For instance if the request was 'news' it might reply with 'bbc', 'headline', 'usa', 'war' etc.
-
FWA
Example:http://alpha.iliketext.com/word/wet/fwa.jsonReturns an array of words that are related to the requested word by Free Word Assosiation, For instance if the request was for 'wet' it might reply with 'water', 'rain', 'weather', 'swimming' etc.
-
Related_Texts
Example:http://alpha.iliketext.com/word/good/related_texts.jsonReturns an array of texts that rank as being related (by commond tags/words or by favorited by common users etc etc)
-
Related_Users
Example:http://alpha.iliketext.com/word/bad/related_users.jsonReturns an array of users that have the tags related to the request word ranking highly in thier content defined tags, meant to show users that may have an intrest in the content, whether or not they have that text in thier collection or not.
-
Stem
Example:http://alpha.iliketext.com/word/supporting/stem.jsonReturns an the stem work of the requested word. For instance is the request was for 'supporting' it would respond with 'support'.
User
Authenticate
Example:http://alpha.iliketext.com/user/barumunk/authenticate.json&password=[md5 of password]This method is for requesting an authentication token for requested user. Supplying a username ie:barumunk and an MD5 hash of thier password, if the password matches, then we will return a token, wich will allow "active" requests/changes to users information for 6 hours. For use with future "active" methods.
Meta
Example:http://alpha.iliketext.com/user/barumunk/meta.jsonReturns all the information publicly available for requested user, essentially all of the requests below in one request.
UDT
Example:http://alpha.iliketext.com/user/barumunk/udt.jsonReturns an array of words/tags that are defined by requested user directly.
CDT
Example:http://alpha.iliketext.com/user/barumunk/cdt.jsonReturns an array of words/tags that are defined by requested user's collection.
Collection
Example:http://alpha.iliketext.com/user/barumunk/collection.jsonReturns an array of text IDs that are in requested user's collection.
Recommended
Example:http://alpha.iliketext.com/user/barumunk/recomended.jsonNot yet implemented
Followers
Example:http://alpha.iliketext.com/user/barumunk/followers.jsonReturns an array of all users that have requested user as a favorite.
Favorites
Example:http://alpha.iliketext.com/user/barumunk/favorites.jsonReturns an array of requested user's favorite users.
Text
Meta
Example:http://alpha.iliketext.com/text/117/meta.jsonReturns the properties of requested text, namely id, content, and tags etc
Meta
Texts - total
Example:http://alpha.iliketext.com/meta/texts/total.jsonReturns the total number of texts in the database.
Users - total
Example:http://alpha.iliketext.com/meta/users/total.jsonReturns the total number of texts in the database.
Words - total
Example:http://alpha.iliketext.com/meta/words/total.jsonReturns the total number of texts in the database.
Follow us on Twitter.com