> > > >  
  

Application programming interface

Tagatum.com' API-interface is RESTful interface. This means that you can send HTTP-request using GET or POST methods to call API function. Then you will recieve XML document as a response to your request. Entry point to send HTTP-request is http://api.tagatum.com/rest/

All data in tagatum.com API are represented in UTF-8.

When you send request, you get XML-document in the following form:

<rsp result="ok">
  [Data in XML format specific for each method]
</rsp>

In case of an error, tagatum.com will send response containing description of the error.

<rsp result="Event not found" />

Tagatum.com API returns the following errors with error code:
1 - unknown method
2 - incorrect parameters of the method
3 - can not connect to database
4 - no data (there is no information to return - the result is empty)
11 - tag was not found
12 - tag has no associated tags

API functions

Search

Return the list of tags that contain search string.

Request example:

http://api.tagatum.com/rest/?method=search&tag=

Response example:

<?xml version="1.0" encoding="UTF-8"?>
<rsp result="ok">
<tag>
  <name>example</name>
  <tag_rating>110</tag_rating>
</tag>
<tag>
  <name>examination</name>
  <tag_rating>25</tag_rating>
</tag>
</rsp>

Elements:

name - tag name;
tag_rating - tag raiting (amount of tags associated with the tag).

GetAssociatedTags

Get tags which are associated with the tag passed as a parameter.

Request example:

http://api.tagatum.com/rest/?method=getassociatedtags&tag=

Response example:

<?xml version="1.0" encoding="UTF-8"?>
<rsp result="ok">
<tag>
  <name>example</name>
  <tag_rating>8815</tag_rating>
  <pair_rating>14</pair_rating>
</tag>
<tag>
  <name>examination</name>
  <tag_rating>8805</rating>
  <pair_rating>12</rating>
</tag>
</rsp>

Elements:

name - tag name;
tag_rating - tag raiting (amount of tags associated with the tag);
pair_rating - tags pair raiting (amount of times these two tags were combined into pair).

GetMostAssociated

Return the list of tags pairs which have the highest rating of the pair. Function returns first 1000 pairs.

Request example:

http://api.tagatum.com/rest/?method=getmostassociated

Response example:

<?xml version="1.0" encoding="UTF-8"?>
<rsp result="ok">
<tag_pair>
  <pair_rating>515</pair_rating>
  <tag1>video</tag1>
  <tag1_rating>4411</tag1_rating>
  <tag2>film</tag2>
  <tag2_rating>4322</tag2_rating>
</tag_pair>
<tag_pair>
  <pair_rating>509</pair_rating>
  <tag1>funny</tag1>
  <tag1_rating>3442</tag1_rating>
  <tag2>life</tag2>
  <tag2_rating>7079</tag2_rating>
</tag_pair>
</rsp>

Elements:

tag1 - name of the first tag in pair;
tag1_rating - raiting of the first tag (amount of tags associated with the tag);
tag2 - name of the second tag in the pair;
tag2_rating - raitng of the second tag (amount of tags associated with the tag);
pair_rating - raiting of the pair.