AlchemyAPI provides easy-to-use facilities for extracting topic keywords from any textual content: Post (upload) any content directly to our service for analysis.
Posted content is analyzed to detect the primary document language, and topic keywords are extracted automatically.
These API calls may be utilized to process posted (uploaded) textual content. If you are processing content hosted on a publicly accessible website, consider using our URL processing calls.
Description: The TextGetRankedKeywords call is utilized to extract a relevancy-ranked list of topic keywords from within a posted text document.
Endpoint: http://access.alchemyapi.com/calls/text/TextGetRankedKeywords
| http argument | parameter description |
|---|---|
| apikey | your private api key
(required parameter) |
| text | Text document content (must be uri-argument encoded)
(required parameter) |
| url | Text document URL (must be uri-argument encoded)
(optional parameter, for response tracking purposes.) |
| maxRetrieve | maximum number of keywords to extract (default: 50)
(optional parameter) |
| keywordExtractMode | keyword extraction mode (normal or strict) Possible values: normal - normal keyword extraction mode (default) strict - strict keyword extraction mode (returns more "well-formed" keywords). refines results at the expense of returning fewer keywords. (optional parameter) |
| sentiment | whether to enable keyword-level sentiment analysis. Possible values: 1 - enabled 0 - disabled (default) (optional parameter - Note that enabling this option will incur usage of one (1) additional AlchemyAPI transaction) |
| outputMode | desired API output format Possible values: xml (default) json rdf rel-tag rel-tag-raw (optional parameter) |
| jsonp | desired JSONP callback (optional parameter, requires "outputMode" to be set to json) |
| showSourceText | whether to include the original 'source text' the keywords were extracted from within the API response. Possible values: 1 - enabled 0 - disabled (default) (optional parameter) |
| baseUrl | rel-tag output base http url (must be uri-argument encoded)
(optional parameter, used with rel-tag or rel-tag-raw outputMode.) |
<results>
<status>REQUEST_STATUS</status>
<url>DOCUMENT_URL</url>
<language>DOCUMENT_LANGUAGE</language>
<text>DOCUMENT_TEXT</text>
<keywords>
<keyword>
<text>DETECTED_KEYWORD</text>
<relevance>DETECTED_RELEVANCE</relevance>
<sentiment>
<type>SENTIMENT_LABEL</type>
<score>SENTIMENT_SCORE</score>
<mixed>SENTIMENT_MIXED</mixed>
</sentiment>
</keyword>
</keywords>
</results>
{
"status": "REQUEST_STATUS",
"url": "DOCUMENT_URL",
"language": "DOCUMENT_LANGUAGE",
"text": "DOCUMENT_TEXT",/text>
"keywords": [
{
"text": "DETECTED_KEYWORD",
"relevance": "DETECTED_RELEVANCE",
"sentiment": {
"type": "SENTIMENT_LABEL",
"score": "SENTIMENT_SCORE",
"mixed": "SENTIMENT_MIXED"
}
}
]
}
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:aapi="http://rdf.alchemyapi.com/rdf/v1/s/aapi-schema#"
xml:base="http://rdf.alchemyapi.com/rdf/v1/r/response.rdf">
<rdf:Description rdf:ID="DOCUMENT_HASH">
<rdf:type rdf:resource="http://rdf.alchemyapi.com/rdf/v1/s/aapi-schema#DocInfo"/>
<aapi:ResultStatus>REQUEST_STATUS</aapi:ResultStatus>
<aapi:URL>DOCUMENT_URL</aapi:URL>
<aapi:Language>DOCUMENT_LANGUAGE</aapi:Language>
<aapi:DocText>DOCUMENT_TEXT</aapi:DocText>
</rdf:Description>
<rdf:Description rdf:ID="DOCUMENT_HASH-KEYWORD_NUM">
<rdf:type rdf:resource="http://rdf.alchemyapi.com/rdf/v1/s/aapi-schema#KeywordOccurrences"/>
<aapi:Doc>DOCUMENT_HASH</aapi:Doc>
<aapi:Relevance>DETECTED_RELEVANCE</aapi:Relevance>
<aapi:Name>DETECTED_KEYWORD</aapi:Name>
<aapi:Sentiment>
<rdf:Description rdf:about="#DOCUMENT_HASH-KEYWORD_NUM">
<rdf:type rdf:resource="http://rdf.alchemyapi.com/rdf/v1/s/aapi-schema#Sentiment"/>
<aapi:Doc>DOCUMENT_HASH</aapi:Doc>
<aapi:SentimentType>SENTIMENT_LABEL</aapi:SentimentType>
<aapi:SentimentScore>SENTIMENT_SCORE</aapi:SentimentScore>
<aapi:SentimentMixed>SENTIMENT_MIXED</aapi:SentimentMixed>
</rdf:Description>
</aapi:Sentiment>
</rdf:Description>
</rdf:RDF>
<results>
<status>REQUEST_STATUS</status>
<url>REQUESTED_URL</url>
<language>DOCUMENT_LANGUAGE</language>
<text>DOCUMENT_TEXT</text>
<microformats>
<a href="REQUESTED_BASE_URL/DETECTED_KEYWORD" rel="tag">DETECTED_KEYWORD</a>
<a href="REQUESTED_BASE_URL/DETECTED_KEYWORD" rel="tag">DETECTED_KEYWORD</a>
</microformats>
</results>
<a href="REQUESTED_BASE_URL/DETECTED_KEYWORD" rel="tag">DETECTED_KEYWORD</a>
<a href="REQUESTED_BASE_URL/DETECTED_KEYWORD" rel="tag">DETECTED_KEYWORD</a>
| field name | field description | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| status | success / failure status indicating whether the request was processed. Possible values: OK ERROR |
||||||||
| language | the detected language that the source text was written in. | ||||||||
| url | http url information was requested for. | ||||||||
| relevance | relevance score for a detected keyword. Possible values: (0.0 - 1.0) [1.0 = most relevant] |
||||||||
| text | the detected keyword text. | ||||||||
| sentiment | sentiment for the detected keyword (sent only if keyword-level sentiment analysis is enabled)
|
||||||||
| statusInfo | failure status information (sent only if "status" == "ERROR"). Possible values: invalid-api-key |