Colbie Martin APIThe Colbie Martin API (Application Program Interface) allows people to interact programmatically with Colbie Martin.
The Colbie Martin API is available free of charge, and it returns data generated by Colbie Martin in a form that can be easily integrated into an application or a website.
This is the first version of the Colbie Martin API. It provides a handful of basic calls, but there's a lot more funtionality on the way.
At this moment the Colbie Martin API accepts REST requests and returns the results in XML. We will be offering other ways to access the API as well as returning the results in a future version of the API.
We group the current API calls in three categories or levels: Site, News and Users
Parameters:
<corank siteid="437"> <title>Title for this site</title> <descr>Description for this site</descr> <locale>en</locale> <ownerid>2735</ownerid> <vup>Interesting</vup> <vdown>Not for me</vdown> <sword>source</sword> <swords>sources</swords> </corank>
Parameters:
<corank siteid="437"> <cat id="1" idname="arts">Arts and Design</cat> <cat id="2" idname="business">Business</cat> <cat id="4" idname="currentnews">Current News</cat> ... </corank>
Parameters:
<corank siteid="437"> <users>2455</users> <votes>12447</votes> <stories>821</stories> </corank>
Parameters:
It may take either 'id' or 'url' but not both.
With the URL path: http://ColbieMartin.corank.com/api/coRank.News.GetItem/url=art-tells-the-technological-future
In the second example, we're requesting info for the item that can be retrieved directly by visiting http://ColbieMartin.corank.com/tech/story/art-tells-the-technological-future
<corank siteid="437"> <items> <item id="4478" pvotes="221" nvotes="17" comments="12" catid="16" senderid="2234" sendernick="joesmith" urlname="story-about-nothing" sdate="1170668942"> <title>Story about nothing</title> <link>http://www.example.com/</link> <description>This story is about nothing at all</description> <tags> <tag>party</tag> <tag>love</tag> </tags> </item> </items> </corank>
Response Details:
<description>This story is about nothing as you may have guessed by now</description>
Therefore it is the best function to find out whether a particular page has already been submitted to the site.
Parameters:
Here, we're requesting info for the story that points to the page http://www.example.com/article/1223.html
IMPORTANT: If the URL contains the question mark symbol ?, you must url-encode it when you make the call. That is, change the ? for a %3F
If no entry with that URL is found, it will return the standard error "No story found"
<corank siteid="437"> <items> <item id="4478" pvotes="221" nvotes="17" comments="12" catid="16" senderid="2234" sendernick="joesmith" urlname="story-about-nothing" sdate="1170668942"> <title>Story about nothing</title> <link>http://www.example.com/</link> <description>This story is about nothing at all</description> <tags> <tag>party</tag> <tag>love</tag> </tags> </item> </items> </corank>
Response Details:
<description>This story is about nothing as you may have guessed by now</description>
If "end" - "start" is greater than 100, the value of "end" is ignored and only the first 100 stories, starting from "start" are returned.
Parameters:
<corank siteid="437">
<cat id="2" total="300">
<item id="231" index="1" />
<item id="237" index="2" />
<item id="295" index="3" />
...
</cat>
</corank>
Response Details:
Parameters:
It may take either 'id' or 'url' but not both.
With the URL path: http://ColbieMartin.corank.com/api/coRank.News.GetComments/url=art-tells-the-technological-future
In the second example, we're requesting the comments for the item that can be retrieved directly by visiting http://ColbieMartin.corank.com/tech/story/art-tells-the-technological-future
<corank siteid="437">
<item id="4478" comments="12">
<comments>
<comment id="1" nick="joedirt"
sdate="1170668942" rank="1,0,0,3,8"><![CDATA[Cool story]]></comment>
<comment id="2" nick="joedirt"
sdate="1170698547" rank="5,1,0,2,0" replyto="1"><![CDATA[It sucks]]></comment>
...
</comments>
</item>
</corank>
Response Details:
...
<comments>
<comment ...><![CDATA[This is a very
cool story]]></comment>
</comments>
...
The results are sorted as follows:
The maximum number of stories to return is 100. In order to obtain the stories beyond position 100, one must use the parameters "start" and "end". If "end" - "start" is greater than 100, the value of "end" is ignored and only the first 100 stories, starting from "start" are returned.
Note that Colbie Martin only "remembers" 300 featured stories anyway, so trying to retrieve featured stories beyond position 300 will return no stories.
Parameters:
<corank siteid="437">
<featured>
<item id="231" index="1" />
<item id="237" index="2" />
<item id="295" index="3" />
...
</featured>
</corank>
For coRank.News.GetUpcoming:
<corank siteid="437">
<upcoming>
<item id="231" index="1" />
<item id="237" index="2" />
<item id="295" index="3" />
...
</upcoming>
</corank>
For coRank.News.GetTop:
<corank siteid="437">
<top>
<item id="231" index="1" />
<item id="237" index="2" />
<item id="295" index="3" />
...
</top>
</corank>
Response Details:
All user level calls also assume the site you're referring to is the one from where you're running the API call. This is important because a user will have different stats depending on the coRank site you're querying.
Parameters: It may take either 'id' or 'nick' but not both.
With the user nick: http://ColbieMartin.corank.com/api/coRank.User.GetProfile/nick=joesmith
<corank siteid="437"> <user id="3345" nick="joesmith" sources="12" fans="34" pviews="67" grank="3" mrank="2"> <name>Joe Smith</name> <location>US</location> <blog>http://myblogishere.example.com/</blog> <about><![CDATA[I'm into whatever I like]]></about> <stories submitted="22" vup="3344" vdown="11" fav="12" /> </user> </corank>
... <about><![CDATA[I'm into whatever I like]]></about> ...
The maximum number of stories to return is 100. In order to obtain the stories beyond position 100, one must use the parameters "start" and "end".
If "end" - "start" is greater than 100, the value of "end" is ignored and only the first 100 stories, starting from "start" are returned.
The results are sorted by date, latest submitted/voted first. You'll be able to specify different sorting orders in an upcoming version of the API.
Parameters:
<corank siteid="437"> <user id="16" nick="joe" total="300"> <item id="231" index="1" /> <item id="237" index="2" /> <item id="295" index="3" /> ... </user> </corank>
For coRank.User.GetVoted:
<corank siteid="437"> <user id="16" nick="joe" total="300"> <item id="231" vote="+" index="1" /> <item id="237" vote="+" index="2" /> <item id="295" vote="-" index="3" /> ... </user> </corank>
Response Details:
The maximum number of users to return is 100. In order to obtain the users beyond position 100, one must use the parameters "start" and "end".
If "end" - "start" is greater than 100, the value of "end" is ignored and only the first 100 sources, starting from "start" are returned.
The results are sorted in the order the users were added as sources. You'll be able to specify different sorting orders in an upcoming version of the API.
Parameters:
<corank siteid="437"> <user id="16" nick="joe" total="98"> <source id="231" weight="100" index="1" /> <source id="237" weight="100" index="2" /> <source id="295" weight="50" index="3" /> ... </user> </corank>
Response Details:
The maximum number of users to return is 100. In order to obtain the fans beyond position 100, one must use the parameters "start" and "end".
If "end" - "start" is greater than 100, the value of "end" is ignored and only the first 100 fans, starting from "start" are returned.
The results are sorted in the order the fans added the user as their source. You'll be able to specify different sorting orders in an upcoming version of the API.
Parameters:
<corank siteid="437"> <user id="16" nick="joe" total="98"> <fan id="231" index="1" /> <fan id="237" index="2" /> <fan id="295" index="3" /> ... </user> </corank>
Response Details:
The results are sorted by affinitym that is, users that are more like-minded will appear first. The maximum number of like-minded users returned is 50. You cannot retrieve like-minded users beyond the 50th most like-minded user.
Parameters:
<corank siteid="437"> <user id="16" nick="joe" total="23"> <match id="231" index="1" /> <match id="237" index="2" /> <match id="295" index="3" /> ... </user> </corank>NOTE: There's additional info usually associated to like-minded users (agreement/disagreement in votes, etc). That info is not yet supplied by the API but it will be included in a future version of the API.
Response Details:
When an API call cannot be completed or is unable to return meaningful results, an error code is returned instead.
Example Response:
<rsp stat="fail"> <err code="1" msg="Method missing" /> </rsp>
Response Details:
The current numeric codes and their equivalent messages are: