OTHER

OTHER

List label filters

List all labels you've defined so far.

Request
path Parameters
apikey
required
string

Valid API key for your account

Responses
200

OK

get/{apikey}/filter-rules.json
Request samples
curl https://api.repustate.com/v4/{apikey}/filter-rules.json
Response samples
application/json
{
  • "status": "OK",
  • "labels": [
    ]
}

Add label filter

Repustate can automatically assign labels to the text you analyze. Labels are defined as a mix of boolean operators, keyword matching, and a proximity operator. The following operators are allowed:

  • AND
  • OR (a blank space between terms is an implicit OR)
  • NOT
  • NEAR/N (proximity operator, meaning two terms must appear within N tokens of one another)
  • ~ (tilde, meaning exact match, other matching is case-insensitive)
  • * (wildcard matching for suffixes)

Zero, one, or more label filters can be returned for a given piece of text.

Request
path Parameters
apikey
required
string

Valid API key for your account

Request Body schema: multipart/form-data
text
required
string

These are the rules that determine whether or not a block of text should be assigned a particular label.

label
required
string

The value you'd like to assign to the rule you define below. This label is what Repustate returns when applying filters to text.

Responses
200

OK

post/{apikey}/filter-rules.json
Request samples
curl -d "text=hockey AND basketball&label=sports" \
https://api.repustate.com/v4/{apikey}/filter-rules.json
Response samples
application/json
{
  • "status": "OK"
}

Delete label filter

Deletes a previously created label filter.

Request
path Parameters
apikey
required
string

Valid API key for your account

query Parameters
label
required
string

The value of the label you'd like to remove.

Responses
200

OK

400

error

delete/{apikey}/filter-rules.json
Request samples
curl https://api.repustate.com/v4/{apikey}/filter-rules.json -X DELETE -G -d "label=mylabel"
        
Response samples
application/json
{
  • "status": "OK"
}

Clean text

Get clean text from a remote source via its URL

Request
path Parameters
apikey
required
string

Valid API key for your account

query Parameters
url
required
string

Any valid URL that has been url encoded ("escaped"). If the URL specified is a URL-shortened one (e.g. bit.ly), Repustate will follow the redirects properly until the final page is found

Responses
200

OK

get/{apikey}/clean-html.json
Request samples
curl "https://api.repustate.com/v4/repustatedemopage/clean-html.json?url=http%3A%2F%2Fwww.example.com"
        
Response samples
application/json
{
  • "image": "",
  • "status": "OK",
  • "text": " Example Domain This domain is established to be used for illustrative examples in documents. You may use this domain in examples without prior coordination or asking for permission.\n More information...\n",
  • "title": "Example Domain",
}

Clean text (HTML/PDF)

Get clean text from a HTML or PDF source

Request
path Parameters
apikey
required
string

Valid API key for your account

Request Body schema: multipart/form-data
html
string

Raw HTML content that needs to be cleaned up

pdf
string

PDF content that you want cleaned up to show just the text

Responses
200

OK

400

error

post/{apikey}/clean-html.json
Request samples
curl -X "POST" "https://api.repustate.com/v4/{apikey}/clean-html.json" \
     -H 'Content-Type: application/x-www-form-urlencoded; charset=utf-8' \
     --data-urlencode "html=<html><head><title>Example Domain</title><meta charset=\"utf-8\" /><meta http-equiv=\"Content-type\" content=\"text/html; charset=utf-8\" /><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" /><style type=\"text/css\">body {background-color: #f0f0f2;margin: 0;padding: 0;font-family: \"Open Sans\", \"Helvetica Neue\", Helvetica, Arial, sans-serif;}div {width: 600px;margin: 5em auto;padding: 50px;background-color: #fff;border-radius: 1em;}a:link, a:visited {color: #38488f;text-decoration: none;}@media (max-width: 700px) {body {background-color: #fff;}div {width: auto;margin: 0 auto;border-radius: 0;padding: 1em;}}</style> </head><body><div><h1>Example Domain</h1><p>This domain is established to be used for illustrative examples in documents. You may use thisdomain in examples without prior coordination or asking for permission.</p><p><a href=\"http://www.iana.org/domains/example\">More information...</a></p></div></body></html>"

        
Response samples
application/json
{
  • "image": "",
  • "status": "OK",
  • "text": " Example Domain This domain is established to be used for illustrative examples in documents. You may use thisdomain in examples without prior coordination or asking for permission.\nMore information...\n",
  • "title": "Example Domain",
  • "url": ""
}

Apply filters

Apply the filter rules you've created to the supplied text block. Zero, one or more labels may be returned. For each label returned, we also show a list of (start, end) pairs designating where in the text the label was matched against.

Request
path Parameters
apikey
required
string

Valid API key for your account

Request Body schema: multipart/form-data
text
required
string

The block of text you'd like to analyze.

Responses
200

OK

post/{apikey}/filter.json
Request samples
curl -d "text=I love to play hockey" \
https://api.repustate.com/v4/{apikey}/filter.json


        
Response samples
application/json
{
  • "status": "OK",
  • "myFilterID": [
    ]
}

Part-of-speech tagging

Get access to Repustate's all purpose part-of-speech tagger in the language of your choice. This API call returns the entire text block tagged with the part of speech for each word. The list of possible tags and their meaning for ALL languages is below:

  • NN: noun
  • ADJ: adjective
  • VB: verb
  • ADV: adverb
  • CONJ: conjunction
  • PREP: preposition
  • ART: article
  • PP: pronoun
  • POSS: possessive noun
  • PUNC: punctuation
Request
path Parameters
apikey
required
string

Valid API key for your account

Request Body schema: multipart/form-data
text
required
string

The block of text to analyze.

lang
string

The two letter code of the language you want to analyze the sentiment in. The default is English (en); you do not need to specify anything if you're just scoring English text.

Responses
200

OK

post/{apikey}/pos.json
Request samples
curl -d "text=Let me see the part of speech tags for this sentence!" \
https://api.repustate.com/v4/{apikey}/pos.json
Response samples
application/json
{
  • "status": "OK",
  • "text": "Let me see the part of speech tags for this sentence!",
  • "language": "en",
  • "tags": [
    ]
}

Language detection

Given a piece of text , this API call will determine the language of the text in question. The response will contain a two letter code (ISO 639-1) representing the language identified. If a language cannot be accurately detected, an empty string will be returned as the language code.

Request
path Parameters
apikey
required
string

Valid API key for your account

Request Body schema: multipart/form-data
text
required
string

The block of text you'd like to analyze.

Responses
200

OK

post/{apikey}/detect-language.json
Request samples
curl -d "text=أنا أحب أن تأكل البيتزا مع أصدقائي" \
https://api.repustate.com/v4/{apikey}/detect-language.json
Response samples
application/json
{
  • "status": "OK",
  • "language": "ar"
}

Usage

Retrieve your API usage for the current billing period.

Request
path Parameters
apikey
required
string

Valid API key for your account

Responses
200

OK

get/{apikey}/usage.json
Request samples
curl https://api.repustate.com/v4/{apikey}/usage.json
Response samples
application/json
{
  • "max_calls_allowed": 4000000,
  • "status": "OK",
  • "calls_used": 761099
}

List subaccounts

List all subaccounts created under the given API key

Request
path Parameters
apikey
required
string

Valid API key for your account

Responses
200

OK

get/{apikey}/subaccounts.json
Request samples
curl https://api.repustate.com/v4/{apikey}/subaccounts.json
Response samples
application/json
{
  • "status": "OK",
  • "subaccounts": [
    ]
}

Last updated rule

Return the time stamp (in seconds since Jan 1, 1970) that a custom sentiment rule or filter rule was added.

Request
path Parameters
apikey
required
string

Valid API key for your account

Responses
200

OK

get/{apikey}/last-updated-rule.json
Request samples
curl https://api.repustate.com/v4/{apikey}/last-updated-rule.json
        
Response samples
application/json
{
  • "status": "OK",
  • "sentiment": 1516912486821,
  • "filter": 151691248623
}