URL API - deprecated

The URL API has been deprecated, please use the URL REST API instead.

Overview

Our hope is to provide an easy-to-use API using URL requests. When a request is done to the server, a response is returned. The response will tell you if the request was successful and return whatever is relevant for your calls. Responses will be in XML or JSON while requests are in URL format as detailed below. As you may be familiar with, accessing classifier via the web can be done by browsing them. The URL API uses the same structure to access classifiers, that is:

http://uclassify.com/browse/{username}/{classifiername}/{operation}?{arguments}

ClassifyText

Classifying a text with the URL API is easy, just use a classifytext operation together with the appropriate arguments. Please note that all arguments should be URL encoded (HttpUtility.UrlEncode in C# and urlencode in PHP). uClassify has a 1MB limit per request however Web browsers (Internet Explorer, Firefox etc) usually limit the length of urls to between 2000 and 4000 characters.

Name Type Description
readKeystringa read API key that has access to the specified classifier. Sign up to get yours for free.
textstringThe text you want to classify. Remember to URL encode it!
removeHtml (optional)boolSpecifies whether you want the API to remove html tags before classification. Possible values are: '1', '0', 'true', 'false'. Default is 'true'
output (optional)stringSpecifies the response format (default is 'xml'), can be 'xml' or 'json'. Default is 'xml'
version (optional)stringSpecifies the api version (default is 1.00), can be '1.00' or '1.01'. Default is '1.01'

You must exchange 'YOUR_READ_API_KEY_HERE' with a real API key for the examples to work (sign up)

ClassifyUrl

Classifying an URL with the URL API is easy, just use the classifyurl operation together with the appropriate arguments. Please note that all arguments should be URL encoded (HttpUtility.UrlEncode in C# and urlencode in PHP). There is a limit of 4 simultaneous calls per second to the URL api.

Name Type Description
readKeystringa read API key that has access to the specified classifier. Sign up to get yours for free.
urlstringThe content on the url will be downloaded and classified. Remember to URL encode it!
removeHtml (optional)boolSpecifies whether you want the API to remove html tags before classification. Possible values are: '1', '0', 'true', 'false'. Default is 'true'
output (optional)stringSpecifies the response format (default is 'xml'), can be 'xml' or 'json'. Default is 'xml'
version (optional)stringSpecifies the api version (default is 1.00), can be '1.00' or '1.01'. Default is '1.01'

You must exchange 'YOUR_READ_API_KEY_HERE' with a real API key for the examples to work (sign up)

Json Response

Response from sentiment classifier
{
	"version" : "1.01",
	"success" : true,
	"statusCode" : 2000,
	"errorMessage" : "",
	"textCoverage" : 1,
	"call_1" :
	{
		"negative" : 0.628401,
		"positive" : 0.371599
	}
}

Xml Response

Response from sentiment classifier
<?xml version="1.0" encoding="UTF-8" ?>
<uclassify xmlns="http://api.uclassify.com/1/ResponseSchema" version="1.01">
  <status success="true" statusCode="2000"/>
  <readCalls>
  <classify id="call_1">
    <classification textCoverage="1">
      <class className="negative" p="0.628401"/>
      <class className="positive" p="0.371599"/>
    </classification>
  </classify>
  </readCalls>
</uclassify>